# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1272880387 -10800 # Node ID 9c97ad6591ae0d8a4dc9af97d396bba82b024c12 # Parent fcbbe021d614871c3a82b733077f36dbbe6bf292 Revision: 201015 Kit: 201018 diff -r fcbbe021d614 -r 9c97ad6591ae apengine/apeng/group/APEngine.MMP --- a/apengine/apeng/group/APEngine.MMP Fri Apr 16 15:21:37 2010 +0300 +++ b/apengine/apeng/group/APEngine.MMP Mon May 03 12:53:07 2010 +0300 @@ -63,10 +63,6 @@ //Macro to /epoc32 headers MW_LAYER_SYSTEMINCLUDE -#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -SYSTEMINCLUDE ../../../../../os/commsfw/commsconfig/commsdatabaseshim/commdbshim/ProtectedDB -#endif - LIBRARY commdb.lib LIBRARY euser.lib LIBRARY efsrv.lib diff -r fcbbe021d614 -r 9c97ad6591ae apengine/apeng/src/APNetworks.cpp --- a/apengine/apeng/src/APNetworks.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/apengine/apeng/src/APNetworks.cpp Mon May 03 12:53:07 2010 +0300 @@ -25,11 +25,7 @@ #include #include -#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#else #include -#endif #include "ApNetworks.h" #include "ApEngineLogger.h" diff -r fcbbe021d614 -r 9c97ad6591ae apengine/apeng/src/APSelect.cpp --- a/apengine/apeng/src/APSelect.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/apengine/apeng/src/APSelect.cpp Mon May 03 12:53:07 2010 +0300 @@ -22,12 +22,7 @@ #include #include #include - -#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#else #include -#endif #include #ifdef __TEST_USE_SHARED_DATA diff -r fcbbe021d614 -r 9c97ad6591ae apengine/apeng/src/ApProtHandler.cpp --- a/apengine/apeng/src/ApProtHandler.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/apengine/apeng/src/ApProtHandler.cpp Mon May 03 12:53:07 2010 +0300 @@ -21,13 +21,8 @@ #include #include -#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#include -#else #include #include -#endif #include #include diff -r fcbbe021d614 -r 9c97ad6591ae apengine/apsettingsplugin/src/APSettingsPlugin.cpp --- a/apengine/apsettingsplugin/src/APSettingsPlugin.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/apengine/apsettingsplugin/src/APSettingsPlugin.cpp Mon May 03 12:53:07 2010 +0300 @@ -248,16 +248,17 @@ // --------------------------------------------------------- void CApSettingsPlugin::DoSettingsL() { - CCmSettingsUi* settings = CCmSettingsUi::NewL(); - CleanupStack::PushL( settings ); + // RunSettingsL API removed from new cmmgr implementation + //CCmSettingsUi* settings = CCmSettingsUi::NewL(); + //CleanupStack::PushL( settings ); - if( settings->RunSettingsL() == CCmSettingsUi::EExit ) - { + //if( settings->RunSettingsL() == CCmSettingsUi::EExit ) + // { //exit from General Settings - ProcessCommandL( EAknCmdExit ); - } + // ProcessCommandL( EAknCmdExit ); + // } - CleanupStack::PopAndDestroy( settings ); + //CleanupStack::PopAndDestroy( settings ); } diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/group/mpmserver.mmp --- a/bearermanagement/mpm/group/mpmserver.mmp Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/group/mpmserver.mmp Mon May 03 12:53:07 2010 +0300 @@ -34,7 +34,6 @@ epocstacksize 0x5000 SOURCEPATH ../src -SOURCE mpmdialog.cpp SOURCE mpmconnmonevents.cpp SOURCE mpmconnmonreqs.cpp SOURCE mpmserversession.cpp @@ -55,6 +54,7 @@ SOURCE mpmcsidwatcher.cpp SOURCE mpmdialogbase.cpp SOURCE mpmdatausagewatcher.cpp +SOURCE mpmofflinewatcher.cpp USERINCLUDE ../inc @@ -81,8 +81,6 @@ LIBRARY connectionuiutilities.lib LIBRARY cmmanagerdatabase.lib LIBRARY charconv.lib -LIBRARY wifiprotclient.lib -LIBRARY wifiprotplugin.lib LIBRARY cmmanager.lib DEBUGLIBRARY flogger.lib diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/inc/mpmcommsdataccess.h --- a/bearermanagement/mpm/inc/mpmcommsdataccess.h Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/inc/mpmcommsdataccess.h Mon May 03 12:53:07 2010 +0300 @@ -54,36 +54,7 @@ enum TWlanIapType { ENotWlanIap, - EWlanIap, - EEasyWlanIap - }; - -// Structure containing WLAN WEP key data -// -class TWepKeyData - { -public: - inline TWepKeyData(): - iWep1(), - iWep2(), - iWep3(), - iWep4(), - iWepFormat1( 0 ), - iWepFormat2( 0 ), - iWepFormat3( 0 ), - iWepFormat4( 0 ), - iDefaultWep( EWlanDefaultWepKey1 ) - {}; - - TWlanWepKey iWep1; - TWlanWepKey iWep2; - TWlanWepKey iWep3; - TWlanWepKey iWep4; - TUint iWepFormat1; - TUint iWepFormat2; - TUint iWepFormat3; - TUint iWepFormat4; - TWlanDefaultWepKey iDefaultWep; + EWlanIap }; // CLASS DECLARATION @@ -138,14 +109,6 @@ CMPMServerSession& aSession ); /** - * Checks if given IAP is Easy WLan. - * @since 3.1 - * @param aIapId IAP Id to be checked - * @return ETrue if IAP Id is Easy WLan, otherwise EFalse. - */ - TBool CheckEasyWLanL( TUint32 aIapId ) const; - - /** * Find all snap ids * * @since 3.2 @@ -196,47 +159,6 @@ void CheckWLANIapL(CMPMServerSession& aSession); /** - * Checks whether there is a wlan iap which matches the - * parameter settings. - * - * @since 3.2 - * @param aSsid Wlan iap ssid - * @param aSecMode Wlan iap security mode - * @param aConnMode Wlan iap connection mode - */ - TUint32 CheckWLANIapWithSsidL( TWlanSsid& aSsid, - TUint32 aSecMode, - TWlanNetMode aConnMode ); - - /** - * Stores easy wlan settings into commsdat. - * - * @since 3.2 - * @param aSsid Wlan iap ssid, stored in used ssid field - * @param aSecMode Wlan iap security mode - * @param aConnMode Wlan iap connection mode - * @param aWepData WEP key data - * @param aEnableWpaPsk Wlan iap enable psk mode - * @param aWpaPsk Wlan iap wpa psk - * @param aWpaKeyLen Wlan iap wpa key length - */ - void SetEasyWlanDataL( const TWlanSsid& aSsid, - TUint aSecMode, - TWlanNetMode aConnMode, - TWepKeyData aWepData, - TUint aEnableWpaPsk, - const TDesC8& aWpaPsk, - TUint aWpaKeyLen ); - - /** - * Returns Easy wlan service record id. - * @since 3.2 - * @param aDb DB session - * return Easy wlan service record id - */ - TUint32 FindEasyWlanServiceIdL( CMDBSession* aDb ); - - /** * Checks if the HiddenAgent metadata is set for this IAP. * @since 3.2 * @param aIapId Given Iap Id @@ -291,11 +213,10 @@ RArray& aEmbeddedIaps ); /** - * Checks if given IAP is WLAN and whether it is EasyWLAN IAP. + * Checks if given IAP is WLAN. * @since 3.2 * @param aIapId IAP Id to be checked - * @return One of TWlanIapType values depending on - * whether IAP is WLAN or Easy WLAN + * @return One of TWlanIapType values */ TWlanIapType CheckWlanL( TUint32 aIapId ) const; @@ -351,36 +272,6 @@ * @return Type of the bearer. */ TMPMBearerType GetBearerTypeL( TUint32 aIapId ); - - /** - * Check if all active connections are in same snap. - * - * @since 5.0 - * @param aActiveBMConns Array of active connections. - * @param aSnapId Destination where connections are located is returned - * to this parameter. - * @return ETrue if all active connections are in same snap. - */ - TBool AreActiveIapsInSameSnapL ( RArray& aActiveBMConns, - TUint32& aSnapId ); - - /** - * Select active connection according to snap priorities. - * - * @since 5.0 - * @param aSnapId Snap id of the connection. - * @param aActiveBMConns Array of active connections. - * @param aActiveIapId Iap id of the selected active connection. - * @param aActiveSnapId Snap id of the selected active connection. - * @param aActiveBearerType Bearer type of the selected active connection. - * @param aSession Handle to session class. - */ - void SelectActiveConnectionL ( const TUint32 aSnapId, - RArray& aActiveBMConns, - TUint32& aActiveIapId, - TUint32& aActiveSnapId, - TMPMBearerType& aActiveBearerType, - CMPMServerSession& aSession ); /** * Check if snap is empty. @@ -521,30 +412,6 @@ CCDRecordBase* LoadLinkedRecordL( CMDBSession& aSession, TMDBElementId aElementId ); - /** - * Sets WEP key data for WLAN service record - * @since 9.1 - * @param aFormatId Id of the field where WEP format is stored - * @param aKeyId Id of the field where WEP key is stored - * @param aWepData WEP key value - * @param aWepFormat WEP key format value - * @param aRecord WLAN service record where data is stored - */ - void SetWepKeyL( TMDBElementId aFormatId, - TMDBElementId aKeyId, - TWlanWepKey aWepData, - TUint aWepFormat, - CMDBGenericRecord* aRecord ); - - /** - * Converts ascii data to hex - * @since 3.2 - * @param aSource Ascii data - * @param aDest hex data to be filled in - */ - void ConvertAsciiToHex( const TDesC8& aSource, - HBufC8* aDest ); - /** * Returns true if destination is internet. * @since 5.1 @@ -572,15 +439,6 @@ * @param aWlanArray Array of wlan bearers */ void BuildWlanArrayL(CMDBSession& aDb, RArray& aWlanArray); - - /** - * Get snap id for the iap - * - * @since 5.0 - * @param aIapId Id of the iap - * @return Id of the snap - */ - TUint32 GetSnapIdL( TUint32 aIapId ); /** * C++ default constructor. diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/inc/mpmcsidwatcher.h --- a/bearermanagement/mpm/inc/mpmcsidwatcher.h Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/inc/mpmcsidwatcher.h Mon May 03 12:53:07 2010 +0300 @@ -23,6 +23,9 @@ class CRepository; +// Stop after this many consecutive central repository errors. +const TInt KMpmCsIdWatcherCenRepErrorThreshold = 80; + /** * Class for accessing central repository * Follows KMpmConnectScreenId key in central repository. @@ -57,8 +60,6 @@ void RunL(); - TInt RunError( TInt aError ); - void DoCancel(); private: @@ -66,6 +67,16 @@ CMpmCsIdWatcher(); void ConstructL(); + + /** + * Request for notifications. + */ + TInt RequestNotifications(); + + /** + * Get Connect screen ID from repository. + */ + TInt GetConnectScreenId(); private: // data @@ -84,6 +95,11 @@ * Set when user connection is enabled */ TBool iUserConnectionSupported; + + /** + * Error counter. + */ + TUint iErrorCounter; }; #endif // MPMCSIDWATCHER_H diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/inc/mpmdatausagewatcher.h --- a/bearermanagement/mpm/inc/mpmdatausagewatcher.h Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/inc/mpmdatausagewatcher.h Mon May 03 12:53:07 2010 +0300 @@ -24,6 +24,9 @@ class CRepository; class CMPMServer; +// Stop after this many consecutive central repository errors. +const TInt KMpmDataUsageWatcherCenRepErrorThreshold = 80; + /** * Class for accessing central repository. * Follows KCurrentCellularDataUsage key in central repository. @@ -55,11 +58,6 @@ void RunL(); /** - * Active object's RunError. - */ - TInt RunError( TInt aError ); - - /** * Active object's DoCancel. */ void DoCancel(); @@ -75,6 +73,17 @@ * Symbian 2nd phase constructor. */ void ConstructL(); + + /** + * Request for notifications. + */ + TInt RequestNotifications(); + + /** + * Get current cellular data usage value. + */ + TInt GetCurrentDataUsageValue(); + private: // data @@ -95,6 +104,11 @@ */ CMPMServer* iServer; + /** + * Error counter. + */ + TUint iErrorCounter; + }; #endif // MPMDATAUSAGEWATCHER_H diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/inc/mpmdialog.h --- a/bearermanagement/mpm/inc/mpmdialog.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/* -* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: MPM class used for agent dialog initiation -* -*/ - -/** -@file mpmdialog.h -Mobility Policy Manager agent dialog initiation class. -*/ - -#ifndef MPMDIALOG_H -#define MPMDIALOG_H - -// INCLUDES -#include -#include - -#include "mpmiapselection.h" -#include "mpmdialogbase.h" - -// CLASS DECLARATION -/** -* MPM dialog initiation class definition. -* -* @lib MPMServer.exe -* @since 3.0 -*/ -class CMPMDialog : protected CMPMDialogBase - { -public: - - /** - * Two-phased constructor. - * @param aCommDbConnPref Connection preferences - */ - static CMPMDialog* NewL( CMPMIapSelection& aIapSelection, - const RAvailableIAPList& aIAPList, - TUint32 aBearerSet, - CArrayPtrFlat& aQueue, - CMPMServer& aServer ); - - /** - * Destructor. - */ - virtual ~CMPMDialog(); - - /** - * Write sort snap information to publish and subscribe. - * - * Publish and subscribe is used as there is otherwise circular - * reference between MPM and connection dialogs which causes - * @since 3.2 - */ - void PublishSortSnapInfoL(); - -protected: // Functions from base classes - /** - * Called from the Base class implementation - * when dialog is started. In the current - * call stack it's possible to query aDlg for - * more information and after that pointer is - * invalid. - */ - virtual void Start( CMPMDialogBase* aDlg = NULL ); - - - /** - * From CActive. Cancels UI dialog. - * @since 3.0 - */ - void DoCancel(); - - /** - * From CActive. Run when UI dialog finished. - * @since 3.0 - */ - void RunL(); - - /** - * From CActive. Run if RunL leaves. - * @since 3.0 - * @param aError Error that caused leave. - * @return KErrNone - */ - TInt RunError( TInt aError ); - -private: // New methods - /** - * Initiates a UI dialog towards Agent Dialog Server. - * @since 3.0 - */ - void InitSelectConnection(); - - /** - * C++ default constructor. - * @param aCommDbConnPref Connection preferences - */ - CMPMDialog( CMPMIapSelection& aIapSelection, - TUint32 aBearerSet, - CArrayPtrFlat& aQueue, - CMPMServer& aServer ); - - /** - * 2nd phase constructor. - */ - void ConstructL( const RAvailableIAPList& aIAPList ); - - /** - * Copies aOrigin to aCopy. - * @since 3.2 - * @param aOrigin Original RAvailableIAPList. - * @param aCopy Copy RAvailableIAPList. - * @return KErrNone if successful, otherwise one of the - * system-wide error codes. - */ - TInt CopyArray( const RAvailableIAPList& aOrigin, - RAvailableIAPList& aCopy ); - - /** - * Clean sort snap information from publish and subscribe. - * - * @since 3.2 - */ - void CleanSortSnapInfo(); - -private: // Data - // Agent Dialog server - RGenConAgentDialogServer iDlgServ; - - // Iap selection object reference - CMPMIapSelection& iIapSelection; - - // SNAP or IAP id - TUint32 iSnapOrIAPId; - - // Bearer set as a combination of - // TExtendedConnPref::TExtendedConnBearer values. - TUint32 iBearerSet; - - // Handle to server class - CMPMServer& iServer; - - RAvailableIAPList iIAPList; - }; - - -#endif // MPMDIALOG_H - -// End of file diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/inc/mpmiapselection.h --- a/bearermanagement/mpm/inc/mpmiapselection.h Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/inc/mpmiapselection.h Mon May 03 12:53:07 2010 +0300 @@ -23,18 +23,10 @@ #include "mpmserversession.h" #include "mpmcommsdataccess.h" -class CMPMDialog; class CMPMWlanQueryDialog; class CMPMConfirmDlgStarting; class TMpmConnPref; -enum TOfflineNoteResponse - { - EOfflineResponseUndefined, - EOfflineResponseYes, - EOfflineResponseNo - }; - /** * Handles IAP selection. MPM Server session * uses the class to select the best available @@ -73,7 +65,8 @@ * Two-phased constructor. */ static CMPMIapSelection* NewL( CMPMCommsDatAccess* aCommsDatAccess, - CMPMServerSession* aSession ); + CMPMServerSession* aSession, + CConnectionUiUtilities* aConnUiUtils ); /** * Destructor. @@ -96,14 +89,6 @@ */ void ExplicitConnectionL(); - /** - * Updates connection dialog contents if - * the dilog is shown - * - * @since S60 v3.2 - */ - void UpdateConnectionDialogL(); - public: /** * Starts Wlan query if Iap is wlan iap. @@ -218,27 +203,6 @@ void HandleUserSelectionL( TBool aIsIap, TUint32 aId, TInt aError ); /** - * Returns the stored user response to the offline note - * @since 3.2 - */ - TOfflineNoteResponse OfflineNoteResponse(); - - /** - * Stores the user response to the offline note - * @since 3.2 - * @param aResponse Offline note response - */ - void SetOfflineNoteResponse( TOfflineNoteResponse aResponse ); - - /** - * Iap selection is notified that conenction is started. - * Offline note response is reseted. - * - * @since 3.2 - */ - void ConnectionStarted(); - - /** * Get original MPM connection preferences * @since 5.2 */ @@ -303,7 +267,8 @@ * C++ default constructor. */ CMPMIapSelection( CMPMCommsDatAccess* aCommsDatAccess, - CMPMServerSession* aSession ); + CMPMServerSession* aSession, + CConnectionUiUtilities* aConnUiUtils ); /** * ConstructL @@ -324,6 +289,9 @@ // Used for commsdat related functionalities CMPMCommsDatAccess* iCommsDatAccess; + // Handle to connection UI utilities + CConnectionUiUtilities* iConnUiUtils; + // Contains state info whether PrefIapnotifs can be sent // and saved IAP info structure. TStoredIapInfo iStoredIapInfo; @@ -337,9 +305,6 @@ // Pointer to Confirmation dialog. CMPMConfirmDlgStarting* iConfirmDlgStarting; - // Pointer to the dialog active object. - CMPMDialog* iDialog; - // Pointer to Wlan query dialog. CMPMWlanQueryDialog* iWlanDialog; @@ -356,11 +321,6 @@ // State of impilict connection start TImplicitConnectionState iImplicitState; - // Offline note response for the connection. - // Offline note must be displayed only once - // during the connection (not for each wlan iap of a snap). - TOfflineNoteResponse iOfflineNoteResponse; - // True if connection is roaming (set when displaying offline note) TBool iIsRoaming; diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/inc/mpmofflinewatcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bearermanagement/mpm/inc/mpmofflinewatcher.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Listens for offline mode changes in central repository. +* +*/ + +#ifndef MPMOFFLINEWATCHER_H +#define MPMOFFLINEWATCHER_H + +// INCLUDES +#include + +class CRepository; +class CMPMServer; + +// Stop after this many consecutive central repository errors. +const TInt KMpmOfflineWatcherCenRepErrorThreshold = 80; + +/** + * Class for accessing central repository. + * Follows KCoreAppUIsNetworkConnectionAllowed key in central repository. + * @since 5.2 + */ +class CMpmOfflineWatcher : public CActive + { + +public: + + /** + * New for calling the two-phased constructor. + */ + static CMpmOfflineWatcher* NewL( CMPMServer* aServer ); + + /** + * Destructor. + */ + virtual ~CMpmOfflineWatcher(); + + /** + * Start to listen for events. + */ + void StartL(); + + /** + * Active object's RunL. + */ + void RunL(); + + /** + * Active object's DoCancel. + */ + void DoCancel(); + +private: + + /** + * C++ default constructor. + */ + CMpmOfflineWatcher( CMPMServer* aServer ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * Request for notifications. + */ + TInt RequestNotifications(); + + /** + * Get current offline mode value. + */ + TInt GetCurrentOfflineValue(); + + +private: // data + + /** + * Is offline feature supported. + */ + TBool iOfflineFeatureSupported; + + /** + * Central repository handle. + * Own. + */ + CRepository* iRepository; + + /** + * Offline mode activity value. + */ + TInt iOfflineMode; // type: TCoreAppUIsNetworkConnectionAllowed + + /** + * Pointer to the MPM Server object. + * Not own. + */ + CMPMServer* iServer; + + /** + * Error counter. + */ + TUint iErrorCounter; + + }; + +#endif // MPMOFFLINEWATCHER_H diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/inc/mpmserver.h --- a/bearermanagement/mpm/inc/mpmserver.h Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/inc/mpmserver.h Mon May 03 12:53:07 2010 +0300 @@ -29,6 +29,7 @@ #include // RTelServer #include // RMobilePhone #include // RPacketService +#include #include "mpmcommon.h" #include "rmpm.h" @@ -38,6 +39,7 @@ class CMPMCommsDatAccess; class CMpmCsIdWatcher; class CMpmDataUsageWatcher; +class CMpmOfflineWatcher; // CONSTANTS _LIT( KMPMPanicCategory, "Mobility Policy Manager Server" ); @@ -167,6 +169,13 @@ EMPMBearerTypeOther }; +enum TOfflineWlanQueryResponse + { + EOfflineResponseUndefined, + EOfflineResponseYes, + EOfflineResponseNo + }; + // FUNCTION PROTOTYPES void PanicServer( TInt aPanic ); @@ -179,7 +188,6 @@ class CMPMConfirmDlgStarting; class CMPMDefaultConnection; class CMPMWlanQueryDialog; -class CMPMDialog; // CLASS DECLARATION /** @@ -343,8 +351,10 @@ * Checks if the connection is started for the Iap Id. * @since 3.2 * @param aIapId IAP Id of the connection + * @param aConnId Connection Id */ - TBool CheckIfStarted( const TUint32 aIapId ); + TBool CheckIfStarted( const TUint32 aIapId, + const TConnectionId aConnId ); /** * Checks if a connection is started with wlan iap. @@ -445,12 +455,6 @@ const TPrefIAPNotifCaller aCaller ); /** - * Update Connection dialog of each session - * @since 3.2 - */ - void UpdateSessionConnectionDlgL(); - - /** * Handling of blacklisting certain IAP and the presumed IAP for * the certain connection. * @since 3.1 @@ -629,13 +633,6 @@ inline CMPMWlanQueryDialog* FirstInWlanQueryQueue(); /** - * Get the ConnectDialogQueue. - * @since 3.2 - * @return Pointer to the CMPMDialogQueue. - */ - inline CArrayPtrFlat* ConnectDialogQueue(); - - /** * Get the Default Connection object. * @since 3.2 * @return Pointer to the Default Connection object. @@ -790,34 +787,6 @@ inline CMpmCsIdWatcher* CsIdWatcher(); /** - * Change state of the P&S keys according to active connection. - * @since 5.0 - * @param aSession Handle to session used by connection. - */ - void UpdateActiveConnectionL( CMPMServerSession& aSession ); - - /** - * Map bearer type between MPM and commsdat. - * @since 5.0 - * @param aBearerType Bearer type used by MPM for active connection selection. - * @return Bearer type used by commsdat - */ - TUint32 MapBearerType( TMPMBearerType aBearerType ); - - /** - * Writes new active connection to the P&S keys - * @since 5.0 - */ - void PublishActiveConnection(); - - /** - * Returns number of active connections. - * @since 5.0 - * @return Number of active connections - */ - TInt NumberOfActiveConnections(); - - /** * Returns server session instance that corresponds to given * connection id. * @since 5.2 @@ -832,6 +801,39 @@ * @since 5.2 */ void StopCellularConns(); + + /** + * Handle to connection ui utilities + */ + inline CConnectionUiUtilities* ConnUiUtils() const; + + /** + * Offline mode watcher updates the mode variable stored by MPM server. + * @since 5.2 + * @param aNewModeValue New offline mode value to be updated. + */ + void UpdateOfflineMode( TInt aNewModeValue ); + + /** + * Tells if the phone is in offline mode. + * @since 5.2 + * @return ETrue if phone is in offline mode. + */ + TBool IsPhoneOffline(); + + /** + * Tells the "Use WLAN in offline mode" query response. + * @since 5.2 + * @return TOfflineWlanQueryResponse (not_responded/yes/no). + */ + TOfflineWlanQueryResponse OfflineWlanQueryResponse(); + + /** + * Called when the "Use WLAN in offline mode" query has been responded. + * @since 5.2 + * @param aResponse setting the query response value (not_responded/yes/no). + */ + void SetOfflineWlanQueryResponse( TOfflineWlanQueryResponse aResponse); private: @@ -912,9 +914,6 @@ // Solves problem with overlapping Wlan Queries CArrayPtrFlat* iWlanQueryQueue; - - // Solves problem with overlapping Connection Dialogs - CArrayPtrFlat* iConnectDialogQueue; // Handles Default Connection selection CMPMDefaultConnection* iDefaultConnection; @@ -938,24 +937,30 @@ CMpmCsIdWatcher* iMpmCsIdWatcher; /** - * Handle to another central repository watcher + * Handle to central repository watcher */ CMpmDataUsageWatcher* iMpmDataUsageWatcher; - // Iap id of the active connection - TUint32 iActiveIapId; - - // Snap id of the active connection - TUint32 iActiveSnapId; - - // Bearer type of the active connection - TMPMBearerType iActiveBearerType; + /** + * Handle to central repository watcher + */ + CMpmOfflineWatcher* iMpmOfflineWatcher; // Dedicated clients RArray iDedicatedClients; // Used for commsdat related functionalities CMPMCommsDatAccess* iCommsDatAccess; + + // Handle to connection UI utilities + // + CConnectionUiUtilities* iConnUiUtils; + + // Offline mode. + TInt iOfflineMode; + + // Is WLAN usage already accepted in this offline session. + TOfflineWlanQueryResponse iOfflineWlanQueryResponse; }; #include "mpmserver.inl" diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/inc/mpmserver.inl --- a/bearermanagement/mpm/inc/mpmserver.inl Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/inc/mpmserver.inl Mon May 03 12:53:07 2010 +0300 @@ -136,15 +136,6 @@ } // ----------------------------------------------------------------------------- -// CMPMServer::ConnectDialogQueue -// ----------------------------------------------------------------------------- -// -inline CArrayPtrFlat* CMPMServer::ConnectDialogQueue() - { - return iConnectDialogQueue; - } - -// ----------------------------------------------------------------------------- // CMPMServer::IncrementConnections // ----------------------------------------------------------------------------- // @@ -262,9 +253,18 @@ // CMPMServer::RoamingWatcher() // ----------------------------------------------------------------------------- // -CMPMRoamingWatcher* CMPMServer::RoamingWatcher() const +inline CMPMRoamingWatcher* CMPMServer::RoamingWatcher() const { return iRoamingWatcher; } +// ----------------------------------------------------------------------------- +// CMPMServer::ConnUiUtils() +// ----------------------------------------------------------------------------- +// +inline CConnectionUiUtilities* CMPMServer::ConnUiUtils() const + { + return iConnUiUtils; + } + // End of File diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/inc/mpmserversession.h --- a/bearermanagement/mpm/inc/mpmserversession.h Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/inc/mpmserversession.h Mon May 03 12:53:07 2010 +0300 @@ -28,7 +28,7 @@ #include // for TCommDbConnPref #include // for TConnPref #include // for TConnMonIapInfo -#include //TMsgQueryLinkedResults +#include #include "rmpm.h" #include "mpmserver.h" @@ -289,13 +289,6 @@ void ClientErrorNotificationL( TInt aError ); /** - * Checks if phone is in offline mode or not. - * @since 3.1 - * @return ETrue if phone is in offline mode, otherwise EFalse. - */ - TBool IsPhoneOfflineL() const; - - /** * Returns the list of available IAPs, where the blacklisted IAPs * have already been removed. * @since 3.2 @@ -328,13 +321,6 @@ void SortSnapL( const TUint32 aSnapId, TMpmSnapBuffer& aSortedIaps ); - /** - * If session is displaying connection selection dialog - * updated contents for it are written to publish& subscribe API. - * - * @since 3.2 - */ - void UpdateConnectionDialogL(); /** * Returns a reference to iStoredIapInfo. @@ -807,9 +793,9 @@ * @param aValidatedIap Iap validated by MPM for roaming * @return ETrue if necessary, otherwise EFalse. */ - TBool CheckNotifNeed( const TUint32 aCurrentIap, - const TUint32 aLastNotifiedIap, - const TUint32 aValidatedIap ); + TBool CheckNotifNeedL( const TUint32 aCurrentIap, + const TUint32 aLastNotifiedIap, + const TUint32 aValidatedIap ); /** * Returns the list of unavailable IAPs. @@ -944,21 +930,26 @@ // CMPMIapSelection* iIapSelection; - // Stored state of migrating to carrier - // - TMigrateToCarrierState iMigrateState; + // Stored state of migrating to carrier + // + TMigrateToCarrierState iMigrateState; - // Last Iap notified using PreferredIap-notification - // - TUint32 iLastNotifiedIap; + // Last Iap notified using PreferredIap-notification + // + TUint32 iLastNotifiedIap; - // Iap to which connection is migrating + // Iap to which connection is migrating // TUint32 iMigrateIap; // Set when this session is user connection - // + // TBool iUserConnection; + + // Set when disconnect dialog is shown to avoid + // showing duplicate cellulara data usage dialog + // + TBool iDisconnectDialogShown; }; #include "mpmserversession.inl" diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/inc/mpmwlanquerydialog.h --- a/bearermanagement/mpm/inc/mpmwlanquerydialog.h Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/inc/mpmwlanquerydialog.h Mon May 03 12:53:07 2010 +0300 @@ -22,16 +22,8 @@ #include #include //for struct #include -#include -#include -#include "mpmiapselection.h" // for TOfflineNoteResponse - -// ID of Easy Wep dialog -const TUid KUidEasyWepDlg = { 0x101FD673 }; - -// ID of Easy Wpa dialog -const TUid KUidEasyWpaDlg = { 0x101FD674 }; +#include "mpmcommsdataccess.h" // ID of OfflineWlanNote dialog const TUid KUidCOfflineWlanNoteDlg = { 0x101FD671 }; @@ -51,16 +43,8 @@ ///< Wlan network supports Protected Setup }; -const TInt KEasyWepQuery256BitMaxLength = 58; +class CMPMIapSelection; -class TWlanAgtWepKeyData - { -public: - TBuf< KEasyWepQuery256BitMaxLength > iKey; - TBool iHex; - }; - -class CMPMIapSelection; /** * Handles displaying wlan related dialogs * @@ -72,12 +56,7 @@ enum TWlanQueryState { - EOffline, - EWlanNetwork, - EWepSettings, - EWpaSettings, - EWPS, - ERetrySettingsStorage + EOffline }; public: @@ -119,14 +98,6 @@ * @since 3.2 */ void StartWlanQueryL(); - - /** - * Stores user defined easy wlan parameters to commsdat - * if easy wlan has been selected. - * - * @since 3.2 - */ - void StoreEasyWlanSelectionL(); private: @@ -134,105 +105,16 @@ * Propagates wlan network selection as an initial value for the dialog, * Used if there are several dialogs queued. * - * @param aWlanIapId Selected WLAN IAP - * @param aOfflineStatus Offline note response * @param aDialogStatus Status of the dialog when destroyed. * @since 3.2 */ - void OfferInformation( TUint32 aWlanIapId, - TOfflineNoteResponse aOfflineStatus, - TInt aDialogStatus ); + void OfferInformation( TInt aDialogStatus ); - CMPMWlanQueryDialog( CMPMIapSelection& aSession, + CMPMWlanQueryDialog( CMPMIapSelection& aIapSelection, TUint32 aSelectedWlanIap ); void ConstructL(); - /** - * Gets Easy Wlan data from member variables and stores - * it to arguments - * - * @since 9.1 - * @param aSsid Wlan iap ssid, stored in used ssid field - * @param aSecMode Wlan iap security mode - * @param aConnMode Wlan iap connection mode - * @param aWepKeyData Wlan iap wep key data - * @param aEnableWpaPsk Wlan iap enable psk mode - * @param aWpaPsk Wlan iap wpa psk - * @param aWpaKeyLen Wlan iap wpa key length - */ - void GetEasyWlanDataL( TWlanSsid& aSsid, - TUint& aSecMode, - TWlanNetMode& aConnMode, - TWepKeyData& aWepKeyData, - TUint& aEnableWpaPsk, - TDes8& aWpaPsk, - TUint& aWpaKeyLen ); - - /** - * Maps TWlanConnectionSecurityMode to security mode stored in CommsDat - * - * @since 9.1 - * @param aConnSecmode Security mode in TWlanConnectionSecurityMode format - * @param aCommsdatSecMode returned security mode value in CommsDat format - */ - TInt ConnSecModeToCommsDatSecMode( TWlanConnectionSecurityMode aConnSecmode, - TUint& aCommsdatSecMode ) const; - - /** - * Maps TWlanIapSecurityMode to security mode stored in CommsDat - * - * @since 9.1 - * @param aConnSecmode Security mode in TWlanIapSecurityMode format - * @param aCommsdatSecMode returned security mode value in CommsDat format - */ - TInt IapSecModeToCommsDatSecMode( TWlanIapSecurityMode aConnSecmode, - TUint& aCommsdatSecMode ) const; - - /** - * Gets Easy Wlan data from member variables when WPS has been used - * and stores it to arguments - * - * @since 9.1 - * @param aSsid Wlan iap ssid, stored in used ssid field - * @param aSecMode Wlan iap security mode - * @param aConnMode Wlan iap connection mode - * @param aWepKeyData WEP key data - * @param aEnableWpaPsk Wlan iap enable psk mode - * @param aWpaPsk Wlan iap wpa psk - * @param aWpaKeyLen Wlan iap wpa key length - */ - void GetEasyWlanDataForWpsL( TWlanSsid& aSsid, - TUint& aSecMode, - TWlanNetMode& aConnMode, - TWepKeyData& aWepKeyData, - TUint& aEnableWpaPsk, - TDes8& aWpaPsk, - TUint& aWpaKeyLen ); - - /** - * Starts WPS dialog and sets the active object active. - * - * @since 9.1 - */ - void StartWpsDlgL(); - - /** - * Determines whether WEP key is hex format based on the length - * - * @since 9.1 - * @param aLength - * @return ETrue if format is hex, otherwise EFalse - */ - TBool IsWepFormatHexL( TInt aLength ) const; - - /** - * Get the network preferences using ConnectionUiUtilities API. - * - * @since 5.1 - */ - void GetNetworkPrefs(); - private: // data // Reference to iap selection object @@ -244,47 +126,20 @@ // Stores data for wlan network guery TPckgBuf iNetworkPrefs; - // Stores data for wep query - TPckgBuf iNotifWep; - - // Stores data for wpa query - TPckgBuf< TBuf< KWLMMaxWpaPskLength > > iNotifWpaKey; - //Interfce to Notifier RNotifier iNotifier; //State of querying Wlan settings TWlanQueryState iWlanQueryState; - // selected wlan iap id - TUint32 iWlanIapId; - - // ETrue if user has selected easy wlan - TBool iEasyWlanSelected; - - // Flag that can be used to cancel the dialog startup based on earlier dialog - TInt iOverrideStatus; - // Connection Ui Utilities pointer CConnectionUiUtilities* iConnUiUtils; - - // Contains WLAN settings received through WPS - TWlanProtectedSetupCredentialAttribute iWpsAttribute; - - // WPS client pointer for displaying WPS dialogs - CWiFiProtUiClient* iWps; - - // Contains WPS return value - WiFiProt::TWiFiReturn iWpsReturn; - - // True if wps has been completed. - TBool iWpsCompleted; - // Retry count - TUint32 iRetryCount; + // Wlan iap + TUint32 iWlanIapId; - // Retry timer - RTimer iTimer; + // Flag that can be used to cancel the dialog startup based on earlier dialog + TInt iOverrideStatus; }; #endif // MPMWLANQUERYDIALOG_H diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/inc/rmpm.h --- a/bearermanagement/mpm/inc/rmpm.h Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/inc/rmpm.h Mon May 03 12:53:07 2010 +0300 @@ -63,71 +63,6 @@ // Write policy _LIT_SECURITY_POLICY_C1( KMPMSortSnapWritePolicy, ECapabilityNetworkControl ); -// Definitions for Reading/Writing user connection data -// to publish and subscribe API -// -// UID of the category (note that uid is the same as sort snap category) -const TUid KMPMUserConnectionCategory = { 0x101f6d3a }; - -// Keys for this category -const TUint KMPMPSKeyUserConnectionSnap = 10001; -const TUint KMPMPSKeyUserConnectionIap = 10002; - -// Property types -const TInt KMPMUserConnectionSnapType = RProperty::EInt; -const TInt KMPMUserConnectionIapType = RProperty::EInt; - -// Read policy, no capabilities required -// This format is used instead of _LIT_SECURITY_POLICY_PASS, which -// produces pclint warnings -_LIT_SECURITY_POLICY_C1( KMPMUserConnectionReadPolicy, ECapability_None ); - -// Write policy -_LIT_SECURITY_POLICY_C1( KMPMUserConnectionWritePolicy, ECapabilityNetworkControl ); - -// Definitions for Reading/Writing active connection data -// to publish and subscribe API -// -// UID of the category -const TUid KMPMActiveConnectionCategory = { 0x101f6d3a }; - -// Property types -const TInt KMPMActiveConnectionIapType = RProperty::EInt; -const TInt KMPMActiveConnectionSnapType = RProperty::EInt; -const TInt KMPMActiveConnectionBearerType = RProperty::EInt; - -// Keys for active connection category - -/** - * Iap Id of the active connection. - * If set to zero then no active connection - */ -const TUint KMPMPSKeyActiveConnectionIap = 10003; - -/** - * Snap Id of the active connection. - * If set to zero then possible iap connection - */ -const TUint KMPMPSKeyActiveConnectionSnap = 10004; - -/** - * Possible values: - * 0, - * KCommDbBearerVirtual, - * KCommDbBearerWLAN, - * KCommDbBearerWcdma, - * KCommDbBearerUnknown, - */ -const TUint KMPMPSKeyActiveConnectionBearer = 10005; - -// Read policy, no capabilities required -// This format is used instead of _LIT_SECURITY_POLICY_PASS, which -// produces pclint warnings -_LIT_SECURITY_POLICY_C1( KMPMActiveConnectionReadPolicy, ECapability_None ); - -// Write policy -_LIT_SECURITY_POLICY_C1( KMPMActiveConnectionWritePolicy, ECapabilityNetworkControl ); - // MACROS _LIT( KPanicCategory, "MPM Client" ); diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/src/mpmcommsdataccess.cpp --- a/bearermanagement/mpm/src/mpmcommsdataccess.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/src/mpmcommsdataccess.cpp Mon May 03 12:53:07 2010 +0300 @@ -235,13 +235,6 @@ TUint32 presumedIapId = aIapId; - // Find and change Iap and Net Id if SSID exist - // - if ( !CheckEasyWLanL( aIapId ) ) - { - aSession.MyServer().Events()->FindSSID( ssid, aIapId, aNetId ); - } - // Store Iap Id, Net Id and empty APN to TConnInfo, // so that FindAPN can utilise the information // during the validation of next IAP to support @@ -416,125 +409,6 @@ } // ----------------------------------------------------------------------------- -// CMPMCommsDatAccess::CheckEasyWLanL -// ----------------------------------------------------------------------------- -// -TBool CMPMCommsDatAccess::CheckEasyWLanL( TUint32 aIapId ) const - { - MPMLOGSTRING2( "CMPMCommsDatAccess::CheckEasyWLanL: IAP Id = %i", aIapId) - - TBool easyWlan = EFalse; - CCommsDatabase* commsDatabase = CCommsDatabase::NewL(); - CleanupStack::PushL( commsDatabase ); - - // Make hidden records visible - // - commsDatabase->ShowHiddenRecords(); - - CCommsDbTableView* commsDbIapTableView = - commsDatabase->OpenViewMatchingUintLC( TPtrC( IAP ), - TPtrC( COMMDB_ID ), - aIapId ); - - User::LeaveIfError( commsDbIapTableView->GotoFirstRecord() ); - - TInt length1( 0 ); - - commsDbIapTableView->ReadColumnLengthL( TPtrC( IAP_SERVICE_TYPE ), - length1 ); - - HBufC* buf1 = HBufC::NewLC( length1 ); - TPtr ptr1( buf1->Des() ); - - // Read IAP's service type - // - commsDbIapTableView->ReadTextL(TPtrC( IAP_SERVICE_TYPE ), ptr1 ); - MPMLOGSTRING2( - "CMPMCommsDatAccess::CheckEasyWLanL: IAP service type = %S", &ptr1 ) - - if ( ptr1.Compare( TPtrC( LAN_SERVICE ) ) == KErrNone ) - { - TUint32 service( 0 ); - commsDbIapTableView->ReadUintL( TPtrC( IAP_SERVICE ), service ); - - // Now open a view to LAN_SERVICE table - // - CCommsDbTableView* commsDbLanTableView = - commsDatabase->OpenViewMatchingUintLC( TPtrC( LAN_SERVICE ), - TPtrC( COMMDB_ID ), - service ); - - User::LeaveIfError( commsDbLanTableView->GotoFirstRecord() ); - - TUint32 commDbId( 0 ); - - commsDbLanTableView->ReadUintL( TPtrC( COMMDB_ID ), commDbId ); - - // Now open a view to WLAN_SERVICE table - // - // If non wlan product, wlan tables won't exist and this will - // leave. In that case do not check WLAN related issues - // - CCommsDbTableView* commsDbWlanTableView( NULL ); - TRAPD( err2, commsDbWlanTableView = - commsDatabase->OpenViewMatchingUintLC( TPtrC( WLAN_SERVICE ), - TPtrC( WLAN_SERVICE_ID ), - commDbId ); - CleanupStack::Pop( commsDbWlanTableView ) ); - if ( err2 == KErrNone ) - { - // Push back to cleanup stack. Object must be popped within - // TRAP, to avoid unbalance in cleanup stack and panic 71 - CleanupStack::PushL( commsDbWlanTableView ); - - TInt err = commsDbWlanTableView->GotoFirstRecord(); - - if ( err == KErrNone ) - { - TInt ssidLength( 0 ); - commsDbWlanTableView->ReadColumnLengthL( TPtrC( NU_WLAN_SSID ), - ssidLength ); - if ( ssidLength == 0 ) - { - MPMLOGSTRING( - "CMPMCommsDatAccess::CheckEasyWLanL: IAP is Easy WLAN" ) - easyWlan = ETrue; - } - else - { - MPMLOGSTRING( - "CMPMCommsDatAccess::CheckEasyWLanL: IAP isn't Easy WLAN" ) - easyWlan = EFalse; - } - } - else - { - MPMLOGSTRING2( "CMPMCommsDatAccess::CheckEasyWLanL\ - GotoFirstRecord returned %d", err ) - } - - // Release memory - // - CleanupStack::PopAndDestroy( commsDbWlanTableView ); - } - else - { - MPMLOGSTRING2( - "CMPMCommsDatAccess::CheckEasyWLanL: WLAN table view failed, err %d", err2 ) - } - CleanupStack::PopAndDestroy( commsDbLanTableView ); - } - - // Release memory - // - CleanupStack::PopAndDestroy( buf1 ); - CleanupStack::PopAndDestroy( commsDbIapTableView ); - CleanupStack::PopAndDestroy( commsDatabase ); - - return easyWlan; - } - -// ----------------------------------------------------------------------------- // CMPMCommsDatAccess::DumpIAPsL // ----------------------------------------------------------------------------- // @@ -1034,317 +908,6 @@ CleanupStack::PopAndDestroy( table ); CleanupStack::PopAndDestroy( commsDatabase ); } - -// ----------------------------------------------------------------------------- -// CMPMCommsDatAccess::CheckWLANIapWithSsidL -// ----------------------------------------------------------------------------- -// - -TUint32 CMPMCommsDatAccess::CheckWLANIapWithSsidL( TWlanSsid& aSsid, - TUint32 aSecMode, - TWlanNetMode aConnMode ) - { - MPMLOGSTRING( "CMPMCommsDatAccess::CheckWLANIapWithSsidL" ) - TUint iapId( 0 ); - - // Creating a session with the latest version - // - CMDBSession* db = CMDBSession::NewLC( KCDVersion1_1 ); - - db->SetAttributeMask( ECDHidden | ECDProtectedWrite ); - - // Find Wlan service record - // - TBuf ssid16; - CnvUtfConverter::ConvertToUnicodeFromUtf8( ssid16, aSsid ); - MPMLOGSTRING4( "CMPMCommsDatAccess::CheckWLANIapWithSsidL sec:%d, conn:%d ssid %S", - aSecMode, - aConnMode, - &ssid16 ) - CMDBRecordSet* wlanSet = - new ( ELeave ) CMDBRecordSet( - CCDWlanServiceRecord::TableIdL( *db ) ); - CleanupStack::PushL( wlanSet ); - - CCDWlanServiceRecord* wlanRecord = new ( ELeave ) - CCDWlanServiceRecord( CCDWlanServiceRecord::TableIdL( *db ) ); - - CleanupStack::PushL( wlanRecord ); - wlanSet->LoadL( *db ); - - MPMLOGSTRING2( "CMPMCommsDatAccess::CheckWLANIapWithSsidL, record count:%d", - wlanSet->iRecords.Count() ) - TBool matchFound( EFalse ); - for (TInt i = 0; ( i < wlanSet->iRecords.Count() ) && !matchFound; i++ ) - { - wlanRecord->SetElementId( GetRealElementId( wlanSet->iRecords[i] ) ); - wlanRecord->LoadL( *db ); - TBuf ssid; - ssid = wlanRecord->iWLanSSID; - //if not easywlan, continue - // - if( ssid.Compare( KNullDesC() ) ) - { - ssid = wlanRecord->iWLanSSID.GetL(); - TUint32 secMode = wlanRecord->iWlanSecMode; - TUint32 connMode = wlanRecord->iWlanConnMode; - - if ( connMode ) - { - connMode = 1; - } - MPMLOGSTRING3( "CMPMCommsDatAccess::CheckWLANIapWithSsidL CommsDat secmode:%d, connmode:%d ", - secMode, - connMode ) - - if ( !ssid.Compare( ssid16 ) && ( aConnMode == connMode ) ) - { - //compare sec mode - if ( aSecMode == EWlanSecModeOpen || aSecMode == EWlanSecModeWep ) - { - if ( aSecMode == secMode ) - { - MPMLOGSTRING( "CMPMCommsDatAccess::CheckWLANIapWithSsidL match found, open/wep " ) - matchFound = ETrue; - } - - } - //WPA PSK case - else if ( aSecMode == EWlanSecModeWpa2 ) - { - if ( ( secMode > EWlanSecModeWep ) && (wlanRecord->iWlanEnableWpaPsk) ) - { - MPMLOGSTRING( "CMPMCommsDatAccess::CheckWLANIapWithSsidL match found, wpa psk " ) - matchFound = ETrue; - } - } - //aSecMode = EWlanSecModeWpa - else - { - if ( secMode > EWlanSecModeWep ) - { - MPMLOGSTRING( "CMPMCommsDatAccess::CheckWLANIapWithSsidL match found, wpa " ) - matchFound = ETrue; - } - } - - } - } - } - - if ( matchFound ) - { - // load Iap record - // - CCDIAPRecord* iapRecord = static_cast ( - CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); - CleanupStack::PushL( iapRecord ); - - CCDLANServiceRecord* lanRecord = static_cast ( - CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord )); - CleanupStack::PushL( lanRecord ); - - iapRecord->iServiceType.SetL( TPtrC( KCDTypeNameLANService ) ); - - lanRecord->SetRecordId( wlanRecord->iWlanServiceId ); - lanRecord->LoadL( *db ); - - iapRecord->iService = lanRecord->ElementId(); - -/* iapRecord->iServiceType.SetL( TPtrC( KCDTypeNameLANService ) ); - iapRecord->iService = wlanRecord->iWlanServiceId; -*/ - if( iapRecord->FindL( *db ) ) - { - MPMLOGSTRING( "CMPMCommsDatAccess::CheckWLANIapWithSsidL iap found" ) - // Iap record found - // - iapId = iapRecord->RecordId(); - } - CleanupStack::PopAndDestroy( lanRecord ); - CleanupStack::PopAndDestroy( iapRecord ); - } - CleanupStack::PopAndDestroy( wlanRecord ); - CleanupStack::PopAndDestroy( wlanSet ); - CleanupStack::PopAndDestroy( db ); - - return iapId; - } - -// ----------------------------------------------------------------------------- -// CMPMCommsDatAccess::SetEasyWlanDataL -// ----------------------------------------------------------------------------- -// -void CMPMCommsDatAccess::SetEasyWlanDataL( const TWlanSsid& aSsid, - TUint aSecMode, - TWlanNetMode aConnMode, - TWepKeyData aWepData, - TUint aEnableWpaPsk, - const TDesC8& aWpaPsk, - TUint aWpaKeyLen ) - { - MPMLOGSTRING( "CMPMCommsDatAccess::SetEasyWlanDataL" ) - CMDBSession* dbSession = CMDBSession::NewL( KCDVersion1_1 ); - CleanupStack::PushL(dbSession); - - // Try to open a transaction to obtain write lock - dbSession->OpenTransactionL(); - - TUint32 wlanId = FindEasyWlanServiceIdL( dbSession ); - if( !wlanId ) - { - MPMLOGSTRING( "CMPMCommsDatAccess::SetEasyWlanDataL unable to store \ - easy wlan settings" ) - dbSession->Close(); - CleanupStack::PopAndDestroy( dbSession ); - return; - } - - CMDBGenericRecord* record = static_cast - ( CCDRecordBase::RecordFactoryL( 0)); - CleanupStack::PushL( record ); - record->InitializeL( TPtrC( WLAN_SERVICE ),NULL ); - record->SetRecordId( wlanId ); - record->LoadL( *dbSession ); - - TBuf ssid16; - CnvUtfConverter::ConvertToUnicodeFromUtf8( ssid16, aSsid ); - CMDBField* textField = (CMDBField*)record->GetFieldByIdL(KCDTIdWlanUsedSSID); - textField->SetMaxLengthL( ssid16.Length()); - textField->SetL( ssid16 ); - - *((CMDBField*)record->GetFieldByIdL(KCDTIdWlanSecMode)) = aSecMode; - *((CMDBField*)record->GetFieldByIdL(KCDTIdWlanConnMode)) = aConnMode; - - if (aEnableWpaPsk) - { - MPMLOGSTRING( "CMPMCommsDatAccess::SetEasyWlanDataL wpa psk" ) - CMDBField* binField = (CMDBField*) - record->GetFieldByIdL(KCDTIdWlanWpaPreSharedKey); - binField->SetMaxLengthL( aWpaKeyLen ); - binField->SetL( aWpaPsk ); - - *((CMDBField*)record->GetFieldByIdL(KCDTIdWlanWpaKeyLength)) = aWpaKeyLen; - *((CMDBField*)record->GetFieldByIdL(KCDTIdWlanEnableWpaPsk)) = aEnableWpaPsk; - } - else if (aSecMode == EWlanSecModeWep) - { - MPMLOGSTRING( "CMPMCommsDatAccess::SetEasyWlanDataL wep psk" ) - *((CMDBField*)record->GetFieldByIdL( KCDTIdWlanWepIndex )) = - aWepData.iDefaultWep; - - SetWepKeyL( KCDTIdWlanFormatKey1, KCDTIdWlanWepKey1, - aWepData.iWep1, aWepData.iWepFormat1, record ); - SetWepKeyL( KCDTIdWlanFormatKey2, KCDTIdWlanWepKey2, - aWepData.iWep2, aWepData.iWepFormat2, record ); - SetWepKeyL( KCDTIdWlanFormatKey3, KCDTIdWlanWepKey3, - aWepData.iWep3, aWepData.iWepFormat3, record ); - SetWepKeyL( KCDTIdWlanFormatKey4, KCDTIdWlanWepKey4, - aWepData.iWep4, aWepData.iWepFormat4, record ); - } - else - { - MPMLOGSTRING2( "CMPMCommsDatAccess::SetEasyWlanDataL sec mode %d, no key data written", - aSecMode ) - } - - //Finally save all to commsdat. - record->ModifyL( *dbSession ); - dbSession->CommitTransactionL(); - dbSession->Close(); - CleanupStack::PopAndDestroy( record ); - CleanupStack::PopAndDestroy( dbSession ); - } - -// ----------------------------------------------------------------------------- -// CMPMCommsDatAccess::SetWepKeyL -// ----------------------------------------------------------------------------- -// -void CMPMCommsDatAccess::SetWepKeyL( TMDBElementId aFormatId, - TMDBElementId aKeyId, - TWlanWepKey aWepKey, - TUint aWepFormat, - CMDBGenericRecord* aRecord ) - { - CMDBField* formatField = static_cast*> - ( aRecord->GetFieldByIdL( aFormatId ) ); - formatField->SetL( aWepFormat ); - CMDBField* wepKey = static_cast*> - ( aRecord->GetFieldByIdL( aKeyId ) ); - if ( aWepFormat ) - { - wepKey->SetL( aWepKey ); - } - else - { - //Convert Ascii to Hex format, as only Hex value to be stored in CommsDat - HBufC8* buf8Conv = HBufC8::NewLC( aWepKey.Length() * KMpmDoubleLength ); - ConvertAsciiToHex( aWepKey, buf8Conv ); - wepKey->SetL( buf8Conv->Des() ); - CleanupStack::PopAndDestroy( buf8Conv ); - } - } - -// ----------------------------------------------------------------------------- -// CMPMCommsDatAccess::ConvertAsciiToHex -// ----------------------------------------------------------------------------- -// -void CMPMCommsDatAccess::ConvertAsciiToHex( const TDesC8& aSource, - HBufC8* aDest ) - { - MPMLOGSTRING( "CMPMCommsDatAccess::ConvertAsciiToHex" ) - _LIT( hex, "0123456789ABCDEF" ); - TInt size = aSource.Size(); - TPtr8 ptr = aDest->Des(); - for ( TInt ii = 0; ii < size; ii++ ) - { - TText8 ch = aSource[ii]; - ptr.Append( hex()[(ch/16)&0x0f] ); - ptr.Append( hex()[ch&0x0f] ); - } - } - -// ----------------------------------------------------------------------------- -// CMPMCommsDatAccess::FindEasyWlanServiceIdL -// ----------------------------------------------------------------------------- -// -TUint32 CMPMCommsDatAccess::FindEasyWlanServiceIdL( CMDBSession* aDb ) - { - // if the method returns the record container there is for - // some reason garbage data in the key values - // - TUint32 wlanId( 0 ); - MPMLOGSTRING( "CMPMCommsDatAccess::FindEasyWlanServiceIdL" ) - - CMDBRecordSet* wlanSet = - new ( ELeave ) CMDBRecordSet( - CCDWlanServiceRecord::TableIdL( *aDb ) ); - CleanupStack::PushL( wlanSet ); - wlanSet->LoadL( *aDb ); - - TBool found( EFalse ); - for ( TInt i = 0; i < wlanSet->iRecords.Count() && !found; i++ ) - { - CCDWlanServiceRecord* wlanRecord = new ( ELeave ) - CCDWlanServiceRecord( CCDWlanServiceRecord::TableIdL( *aDb ) ); - CleanupStack::PushL( wlanRecord ); - - wlanRecord->SetElementId( GetRealElementId( wlanSet->iRecords[i] ) ); - wlanRecord->LoadL( *aDb ); - - TDesC ssid = wlanRecord->iWLanSSID; - if( !ssid.Compare( KNullDesC() ) ) - { - MPMLOGSTRING2( "CMPMCommsDatAccess::FindEasyWlanServiceIdL: \ -found service entry %i", wlanRecord->RecordId() ) - wlanId = wlanRecord->RecordId(); - found = ETrue; - } - CleanupStack::PopAndDestroy( wlanRecord ); - } - CleanupStack::PopAndDestroy( wlanSet ); - return wlanId; - } // ----------------------------------------------------------------------------- // CMPMCommsDatAccess::CheckHiddenAgentL @@ -1753,12 +1316,6 @@ TInt ssidLength( 0 ); commsDbWlanTableView->ReadColumnLengthL( TPtrC( NU_WLAN_SSID ), ssidLength ); - if ( ssidLength == 0 ) - { - MPMLOGSTRING( - "CMPMCommsDatAccess::CheckWlanL: IAP is Easy WLAN" ) - wlan = EEasyWlanIap; - } } else { @@ -2325,7 +1882,26 @@ TMpmConnPref tempMpmConnPref; tempMpmConnPref.SetSnapId( snap ); - aSession.IapSelectionL()->ChooseBestIAPL( tempMpmConnPref, aAvailableIAPList ); + + // Ensure that there will be no infinite loops by dropping + // this virtual iap out from the list of available iaps. + // E.g. next layer SNAP could be the same as current SNAP. + RAvailableIAPList tempList; + CleanupClosePushL( tempList ); + + for( TInt i=0; i < aAvailableIAPList.Count(); i++ ) + { + // drop this virtual iap out from the list of + // available iaps to prevent from infinitely looping + // + if ( aAvailableIAPList[i] != aVirtualIapId ) + { + tempList.Append( aAvailableIAPList[i] ); + } + } + aSession.IapSelectionL()->ChooseBestIAPL( tempMpmConnPref, tempList ); + CleanupStack::PopAndDestroy( &tempList ); + aRealIapId = tempMpmConnPref.IapId(); } else if ( virtualNext->iNextLayerIAP != 0 ) @@ -2344,10 +1920,18 @@ MPMLOGSTRING( "CMPMCommsDatAccess::FindRealIapL: Call FindRealIapL" ) - FindRealIapL( iap2->RecordId(), - aRealIapId, - aAvailableIAPList, - aSession ); + if ( aVirtualIapId != virtualNext->iNextLayerIAP ) + { + FindRealIapL( iap2->RecordId(), + aRealIapId, + aAvailableIAPList, + aSession ); + } + else + { + aRealIapId = 0; + MPMLOGSTRING( "CMPMCommsDatAccess::FindRealIapL: Virtual iap points to itself" ) + } } else { @@ -2668,201 +2252,6 @@ } // ----------------------------------------------------------------------------- -// CMPMCommsDatAccess::AreActiveIapsInSameSnapL -// ----------------------------------------------------------------------------- -// -TBool CMPMCommsDatAccess::AreActiveIapsInSameSnapL ( RArray& aActiveBMConns, - TUint32& aSnapId ) - { - MPMLOGSTRING( "CMPMCommsDatAccess::AreActiveIapsInSameSnapL" ) - TBool same = ETrue; - TUint32 snapId = 0; - TUint32 prevSnapId = 0; - - // Go through all active connections - for (TInt index = 0; index < aActiveBMConns.Count(); index++ ) - { - // Do check only for active connections - if ( aActiveBMConns[index].iConnInfo.iState != EStarted ) - { - continue; - } - - // Iap id must be nonzero - if ( aActiveBMConns[index].iConnInfo.iIapId ) - { - prevSnapId = snapId; - // Get destination id for the iap - snapId = GetSnapIdL( aActiveBMConns[index].iConnInfo.iIapId ); - - // Check if previous iap's destination is different - if ( ( ( prevSnapId != snapId ) && prevSnapId && snapId ) || - !snapId ) - { - // Set return value to false and leave loop - same = EFalse; - break; - } - } - } - - // Return destId for later use - aSnapId = snapId; - - return same; - } - -// ----------------------------------------------------------------------------- -// CMPMCommsDatAccess::SelectActiveConnectionL -// ----------------------------------------------------------------------------- -// -void CMPMCommsDatAccess::SelectActiveConnectionL ( const TUint32 aSnapId, - RArray& aActiveBMConns, - TUint32& aActiveIapId, - TUint32& aActiveSnapId, - TMPMBearerType& aActiveBearerType, - CMPMServerSession& aSession ) - { - MPMLOGSTRING( "CMPMCommsDatAccess::SelectActiveConnectionL" ) - RArray activeIaps; - RArray iapIds; - - // Reset output parameters - aActiveIapId = 0; - aActiveSnapId = 0; - aActiveBearerType = EMPMBearerTypeNone; - - CleanupClosePushL( activeIaps ); - - for (TInt index = 0; index < aActiveBMConns.Count(); index++ ) - { - CMPMServerSession* serverSession = - aSession.MyServer().GetServerSession( - aActiveBMConns[index].iConnInfo.iConnId ); - - // Add only started iaps to array - if ( aActiveBMConns[index].iConnInfo.iState == EStarted && - serverSession->ChooseBestIapCalled() ) - { - activeIaps.AppendL ( aActiveBMConns[index].iConnInfo.iIapId ); - } - } - - CleanupClosePushL( iapIds ); - SearchDNEntriesL( aSnapId, iapIds ); - - // Remove any deactived IAP from iapIds - TInt ret = KErrNotFound; - TInt destCount = iapIds.Count(); - - // Decrement by one, because count is n, - // but indexes in array are 0 .. n-1. - // - destCount--; - - // This time we are browsing the array from the end to the beginning, - // because removing one element from array affects index numbering. - for ( TInt k = destCount; k >= 0; k-- ) - { - ret = activeIaps.Find( iapIds[k].iIapId ); - if ( ret == KErrNotFound ) - { - MPMLOGSTRING2( "CMPMCommsDatAccess::SelectActiveConnectionL: \ -Remove deactived IAP = %i", iapIds[k].iIapId ) - iapIds.Remove( k ); - } - } - - // Determine the actual priorities for IAPs - DeterminePrioritiesL( iapIds, activeIaps, aSession ); - - // Check if a matching available IAP is found. - if( iapIds.Count() ) - { - // Go through all iaps - for ( TInt index = 0; index < iapIds.Count(); index++ ) - { - // Get bearer type - TMPMBearerType bearerType = GetBearerTypeL( iapIds[index].iIapId ); - - // If iap is not vpn, wlan or packet then skip it - if ( bearerType == EMPMBearerTypeOther ) - { - continue; - } - - // Set bearer type, iap id and snap id - for (TInt index2 = 0; index2 < aActiveBMConns.Count(); index2++ ) - { - if ( ( aActiveBMConns[index2].iConnInfo.iIapId == - iapIds[index].iIapId ) ) - { - if ( aSession.MyServer().DedicatedClients().Find( - aActiveBMConns[index2].iConnInfo.iAppUid ) != KErrNone ) - { - aActiveSnapId = aActiveBMConns[index2].iConnInfo.iSnap; - aActiveIapId = aActiveBMConns[index2].iConnInfo.iIapId; - aActiveBearerType = bearerType; - } - break; - } - } - - break; - } - } - - MPMLOGSTRING4( - "CMPMCommsDatAccess::SelectActiveConnectionL: Iap id = %i, Snap id = %i, \ -Bearer type = %i", - aActiveIapId, aActiveSnapId, aActiveBearerType ) - - CleanupStack::PopAndDestroy( &iapIds ); - CleanupStack::PopAndDestroy( &activeIaps ); - } - -// ----------------------------------------------------------------------------- -// CMPMCommsDatAccess::GetSnapIdL -// ----------------------------------------------------------------------------- -// -TUint32 CMPMCommsDatAccess::GetSnapIdL( TUint32 aIapId ) - { - MPMLOGSTRING( "CMPMCommsDatAccess::GetSnapIdL" ) - TUint32 snapId = 0; - RArray snapIds; - - CleanupClosePushL( snapIds ); - // Get destinations - FindAllSnapsL( snapIds ); - - for (TInt index = 0; index < snapIds.Count(); index++) - { - RArray ids; - // Get iaps belonging to this snap - CleanupClosePushL( ids ); - SearchDNEntriesL( snapIds[index], ids ); - - for (TInt index2 = 0; index2 < ids.Count(); index2++) - { - // Check if iap belongs to this destination - if (ids[index2].iIapId == aIapId) - { - snapId = snapIds[index]; - CleanupStack::PopAndDestroy( &ids ); - CleanupStack::PopAndDestroy( &snapIds ); - return snapId; - } - } - - CleanupStack::PopAndDestroy( &ids ); - } - - CleanupStack::PopAndDestroy( &snapIds ); - - return snapId; - } - -// ----------------------------------------------------------------------------- // CMPMCommsDatAccess::IsSnapEmptyL // ----------------------------------------------------------------------------- // diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/src/mpmconfirmdlg.cpp --- a/bearermanagement/mpm/src/mpmconfirmdlg.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/src/mpmconfirmdlg.cpp Mon May 03 12:53:07 2010 +0300 @@ -86,7 +86,8 @@ // OR // if ConfirmDlgResponse is not accepted by the iConfirmDlgUser. // - if ( !aDlg || !iConfirmDlgUser.ConfirmDlgResponse( &((CMPMConfirmDlg*)aDlg)->iConfirmDlgUser ) ) + if ( !aDlg || !iConfirmDlgUser.ConfirmDlgResponse( + &((CMPMConfirmDlg*)aDlg)->iConfirmDlgUser ) ) { MPMLOGSTRING3( "CMPMConfirmDlg::Start Display dialog: SNAP %d, IAP %d", iSnapId, iIAP ) @@ -95,7 +96,7 @@ { case EConfirmDlgHomeNetwork: { - MPMLOGSTRING( " normal confirm dialog" ) + MPMLOGSTRING( " Show home network confirm dialog" ) iUtils->ConfirmMethodUsageQuery( iResult, true, iStatus); @@ -104,7 +105,7 @@ case EConfirmDlgVisitorNetwork: { - MPMLOGSTRING( " normal confirm dialog" ) + MPMLOGSTRING( " Show visitor network confirm dialog" ) iUtils->ConfirmMethodUsageQuery( iResult, false, iStatus); diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/src/mpmconfirmdlgstarting.cpp --- a/bearermanagement/mpm/src/mpmconfirmdlgstarting.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/src/mpmconfirmdlgstarting.cpp Mon May 03 12:53:07 2010 +0300 @@ -193,8 +193,6 @@ // void CMPMConfirmDlgStarting::UserSelectedCancel( const TInt aError ) { - MPMLOGSTRING2( "CMPMConfirmDlgStarting<0x%x>::UserSelectedCancel", - iConnId ) MPMLOGSTRING3( "CMPMConfirmDlgStarting<0x%x>::UserSelectedCancel:\ Complete %d", iConnId, aError ) iIapSelection.ChooseIapComplete( aError, NULL ); diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/src/mpmconnmonevents.cpp --- a/bearermanagement/mpm/src/mpmconnmonevents.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/src/mpmconnmonevents.cpp Mon May 03 12:53:07 2010 +0300 @@ -535,13 +535,6 @@ iAvailableIAPs = eventIap->IapAvailability(); UpdateIAPRefreshTime(); IapAvailabilityChange( EConnMonEvent ); - - TRAPD( err, iMyServer.UpdateSessionConnectionDlgL() ) - if( err != KErrNone ) - { - MPMLOGSTRING2( "CMPMConnMonEvents::EventL UpdateSessionConnectionDlgL \ -error code %d", err ) - } break; } default: diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/src/mpmcsidwatcher.cpp --- a/bearermanagement/mpm/src/mpmcsidwatcher.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/src/mpmcsidwatcher.cpp Mon May 03 12:53:07 2010 +0300 @@ -29,16 +29,20 @@ CMpmCsIdWatcher::CMpmCsIdWatcher() : CActive( EPriorityStandard ) { + MPMLOGSTRING( "CMpmCsIdWatcher::CMpmCsIdWatcher" ) + CActiveScheduler::Add( this ); } // --------------------------------------------------------------------------- -// Creates central repositor object +// Creates central repository object // --------------------------------------------------------------------------- // void CMpmCsIdWatcher::ConstructL() { + MPMLOGSTRING( "CMpmCsIdWatcher::ConstructL" ) + iRepository = CRepository::NewL( KMpmOccCenRepUid ); // Check whether user connection is supported @@ -56,6 +60,8 @@ // CMpmCsIdWatcher* CMpmCsIdWatcher::NewL() { + MPMLOGSTRING( "CMpmCsIdWatcher::NewL" ) + CMpmCsIdWatcher* self = new( ELeave ) CMpmCsIdWatcher(); CleanupStack::PushL( self ); self->ConstructL(); @@ -68,7 +74,9 @@ // --------------------------------------------------------------------------- // CMpmCsIdWatcher::~CMpmCsIdWatcher() - { + { + MPMLOGSTRING( "CMpmCsIdWatcher::~CMpmCsIdWatcher" ) + Cancel(); delete iRepository; } @@ -79,13 +87,13 @@ // void CMpmCsIdWatcher::StartL() { - // Request notification - User::LeaveIfError( iRepository->NotifyRequest( KMpmConnectScreenId, - iStatus )); - SetActive(); + MPMLOGSTRING( "CMpmCsIdWatcher::StartL" ) + + // Get the initial Connect screen ID from repository. + User::LeaveIfError( GetConnectScreenId() ); - // Get value from central repository - User::LeaveIfError(iRepository->Get(KMpmConnectScreenId, iConnectScreenId)); + // Request for notifications. + User::LeaveIfError( RequestNotifications() ); } // --------------------------------------------------------------------------- @@ -94,6 +102,8 @@ // TUint32 CMpmCsIdWatcher::ConnectScreenId() const { + MPMLOGSTRING( "CMpmCsIdWatcher::ConnectScreenId" ) + if ( iUserConnectionSupported ) { // Return real value if user connection is supported @@ -113,26 +123,30 @@ // void CMpmCsIdWatcher::RunL() { - // Leave if error - User::LeaveIfError( iStatus.Int() ); + MPMLOGSTRING( "CMpmCsIdWatcher::RunL" ) - // Request new notification - User::LeaveIfError( iRepository->NotifyRequest( KMpmConnectScreenId, - iStatus )); - SetActive(); - - // Get value from central repository - iRepository->Get( KMpmConnectScreenId, iConnectScreenId ); - } + if ( iStatus.Int() < KErrNone ) + { + MPMLOGSTRING2("Status: 0x%08X", iStatus.Int()) + iErrorCounter++; + if ( iErrorCounter > KMpmCsIdWatcherCenRepErrorThreshold ) + { + MPMLOGSTRING2("Over %d consecutive errors, stopping notifications permanently.", + KMpmCsIdWatcherCenRepErrorThreshold) + return; + } + // Else: Error occured but counter not expired. Proceed. + } + else + { + // Notification is received ok => Reset the counter. + iErrorCounter = 0; -// --------------------------------------------------------------------------- -// From class CActive. -// Nothing to do over here -// --------------------------------------------------------------------------- -// -TInt CMpmCsIdWatcher::RunError( TInt /*aError*/ ) - { - return KErrNone; + // Get value from central repository + GetConnectScreenId(); + } + + RequestNotifications(); } // --------------------------------------------------------------------------- @@ -142,6 +156,44 @@ // void CMpmCsIdWatcher::DoCancel() { + MPMLOGSTRING( "CMpmCsIdWatcher::DoCancel" ) iRepository->NotifyCancel( KMpmConnectScreenId ); } +// --------------------------------------------------------------------------- +// Request notifications. +// --------------------------------------------------------------------------- +// +TInt CMpmCsIdWatcher::RequestNotifications() + { + MPMLOGSTRING( "CMpmCsIdWatcher::RequestNotifications" ) + + TInt err = iRepository->NotifyRequest( KMpmConnectScreenId, iStatus ); + + if ( err == KErrNone ) + { + SetActive(); + } + else + { + MPMLOGSTRING2( "CMpmCsIdWatcher::RequestNotifications, ERROR: %d", err ) + } + return err; + } + +// --------------------------------------------------------------------------- +// Get current repository key value. +// --------------------------------------------------------------------------- +// +TInt CMpmCsIdWatcher::GetConnectScreenId() + { + MPMLOGSTRING( "CMpmCsIdWatcher::GetConnectScreenId" ) + + TInt err = iRepository->Get( KMpmConnectScreenId, iConnectScreenId ); + + if ( err != KErrNone ) + { + MPMLOGSTRING2( "CMpmCsIdWatcher::GetConnectScreenId, ERROR: %d", err ) + } + return err; + } diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/src/mpmdatausagewatcher.cpp --- a/bearermanagement/mpm/src/mpmdatausagewatcher.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/src/mpmdatausagewatcher.cpp Mon May 03 12:53:07 2010 +0300 @@ -82,14 +82,11 @@ { MPMLOGSTRING( "CMpmDataUsageWatcher::StartL" ) - // Request notification - User::LeaveIfError( iRepository->NotifyRequest( KCurrentCellularDataUsage, - iStatus ) ); - SetActive(); + // Get the initial data usage value from repository. + User::LeaveIfError( GetCurrentDataUsageValue() ); - // Get value from central repository - User::LeaveIfError( iRepository->Get( KCurrentCellularDataUsage, - iCellularDataUsage ) ); + // Request notifications. + User::LeaveIfError( RequestNotifications() ); } // --------------------------------------------------------------------------- @@ -101,38 +98,39 @@ { MPMLOGSTRING( "CMpmDataUsageWatcher::RunL" ) - User::LeaveIfError( iStatus.Int() ); + if ( iStatus.Int() < KErrNone ) + { + MPMLOGSTRING2("Status: 0x%08X", iStatus.Int()) + iErrorCounter++; + if ( iErrorCounter > KMpmDataUsageWatcherCenRepErrorThreshold ) + { + MPMLOGSTRING2("Over %d consecutive errors, stopping notifications permanently.", + KMpmDataUsageWatcherCenRepErrorThreshold) + return; + } + // Else: Error occured but counter not expired. Proceed. + } + else + { + // Notification is received ok => Reset the counter. + iErrorCounter = 0; - // Request new notification - User::LeaveIfError( iRepository->NotifyRequest( KCurrentCellularDataUsage, - iStatus ) ); - SetActive(); + // Get the new Cellular data usage setting value from central repository. + TInt oldCellularDataUsage = iCellularDataUsage; - TInt oldCellularDataUsage = iCellularDataUsage; - - // Get the new value from central repository - User::LeaveIfError( iRepository->Get( KCurrentCellularDataUsage, - iCellularDataUsage ) ); + if ( GetCurrentDataUsageValue() == KErrNone ) + { + // Stop cellular connections if the setting changes into Disabled. + if ( oldCellularDataUsage != ECmCellularDataUsageDisabled && + iCellularDataUsage == ECmCellularDataUsageDisabled && + iServer->RoamingWatcher()->RoamingStatus() != EMPMRoamingStatusUnknown ) + { + iServer->StopCellularConns(); + } + } + } - // Stop cellular connections if the setting changes into Disabled - if ( oldCellularDataUsage != ECmCellularDataUsageDisabled && - iCellularDataUsage == ECmCellularDataUsageDisabled && - iServer->RoamingWatcher()->RoamingStatus() != EMPMRoamingStatusUnknown ) - { - iServer->StopCellularConns(); - } - } - -// --------------------------------------------------------------------------- -// From class CActive. -// Nothing to do over here. -// --------------------------------------------------------------------------- -// -TInt CMpmDataUsageWatcher::RunError( TInt /*aError*/ ) - { - MPMLOGSTRING( "CMpmDataUsageWatcher::RunError" ) - - return KErrNone; + RequestNotifications(); } // --------------------------------------------------------------------------- @@ -147,3 +145,40 @@ iRepository->NotifyCancel( KCurrentCellularDataUsage ); } +// --------------------------------------------------------------------------- +// Request notifications. +// --------------------------------------------------------------------------- +// +TInt CMpmDataUsageWatcher::RequestNotifications() + { + MPMLOGSTRING( "CMpmDataUsageWatcher::RequestNotifications" ) + + TInt err = iRepository->NotifyRequest( KCurrentCellularDataUsage, iStatus ); + + if ( err == KErrNone ) + { + SetActive(); + } + else + { + MPMLOGSTRING2( "CMpmDataUsageWatcher::RequestNotifications, ERROR: %d", err ) + } + return err; + } + +// --------------------------------------------------------------------------- +// Get current repository key value. +// --------------------------------------------------------------------------- +// +TInt CMpmDataUsageWatcher::GetCurrentDataUsageValue() + { + MPMLOGSTRING( "CMpmDataUsageWatcher::GetCurrentDataUsageValue" ) + + TInt err = iRepository->Get( KCurrentCellularDataUsage, iCellularDataUsage ); + + if ( err != KErrNone ) + { + MPMLOGSTRING2( "CMpmDataUsageWatcher::GetCurrentDataUsageValue, ERROR: %d", err ) + } + return err; + } diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/src/mpmdialog.cpp --- a/bearermanagement/mpm/src/mpmdialog.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,374 +0,0 @@ -/* -* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: MPM user dialog handling -* -*/ - -/** -@file mpmdialog.cpp -Mobility Policy Manager user dialog initiation. -*/ - -// INCLUDE FILES -#include // for TConnPref -#include -#include -#include -#include -#include // For feature flags -#include //publish and subscribe - -#include "mpmdialog.h" -#include "mpmlogger.h" -#include "mpmdefaultconnection.h" -#include "rmpm.h" -#include "mpmcommsdataccess.h" - -// ============================= LOCAL FUNCTIONS =============================== - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CMPMDialog::NewL -// ----------------------------------------------------------------------------- -// -CMPMDialog* CMPMDialog::NewL( CMPMIapSelection& aIapSelection, - const RAvailableIAPList& aIAPList, - TUint32 aBearerSet, - CArrayPtrFlat& aQueue, - CMPMServer& aServer ) - { - CMPMDialog* self = new ( ELeave ) CMPMDialog( aIapSelection, - aBearerSet, - aQueue, - aServer ); - CleanupStack::PushL( self ); - self->ConstructL( aIAPList ); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// CMPMDialog::CMPMDialog -// ----------------------------------------------------------------------------- -// -CMPMDialog::CMPMDialog( CMPMIapSelection& aIapSelection, - TUint32 aBearerSet, - CArrayPtrFlat& aQueue, - CMPMServer& aServer ) - : CMPMDialogBase( *(CArrayPtrFlat*)&aQueue ), - iIapSelection( aIapSelection ), - iSnapOrIAPId( 0 ), - iBearerSet( aBearerSet ), - iServer ( aServer ) - { - } - - -// ----------------------------------------------------------------------------- -// CMPMDialog::~CMPMDialog -// ----------------------------------------------------------------------------- -// -CMPMDialog::~CMPMDialog() - { - Cancel(); - MPMLOGSTRING2( "CMPMDialog::~CMPMDialog: deleted, Completing with code = %i", - iStatus.Int() ) - iDlgServ.Close(); - // Clean up all other stuff - iIAPList.Close(); - } - - -// ----------------------------------------------------------------------------- -// CMPMDialog::ConstructL -// ----------------------------------------------------------------------------- -// -void CMPMDialog::ConstructL( const RAvailableIAPList& aIAPList ) - { - User::LeaveIfError( CopyArray( aIAPList, iIAPList ) ); - CMPMDialogBase::ConstructL(); - } - -// ----------------------------------------------------------------------------- -// CMPMDialog::ConstructL -// ----------------------------------------------------------------------------- -// -void CMPMDialog::Start( CMPMDialogBase* /*aDlg*/ ) - { - InitSelectConnection(); - } - -// ----------------------------------------------------------------------------- -// CMPMDialog::IntSelectConnection -// ----------------------------------------------------------------------------- -// -void CMPMDialog::InitSelectConnection() - { - TInt err = iDlgServ.Connect(); - // Try to publish sort snap data - // - if ( err == KErrNone ) - { - TRAP( err, PublishSortSnapInfoL() ) - } - if ( err != KErrNone ) - { - // Jump to RunL() - TRequestStatus* status = &iStatus; - User::RequestComplete( status, err ); - SetActive(); - return; - } - - // Map bearer set. bearerSet variable is a combination of values - // mapped to TCommDbBearer while iBearerSet is a combination of - // TExtendedConnPref::TExtendedConnBearer values. - - TUint32 bearerSet( ECommDbBearerVirtual ); - if ( iBearerSet == TExtendedConnPref::EExtendedConnBearerUnknown ) - { - bearerSet |= ECommDbBearerCSD | ECommDbBearerWcdma | - ECommDbBearerWLAN; - } - else - { - if ( iBearerSet & TExtendedConnPref::EExtendedConnBearerWLAN ) - { - bearerSet |= ECommDbBearerWLAN; - } - if ( iBearerSet & TExtendedConnPref::EExtendedConnBearerCellular ) - { - bearerSet |= ECommDbBearerWcdma; - } - } - - // API definition was provided by Symbian, but we don't really need - // these parameters with AccessPointConnection. - // - TUint32 unusedVariable( 0 ); - - /* AccessPointConnection API implements also the ChangeConnection in - * the ALR "world", you should also be careful of the input value of - * iSnapOrIAPId, because the Destination with the input ElementID is - * considered the "current Destination in use", so it will not be - * listed by the notifier. So if you really want to see the ALR - * version of AccessPointConnection, in input iSnapOrIAPId MUST be - * an invalid ElementID (e.g. 0), to be sure that no Destinations - * will be removed from the list. - */ - iDlgServ.AccessPointConnection( unusedVariable, - unusedVariable, - iSnapOrIAPId, - bearerSet, - iStatus ); - - SetActive(); - } - -// ----------------------------------------------------------------------------- -// CMPMDialog::PublishSortSnapInfoL -// ----------------------------------------------------------------------------- -// -void CMPMDialog::PublishSortSnapInfoL() - { - // allow PublishSortSnapInfoL to run only - // if the dialog is the first one in the queue. - // => First one is active one. - if ( !IsFirst() ) - { - return; - } - - MPMLOGSTRING( "CMPMDialog::PublishSortSnapInfoL" ) - RArray snaps; - CleanupClosePushL( snaps ); - - // set first snap to 0 as ungathegorised - // - snaps.AppendL( KSortUncategorisedIaps ); - - // Find Snap ids - // - iServer.CommsDatAccess()->FindAllSnapsL( snaps ); - - // Write iaps for each snap, also 0 is - // included for uncategorised - // - TMpmSnapPubSubFormat snapData; - TInt i( 0 ), err( KErrNone ); - for(; ( i < snaps.Count() ) && - ( i < KMPMSortSnapMaxKey ); i++ ) - { - snapData.iSnap = snaps[ i ]; - snapData.iSortedIaps.Reset(); - // Get sorted iaps - // - iIapSelection.Session()->SortSnapL( snaps[ i ], snapData.iSortedIaps ); - - // Define pub&sub key if not already defined - // - err = RProperty::Define( KMPMSortSnapCategory, - i, - KMPMSortSnapType, - KMPMSortSnapReadPolicy, - KMPMSortSnapWritePolicy ); - - if ( err != KErrAlreadyExists && - err != KErrNone ) - { - MPMLOGSTRING2( "CMPMDialog::PublishSortSnapInfoL: error in define: %d ", err ) - } - - TPtrC8 dataPtr( reinterpret_cast< TUint8* >( &snapData ), sizeof( snapData ) ); - - err = RProperty::Set( KMPMSortSnapCategory, - i, - dataPtr ); - if ( err != KErrNone ) - { - MPMLOGSTRING2( "CMPMDialog::PublishSortSnapInfoL: error in set: %d ", err ) - } - MPMLOGSTRING3( "CMPMDialog::PublishSortSnapInfoL: snap %d iap count %d", - snapData.iSnap, snapData.iSortedIaps.Count() ) - } - - // set rest of the keys to undefined - // - while( i < KMPMSortSnapMaxKey ) - { - err = RProperty::Delete( KMPMSortSnapCategory, i ); - if ( err != KErrNotFound && - err != KErrNone ) - { - MPMLOGSTRING2( "CMPMDialog::PublishSortSnapInfoL: error in delete: %d ", err ) - } - i++; - } - CleanupStack::PopAndDestroy( &snaps ); - } - -// ----------------------------------------------------------------------------- -// CMPMDialog::RunL -// ----------------------------------------------------------------------------- -// -void CMPMDialog::RunL() - { - MPMLOGSTRING2( "CMPMDialog::RunL: status = %i", - iStatus.Int() ) - - TMDBElementId tableId = iSnapOrIAPId & KCDMaskShowRecordType; - TBool isIap( EFalse ); - if ( tableId == KCDTIdIAPRecord ) - { - isIap = ETrue; - } - - // Clean data from publish & subscribe - // - CleanSortSnapInfo(); - - TUint32 id = ( iSnapOrIAPId & KCDMaskShowRecordId ) >> KShift8; - iIapSelection.HandleUserSelectionL( isIap, id, iStatus.Int() ); - } - - -// ----------------------------------------------------------------------------- -// CMPMDialog::RunError -// ----------------------------------------------------------------------------- -// -TInt CMPMDialog::RunError(TInt aError) - { - // Handles a leave occurring in the request completion event handler - // RunL(). The active scheduler calls this function if this active - // object's RunL() function leaves. This gives this active object - // the opportunity to perform any necessary cleanup. - // - MPMLOGSTRING2( "CMPMDialog::RunError: RunL left with error = %i", aError ) - iIapSelection.HandleUserSelectionError( aError ); - - // Clean data from publish & subscribe - // - CleanSortSnapInfo(); - - // Return KErrNone to prevent panic - // - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// CMPMDialog::DoCancel -// ----------------------------------------------------------------------------- -// -void CMPMDialog::DoCancel() - { - iDlgServ.CancelAccessPointConnection(); - // Clean data from publish & subscribe - // - CleanSortSnapInfo(); - } - - -// ----------------------------------------------------------------------------- -// CMPMDialog::CopyArray -// ----------------------------------------------------------------------------- -// -TInt CMPMDialog::CopyArray( const RAvailableIAPList& aOrigin, - RAvailableIAPList& aCopy ) - { - TInt err( KErrNone ); - - // Clean array first - // - aCopy.Reset(); - - for( TInt i( 0 ); ( i < aOrigin.Count() ) && ( err == KErrNone ); ++i ) - { - err = aCopy.Append( aOrigin[i] ); - if ( err != KErrNone ) - { - // Cleanup and return - // - MPMLOGSTRING2( "CMPMDialog::CopyArray: Append error = %i", err ) - aCopy.Reset(); - } - } - - return err; - } - -// ----------------------------------------------------------------------------- -// CMPMDialog::CleanSortSnapInfoL -// ----------------------------------------------------------------------------- -// -void CMPMDialog::CleanSortSnapInfo() - { - MPMLOGSTRING( "CMPMDialog::CleanSortSnapInfoL" ) - - // Clean info from all keys - // - for( TInt i(0); i < KMPMSortSnapMaxKey; i++ ) - { - TInt err = RProperty::Delete( KMPMSortSnapCategory, i ); - if ( err != KErrNotFound && - err != KErrNone ) - { - MPMLOGSTRING2( "CMPMDialog::CleanSortSnapInfoL: error in delete: %d ", err ) - } - } - } - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/src/mpmiapselection.cpp --- a/bearermanagement/mpm/src/mpmiapselection.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/src/mpmiapselection.cpp Mon May 03 12:53:07 2010 +0300 @@ -17,7 +17,6 @@ #include "mpmiapselection.h" #include "mpmlogger.h" -#include "mpmdialog.h" #include "mpmserversession.h" #include "mpmcommsdataccess.h" #include "mpmconnmonevents.h" @@ -31,19 +30,19 @@ // --------------------------------------------------------------------------- // CMPMIapSelection::CMPMIapSelection( CMPMCommsDatAccess* aCommsDatAccess, - CMPMServerSession* aSession ) + CMPMServerSession* aSession, + CConnectionUiUtilities* aConnUiUtils ) : iChooseIapState( ENoConnection ), iCommsDatAccess( aCommsDatAccess ), + iConnUiUtils( aConnUiUtils ), iStoredIapInfo(), iSession( aSession ), iConfirmDlgStarting( NULL ), - iDialog( NULL ), iWlanDialog( NULL ), iNextBestExists( EFalse ), iUserSelectionIapId( 0 ), iUserSelectionSnapId( 0 ), iImplicitState( EImplicitStart ), - iOfflineNoteResponse( EOfflineResponseUndefined ), iIsRoaming( EFalse ), iNewWlansAllowed ( EFalse ) { @@ -63,10 +62,12 @@ // --------------------------------------------------------------------------- // CMPMIapSelection* CMPMIapSelection::NewL( CMPMCommsDatAccess* aCommsDatAccess, - CMPMServerSession* aSession ) + CMPMServerSession* aSession, + CConnectionUiUtilities* aConnUiUtils ) { CMPMIapSelection* self = new ( ELeave ) CMPMIapSelection( aCommsDatAccess, - aSession ); + aSession, + aConnUiUtils ); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -85,7 +86,6 @@ StopDisplayingStartingDlg(); delete iConfirmDlgStarting; - delete iDialog; delete iWlanDialog; } @@ -132,8 +132,8 @@ iChooseIapPref.SetSnapId( 0 ); } - MPMLOGSTRING2( "CMPMIapSelection::ChooseIapL: IapID: %i", - iChooseIapPref.IapId() ) + MPMLOGSTRING3( "CMPMIapSelection::ChooseIapL: IapID: %i SnapId: %i", + iChooseIapPref.IapId(), iChooseIapPref.SnapId() ) // Update WLAN only information and whether new WLAN network usage is allowed. TBool wlanOnly = iSession->IsWlanOnlyL( iNewWlansAllowed ); @@ -345,7 +345,7 @@ // KErrGprsOfflineMode should be returned instead of KErrNone. // - if ( !iapTypeLanOrWlan && iSession->IsPhoneOfflineL() ) + if ( !iapTypeLanOrWlan && iSession->MyServer().IsPhoneOffline() ) { ChooseIapComplete( KErrGprsOfflineMode, &iChooseIapPref ); } @@ -448,19 +448,6 @@ } // ----------------------------------------------------------------------------- -// CMPMIapSelection::UpdateConnectionDialog -// ----------------------------------------------------------------------------- -// -void CMPMIapSelection::UpdateConnectionDialogL() - { - if( iDialog ) - { - MPMLOGSTRING( "CMPMIapSelection::UpdateConnectionDialogL data will be updated" ) - iDialog->PublishSortSnapInfoL(); - } - } - -// ----------------------------------------------------------------------------- // CMPMIapSelection::CompleteExplicitSnapConnectionL // ----------------------------------------------------------------------------- // @@ -513,7 +500,7 @@ { ChooseIapComplete( KErrGprsServicesNotAllowed, NULL ); } - else if ( !iapTypeLanOrWlan && iSession->IsPhoneOfflineL() ) + else if ( !iapTypeLanOrWlan && iSession->MyServer().IsPhoneOffline() ) { // In case offline mode is enabled, only LAN or WLAN is allowed. // If some other bearer has been requested, then error code @@ -649,8 +636,6 @@ // void CMPMIapSelection::ImplicitConnectionCheckWlanScanNeededL() { - __ASSERT_DEBUG( !iDialog, PanicServer( EMPMReceiveAlreadyActive ) ); - MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionCheckWlanScanNeededL" ) iCommsDatAccess->CheckWLANIapL( *iSession ); @@ -719,27 +704,7 @@ const TMpmConnPref* aPolicyPref ) { MPMLOGSTRING2( "CMPMIapSelection::ChooseIapComplete aError = %d", aError ) - - if ( ( aError == KErrNone ) && - !( iChooseIapPref.NoteBehaviour() & - TExtendedConnPref::ENoteBehaviourConnDisableNotes ) && - ( iSession->IsMMSIap( aPolicyPref->IapId() ) == EFalse ) ) - { - TBool connectionAlreadyActive = - iSession->MyServer().CheckIfStarted( aPolicyPref->IapId() ); - CConnectionUiUtilities* connUiUtils = NULL; - TRAPD( popupError, - connUiUtils = CConnectionUiUtilities::NewL(); - connUiUtils->ConnectingViaDiscreetPopup( - aPolicyPref->IapId(), - connectionAlreadyActive ); - delete connUiUtils; ); - if ( popupError && connUiUtils ) - { - delete connUiUtils; - } - } - + if( iWlanDialog ) { delete iWlanDialog; @@ -796,7 +761,6 @@ aIapId, EStarting, *iSession ); - iWlanDialog->StoreEasyWlanSelectionL(); delete iWlanDialog; iWlanDialog = NULL; @@ -822,8 +786,6 @@ aError ) ChooseIapComplete( aError, NULL ); - delete iDialog; - iDialog = NULL; } @@ -847,7 +809,7 @@ // User selected SNAP // TMpmConnPref userPref; - iUserSelectionSnapId = iCommsDatAccess->MapNetIdtoSnapAPL( aId ); + iUserSelectionSnapId = aId; userPref.SetSnapId( iUserSelectionSnapId ); userPref.SetIapId( 0 ); @@ -872,12 +834,13 @@ } - // We are done - // - delete iDialog; - iDialog = NULL; - - ImplicitConnectionL(); + // Letting a function leave here would panic the whole MPM. + // + TRAPD( err, ImplicitConnectionL() ); + if( err != KErrNone ) + { + ChooseIapComplete( err, &iChooseIapPref ); + } } // ----------------------------------------------------------------------------- @@ -944,43 +907,6 @@ } // ----------------------------------------------------------------------------- -// CMPMIapSelection::OfflineNoteResponse -// ----------------------------------------------------------------------------- -// -TOfflineNoteResponse CMPMIapSelection::OfflineNoteResponse() - { -#ifndef _PLATFORM_SIMULATOR_ - MPMLOGSTRING2( "CMPMIapSelection::OfflineNoteResponse: %d", - iOfflineNoteResponse ) - return iOfflineNoteResponse; -#else - // Platsim simulates WLAN and offline-mode. To ease automated testing, - // offline connection confirmation is not asked in Platsim-variant - MPMLOGSTRING( "CMPMIapSelection::OfflineNoteResponse: yes for Platsim" ) - return EOfflineResponseYes; -#endif - } - -// ----------------------------------------------------------------------------- -// CMPMIapSelection::ConnectionStarted -// ----------------------------------------------------------------------------- -// -void CMPMIapSelection::ConnectionStarted() - { - MPMLOGSTRING( "CMPMIapSelection::ConnectionStarted: reset offline response" ) - SetOfflineNoteResponse( EOfflineResponseUndefined ); - } - -// ----------------------------------------------------------------------------- -// CMPMIapSelection::SetOfflineNoteShown -// ----------------------------------------------------------------------------- -// -void CMPMIapSelection::SetOfflineNoteResponse( TOfflineNoteResponse aResponse ) - { - MPMLOGSTRING2( "CMPMIapSelection::SetOfflineNoteResponse %d ", aResponse ) - iOfflineNoteResponse = aResponse; - } -// ----------------------------------------------------------------------------- // CMPMIapSelection::CompleteImplicitConnectionL // ----------------------------------------------------------------------------- // @@ -995,7 +921,7 @@ iapTypeLanOrWlan, *iSession ); - if ( !iapTypeLanOrWlan && iSession->IsPhoneOfflineL() ) + if ( !iapTypeLanOrWlan && iSession->MyServer().IsPhoneOffline() ) { MPMLOGSTRING2( "CMPMIapSelection::CompleteImplicitConnectionL: Completing with code = %i", KErrGprsOfflineMode ) @@ -1020,7 +946,6 @@ if( iWlanDialog ) { - iWlanDialog->StoreEasyWlanSelectionL(); delete iWlanDialog; iWlanDialog = NULL; } @@ -1039,13 +964,14 @@ MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionIapSelectionL" ) iSession->AvailableUnblacklistedIapsL( iStoredAvailableIaps, iSession->ConnectionId() ); - // Create and initiate user dialog - // - iDialog = CMPMDialog::NewL( *this, - iStoredAvailableIaps, - iChooseIapPref.BearerSet(), - *iSession->MyServer().ConnectDialogQueue(), - iSession->MyServer() ); + // The connection selection dialog doesn't exist any longer, thus + // the HandleUserSelection is called with the Internet SNAP that is returned instead + TInt err = KErrNone; + TInt internetSnapId = 0; + // if the reading leaves, then the internet snap did not exist for some reason + TRAP ( err, internetSnapId = + iCommsDatAccess->DestinationIdL( CMManager::ESnapPurposeInternet )); + HandleUserSelectionL( false, internetSnapId, err ); } // ----------------------------------------------------------------------------- diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/src/mpmofflinewatcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bearermanagement/mpm/src/mpmofflinewatcher.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Listens central repository for offline mode changes. + * + */ + +#include +#include +#include +#include + +#include "mpmlogger.h" +#include "mpmserver.h" +#include "mpmofflinewatcher.h" + +// --------------------------------------------------------------------------- +// Default C++ constructor. +// --------------------------------------------------------------------------- +// +CMpmOfflineWatcher::CMpmOfflineWatcher( CMPMServer* aServer ) : + CActive( EPriorityStandard ), iServer( aServer ) + { + MPMLOGSTRING( "CMpmOfflineWatcher::CMpmOfflineWatcher" ) + + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor. Creates a central repository object. +// --------------------------------------------------------------------------- +// +void CMpmOfflineWatcher::ConstructL() + { + MPMLOGSTRING( "CMpmOfflineWatcher::ConstructL" ) + + FeatureManager::InitializeLibL(); + // If feature isn't supported, then no watching, but return in StartL(). + iOfflineFeatureSupported = FeatureManager::FeatureSupported( + KFeatureIdOfflineMode ); + FeatureManager::UnInitializeLib(); + + + iRepository = CRepository::NewL( KCRUidCoreApplicationUIs ); + } + +// --------------------------------------------------------------------------- +// Creates a new object by calling the two-phased constructor. +// --------------------------------------------------------------------------- +// +CMpmOfflineWatcher* CMpmOfflineWatcher::NewL( CMPMServer* aServer ) + { + MPMLOGSTRING( "CMpmOfflineWatcher::NewL" ) + + CMpmOfflineWatcher* self = new( ELeave ) CMpmOfflineWatcher( aServer ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMpmOfflineWatcher::~CMpmOfflineWatcher() + { + MPMLOGSTRING( "CMpmOfflineWatcher::~CMpmOfflineWatcher" ) + + Cancel(); + delete iRepository; + } + +// --------------------------------------------------------------------------- +// Order notification from changes. +// --------------------------------------------------------------------------- +// +void CMpmOfflineWatcher::StartL() + { + MPMLOGSTRING( "CMpmOfflineWatcher::StartL" ) + + if ( !iOfflineFeatureSupported ) + { + return; + } + + // Get the initial data usage value from repository. + User::LeaveIfError( GetCurrentOfflineValue() ); + iServer->UpdateOfflineMode( iOfflineMode ); + + // Request notifications. + User::LeaveIfError( RequestNotifications() ); + } + +// --------------------------------------------------------------------------- +// From class CActive. +// Event is received when there is a change in central repository key. +// --------------------------------------------------------------------------- +// +void CMpmOfflineWatcher::RunL() + { + MPMLOGSTRING( "CMpmOfflineWatcher::RunL" ) + + if ( iStatus.Int() < KErrNone ) + { + MPMLOGSTRING2("Status: 0x%08X", iStatus.Int()) + iErrorCounter++; + if ( iErrorCounter > KMpmOfflineWatcherCenRepErrorThreshold ) + { + MPMLOGSTRING2("Over %d consecutive errors, stopping notifications permanently.", + KMpmOfflineWatcherCenRepErrorThreshold) + return; + } + // Else: Error occured but counter not expired. Proceed. + } + else + { + // Notification is received ok => Reset the counter. + iErrorCounter = 0; + + // Check if mode has changed (it should). + TInt oldMode = iOfflineMode; + + TInt err = GetCurrentOfflineValue(); + if ( err == KErrNone && oldMode != iOfflineMode ) + { + iServer->UpdateOfflineMode( iOfflineMode ); + } + } + + RequestNotifications(); + } + +// --------------------------------------------------------------------------- +// From class CActive. +// Cancel the outstanding request. +// --------------------------------------------------------------------------- +// +void CMpmOfflineWatcher::DoCancel() + { + MPMLOGSTRING( "CMpmOfflineWatcher::DoCancel" ) + + iRepository->NotifyCancel( KCoreAppUIsNetworkConnectionAllowed ); + } + +// --------------------------------------------------------------------------- +// Request for notifications. +// --------------------------------------------------------------------------- +// +TInt CMpmOfflineWatcher::RequestNotifications() + { + MPMLOGSTRING( "CMpmOfflineWatcher::RequestNotifications" ) + + TInt err = iRepository->NotifyRequest( KCoreAppUIsNetworkConnectionAllowed, iStatus ); + + if ( err == KErrNone ) + { + SetActive(); + } + else + { + // MPM's offline mode watching wouldn't recover... + MPMLOGSTRING2( "CMpmOfflineWatcher::RequestNotifications, ERROR: %d", err ) + } + return err; + } + +// --------------------------------------------------------------------------- +// Get the current repository key value. +// --------------------------------------------------------------------------- +// +TInt CMpmOfflineWatcher::GetCurrentOfflineValue() + { + MPMLOGSTRING( "CMpmOfflineWatcher::GetCurrentOfflineValue" ) + + TInt err = iRepository->Get( KCoreAppUIsNetworkConnectionAllowed, iOfflineMode ); + + if ( err != KErrNone ) + { + MPMLOGSTRING2( "CMpmOfflineWatcher::GetCurrentOfflineValue, ERROR: %d", err ) + } + return err; + } diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/src/mpmserver.cpp --- a/bearermanagement/mpm/src/mpmserver.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/src/mpmserver.cpp Mon May 03 12:53:07 2010 +0300 @@ -26,6 +26,7 @@ #include // KMmTsyModuleName #include #include +#include #include "mpmserver.h" #include "mpmserversession.h" @@ -39,11 +40,11 @@ #include "mpmdefaultconnection.h" #include "mpmcommsdataccess.h" #include "mpmwlanquerydialog.h" -#include "mpmdialog.h" #include "mpmprivatecrkeys.h" #include "mpmcsidwatcher.h" #include "mpmdatausagewatcher.h" #include "mpmpropertydef.h" +#include "mpmofflinewatcher.h" // ============================= LOCAL FUNCTIONS =============================== @@ -89,9 +90,9 @@ iRoamingQueue( NULL ), iStartingQueue( NULL ), iWlanQueryQueue( NULL ), - iConnectDialogQueue( NULL ), iDefaultConnection( NULL ), - iConnectionCounter( 0 ) + iConnectionCounter( 0 ), + iOfflineMode( ECoreAppUIsNetworkConnectionAllowed ) { } @@ -110,6 +111,7 @@ // The RTelServer::Connect() might not always work with the first trial, // because of a coding error related to using semaphores in the method. TInt err( KErrNotReady ); + err = iTelServer.Connect(); TInt a = 0; while( a < KPhoneRetryCount && err != KErrNone ) { @@ -163,9 +165,6 @@ iWlanQueryQueue = new ( ELeave ) CArrayPtrFlat( KGranularity ); iWlanQueryQueue->Reset(); - - iConnectDialogQueue = new ( ELeave ) CArrayPtrFlat( KGranularity ); - iConnectDialogQueue->Reset(); iDefaultConnection = CMPMDefaultConnection::NewL( this ); @@ -174,8 +173,6 @@ iMpmCsIdWatcher->StartL(); // Create another central repository watcher and start it - // TODO: Trapped, because currently it may fatally leave in HW. - // (Possibly because of the capability updates of data usage watcher's CR-keys.) TRAPD( duwErr, iMpmDataUsageWatcher = CMpmDataUsageWatcher::NewL( this ) ); if (duwErr == KErrNone) { @@ -187,38 +184,18 @@ MPMLOGSTRING( "CMPMServer::ConstructL: CMpmDataUsageWatcher::NewL() failed!" ) } - // Define P&S keys (snap & iap) for the user connection - TInt ret = RProperty::Define( KMPMUserConnectionCategory, - KMPMPSKeyUserConnectionSnap, - KMPMUserConnectionSnapType, - KMPMUserConnectionReadPolicy, - KMPMUserConnectionWritePolicy ); - - if ( (ret != KErrNone) && (ret != KErrAlreadyExists) ) + // Create another central repository watcher and start it + TRAPD( owErr, iMpmOfflineWatcher = CMpmOfflineWatcher::NewL( this ) ); + if (owErr == KErrNone) { - User::Leave(err); + iMpmOfflineWatcher->StartL(); } - - ret = RProperty::Define( KMPMUserConnectionCategory, - KMPMPSKeyUserConnectionIap, - KMPMUserConnectionIapType, - KMPMUserConnectionReadPolicy, - KMPMUserConnectionWritePolicy ); - - if ( (ret != KErrNone) && (ret != KErrAlreadyExists) ) + else { - User::Leave(err); + iMpmOfflineWatcher = NULL; + MPMLOGSTRING( "CMPMServer::ConstructL: CMpmOfflineWatcher::NewL() failed!" ) } - // Set initial values for the keys - User::LeaveIfError(RProperty::Set( KMPMUserConnectionCategory, - KMPMPSKeyUserConnectionSnap, - 0 )); - - User::LeaveIfError(RProperty::Set( KMPMUserConnectionCategory, - KMPMPSKeyUserConnectionIap, - 0 )); - // Read dedicated clients from the central repository CRepository* repository = CRepository::NewL( KCRUidMPM ); @@ -226,7 +203,7 @@ TUint32 baseKey = KMpmDedicatedClientBase; TInt value; - ret = KErrNone; + TInt ret = KErrNone; while ( ret == KErrNone ) { @@ -242,42 +219,8 @@ } CleanupStack::PopAndDestroy ( repository ); - - // Define P&S keys for the connection dialogs - ret = RProperty::Define( KMPMActiveConnectionCategory, - KMPMPSKeyActiveConnectionIap, - KMPMActiveConnectionIapType, - KMPMActiveConnectionReadPolicy, - KMPMActiveConnectionWritePolicy ); - - if ( (ret != KErrNone) && (ret != KErrAlreadyExists) ) - { - User::Leave(err); - } - - ret = RProperty::Define( KMPMActiveConnectionCategory, - KMPMPSKeyActiveConnectionSnap, - KMPMActiveConnectionSnapType, - KMPMActiveConnectionReadPolicy, - KMPMActiveConnectionWritePolicy ); - - if ( (ret != KErrNone) && (ret != KErrAlreadyExists) ) - { - User::Leave(err); - } - - ret = RProperty::Define( KMPMActiveConnectionCategory, - KMPMPSKeyActiveConnectionBearer, - KMPMActiveConnectionBearerType, - KMPMActiveConnectionReadPolicy, - KMPMActiveConnectionWritePolicy ); - - if ( (ret != KErrNone) && (ret != KErrAlreadyExists) ) - { - User::Leave(err); - } - PublishActiveConnection(); + iConnUiUtils = CConnectionUiUtilities::NewL(); } @@ -310,12 +253,6 @@ iWlanQueryQueue->Delete( 0 ); } delete iWlanQueryQueue; - - if ( iConnectDialogQueue ) - { - iConnectDialogQueue->ResetAndDestroy(); - } - delete iConnectDialogQueue; delete iEvents; @@ -344,10 +281,14 @@ delete iMpmCsIdWatcher; delete iMpmDataUsageWatcher; - + + delete iMpmOfflineWatcher; + iDedicatedClients.Close(); - delete iCommsDatAccess; + delete iCommsDatAccess; + + delete iConnUiUtils; } @@ -417,6 +358,7 @@ connInfo.iSnap = aSnap; connInfo.iIapId = aIapId; connInfo.iState = aState; + connInfo.iAppUid = aSession.AppUid(); // Package into TActiveBMConn //TODO Redundant.. remove the other one. // @@ -445,20 +387,6 @@ } } - if ( aState == EStarted ) - { - TInt ret = KErrNone; - - TRAP ( ret, UpdateActiveConnectionL( aSession ) ); - - if ( ret != KErrNone ) - { - iActiveBearerType = EMPMBearerTypeNone; - iActiveIapId = 0; - iActiveSnapId = 0; - } - } - #ifdef _DEBUG // Dump array of active connections to log in order to support testing. // @@ -473,7 +401,7 @@ // void CMPMServer::ResetBMConnection( const TConnectionId aConnId, const TUint32 aIapId, - CMPMServerSession& aSession ) + CMPMServerSession& /*aSession*/ ) { MPMLOGSTRING3( "CMPMServer::ResetBMConnection - aConnId = 0x%x, aIapId = %i", @@ -509,18 +437,6 @@ // iActiveBMConns[index1].iConnInfo.iIapId = 0; iActiveBMConns[index1].iConnInfo.iState = EIdle; - - // Change state of P&S keys if needed - TInt ret = KErrNone; - - TRAP ( ret, UpdateActiveConnectionL( aSession ) ); - - if ( ret != KErrNone ) - { - iActiveBearerType = EMPMBearerTypeNone; - iActiveIapId = 0; - iActiveSnapId = 0; - } } #ifdef _DEBUG // Dump array of active connections to log in order to support testing. @@ -535,7 +451,7 @@ // ----------------------------------------------------------------------------- // void CMPMServer::RemoveBMConnection( const TConnectionId aConnId, - CMPMServerSession& aSession ) + CMPMServerSession& /*aSession*/ ) { MPMLOGSTRING2( "CMPMServer::RemoveBMConnection - aConnId = 0x%x", aConnId ) @@ -557,18 +473,6 @@ // If Connection Id found, remove it. // iActiveBMConns.Remove( i ); - - // Update active connection - TInt ret = KErrNone; - - TRAP ( ret, UpdateActiveConnectionL( aSession ) ); - - if ( ret != KErrNone ) - { - iActiveBearerType = EMPMBearerTypeNone; - iActiveIapId = 0; - iActiveSnapId = 0; - } } } @@ -703,9 +607,11 @@ // CMPMServer::CheckIfStarted // ----------------------------------------------------------------------------- // -TBool CMPMServer::CheckIfStarted( const TUint32 aIapId ) +TBool CMPMServer::CheckIfStarted( const TUint32 aIapId , + const TConnectionId aConnId ) { - MPMLOGSTRING2( "CMPMServer::CheckIfStarted - aIapId = %i", aIapId ) + MPMLOGSTRING3( "CMPMServer::CheckIfStarted - aIapId = %i, aConnId = 0x%x", + aIapId, aConnId ) TConnectionState state( EIdle ); TBool stopLoop( EFalse ); @@ -714,9 +620,10 @@ // for ( TInt i = 0; ( ( i < iActiveBMConns.Count() ) && !stopLoop ); i++ ) { - // Check if IAP Id matches + // Check if IAP Id matches; exclude matching with own connection // - if ( iActiveBMConns[i].iConnInfo.iIapId == aIapId ) + if ( iActiveBMConns[i].iConnInfo.iIapId == aIapId && + iActiveBMConns[i].iConnInfo.iConnId != aConnId) { state = iActiveBMConns[i].iConnInfo.iState; @@ -759,8 +666,12 @@ } } #endif // _DEBUG - - if ( state == EStarted ) + + //Return true incase the matching connection is in EStarting state also because + //sometimes when connections are started simultaneously (for same iapID) + //the first connection may still be in EStarting state. + // + if ( state == EStarted || state == EStarting ) { return ETrue; } @@ -849,17 +760,6 @@ } } - TInt ret = KErrNone; - - TRAP ( ret, UpdateActiveConnectionL( aSession ) ); - - if ( ret != KErrNone ) - { - iActiveBearerType = EMPMBearerTypeNone; - iActiveIapId = 0; - iActiveSnapId = 0; - } - #ifdef _DEBUG // Dump array of active connections to log in order to support testing. // @@ -874,7 +774,7 @@ // void CMPMServer::RemoveBMIAPConnection( const TUint32 aIapId, const TConnectionId aConnId, - CMPMServerSession& aSession ) + CMPMServerSession& /*aSession*/ ) { MPMLOGSTRING3( "CMPMServer::RemoveBMIAPConnection - aIapId = %i, aConnId = 0x%x", @@ -920,18 +820,6 @@ iActiveBMConns[i].iConnInfo.iState = EIdle; } } - - // Update active connection - TInt ret = KErrNone; - - TRAP ( ret, UpdateActiveConnectionL( aSession ) ); - - if ( ret != KErrNone ) - { - iActiveBearerType = EMPMBearerTypeNone; - iActiveIapId = 0; - iActiveSnapId = 0; - } } } @@ -1006,34 +894,8 @@ iapInfo = iSessions[i]->GetAvailableIAPs( ); iSessions[i]->PrefIAPNotificationL( iapInfo, aCaller ); } - - // If a session is displaying connection selection dialog - // the contents of the dialog should be updated according to the - // current iap availability - // - for ( TInt i( 0 ); i < iSessions.Count(); i++ ) - { - iSessions[i]->UpdateConnectionDialogL(); - } } -// ----------------------------------------------------------------------------- -// CMPMServer::UpdateSessionConnectionDlgL -// ----------------------------------------------------------------------------- -// -void CMPMServer::UpdateSessionConnectionDlgL() - { - MPMLOGSTRING( "CMPMServer::UpdateSessionConnectionDlgL" ) - - // If a session is displaying connection selection dialog - // the contents of the dialog should be updated according to the - // current iap availability - // - for ( TInt i( 0 ); i < iSessions.Count(); i++ ) - { - iSessions[i]->UpdateConnectionDialogL(); - } - } // ----------------------------------------------------------------------------- // CMPMServer::HandleServerBlackListIap @@ -1119,9 +981,15 @@ // found blacklisted Connection Id TMPMBlackListConnId connIdInfo = iBlackListIdList[i]; iBlackListIdList.Remove( i ); // remove from the list + + MPMLOGSTRING2( "CMPMServer::HandleServerUnblackListIap - \ +connIdInfo count: %d", connIdInfo.Count() ) if ( aIapId == 0 ) { // 0 will reset Connection Id blacklisted iap list + MPMLOGSTRING( "CMPMServer::HandleServerUnblackListIap - \ +reset Connection Id blacklisted iap list" ) + connIdInfo.Close(); return KErrNone; } @@ -1133,6 +1001,9 @@ { // found and remove blacklisted iap connIdInfo.Remove( j ); + MPMLOGSTRING2( "CMPMServer::HandleServerUnblackListIap - \ +removed blacklisted iap in index = %d", j ) + if ( connIdInfo.Count() == 0 ) { return KErrNone; @@ -1150,6 +1021,8 @@ } else { + MPMLOGSTRING( "CMPMServer::HandleServerUnblackListIap - \ +not found blacklisted Connection Id" ) return KErrNotFound; } } @@ -1161,8 +1034,9 @@ void CMPMServer::HandleServerUnblackListIap( TBlacklistCategory aCategory ) { - MPMLOGSTRING2( "CMPMServer::HandleServerUnblackListIap -\ - aCategory = %i", aCategory ) + MPMLOGSTRING3( "CMPMServer::HandleServerUnblackListIap -\ +aCategory = %i blacklisted Id count = %d", + aCategory, iBlackListIdList.Count() ) for( TInt i( 0 ); i < iBlackListIdList.Count(); i++ ) { @@ -1170,11 +1044,17 @@ TMPMBlackListConnId connIdInfo = iBlackListIdList[i]; iBlackListIdList.Remove( i ); // remove from the list + MPMLOGSTRING3( "CMPMServer::HandleServerUnblackListIap - \ +aConnId = 0x%x, blacklisted IapId count = %d", connIdInfo.iConnId, + connIdInfo.Count() ) + for (TInt j = 0; j < connIdInfo.Count(); j++) { if ( connIdInfo.Category( j ) == aCategory ) { // found and remove blacklisted iap + MPMLOGSTRING3( "CMPMServer::HandleServerUnblackListIap - \ +removed blacklisted iap id %i in index: %d", connIdInfo.Iap( j ), j ) connIdInfo.Remove( j ); } } @@ -1183,6 +1063,7 @@ // if( connIdInfo.Count() > 0 ) { + MPMLOGSTRING( "reinsert connIdInfo to reflect activeness" ) iBlackListIdList.Insert( connIdInfo, 0 ); } } @@ -1522,197 +1403,23 @@ // void CMPMServer::StopConnections( TInt aIapId ) { + MPMLOGSTRING2( "CMPMServer::StopConnections aIapId = %d", aIapId ) for (TInt index = 0; index < iSessions.Count(); index++) { -/* if (iSessions[index]->UserConnection()) - continue; - */ + CMPMServerSession* session = iSessions[index]; // Stop connection if ( aIapId == 0 ) { - iSessions[index]->StopConnection(); - } - else - { - TRAP_IGNORE( iSessions[index]->StopIAPNotificationL( aIapId )); + session->StopConnection(); } - - } - } - -// ----------------------------------------------------------------------------- -// CMPMServer::UpdateActiveConnectionL -// ----------------------------------------------------------------------------- -// -void CMPMServer::UpdateActiveConnectionL( CMPMServerSession& aSession ) - { - MPMLOGSTRING( "CMPMServer::UpdateActiveConnectionL" ) - TUint32 snapId; - - if ( !NumberOfActiveConnections() ) - { - // If no active connections then just reset keys and publish - iActiveBearerType = EMPMBearerTypeNone; - iActiveIapId = 0; - iActiveSnapId = 0; - PublishActiveConnection(); - return; - } - - // Check if all active connections are in same snap - if ( CommsDatAccess()->AreActiveIapsInSameSnapL( - iActiveBMConns, snapId ) ) - { - // Select active connection according to priority - CommsDatAccess()->SelectActiveConnectionL ( - snapId, - iActiveBMConns, - iActiveIapId, - iActiveSnapId, - iActiveBearerType, - aSession ); - - PublishActiveConnection(); - return; - } - - // Reset active connections - iActiveBearerType = EMPMBearerTypeNone; - iActiveIapId = 0; - iActiveSnapId = 0; - - // Active connections locating in different snaps - // Use priority order vpn, wlan and packet - for ( TInt index = 0; index < iActiveBMConns.Count(); index++ ) - { - CMPMServerSession* serverSession = GetServerSession( - iActiveBMConns[index].iConnInfo.iConnId ); - - // Do check only for active connections - if ( iActiveBMConns[index].iConnInfo.iState == EStarted && - serverSession->ChooseBestIapCalled() ) + else if ( GetBMIap( session->ConnectionId() ) == aIapId ) { - TMPMBearerType bearerType = EMPMBearerTypeOther; - - if ( iDedicatedClients.Find( iActiveBMConns[index].iConnInfo.iAppUid ) == - KErrNone ) - { - // Skip dedicated client - continue; - } - - bearerType = CommsDatAccess()->GetBearerTypeL( - iActiveBMConns[index].iConnInfo.iIapId ); - - if ( bearerType == EMPMBearerTypeOther ) - { - // Don't publish this connection - continue; - } - - // This is true if, - // bearer type is smaller or different than none - // or - // bearer type is same and iap is different. - if ( ( bearerType < iActiveBearerType ) || - ( iActiveBearerType == EMPMBearerTypeNone ) || - ( ( bearerType == iActiveBearerType) && - ( iActiveIapId != iActiveBMConns[index].iConnInfo.iIapId ) ) ) - { - iActiveBearerType = bearerType; - iActiveIapId = iActiveBMConns[index].iConnInfo.iIapId; - iActiveSnapId = iActiveBMConns[index].iConnInfo.iSnap; - } - } - - PublishActiveConnection(); + TRAP_IGNORE( session->StopIAPNotificationL( aIapId )); + } } } // ----------------------------------------------------------------------------- -// CMPMServer::MapBearerType -// ----------------------------------------------------------------------------- -// -TUint32 CMPMServer::MapBearerType(TMPMBearerType aBearerType) - { - MPMLOGSTRING( "CMPMServer::MapBearerType" ) - - switch ( aBearerType ) - { - case EMPMBearerTypeNone: - return 0; - - case EMPMBearerTypeVpn: - return KCommDbBearerVirtual; - - case EMPMBearerTypeWlan: - return KCommDbBearerWLAN; - - case EMPMBearerTypePacketData: - return KCommDbBearerWcdma; - - case EMPMBearerTypeOther: - return KCommDbBearerUnknown; - - default: - MPMLOGSTRING( "CMPMServer::MapBearerType: Unknown bearer type" ) - break; - } - - return KCommDbBearerUnknown; - } - -// ----------------------------------------------------------------------------- -// CMPMServer::PublishActiveConnection -// ----------------------------------------------------------------------------- -// -void CMPMServer::PublishActiveConnection() - { - MPMLOGSTRING( "CMPMServer::PublishActiveConnection" ) - - // update active connection keys - RProperty::Set( KMPMActiveConnectionCategory, - KMPMPSKeyActiveConnectionIap, - iActiveIapId ); - - RProperty::Set( KMPMActiveConnectionCategory, - KMPMPSKeyActiveConnectionSnap, - iActiveSnapId ); - - RProperty::Set( KMPMActiveConnectionCategory, - KMPMPSKeyActiveConnectionBearer, - MapBearerType( iActiveBearerType ) ); - - MPMLOGSTRING4( "CMPMServer::PublishActiveConnection: Set to: %d, %d, %d", - iActiveIapId, iActiveSnapId, iActiveBearerType ) - } - -// ----------------------------------------------------------------------------- -// CMPMServer::NumberOfActiveConnections -// ----------------------------------------------------------------------------- -// -TInt CMPMServer::NumberOfActiveConnections() - { - MPMLOGSTRING( "CMPMServer::NumberOfActiveConnections" ) - - TInt count( 0 ); - - for ( TInt index = 0; index < iActiveBMConns.Count(); index++ ) - { - CMPMServerSession* serverSession = GetServerSession( - iActiveBMConns[index].iConnInfo.iConnId ); - - if ( iActiveBMConns[index].iConnInfo.iState == EStarted && - serverSession->ChooseBestIapCalled() ) - { - count++; - } - } - - return count; - } - -// ----------------------------------------------------------------------------- // CMPMServer::UserConnectionInInternet // ----------------------------------------------------------------------------- // @@ -2075,6 +1782,75 @@ stoppedIaps.Close(); } +// --------------------------------------------------------------------------- +// CMPMServer::UpdateOfflineMode +// Offline watcher listens the offline mode and calls this when it's changed. +// --------------------------------------------------------------------------- +// +void CMPMServer::UpdateOfflineMode( TInt aNewModeValue ) + { + MPMLOGSTRING2( "CMPMServer::UpdateOfflineMode: Value %d", aNewModeValue ) + + iOfflineMode = aNewModeValue; + + if ( iOfflineMode == ECoreAppUIsNetworkConnectionAllowed ) + { + // Offline mode finished, reset the QueryResponse variable. + iOfflineWlanQueryResponse = EOfflineResponseUndefined; + } + } + +// --------------------------------------------------------------------------- +// CMPMServer::IsPhoneOffline +// Returns the current offline mode. +// --------------------------------------------------------------------------- +// +TBool CMPMServer::IsPhoneOffline() + { + MPMLOGSTRING( "CMPMServer::IsPhoneOffline" ) + + TBool retval = EFalse; + if ( iOfflineMode == ECoreAppUIsNetworkConnectionNotAllowed) + { + retval = ETrue; + MPMLOGSTRING( "CMPMServer::IsPhoneOffline: Yes." ) + } + return retval; + } + +// --------------------------------------------------------------------------- +// CMPMServer::OfflineWlanQueryResponse +// Tells the "Use WLAN in offline mode" query's response during the +// current offline mode session. +// --------------------------------------------------------------------------- +// +TOfflineWlanQueryResponse CMPMServer::OfflineWlanQueryResponse() + { + MPMLOGSTRING( "CMPMServer::OfflineWlanQueryResponse" ) + +#ifndef _PLATFORM_SIMULATOR_ + MPMLOGSTRING2( "CMPMServer::IsOfflineWlanQueryAccepted: %d", iOfflineWlanQueryResponse ) + return iOfflineWlanQueryResponse; +#else + // Platsim simulates WLAN and offline-mode. To ease automated testing, + // offline connection confirmation is not asked in Platsim-variant + MPMLOGSTRING( "CMPMServer::OfflineWlanQueryResponse: yes for Platsim" ) + return EOfflineResponseYes; +#endif + } + +// --------------------------------------------------------------------------- +// CMPMServer::SetOfflineWlanQueryResponse +// Called when the "Use WLAN in offline mode" note has been responded. +// --------------------------------------------------------------------------- +// +void CMPMServer::SetOfflineWlanQueryResponse( TOfflineWlanQueryResponse aResponse) + { + MPMLOGSTRING( "CMPMServer::SetOfflineWlanQueryResponse" ) + + iOfflineWlanQueryResponse = aResponse; + } + // ----------------------------------------------------------------------------- // TMPMBlackListConnId::Append // ----------------------------------------------------------------------------- diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/src/mpmserversession.cpp --- a/bearermanagement/mpm/src/mpmserversession.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/src/mpmserversession.cpp Mon May 03 12:53:07 2010 +0300 @@ -25,7 +25,6 @@ #include // KErrPacketDataTsyMaxPdpContextsReached #include // KErrUmtsMaxNumOfContextExceededByNetwork #include // For feature flags -#include // FeatureManager #include // CRepository #include // KCRUidCoreApplicationUIs, // KCoreAppUIsNetworkConnectionAllowed @@ -39,7 +38,6 @@ #include "mpmcommsdataccess.h" #include "mpmserversession.h" #include "mpmconnmonevents.h" -#include "mpmdialog.h" #include "mpmdisconnectdlg.h" #include "mpmconfirmdlgstarting.h" #include "mpmconfirmdlgroaming.h" @@ -76,7 +74,8 @@ iConfirmDlgRoaming( NULL ), iStoredIapInfo(), iIapSelection( NULL ), - iMigrateState( EMigrateNone ) + iMigrateState( EMigrateNone ), + iDisconnectDialogShown( EFalse ) { } @@ -94,12 +93,6 @@ *const_cast( &iMyServer ), *this )); } - FeatureManager::InitializeLibL(); - iOfflineFeatureSupported = FeatureManager::FeatureSupported( - KFeatureIdOfflineMode ); - - FeatureManager::UnInitializeLib(); - // Append session pointer to server // iMyServer.AppendSessionL( this ); @@ -125,15 +118,6 @@ iMyServer.ClearUserConnection(); ClearUserConnection(); - // Set PS keys to zero - RProperty::Set( KMPMUserConnectionCategory, - KMPMPSKeyUserConnectionSnap, - 0 ); - - RProperty::Set( KMPMUserConnectionCategory, - KMPMPSKeyUserConnectionIap, - 0 ); - MPMLOGSTRING( "CMPMServerSession::HandleServerApplicationConnectionEnds -\ User connection deactivated" ) } @@ -143,6 +127,9 @@ // Make sure the connection is removed from server's information array. iMyServer.RemoveBMConnection( iConnId, *this ); + + // Cancel discreet popup + iMyServer.ConnUiUtils()->CancelConnectingViaDiscreetPopup(); } @@ -424,16 +411,7 @@ if ( ! ( mpmConnPref.NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableNotes ) ) { - CConnectionUiUtilities* connUiUtils = NULL; - - TRAP_IGNORE( connUiUtils = CConnectionUiUtilities::NewL() ); - - if ( connUiUtils ) - { - connUiUtils->ConnectionErrorDiscreetPopup( error ); - delete connUiUtils; - connUiUtils = NULL; - } + iMyServer.ConnUiUtils()->ConnectionErrorDiscreetPopup( error ); } MPMLOGSTRING( "CMPMServerSession::HandleServerChooseIapL - Error \ @@ -448,18 +426,22 @@ // iAppUid = aMessage.Int2(); - MPMLOGSTRING2( "CMPMServerSession::HandleServerChooseIapL: \ -Client UID = 0x%x", iAppUid ) - if ( !iIapSelection ) { iIapSelection = CMPMIapSelection::NewL( iMyServer.CommsDatAccess(), - this ); + this, + iMyServer.ConnUiUtils() ); } MPMLOGSTRING3( "CMPMServerSession::HandleServerChooseIapL - iap %d \ connType %d", mpmConnPref.IapId(), mpmConnPref.ConnType() ) + if (!( mpmConnPref.NoteBehaviour() & + TExtendedConnPref::ENoteBehaviourConnDisableNotes ) ) + { + iMyServer.ConnUiUtils()->ConnectingViaDiscreetPopup(); + } + iIapSelection->ChooseIapL( mpmConnPref ); if ( iAppUid == iMyServer.CsIdWatcher()->ConnectScreenId() ) @@ -471,16 +453,6 @@ iMyServer.SetUserConnection(); SetUserConnection(); iMyServer.SetUserConnPref( mpmConnPref ); - - // Set PS keys according to user connection - // Do not check return values. Can do nothing in case of failing. - RProperty::Set( KMPMUserConnectionCategory, - KMPMPSKeyUserConnectionSnap, - mpmConnPref.SnapId() ); - - RProperty::Set( KMPMUserConnectionCategory, - KMPMPSKeyUserConnectionIap, - mpmConnPref.IapId() ); } } @@ -713,7 +685,7 @@ // aMessage.Complete( KErrNone ); - IapSelectionL()->ConnectionStarted(); + iMyServer.ConnUiUtils()->CancelConnectingViaDiscreetPopup(); } @@ -760,15 +732,6 @@ iMyServer.ClearUserConnection(); ClearUserConnection(); - // Set PS keys to zero - RProperty::Set( KMPMUserConnectionCategory, - KMPMPSKeyUserConnectionSnap, - 0 ); - - RProperty::Set( KMPMUserConnectionCategory, - KMPMPSKeyUserConnectionIap, - 0 ); - MPMLOGSTRING( "CMPMServerSession::HandleServerApplicationConnectionEnds -\ User connection deactivated" ) } @@ -823,7 +786,7 @@ // check whether a started connection exists which already // uses this IAP. If so, it won't need to be confirmed again // - if( iMyServer.CheckIfStarted( aIapId ) ) + if( iMyServer.CheckIfStarted( aIapId, iConnId ) ) { MPMLOGSTRING( "CMPMServerSession::IsConfirmFirstL - IAP already started, \ @@ -853,6 +816,21 @@ { MPMLOGSTRING( "CMPMServerSession::IsConfirmFirstL - True" ) isConfirmFirst = ETrue; + + // iDisconnectDialogShown is set when disconnect dialog is shown. + // Before the disconnect dialog is shown, data usage confirmation + // dialog is already shown for the new PDP context. If you choose + // to disconnect the active PDP context then data usage dialog is + // shown again for the new context. So, set isConfirmFirst to + // False to avoid duplicate cellular confirm dialog + // + if ( iDisconnectDialogShown ) + { + MPMLOGSTRING( "CMPMServerSession::IsConfirmFirstL - False; Data \ +confirmation dialog already shown for this IAP" ) + isConfirmFirst = EFalse; + iDisconnectDialogShown = EFalse; + } } else { @@ -1420,20 +1398,16 @@ } // Show error popup if it's allowed per client request + // Don't show the pop up if error code is for disconnect dialog + // if ( !( iIapSelection->MpmConnPref().NoteBehaviour() & - TExtendedConnPref::ENoteBehaviourConnDisableNotes ) ) + TExtendedConnPref::ENoteBehaviourConnDisableNotes ) && + !DisconnectDlgErrorCode( error ) ) { - CConnectionUiUtilities* connUiUtils = NULL; - TRAPD( popupCreateError, connUiUtils = CConnectionUiUtilities::NewL() ); - if ( popupCreateError == KErrNone && connUiUtils ) - { - // Note: Below function shows the discreet popup only if the error code - // belongs to the set of errors that are shown to the user. - // Otherwise the popup is not shown. - connUiUtils->ConnectionErrorDiscreetPopup( error ); - delete connUiUtils; - connUiUtils = NULL; - } + // Note: Below function shows the discreet popup only if the error code + // belongs to the set of errors that are shown to the user. + // Otherwise the popup is not shown. + iMyServer.ConnUiUtils()->ConnectionErrorDiscreetPopup( error ); } // Read the Connection Id of the application @@ -1500,6 +1474,7 @@ iDisconnectDlg = CMPMDisconnectDlg::NewL( *const_cast(this), error, *MyServer().DisconnectQueue() ); + iDisconnectDialogShown = ETrue; return; } else @@ -1654,7 +1629,7 @@ ETemporary ); } - // current iap is either WLAN or EasyWlan + // current iap is WLAN // if( ( iMyServer.CommsDatAccess()->CheckWlanL( currentIap ) != ENotWlanIap ) && iMyServer.CommsDatAccess()->SnapContainsWlanL( snapId, iapPath, KMPMNrWlansTwo ) ) @@ -1861,13 +1836,13 @@ // Store message for later usage. iServerSortSNAPMessage = aMessage; - TUint32 aSeconds = static_cast( iServerSortSNAPMessage.Int2() ); + TUint32 seconds = static_cast( iServerSortSNAPMessage.Int2() ); // To display up to date information the WLAN scan should be done first iMyServer.Events()->ScanWLANNetworksL( this, ConnectionId(), EWlanScanCallbackSortSnap, - aSeconds ); + seconds ); } // ----------------------------------------------------------------------------- @@ -2229,18 +2204,6 @@ } // ----------------------------------------------------------------------------- -// CMPMServerSession::UpdateConnectionDialog -// ----------------------------------------------------------------------------- -// -void CMPMServerSession::UpdateConnectionDialogL() - { - if( iIapSelection ) - { - iIapSelection->UpdateConnectionDialogL(); - } - } - -// ----------------------------------------------------------------------------- // CMPMServerSession::CompleteCarrierRejected // ----------------------------------------------------------------------------- // @@ -2332,6 +2295,39 @@ ResolveConnType( aMpmConnPref ); MPMLOGSTRING2( "CMPMServerSession::ExtractConnPref - \ +BearerSet = %d", aMpmConnPref.BearerSet()); + + MPMLOGSTRING2( "CMPMServerSession::ExtractConnPref - \ +ConnSelectionDialog = %d", aMpmConnPref.ConnSelectionDialog()); + + MPMLOGSTRING2( "CMPMServerSession::ExtractConnPref - \ +ConnType = %d", aMpmConnPref.ConnType()); + + MPMLOGSTRING2( "CMPMServerSession::ExtractConnPref - \ +DisconnectDialog = %d", aMpmConnPref.DisconnectDialog()); + + MPMLOGSTRING2( "CMPMServerSession::ExtractConnPref - \ +ForcedRoaming = %d", aMpmConnPref.ForcedRoaming() ); + + MPMLOGSTRING2( "CMPMServerSession::ExtractConnPref - \ +IapId = %d", aMpmConnPref.IapId()); + + MPMLOGSTRING2( "CMPMServerSession::ExtractConnPref - \ +MandateIap = %d", aMpmConnPref.MandateIap()); + + MPMLOGSTRING2( "CMPMServerSession::ExtractConnPref - \ +NetId = %d", aMpmConnPref.NetId()); + + MPMLOGSTRING2( "CMPMServerSession::ExtractConnPref - \ +NoteBehaviour = %d", aMpmConnPref.NoteBehaviour()); + + MPMLOGSTRING2( "CMPMServerSession::ExtractConnPref - \ +SnapId = %d", aMpmConnPref.SnapId()); + + MPMLOGSTRING2( "CMPMServerSession::ExtractConnPref - \ +SnapPurpose = %d", aMpmConnPref.SnapPurpose()); + + MPMLOGSTRING2( "CMPMServerSession::ExtractConnPref - \ Error code in the end: %d", error ) return error; } @@ -2666,16 +2662,9 @@ } } - TInt err(0); TInt currentIap = MyServer().GetBMIap( iConnId ); - MPMLOGSTRING4( "CMPMServerSession::PrefIAPNotificationL - \ -current iap %d, last notified %d, err %d ", currentIap, iLastNotifiedIap, err ) - if( err != KErrNone ) - { - MPMLOGSTRING( "CMPMServerSession::PrefIAPNotificationL: Connection is not \ -registered for notifications" ) - return; - } + MPMLOGSTRING3( "CMPMServerSession::PrefIAPNotificationL - \ +current iap %d, last notified %d ", currentIap, iLastNotifiedIap ) TBool iapTypeLanOrWlan( EFalse ); RAvailableIAPList availableIAPList; @@ -2732,9 +2721,9 @@ iapTypeLanOrWlan, *this ); - if ( CheckNotifNeed( currentIap, - iLastNotifiedIap, - validateIapId ) ) + if ( CheckNotifNeedL( currentIap, + iLastNotifiedIap, + validateIapId ) ) { MPMLOGSTRING2( "CMPMServerSession::PrefIAPNotificationL: \ Sending pref iap notification connId: 0x%x", iConnId ) @@ -2798,7 +2787,7 @@ // else { - err = availableIAPList.Find( oldIapId ); + TInt err = availableIAPList.Find( oldIapId ); if( err == KErrNotFound ) { MPMLOGSTRING2( "CMPMServerSession::PrefIAPNotificationL: \ @@ -2836,18 +2825,10 @@ if ( !( iIapSelection->MpmConnPref().NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableNotes) ) { - TBool connectionAlreadyActive = iMyServer.CheckIfStarted( aIapId ); - CConnectionUiUtilities* connUiUtils = NULL; - TRAPD( popupError, - connUiUtils = CConnectionUiUtilities::NewL(); - connUiUtils->ConnectingViaDiscreetPopup( - aIapId, - connectionAlreadyActive ); - delete connUiUtils; ); - if ( popupError && connUiUtils ) - { - delete connUiUtils; - } + TBool connectionAlreadyActive = iMyServer.CheckIfStarted( aIapId, iConnId ); + + iMyServer.ConnUiUtils()->ConnectingViaDiscreetPopup( aIapId, + connectionAlreadyActive ); } TMpmNotificationStartIAP notifInfo; @@ -2974,35 +2955,6 @@ } // ----------------------------------------------------------------------------- -// CMPMServerSession::IsPhoneOfflineL -// -// Checks if phone is in offline mode or not. -// Return ETrue if phone is in offline mode. -// Return EFalse if phone is not in offline mode. -// ----------------------------------------------------------------------------- -// -TBool CMPMServerSession::IsPhoneOfflineL() const - { - MPMLOGSTRING( "CMPMServerSession::IsPhoneOfflineL" ) - if ( iOfflineFeatureSupported ) - { - CRepository* repository = CRepository::NewLC(KCRUidCoreApplicationUIs); - TInt connAllowed = ECoreAppUIsNetworkConnectionAllowed; - repository->Get( KCoreAppUIsNetworkConnectionAllowed, connAllowed ); - CleanupStack::PopAndDestroy( repository ); - if ( !connAllowed ) - { - MPMLOGSTRING( - "CMPMServerSession::IsPhoneOfflineL Phone is in offline mode" ) - return ETrue; - } - } - MPMLOGSTRING( - "CMPMServerSession::IsPhoneOfflineL Phone is not in offline mode" ) - return EFalse; - } - -// ----------------------------------------------------------------------------- // CMPMServerSession::AvailableUnblacklistedIapsL // ----------------------------------------------------------------------------- // @@ -3078,23 +3030,20 @@ // TBool usesSame( EFalse ); - if ( !iMyServer.CommsDatAccess()->CheckEasyWLanL( unavailableIAPs[i] ) ) - { - TRAP_IGNORE( iMyServer.CommsDatAccess()->MatchSSIDL( ssid, - unavailableIAPs[i], - usesSame, - *this ) ) + TRAP_IGNORE( iMyServer.CommsDatAccess()->MatchSSIDL( ssid, + unavailableIAPs[i], + usesSame, + *this ) ) - if ( usesSame ) - { - // Append unavailable IAP to list of available IAPs - // if it uses same SSID as active WLAN connection. - // - MPMLOGSTRING2( - "CMPMServerSession::AvailableUnblacklistedIapsL:\ + if ( usesSame ) + { + // Append unavailable IAP to list of available IAPs + // if it uses same SSID as active WLAN connection. + // + MPMLOGSTRING2( + "CMPMServerSession::AvailableUnblacklistedIapsL:\ Append unavailable IapId = %i", unavailableIAPs[i] ) - aAvailableIAPs.AppendL( unavailableIAPs[i] ); - } + aAvailableIAPs.AppendL( unavailableIAPs[i] ); } } } @@ -3158,12 +3107,12 @@ } // ----------------------------------------------------------------------------- -// CMPMServerSession::CheckNotifNeed +// CMPMServerSession::CheckNotifNeedL // ----------------------------------------------------------------------------- // -TBool CMPMServerSession::CheckNotifNeed( const TUint32 aCurrentIap, - const TUint32 aLastNotifiedIap, - const TUint32 aValidatedIap ) +TBool CMPMServerSession::CheckNotifNeedL( const TUint32 aCurrentIap, + const TUint32 aLastNotifiedIap, + const TUint32 aValidatedIap ) { TBool retValue( EFalse ); @@ -3182,8 +3131,19 @@ } else { - MPMLOGSTRING( "CMPMServerSession::CheckNotifNeed: notif needed" ) - retValue = ETrue; + TCmUsageOfWlan usageOfWlan = MyServer().CommsDatAccess()->ForcedRoamingL(); + + if ( usageOfWlan == ECmUsageOfWlanManual && + MyServer().CommsDatAccess()->CheckWlanL( aValidatedIap ) != ENotWlanIap ) + { + MPMLOGSTRING( "CMPMServerSession::CheckNotifNeed: WLAN IAP, Switch to WLAN is Manual, no need to send notification" ) + retValue = EFalse; + } + else + { + MPMLOGSTRING( "CMPMServerSession::CheckNotifNeed: notif needed" ) + retValue = ETrue; + } } } else @@ -3301,23 +3261,6 @@ { MPMLOGSTRING2( "CMPMServerSession::ChooseIapComplete aError = %d", aError ) - // Show error popup if it's allowed per client request - if ( ChooseBestIapCalled() && (!( iIapSelection->MpmConnPref().NoteBehaviour() & - TExtendedConnPref::ENoteBehaviourConnDisableNotes )) - && ( aError != KErrNone ) ) - { - CConnectionUiUtilities* connUiUtils = NULL; - TRAPD( error, connUiUtils = CConnectionUiUtilities::NewL() ); - if ( error == KErrNone && connUiUtils ) - { - // Note: Below function shows the discreet popup only if the error code - // belongs to the set of errors that are shown to the user. - // Otherwise the popup is not shown. - connUiUtils->ConnectionErrorDiscreetPopup( aError ); - delete connUiUtils; - connUiUtils = NULL; - } - } // Try to write back arguments and complete message. // @@ -3373,6 +3316,29 @@ MPMLOGSTRING( "CMPMServerSession::ChooseIapComplete Message completed" ) iChooseIapMessage.Complete( aError ); } + + // Show error popup if it's allowed per client request + if ( ChooseBestIapCalled() && (!( iIapSelection->MpmConnPref().NoteBehaviour() & + TExtendedConnPref::ENoteBehaviourConnDisableNotes )) + && ( aError != KErrNone ) ) + { + // Note: Below function shows the discreet popup only if the error code + // belongs to the set of errors that are shown to the user. + // Otherwise the popup is not shown. + iMyServer.ConnUiUtils()->ConnectionErrorDiscreetPopup( aError ); + } + else + { + if (!( iIapSelection->MpmConnPref().NoteBehaviour() & + TExtendedConnPref::ENoteBehaviourConnDisableNotes ) ) + { + TBool connectionAlreadyActive = + MyServer().CheckIfStarted( aPolicyPref->IapId(), iConnId ); + + iMyServer.ConnUiUtils()->ConnectingViaDiscreetPopup( aPolicyPref->IapId(), + connectionAlreadyActive ); + } + } } @@ -3578,7 +3544,7 @@ TBool CMPMServerSession::ForcedRoaming() { TBool forcedRoaming( EFalse ); - if ( iIapSelection != NULL ) + if ( iIapSelection ) { forcedRoaming = iIapSelection->MpmConnPref().ForcedRoaming(); } @@ -3658,7 +3624,8 @@ // be filtered. index = 0; RAvailableIAPList availableIaps; - + CleanupClosePushL( availableIaps ); + for ( TUint i = 0; i < aIapInfo.iCount; i++ ) { availableIaps.AppendL( aIapInfo.iIap[i].iIapId ); @@ -3703,7 +3670,8 @@ aIapInfo.iCount--; } index++; - } + } + CleanupStack::PopAndDestroy( &availableIaps ); } } diff -r fcbbe021d614 -r 9c97ad6591ae bearermanagement/mpm/src/mpmwlanquerydialog.cpp --- a/bearermanagement/mpm/src/mpmwlanquerydialog.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/bearermanagement/mpm/src/mpmwlanquerydialog.cpp Mon May 03 12:53:07 2010 +0300 @@ -27,42 +27,21 @@ #include "mpmconnmonevents.h" #include "mpmlogger.h" -// valid Wep key lengths, to check wep key format -// (wep key format depends on key length) -const TInt KConnUiUtilsWepLengthASCII5 = 5; -const TInt KConnUiUtilsWepLengthASCII13 = 13; -const TInt KConnUiUtilsWepLengthASCII29 = 29; -const TInt KConnUiUtilsWepLengthHEX10 = 10; -const TInt KConnUiUtilsWepLengthHEX26 = 26; -const TInt KConnUiUtilsWepLengthHEX58 = 58; - -// Retry count and delay for storing Easy WLAN data -const TInt KStoreRetryCount = 10; -const TInt KStoreRetryDelay = 100000; - // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- // CMPMWlanQueryDialog::CMPMWlanQueryDialog // --------------------------------------------------------------------------- // -CMPMWlanQueryDialog::CMPMWlanQueryDialog( CMPMIapSelection& aSession, +CMPMWlanQueryDialog::CMPMWlanQueryDialog( CMPMIapSelection& aIapSelection, TUint32 aWlanIapId ) : CActive( CActive::EPriorityStandard ), - iIapSelection( aSession ), - iNetworkPrefs(), - iNotifWep(), - iWlanQueryState( EWlanNetwork ), + iIapSelection( aIapSelection ), + iWlanQueryState( EOffline ), iWlanIapId( aWlanIapId ), - iEasyWlanSelected( EFalse ), - iOverrideStatus( KErrNone ), - iConnUiUtils( NULL ), - iWps( NULL ), - iWpsReturn( WiFiProt::EWiFiOK ), - iWpsCompleted( EFalse ), - iRetryCount( 0 ) + iOverrideStatus( KErrNone ) { - + CActiveScheduler::Add( this ); } // --------------------------------------------------------------------------- @@ -72,9 +51,6 @@ void CMPMWlanQueryDialog::ConstructL() { User::LeaveIfError(iNotifier.Connect()); - CActiveScheduler::Add( this ); - iConnUiUtils = CConnectionUiUtilities::NewL(); - User::LeaveIfError( iTimer.CreateLocal() ); } // --------------------------------------------------------------------------- @@ -100,14 +76,14 @@ CMPMWlanQueryDialog::~CMPMWlanQueryDialog() { MPMLOGSTRING( "CMPMWlanQueryDialog::~CMPMWlanQueryDialog enters" ) + // Check if this dialog instance was not started but only added to the queue if ( iIapSelection.Session()->MyServer().FirstInWlanQueryQueue() != this ) { MPMLOGSTRING( "CMPMWlanQueryDialog::~CMPMWlanQueryDialog, not a active delete" ) - // Close notifier and timer + // Close notifier iNotifier.Close(); - iTimer.Close(); // We're not first in the queue, thus we can just delete. // But remember the pointer in the array. @@ -119,24 +95,18 @@ // Cancel previous dialogs if any. Cancel(); - // Close notifier and timer + // Close notifier iNotifier.Close(); - iTimer.Close(); - delete iConnUiUtils; - - delete iWps; // Remove self from the queue iIapSelection.Session()->MyServer().RemoveFromWlanQueryQueue( this ); - + // Start the next query CMPMWlanQueryDialog* dlg = iIapSelection.Session()->MyServer().FirstInWlanQueryQueue(); if ( dlg ) { MPMLOGSTRING( "CMPMWlanQueryDialog::~CMPMWlanQueryDialog starts new dialog" ) - dlg->OfferInformation( iWlanIapId, - iIapSelection.OfflineNoteResponse(), - iStatus.Int() ); + dlg->OfferInformation( iStatus.Int() ); // In destructor we cannot let the query leave TRAPD( err, dlg->StartWlanQueryL(); ) if ( err != KErrNone ) @@ -160,26 +130,6 @@ { iNotifier.CancelNotifier( KUidCOfflineWlanNoteDlg ); } - else if ( iWlanQueryState == EWlanNetwork ) - { - iConnUiUtils->CancelSearchWLANNetwork(); - } - else if ( iWlanQueryState == EWepSettings ) - { - iNotifier.CancelNotifier( KUidEasyWepDlg ); - } - else if( iWlanQueryState == EWPS ) - { - iWps->CancelWiFiProt(); - } - else if ( iWlanQueryState == EWpaSettings ) - { - iNotifier.CancelNotifier( KUidEasyWpaDlg ); - } - else // ERetrySettingsStorage - { - iTimer.Cancel(); - } } // --------------------------------------------------------------------------- @@ -191,21 +141,18 @@ MPMLOGSTRING3( "CMPMWlanQueryDialog::RunL status %d state %d", iStatus.Int(), iWlanQueryState ) + if( iWlanQueryState == EOffline ) { if( iStatus.Int() == KErrNone ) { - iIapSelection.SetOfflineNoteResponse( EOfflineResponseYes ); - if( iIapSelection.Session()->MyServer().CommsDatAccess()->CheckEasyWLanL( iWlanIapId ) ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::RunL starting wlan network query" ) - GetNetworkPrefs(); - return; - } + iIapSelection.Session()->MyServer().SetOfflineWlanQueryResponse( + EOfflineResponseYes ); } else if ( iStatus.Int() == KErrCancel ) { - iIapSelection.SetOfflineNoteResponse( EOfflineResponseNo ); + iIapSelection.Session()->MyServer().SetOfflineWlanQueryResponse( + EOfflineResponseNo ); MPMLOGSTRING2( "CMPMWlanQueryDialog::RunL offline query returned %d", iStatus.Int() ) } @@ -215,163 +162,12 @@ iStatus.Int() ) } } - else if( iWlanQueryState == EWlanNetwork ) + // if an error was given through OfferInformation() -call we abort the execution. + // + else if ( iOverrideStatus != KErrNone ) { - if( iStatus.Int() == KErrNone ) - { - - TUint secMode( 0 ); - TWlanNetMode connMode( EInfra ); - TInt err = ConnSecModeToCommsDatSecMode( iNetworkPrefs().iSecMode, - secMode ); - if( err != KErrNone ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::RunL, Unknown security mode" ) - iWlanIapId = 0; - iWlanQueryState = EWlanNetwork; - iIapSelection.UserWlanSelectionDoneL( KErrCouldNotConnect, iWlanIapId ); - return; - } - - TUint32 configuredIap = iIapSelection.Session()->MyServer(). - CommsDatAccess()->CheckWLANIapWithSsidL( iNetworkPrefs().iSsId, - secMode, - connMode ); - // If previously unknown IAP, query wep/wpa parameters - // - if( !configuredIap ) - { - iEasyWlanSelected = ETrue; - if ( iNetworkPrefs().iProtectedSetupSupported && - iNetworkPrefs().iNetworkMode != EWlanConnectionModeAdhoc ) - { - StartWpsDlgL(); - return; - } - // WEP - // - if( iNetworkPrefs().iSecMode == EWlanConnectionSecurityWep ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::RunL unknown wep network" ) - iWlanQueryState = EWepSettings; - iNotifier.StartNotifierAndGetResponse( iStatus, - KUidEasyWepDlg, - iNotifWep, - iNotifWep ); - SetActive(); - return; - } - // WPA - // - else if ( iNetworkPrefs().iSecMode == EWlanConnectionSecurityWpaPsk ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::RunL unknown wpa network" ) - iWlanQueryState = EWpaSettings; - iNotifier.StartNotifierAndGetResponse( iStatus, - KUidEasyWpaDlg, - iNotifWpaKey, - iNotifWpaKey ); - SetActive(); - return; - - } - else - { - MPMLOGSTRING2( "CMPMWlanQueryDialog::RunL security mode %d", - iNetworkPrefs().iSecMode ) - } - } - - else - { - iWlanIapId = configuredIap; - MPMLOGSTRING2( "CMPMWlanQueryDialog::RunL found configured iap matching ssid, id %d", - iWlanIapId ) - - } - } - else if( iStatus.Int() == KErrCancel ) - { - iEasyWlanSelected = EFalse; - MPMLOGSTRING( "CMPMWlanQueryDialog::RunL easy wlan dialog cancelled, \ -setting easy wlan as not selected" ) - } - else - { - MPMLOGSTRING2( "CMPMWlanQueryDialog::RunL EWlanNetwork error %d", - iStatus.Int() ) - } - - } - else if( iWlanQueryState == EWepSettings || iWlanQueryState == EWpaSettings ) - { - if( iStatus.Int() == KErrCancel ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::Key dialog cancelled,back to easy wlan" ) - iNetworkPrefs().iSsId.FillZ(); - iNetworkPrefs().iNetworkMode = EWlanConnectionModeNotConnected; - iNetworkPrefs().iSecMode = EWlanConnectionSecurityOpen; - GetNetworkPrefs(); - return; - } - } - else if( iWlanQueryState == EWPS ) - { - MPMLOGSTRING2( "CMPMWlanQueryDialog::RunL WPS, status %d", iStatus.Int() ) - if( iStatus.Int() == KErrNone ) - { - if( iWpsReturn == WiFiProt::EWiFiOK) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::RunL WPS ok" ) - iWpsCompleted = ETrue; - } - else if ( iWpsReturn == WiFiProt::EWiFiCancel ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::RunL WPS cancelled" ) - iStatus = KErrCancel; - } - else // WiFiProt::EWiFiNoAuto - { - if( iNetworkPrefs().iSecMode == EWlanConnectionSecurityWep ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::RunL: No WPS, starting WEP key query" ); - iWlanQueryState = EWepSettings; - iNotifier.StartNotifierAndGetResponse( iStatus, - KUidEasyWepDlg, - iNotifWep, - iNotifWep ); - SetActive(); - return; - } - else if ( iNetworkPrefs().iSecMode == EWlanConnectionSecurityWpaPsk ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::RunL: No WPS, starting WPA key query" ); - iWlanQueryState = EWpaSettings; - iNotifier.StartNotifierAndGetResponse( iStatus, - KUidEasyWpaDlg, - iNotifWpaKey, - iNotifWpaKey ); - SetActive(); - return; - } - else if ( iNetworkPrefs().iSecMode == EWlanConnectionSecurityOpen ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::RunL: No WPS, sec mode open" ); - iStatus = KErrNone; - } - else - { - MPMLOGSTRING2( "CMPMWlanQueryDialog::RunL: No WPS, unsupported sec mode %d", - iNetworkPrefs().iSecMode ); - iStatus = KErrNotSupported; - } - } - } - } - else if ( iWlanQueryState == ERetrySettingsStorage ) - { - // Retry settings storage - MPMLOGSTRING( "CMPMWlanQueryDialog::RunL Retry settings storage" ) + MPMLOGSTRING2( "CMPMWlanQueryDialog::StartWlanQuery inherited error %d", iOverrideStatus ) + iIapSelection.UserWlanSelectionDoneL( iOverrideStatus, iWlanIapId ); } else { @@ -379,29 +175,9 @@ User::Leave( KErrCancel ); } - TRAPD( leaveCode, iIapSelection.UserWlanSelectionDoneL( iStatus.Int(), iWlanIapId ) ); - if( leaveCode != KErrNone ) - { - // Something caused method to leave, if CommsDat was locked we should retry - if ( iStatus.Int() == KErrNone && - leaveCode == KErrLocked && - iRetryCount > 0 ) - { - MPMLOGSTRING2( "CMPMWlanQueryDialog::RunL Start retry timer, retry count %d", iRetryCount ) - iWlanQueryState = ERetrySettingsStorage; - iRetryCount--; - iTimer.After( iStatus, KStoreRetryDelay ); - SetActive(); - return; - } - else - { - User::Leave( leaveCode ); - } - } + iIapSelection.UserWlanSelectionDoneL( iStatus.Int(), iWlanIapId ); iWlanIapId = 0; - iWlanQueryState = EWlanNetwork; } // --------------------------------------------------------------------------- @@ -411,7 +187,6 @@ TInt CMPMWlanQueryDialog::RunError( TInt aError ) { MPMLOGSTRING2( "CMPMWlanQueryDialog::RunError failed with %d", aError ) - iEasyWlanSelected = EFalse; iIapSelection.ChooseIapComplete( aError, NULL ); return KErrNone; } @@ -423,26 +198,6 @@ void CMPMWlanQueryDialog::StartWlanQueryL() { MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery" ) - - iRetryCount = KStoreRetryCount; - - // if first dialog user, add it to the array and continue. - // - if ( iIapSelection.Session()->MyServer().WlanQueryQueue()->Count() == 0 ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery First one, start immediately" ) - iIapSelection.Session()->MyServer().AppendWlanQueryQueueL( this ); - } - // if another dialog should be processed before this, just add and return. - // - else if ( iIapSelection.Session()->MyServer().FirstInWlanQueryQueue() != this ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery Latter, process later" ) - iIapSelection.Session()->MyServer().AppendWlanQueryQueueL( this ); - return; - } - // else Continue to process the first dialog.(this one) - // FirstInWlanQueryQueue() == this && Count() > 0 TUint32 activeWlanIap = iIapSelection.Session()->MyServer().IsWlanConnectionStartedL( iIapSelection.Session()->MyServer().CommsDatAccess() ); @@ -462,19 +217,12 @@ MPMLOGSTRING2( "CMPMWlanQueryDialog::StartWlanQuery noteBehaviour = %d", noteBehaviour ) if( !emergencyCallEstablished && - iIapSelection.Session()->IsPhoneOfflineL() && + iIapSelection.Session()->MyServer().IsPhoneOffline() && !activeWlanIap && - iIapSelection.OfflineNoteResponse() != EOfflineResponseYes && + iIapSelection.Session()->MyServer().OfflineWlanQueryResponse() != EOfflineResponseYes && iOverrideStatus == KErrNone ) { - // if user has already refused offline note complete immediately - // - if ( iIapSelection.OfflineNoteResponse() == EOfflineResponseNo ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery user has already refused offline" ) - iIapSelection.UserWlanSelectionDoneL( KErrCancel, iWlanIapId ); - } - else if ( noteBehaviour & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) + if ( noteBehaviour & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) { MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery offline note query not shown due to disabled queries" ) iIapSelection.UserWlanSelectionDoneL( KErrPermissionDenied, iWlanIapId ); @@ -490,32 +238,6 @@ SetActive(); } } - // if easy wlan iap and some wlan iap started, use existing connection - // - else if( iIapSelection.Session()->MyServer().CommsDatAccess()->CheckEasyWLanL( iWlanIapId ) && - activeWlanIap ) - { - MPMLOGSTRING2( "CMPMWlanQueryDialog::StartWlanQuery using active WLAN IAP %d", - activeWlanIap ) - iIapSelection.UserWlanSelectionDoneL( KErrNone, activeWlanIap ); - } - // if easy wlan iap and easy wlan is not already started - // - else if( iIapSelection.Session()->MyServer().CommsDatAccess()->CheckEasyWLanL( iWlanIapId ) && - !iIapSelection.Session()->MyServer().CheckIfStarted( iWlanIapId ) && - iNetworkPrefs().iSsId.Length() == 0 && - iOverrideStatus == KErrNone ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery starting network query" ) - GetNetworkPrefs(); - } - // if an error was given through OfferInformation() -call we abort the execution. - // - else if ( iOverrideStatus != KErrNone ) - { - MPMLOGSTRING2( "CMPMWlanQueryDialog::StartWlanQuery inherited error %d", iOverrideStatus ) - iIapSelection.UserWlanSelectionDoneL( iOverrideStatus, iWlanIapId ); - } else { MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery no wlan dialog to show" ) @@ -523,40 +245,19 @@ } } - // ----------------------------------------------------------------------------- // CMPMWlanQueryDialog::OfferInformation // ----------------------------------------------------------------------------- // -void CMPMWlanQueryDialog::OfferInformation( - TUint32 aWlanIapId, - TOfflineNoteResponse aOfflineStatus, - TInt aDialogStatus ) +void CMPMWlanQueryDialog::OfferInformation( TInt aDialogStatus ) { - TBool isEasyWlan( EFalse ); - // Take information from earlier note into use - // if the selected IAP is EasyWLAN or Offline note response was No. - // - TRAP_IGNORE( isEasyWlan = - iIapSelection.Session()->MyServer().CommsDatAccess()->CheckEasyWLanL( iWlanIapId ); ) - if ( isEasyWlan ) - { - // iEasyWlanSelected is not passed as only the first connection - // should write the easy wlan settings to commsdat if easy wlan is used. - // - MPMLOGSTRING3( "CMPMWlanQueryDialog<0x%x>::OfferInformation: EasyWLAN, iap %d", - iIapSelection.Session()->ConnectionId(), - aWlanIapId ) - - iWlanIapId = aWlanIapId; - iOverrideStatus = aDialogStatus; - } - if ( aOfflineStatus != EOfflineResponseUndefined ) + TOfflineWlanQueryResponse offlineResponse = + iIapSelection.Session()->MyServer().OfflineWlanQueryResponse(); + if ( offlineResponse != EOfflineResponseUndefined ) { MPMLOGSTRING3( "CMPMWlanQueryDialog<0x%x>::OfferInformation: offline response %d", iIapSelection.Session()->ConnectionId(), - aOfflineStatus ) - iIapSelection.SetOfflineNoteResponse( aOfflineStatus ); + offlineResponse ) iOverrideStatus = aDialogStatus; } @@ -568,313 +269,3 @@ #endif } - -// ----------------------------------------------------------------------------- -// CMPMWlanQueryDialog::StoreEasyWlanSelectionL -// ----------------------------------------------------------------------------- -// -void CMPMWlanQueryDialog::StoreEasyWlanSelectionL() - { - if( iEasyWlanSelected ) - { - TWlanSsid ssid; - TWepKeyData wepData; - TUint wpaPskEnabled( 0 ); - TUint wpaPskLen( 0 ); - TBuf8 wpa; - TUint secMode( 0 ); - TWlanNetMode connMode( EInfra ); - - if( iWpsCompleted ) - { - GetEasyWlanDataForWpsL( ssid, - secMode, - connMode, - wepData, - wpaPskEnabled, - wpa, - wpaPskLen ); - MPMLOGSTRING3( "CMPMWlanQueryDialog::StoreEasyWlanSelection: \ -wps used, connection iap %d, ssid %S", iWlanIapId, &iWpsAttribute.iSsid ) - iIapSelection.Session()->MyServer().Events()-> - SetConnInfoIapSsid( iWlanIapId, - iWpsAttribute.iSsid ); - iIapSelection.Session()->MyServer().CommsDatAccess()->SetEasyWlanDataL( ssid, - secMode, - connMode, - wepData, - wpaPskEnabled, - wpa, - wpaPskLen ); - return; - } - - MPMLOGSTRING( "CMPMWlanQueryDialog::StoreEasyWlanSelection: setting easy wlan data" ) - GetEasyWlanDataL( ssid, - secMode, - connMode, - wepData, - wpaPskEnabled, - wpa, - wpaPskLen ); - - MPMLOGSTRING3( "CMPMWlanQueryDialog::StoreEasyWlanSelection: \ -setting easy wlan iap %d ssid %S in connmon events", iWlanIapId, &iNetworkPrefs().iSsId ) - iIapSelection.Session()->MyServer().Events()->SetConnInfoIapSsid( iWlanIapId, - iNetworkPrefs().iSsId ); - iIapSelection.Session()->MyServer().CommsDatAccess()->SetEasyWlanDataL( ssid, - secMode, - connMode, - wepData, - wpaPskEnabled, - wpa, - wpaPskLen ); - - } - else - { - MPMLOGSTRING( "CMPMWlanQueryDialog::StoreEasyWlanSelection: no easy wlan selected by user" ) - } - } - - -// ----------------------------------------------------------------------------- -// CMPMWlanQueryDialog::GetEasyWlanDataL -// ----------------------------------------------------------------------------- -// -void CMPMWlanQueryDialog::GetEasyWlanDataL( TWlanSsid& aSsid, - TUint& aSecMode, - TWlanNetMode& aConnMode, - TWepKeyData& aWepData, - TUint& aEnableWpaPsk, - TDes8& aWpaPsk, - TUint& aWpaKeyLen ) - { - aSsid.Copy( iNetworkPrefs().iSsId ); - if ( iNetworkPrefs().iNetworkMode == EWlanConnectionModeAdhoc ) - { - aConnMode = EAdhoc; - } - - // Set security mode - TInt err = ConnSecModeToCommsDatSecMode( iNetworkPrefs().iSecMode, - aSecMode ); - - if( err != KErrNone ) - { - MPMLOGSTRING2( "CMPMWlanQueryDialog::StoreEasyWlanSelection: \ -unsupported sec mode %d. leaving", iNetworkPrefs().iSecMode ) - User::Leave( KErrNotSupported ); - } - - if( iNetworkPrefs().iSecMode == EWlanConnectionSecurityWep ) - { - CnvUtfConverter::ConvertFromUnicodeToUtf8( aWepData.iWep1, iNotifWep().iKey ); - //MPMLOG8STRING2( "CMPMWlanQueryDialog::StoreEasyWlanSelection:wep-key8:%S ", &aWepData.iWep1 ) - if( iNotifWep().iHex ) - { - aWepData.iWepFormat1 = 1; - MPMLOGSTRING( "CMPMWlanQueryDialog::StoreEasyWlanSelection: wep format is 1 (hex)") - } - aWepData.iDefaultWep = EWlanDefaultWepKey1; - } - else if( iNetworkPrefs().iSecMode == EWlanConnectionSecurityWpaPsk ) - { - CnvUtfConverter::ConvertFromUnicodeToUtf8( aWpaPsk, iNotifWpaKey() ); - aEnableWpaPsk = 1; - aWpaKeyLen = aWpaPsk.Length(); - MPMLOGSTRING3( "CMPMWlanQueryDialog::StoreEasyWlanSelection:wpapsk-key:%s, len:%d", - &iNotifWpaKey(), - aWpaKeyLen ) - } - else - { - MPMLOGSTRING2( "CMPMWlanQueryDialog::StoreEasyWlanSelection: \ -no key handling needed for sec mode %d", iNetworkPrefs().iSecMode ) - } - } - -// --------------------------------------------------------------------------- -// CMPMWlanQueryDialog::ConnSecModeToCommsDatSecMode -// --------------------------------------------------------------------------- -// -TInt CMPMWlanQueryDialog::ConnSecModeToCommsDatSecMode( TWlanConnectionSecurityMode aConnSecmode, - TUint& aCommsdatSecMode ) const - { - - if ( aConnSecmode == EWlanConnectionSecurityOpen ) - { - aCommsdatSecMode = EWlanSecModeOpen; - } - else if ( aConnSecmode == EWlanConnectionSecurityWep ) - { - aCommsdatSecMode = EWlanSecModeWep; - } - else if ( aConnSecmode == EWlanConnectionSecurityWpaPsk ) - { - aCommsdatSecMode = EWlanSecModeWpa2; - } - else if ( aConnSecmode == EWlanConnectionSecurityWpa ) - { - aCommsdatSecMode = EWlanSecModeWpa; - } - else - { - MPMLOGSTRING( "CMPMWlanQueryDialog::RunL, Unknown security mode" ) - return KErrCouldNotConnect; - } - return KErrNone; - } - - -// --------------------------------------------------------------------------- -// CMPMWlanQueryDialog::IapSecModeToCommsDatSecMode -// --------------------------------------------------------------------------- -// -TInt CMPMWlanQueryDialog::IapSecModeToCommsDatSecMode( TWlanIapSecurityMode aIapSecmode, - TUint& aCommsdatSecMode ) const - { - switch( aIapSecmode ) - { - case EWlanIapSecurityModeAllowUnsecure: - aCommsdatSecMode |= EWlanSecModeOpen; - break; - case EWlanIapSecurityModeWep: - aCommsdatSecMode |= EWlanSecModeWep; - break; - case EWlanIapSecurityModeWpa: - aCommsdatSecMode |= EWlanSecModeWpa; - break; - case EWlanIapSecurityModeWpa2Only: - aCommsdatSecMode |= EWlanSecModeWpa2; - break; - default: - MPMLOGSTRING2( "CMPMWlanQueryDialog::IapSecModeToCommsDatSecMode: \ -unsupported sec mode %d ", aIapSecmode ) - return KErrNotSupported; - } - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CMPMWlanQueryDialog::GetEasyWlanDataForWpsL -// ----------------------------------------------------------------------------- -// -void CMPMWlanQueryDialog::GetEasyWlanDataForWpsL( TWlanSsid& aSsid, - TUint& aSecMode, - TWlanNetMode& aConnMode, - TWepKeyData& aWepKeyData, - TUint& aEnableWpaPsk, - TDes8& aWpaPsk, - TUint& aWpaKeyLen ) - { - aSsid.Copy( iWpsAttribute.iSsid ); - if ( iWpsAttribute.iOperatingMode == EWlanOperatingModeAdhoc ) - { - aConnMode = EAdhoc; - } - TInt err = IapSecModeToCommsDatSecMode( iWpsAttribute.iSecurityMode, - aSecMode ); - if( err != KErrNone ) - { - MPMLOGSTRING( "CMPMWlanQueryDialog::GetEasyWlanDataForWpsL: \ -unsupported wps sec mode leaving" ) - User::Leave( KErrNotSupported ); - } - - if( iWpsAttribute.iSecurityMode == EWlanIapSecurityModeWep ) - { - if( iWpsAttribute.iWepKey1.Length() && - IsWepFormatHexL( iWpsAttribute.iWepKey1.Length() ) ) - { - aWepKeyData.iWepFormat1 = 1; - } - if( iWpsAttribute.iWepKey2.Length() && - IsWepFormatHexL( iWpsAttribute.iWepKey2.Length() ) ) - { - aWepKeyData.iWepFormat2 = 1; - } - if( iWpsAttribute.iWepKey3.Length() && - IsWepFormatHexL( iWpsAttribute.iWepKey3.Length() ) ) - { - aWepKeyData.iWepFormat3 = 1; - } - if( iWpsAttribute.iWepKey4.Length() && - IsWepFormatHexL( iWpsAttribute.iWepKey4.Length() ) ) - { - aWepKeyData.iWepFormat4 = 1; - } - aWepKeyData.iWep1.Copy( iWpsAttribute.iWepKey1 ); - aWepKeyData.iWep2.Copy( iWpsAttribute.iWepKey2 ); - aWepKeyData.iWep3.Copy( iWpsAttribute.iWepKey3 ); - aWepKeyData.iWep4.Copy( iWpsAttribute.iWepKey4 ); - aWepKeyData.iDefaultWep = iWpsAttribute.iWepDefaultKey; - } - if( iWpsAttribute.iWpaPreSharedKey.Length() ) - { - aEnableWpaPsk = 1; - aWpaPsk.Copy( iWpsAttribute.iWpaPreSharedKey ); - aWpaKeyLen = aWpaPsk.Length(); - } - - } - -// --------------------------------------------------------------------------- -// CMPMWlanQueryDialog::StartWpsDlgL -// --------------------------------------------------------------------------- -// -void CMPMWlanQueryDialog::StartWpsDlgL() - { - MPMLOGSTRING( "CMPMWlanQueryDialog::StartWpsDlgL, Starting WPS" ) - iWlanQueryState = EWPS; - iWps = CWiFiProtUiClient::NewL(); - iWps->StartWiFiProtConnL( iNetworkPrefs().iSsId, // TWlanSsid&, - iWpsAttribute, - iWpsReturn, - iStatus ); - SetActive(); - } - -// --------------------------------------------------------------------------- -// CMPMWlanQueryDialog::IsWepFormatHexL -// --------------------------------------------------------------------------- -// -TBool CMPMWlanQueryDialog::IsWepFormatHexL( TInt aLength ) const - { - MPMLOGSTRING2( "CMPMWlanQueryDialog::IsWepFormatHexL length %d", aLength ) - - if ( ( aLength == KConnUiUtilsWepLengthASCII5 ) || - ( aLength == KConnUiUtilsWepLengthASCII13 ) || - ( aLength == KConnUiUtilsWepLengthASCII29 ) ) - { - return EFalse; - } - else if ( ( aLength == KConnUiUtilsWepLengthHEX10 ) || - ( aLength == KConnUiUtilsWepLengthHEX26 ) || - ( aLength == KConnUiUtilsWepLengthHEX58 ) ) - { - return ETrue; - } - else - { - User::Leave( KErrNotSupported ); - } - return EFalse; - } - -// --------------------------------------------------------------------------- -// CMPMWlanQueryDialog::GetNetworkPrefs -// --------------------------------------------------------------------------- -// -void CMPMWlanQueryDialog::GetNetworkPrefs() - { - iWlanQueryState = EWlanNetwork; - iConnUiUtils->SearchWLANNetworkAsync( iStatus, - iNetworkPrefs().iSsId, - iNetworkPrefs().iNetworkMode, - iNetworkPrefs().iSecMode, - iNetworkPrefs().iProtectedSetupSupported - ); - SetActive(); - } - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/bwins/cmapplsettingsuiu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/bwins/cmapplsettingsuiu.def Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,19 @@ +EXPORTS + ??_ECmApplSettingsUi@@UAE@I@Z @ 1 NONAME ; CmApplSettingsUi::~CmApplSettingsUi(unsigned int) + ?tr@CmApplSettingsUi@@SA?AVQString@@PBD0@Z @ 2 NONAME ; class QString CmApplSettingsUi::tr(char const *, char const *) + ?getStaticMetaObject@CmApplSettingsUi@@SAABUQMetaObject@@XZ @ 3 NONAME ; struct QMetaObject const & CmApplSettingsUi::getStaticMetaObject(void) + ?qt_metacast@CmApplSettingsUi@@UAEPAXPBD@Z @ 4 NONAME ; void * CmApplSettingsUi::qt_metacast(char const *) + ?setSelection@CmApplSettingsUi@@QAEXABUSettingSelection@1@@Z @ 5 NONAME ; void CmApplSettingsUi::setSelection(struct CmApplSettingsUi::SettingSelection const &) + ?tr@CmApplSettingsUi@@SA?AVQString@@PBD0H@Z @ 6 NONAME ; class QString CmApplSettingsUi::tr(char const *, char const *, int) + ?trUtf8@CmApplSettingsUi@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString CmApplSettingsUi::trUtf8(char const *, char const *) + ??1CmApplSettingsUi@@UAE@XZ @ 8 NONAME ; CmApplSettingsUi::~CmApplSettingsUi(void) + ?selection@CmApplSettingsUi@@QBE?AUSettingSelection@1@XZ @ 9 NONAME ; struct CmApplSettingsUi::SettingSelection CmApplSettingsUi::selection(void) const + ?qt_metacall@CmApplSettingsUi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 10 NONAME ; int CmApplSettingsUi::qt_metacall(enum QMetaObject::Call, int, void * *) + ?staticMetaObject@CmApplSettingsUi@@2UQMetaObject@@B @ 11 NONAME ; struct QMetaObject const CmApplSettingsUi::staticMetaObject + ?finished@CmApplSettingsUi@@IAEXI@Z @ 12 NONAME ; void CmApplSettingsUi::finished(unsigned int) + ?trUtf8@CmApplSettingsUi@@SA?AVQString@@PBD0H@Z @ 13 NONAME ; class QString CmApplSettingsUi::trUtf8(char const *, char const *, int) + ??0CmApplSettingsUi@@QAE@PAVQObject@@@Z @ 14 NONAME ; CmApplSettingsUi::CmApplSettingsUi(class QObject *) + ?metaObject@CmApplSettingsUi@@UBEPBUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const * CmApplSettingsUi::metaObject(void) const + ?open@CmApplSettingsUi@@QAEXXZ @ 16 NONAME ; void CmApplSettingsUi::open(void) + ?setOptions@CmApplSettingsUi@@QAEXABV?$QFlags@W4SelectionDialogItems@CmApplSettingsUi@@@@ABV?$QSet@I@@@Z @ 17 NONAME ; void CmApplSettingsUi::setOptions(class QFlags const &, class QSet const &) + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/cmapplsettingsui.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/cmapplsettingsui.pro Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,70 @@ +# +# 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: +# CM Manager Application Settings UI project file. +# + +TEMPLATE = lib +TARGET = cmapplsettingsui +TARGET.CAPABILITY = ALL -TCB +DEFINES += BUILD_CMAPPLSETTINGSUI_DLL +DEPENDPATH += . +INCLUDEPATH += inc + +# Temporary solution to fix tracecompiler +# When tracecompiler is fixed, this can be removed +symbian: { + MMP_RULES += "USERINCLUDE traces" +} + +CONFIG += hb +RESOURCES = res/cmapplsettingsui.qrc + +TRANSLATIONS = cmapplsettingsui.ts + +#Store generated files to their own directory +MOC_DIR = build +RCC_DIR = build + +HEADERS += \ + ../../ipcm_plat/connection_settings_ui_api/inc/cmapplsettingsui.h \ + inc/cmapplsettingsui_p.h \ + inc/cmradiodialog.h \ + inc/cmsettingdata.h \ + traces/OstTraceDefinitions.h + +SOURCES += \ + src/cmapplsettingsui.cpp \ + src/cmapplsettingsui_p.cpp \ + src/cmsettingdata.cpp \ + src/cmradiodialog.cpp + +# Temporary export directory definition +# This can be removed when the default has changed to "." from ".." +mmpRuleDeffile = \ + "$${LITERAL_HASH}ifdef WINSCW" \ + "DEFFILE ./bwins/cmapplsettingsui.def" \ + "$${LITERAL_HASH}else" \ + "DEFFILE ./eabi/cmapplsettingsui.def" \ + "$${LITERAL_HASH}endif" + +symbian: { + TARGET.UID3 = 0x2002DC89 + TARGET.EPOCALLOWDLLDATA = 1 + MMP_RULES += mmpRuleDeffile + SYMBIAN_PLATFORMS = WINSCW ARMV5 + BLD_INF_RULES.prj_exports += "rom/cmapplsettingsui.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cmapplsettingsui.iby)" + BLD_INF_RULES.prj_exports += "rom/cmapplsettingsui_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(cmapplsettingsui_resources.iby)" + LIBS += -lcmmanager -lconnection_settings_shim +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/eabi/cmapplsettingsuiu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/eabi/cmapplsettingsuiu.def Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,19 @@ +EXPORTS + _ZN16CmApplSettingsUi10setOptionsERK6QFlagsINS_20SelectionDialogItemsEERK4QSetIjE @ 1 NONAME + _ZN16CmApplSettingsUi11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME + _ZN16CmApplSettingsUi11qt_metacastEPKc @ 3 NONAME + _ZN16CmApplSettingsUi12setSelectionERKNS_16SettingSelectionE @ 4 NONAME + _ZN16CmApplSettingsUi16staticMetaObjectE @ 5 NONAME DATA 16 + _ZN16CmApplSettingsUi19getStaticMetaObjectEv @ 6 NONAME + _ZN16CmApplSettingsUi4openEv @ 7 NONAME + _ZN16CmApplSettingsUi8finishedEj @ 8 NONAME + _ZN16CmApplSettingsUiC1EP7QObject @ 9 NONAME + _ZN16CmApplSettingsUiC2EP7QObject @ 10 NONAME + _ZN16CmApplSettingsUiD0Ev @ 11 NONAME + _ZN16CmApplSettingsUiD1Ev @ 12 NONAME + _ZN16CmApplSettingsUiD2Ev @ 13 NONAME + _ZNK16CmApplSettingsUi10metaObjectEv @ 14 NONAME + _ZNK16CmApplSettingsUi9selectionEv @ 15 NONAME + _ZTI16CmApplSettingsUi @ 16 NONAME + _ZTV16CmApplSettingsUi @ 17 NONAME + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/inc/cmapplsettingsui_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/inc/cmapplsettingsui_p.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CM Manager Application Settings UI private interface. +* +*/ + +#ifndef CMAPPLSETTINGSUI_P_H +#define CMAPPLSETTINGSUI_P_H + +// System includes + +#include +#include +#include +#include +#include + +// User includes + +#include "cmconnectionmethod_shim.h" +#include "cmdestination_shim.h" +#include "cmsettingdata.h" +#include "cmapplsettingsui.h" + +// Forward declarations + +class QTranslator; +class CmManagerShim; +class CmRadioDialog; +class TestCmApplSettingsUi; + +// External data types + +// Constants + +// Class declaration + +class CmApplSettingsUiPrivate : QObject +{ + Q_OBJECT + +public: + + // Data types + + explicit CmApplSettingsUiPrivate(CmApplSettingsUi *q_pointer); + + virtual ~CmApplSettingsUiPrivate(); + + void setOptions( + const QFlags &listItems, + const QSet &bearerFilter); + + void setSelection( + const CmApplSettingsUi::SettingSelection &selection); + + CmApplSettingsUi::SettingSelection selection() const; + + void open(); + +signals: + +public slots: + +protected: + +protected slots: + +private: + + Q_DISABLE_COPY(CmApplSettingsUiPrivate) + + void runDestinationDialog(); + + void runConnectionMethodDialog(); + + int findDestination(uint destinationId) const; + + int findConnectionMethod(uint connMethodId) const; + + void emitFinished(uint status) const; + +private slots: + + void destinationDialogResult(bool success); + + void connMethodDialogResult(bool success); + +private: // data + + //! "Not found" search index value. + static const int ItemNotFound = -1; + + // General member data + CmApplSettingsUi *q_ptr; //!< Public implementation + QSharedPointer mCmManagerShim; //!< CM Manager client instance + QTranslator *mAppTranslator; //!< Translator for application text ID's + QTranslator *mCommonTranslator; //!< Translator for common text ID's + + // Configuration + QFlags mListItems; //!< Wanted dialog type's + + // State data + CmSettingData mSettingData; //!< Setting data + CmRadioDialog *mDestinationDialog; //!< Destination dialog + CmRadioDialog *mConnMethodDialog; //!< Connection method dialog + CmApplSettingsUi::SettingSelection mSelection; //!< Current selection + QList< QSharedPointer > mDestinations; //! Destinations + QList< QSharedPointer > mConnMethods; //! Connection methods + + // Friend classes + + // Test class needs direct access + friend class TestCmApplSettingsUi; +}; + +#endif // CMAPPLSETTINGSUI_P_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/inc/cmradiodialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/inc/cmradiodialog.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,126 @@ +/* +* 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: +* Dialog implementation for the CM Manager Application Settings UI. +* +*/ + +#ifndef CMRADIODIALOG_H +#define CMRADIODIALOG_H + +// System includes + +#include +#include +#include +#include + +// User includes + +// Forward declarations + +class HbDialog; +class HbLabel; +class HbRadioButtonList; +class HbAction; +class HbDocumentLoader; +class TestCmApplSettingsUi; + +// External data types + +// Constants + +// Supported dialog types +enum CmRadioDialogType { + CmRadioDialogTypeDestination = 1, //!< Destination selection dialog + CmRadioDialogTypeAccessPoint //!< Access point selection dialog +}; + +// Supported options +enum CmRadioDialogOpt { + CmRadioDialogOptDedicatedAP = 1 //!< Append "Dedicated access point" +}; + +// Class declaration + +class CmRadioDialog : public QObject +{ + Q_OBJECT + +public: + + // Data types + + explicit CmRadioDialog(QObject *parent = 0); + + ~CmRadioDialog(); + + void setType(CmRadioDialogType type); + + void setOptions(const QSet &options); + + void setItems(const QStringList &list); + + void setSelected(int index); + + int selected() const; + + void open(); + +signals: + + /*! + * Signal used for informing that the dialog has finished. + * + * @param[in] success Dialog run success. This is true if OK was pressed. + */ + void finished(bool success); + +public slots: + + void dialogClosed(HbAction *action); + +protected: + +protected slots: + +private: + + void setHeading(); + +private slots: + + void loadDocml(); + +private: // data + + // Owned data + CmRadioDialogType mType; //!< Radio dialog type + QSet mOptions; //!< Radio dialog options + QSharedPointer mLoader; //!< Dialog document loader + QStringList mListItems; //!< Dialog radio button items + QSharedPointer mDialog; //!< Dialog reference + + // Not owned data + HbLabel *mHeading; //!< Dialog title + HbRadioButtonList *mList; //!< Dialog's radio button list + HbAction *mOkAction; //!< Dialog's OK button action + + // Friend classes + + // Test class needs direct access + friend class TestCmApplSettingsUi; +}; + +#endif // CMRADIODIALOG_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/inc/cmsettingdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/inc/cmsettingdata.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,105 @@ +/* +* 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: +* Data handling encapsulation for CM Application Settings UI. +* +*/ + +#ifndef CMSETTINGDATA_H +#define CMSETTINGDATA_H + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include + +// User includes + +// Forward declarations + +// External data types + +// Constants + +// Class declaration + +class CmSettingData +{ + +public: + + // Data types + + // Data class for Destination + class Destination + { + public: + int id; //!< Destination ID. + QString name; //!< Destination name. + }; + + // Data class for Connection Method + class ConnMethod + { + public: + int id; //!< Connection Method ID. + QString name; //!< Connection Method name. + }; + + explicit CmSettingData(); + + ~CmSettingData(); + + void setBearerFilter(const QSet &bearers); + + bool fetchDestinations(QList< QSharedPointer > &destinations); + + bool fetchConnMethods(QList< QSharedPointer > &connMethods); + +signals: + +public slots: + +protected: + +protected slots: + +private: + + void getCmManager(); + + bool validateDestination(CmDestinationShim *destination) const; + + bool validateConnMethod(CmConnectionMethodShim *connMethod) const; + + static bool connMethodLessThan( + const QSharedPointer connMethod1, + const QSharedPointer connMethod2); + +private slots: + +private: // data + + QSet mBearers; //!< Bearer filter. + QSharedPointer mCmManager; //!< CM Manager client instance + + // Friend classes +}; + +#endif // CMSETTINGDATA_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/res/cmapplsettingsui.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/res/cmapplsettingsui.qrc Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,5 @@ + + + cmradiodialog.docml + + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/rom/cmapplsettingsui.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/rom/cmapplsettingsui.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,23 @@ +/* + * 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 CMAPPLSETTINGSUI_IBY +#define CMAPPLSETTINGSUI_IBY + +file=ABI_DIR\BUILD_DIR\cmapplsettingsui.dll SHARED_LIB_DIR\cmapplsettingsui.dll + +#endif // CMAPPLSETTINGSUI_IBY diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/rom/cmapplsettingsui_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/rom/cmapplsettingsui_resources.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,25 @@ +/* + * 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 CMAPPLSETTINGSUI_RESOURCES_IBY +#define CMAPPLSETTINGSUI_RESOURCES_IBY + +#include + +data=DATAZ_/QT_TRANSLATIONS_DIR/cmapplsettingsui.qm QT_TRANSLATIONS_DIR/cmapplsettingsui.qm + +#endif // CMAPPLSETTINGSUI_RESOURCES_IBY diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/src/cmapplsettingsui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/src/cmapplsettingsui.cpp Mon May 03 12:53:07 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: +* CM Manager Application Settings UI implementation. +* +*/ + +// System includes + +// User includes + +#include "cmapplsettingsui_p.h" + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +CmApplSettingsUi::CmApplSettingsUi(QObject *parent) : + QObject(parent), + d_ptr(new CmApplSettingsUiPrivate(this)) +{ +} + +CmApplSettingsUi::~CmApplSettingsUi() +{ +} + +void CmApplSettingsUi::setOptions( + const QFlags &listItems, + const QSet &bearerFilter) +{ + d_ptr->setOptions(listItems, bearerFilter); +} + +void CmApplSettingsUi::setSelection(const SettingSelection &selection) +{ + d_ptr->setSelection(selection); +} + +CmApplSettingsUi::SettingSelection CmApplSettingsUi::selection() const +{ + return d_ptr->selection(); +} + +void CmApplSettingsUi::open() +{ + d_ptr->open(); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/src/cmapplsettingsui_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/src/cmapplsettingsui_p.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,417 @@ +/* +* 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: +* CM Manager Application Settings UI private implementation. +* +*/ + +// System includes + +#include +#include +#include +#include +#include + +// User includes + +#include "cmradiodialog.h" +#include "cmapplsettingsui_p.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmapplsettingsui_pTraces.h" +#endif + + +/*! + \class CmApplSettingsUiPrivate + \brief Private implementation class for Application Settings UI. + + Displays a radio button list dialog for an application that can be used + to select a destination or connection method. + +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. + + @param q_pointer Parent object. + */ +CmApplSettingsUiPrivate::CmApplSettingsUiPrivate(CmApplSettingsUi *q_pointer) : + QObject(q_pointer), + q_ptr(q_pointer), + mAppTranslator(new QTranslator(this)), + mCommonTranslator(new QTranslator(this)), + mListItems( + CmApplSettingsUi::ShowDestinations | + CmApplSettingsUi::ShowConnectionMethods), + mSettingData(), + mDestinationDialog(0), + mConnMethodDialog(0), + mSelection(), + mDestinations(), + mConnMethods() +{ + OstTraceFunctionEntry0(CMAPPLSETTINGSUIPRIVATE_CMAPPLSETTINGSUIPRIVATE_ENTRY); + + // Initialize to default selection + mSelection.result = CmApplSettingsUi::SelectionTypeDestination; + mSelection.id = 0; + + // Install common localization + QString lang = QLocale::system().name(); + QString path = "Z:/resource/qt/translations/"; + bool loadStatus = mCommonTranslator->load("common_" + lang, path); + qApp->installTranslator(mCommonTranslator); + + // Install this library's localization + loadStatus = mAppTranslator->load("cmapplsettingsui_" + lang, path); + qApp->installTranslator(mAppTranslator); + + OstTraceFunctionExit0(CMAPPLSETTINGSUIPRIVATE_CMAPPLSETTINGSUIPRIVATE_EXIT); +} + +/*! + Destructor. + */ +CmApplSettingsUiPrivate::~CmApplSettingsUiPrivate() +{ + OstTraceFunctionEntry0(DUP1_CMAPPLSETTINGSUIPRIVATE_CMAPPLSETTINGSUIPRIVATE_ENTRY); + OstTraceFunctionExit0(DUP1_CMAPPLSETTINGSUIPRIVATE_CMAPPLSETTINGSUIPRIVATE_EXIT); +} + +/*! + Options setter. + + @param[in] listItems Dialog list items configuration. + @param[in] bearerFilter Dialog Connection Method bearer filter. + */ +void CmApplSettingsUiPrivate::setOptions( + const QFlags &listItems, + const QSet &bearerFilter) +{ + // Store the options + mListItems = listItems; + mSettingData.setBearerFilter(bearerFilter); +} + +/*! + Dialog selection setter. + + @param[in] selection Dialog selection to set. + */ +void CmApplSettingsUiPrivate::setSelection( + const CmApplSettingsUi::SettingSelection &selection) +{ + // Set the selection. + // If the selection is invalid, it is ignored later on, + // and default is used instead. + mSelection = selection; +} + +/*! + Dialog selection getter. Returns the current selection. + + @return Current dialog selection. + */ +CmApplSettingsUi::SettingSelection CmApplSettingsUiPrivate::selection() const +{ + return mSelection; +} + +/*! + This function runs the dialog asynchronously. Use the setters to + configure the dialog before running. After the dialog has been closed + (accepted or cancelled), the signal finished() is emitted. + */ +void CmApplSettingsUiPrivate::open() +{ + OstTraceFunctionEntry0(CMAPPLSETTINGSUIPRIVATE_OPEN_ENTRY); + + // Fetch filtered Destinations and Connection Methods + bool settingsRead = true; + if (mListItems.testFlag(CmApplSettingsUi::ShowDestinations)) { + settingsRead = mSettingData.fetchDestinations(mDestinations); + } + if (mListItems.testFlag(CmApplSettingsUi::ShowConnectionMethods)) { + settingsRead &= mSettingData.fetchConnMethods(mConnMethods); + } + + if (!settingsRead) { + // Settings reading failed + emitFinished(CmApplSettingsUi::ApplSettingsErrorSettingsRead); + } else if (mListItems.testFlag(CmApplSettingsUi::ShowDestinations)) { + // Start with destination view + runDestinationDialog(); + } else if (mListItems.testFlag(CmApplSettingsUi::ShowConnectionMethods)) { + // Start directly with connection method view + runConnectionMethodDialog(); + } else { + // Nothing to show, so finish + emitFinished(CmApplSettingsUi::ApplSettingsErrorNoContent); + } + + OstTraceFunctionExit0(CMAPPLSETTINGSUIPRIVATE_OPEN_EXIT); +} + +/*! + Destination selection dialog execution. + */ +void CmApplSettingsUiPrivate::runDestinationDialog() +{ + OstTraceFunctionEntry0(CMAPPLSETTINGSUIPRIVATE_RUNDESTINATIONDIALOG_ENTRY); + + // Check that there is some content to show: + // -At least one Destination + // -Or at least one Connection Method under "Dedicated access point" + if (mDestinations.isEmpty() + && (!mListItems.testFlag(CmApplSettingsUi::ShowConnectionMethods) + || mConnMethods.isEmpty())) { + // Nothing to show, so finish + emitFinished(CmApplSettingsUi::ApplSettingsErrorNoContent); + OstTraceFunctionExit0(CMAPPLSETTINGSUIPRIVATE_RUNDESTINATIONDIALOG_EXIT); + return; + } + + // Create a new Destination dialog + delete mDestinationDialog; + mDestinationDialog = new CmRadioDialog(this); + mDestinationDialog->setType(CmRadioDialogTypeDestination); + + // Add Dedicated access point option if requested & supported + if (mListItems.testFlag(CmApplSettingsUi::ShowConnectionMethods) + && !mConnMethods.isEmpty()) { + QSet options; + options.insert(CmRadioDialogOptDedicatedAP); + mDestinationDialog->setOptions(options); + } + + // Add destinations to the dialog + QStringList destinations; + for (int i = 0; i < mDestinations.count(); i++) { + destinations << mDestinations[i]->name; + } + mDestinationDialog->setItems(destinations); + + // Set selection + int index = 0; // Default index is the first + if (mListItems.testFlag(CmApplSettingsUi::ShowConnectionMethods) + && mSelection.result == CmApplSettingsUi::SelectionTypeConnectionMethod + && !mConnMethods.isEmpty()) { + // Dedicated access point + index = destinations.count(); + } else { + int destinationIndex = findDestination(mSelection.id); + if (destinationIndex != ItemNotFound) { + index = destinationIndex; + } + } + mDestinationDialog->setSelected(index); + + // Execute the dialog + bool connected = connect( + mDestinationDialog, + SIGNAL(finished(bool)), + this, + SLOT(destinationDialogResult(bool))); + Q_ASSERT(connected); + mDestinationDialog->open(); + + OstTraceFunctionExit0(DUP1_CMAPPLSETTINGSUIPRIVATE_RUNDESTINATIONDIALOG_EXIT); +} + +/*! + Connection method selection dialog execution. + */ +void CmApplSettingsUiPrivate::runConnectionMethodDialog() +{ + OstTraceFunctionEntry0(CMAPPLSETTINGSUIPRIVATE_RUNCONNECTIONMETHODDIALOG_ENTRY); + + // Check that there is at least one Connection Method to show + if (mConnMethods.count() == 0) { + // Nothing to show, so finish + emitFinished(CmApplSettingsUi::ApplSettingsErrorNoContent); + OstTraceFunctionExit0(CMAPPLSETTINGSUIPRIVATE_RUNCONNECTIONMETHODDIALOG_EXIT); + return; + } + + // Create a dialog & configure it + delete mConnMethodDialog; + mConnMethodDialog = new CmRadioDialog(this); + mConnMethodDialog->setType(CmRadioDialogTypeAccessPoint); + + // Add connection methods to the dialog + QStringList connectionMethods; + for (int i = 0; i < mConnMethods.count(); i++) { + connectionMethods << mConnMethods[i]->name; + } + mConnMethodDialog->setItems(connectionMethods); + + // Set selection + int index = findConnectionMethod(mSelection.id); + if (index == ItemNotFound) { + // Connection Method not found + index = 0; + } + mConnMethodDialog->setSelected(index); + + // Execute the dialog + bool connected = connect( + mConnMethodDialog, + SIGNAL(finished(bool)), + this, + SLOT(connMethodDialogResult(bool))); + Q_ASSERT(connected); + mConnMethodDialog->open(); + + OstTraceFunctionExit0(DUP1_CMAPPLSETTINGSUIPRIVATE_RUNCONNECTIONMETHODDIALOG_EXIT); +} + +/*! + Destination search function. + + @param destinationId Destination ID. + + @return Returns index if found, and ItemNotFound if not. + */ +int CmApplSettingsUiPrivate::findDestination(uint destinationId) const +{ + OstTraceFunctionEntry0(CMAPPLSETTINGSUIPRIVATE_FINDDESTINATION_ENTRY); + + int result = ItemNotFound; + + for (int i = 0; i < mDestinations.count(); i++) { + if (mDestinations[i]->id == destinationId) { + result = i; + break; + } + } + + OstTraceExt2( + TRACE_NORMAL, + CMAPPLSETTINGSUIPRIVATE_FINDDESTINATION, + "CmApplSettingsUiPrivate::findDestination;destinationId=%u;result=%d", + destinationId, + result); + + OstTraceFunctionExit0(CMAPPLSETTINGSUIPRIVATE_FINDDESTINATION_EXIT); + return result; +} + +/*! + Connection Method search function. + + @param connMethodId Connection Method ID. + + @return Returns index if found, and ItemNotFound if not. + */ +int CmApplSettingsUiPrivate::findConnectionMethod(uint connMethodId) const +{ + OstTraceFunctionEntry0(CMAPPLSETTINGSUIPRIVATE_FINDCONNECTIONMETHOD_ENTRY); + + int result = ItemNotFound; + + for (int i = 0; i < mConnMethods.count(); i++) { + if (mConnMethods[i]->id == connMethodId) { + result = i; + break; + } + } + + OstTraceExt2( + TRACE_NORMAL, + CMAPPLSETTINGSUIPRIVATE_FINDCONNECTIONMETHOD, + "CmApplSettingsUiPrivate::findConnectionMethod;connMethodId=%u;result=%d", + connMethodId, + result); + + OstTraceFunctionExit0(CMAPPLSETTINGSUIPRIVATE_FINDCONNECTIONMETHOD_EXIT); + return result; +} + +/*! + Emits the completion signal "finished(uint)". + + @param status Finishing status code. + */ +void CmApplSettingsUiPrivate::emitFinished(uint status) const +{ + OstTrace1( + TRACE_NORMAL, + CMAPPLSETTINGSUIPRIVATE_EMITFINISHED, + "CmApplSettingsUiPrivate::emitFinished;status=%u", + status); + emit q_ptr->finished(status); +} + +/*! + Destination dialog result handling slot. + + @param success Destination dialog result - TRUE if accepted. + */ +void CmApplSettingsUiPrivate::destinationDialogResult(bool success) +{ + OstTraceFunctionEntry0(CMAPPLSETTINGSUIPRIVATE_DESTINATIONDIALOGRESULT_ENTRY); + + if (success) { + // Dialog was accepted - user clicked "OK" + int index = mDestinationDialog->selected(); + if (mListItems.testFlag(CmApplSettingsUi::ShowConnectionMethods) + && index == mDestinations.count()) { + // Dedicated access point was selected + runConnectionMethodDialog(); + } else { + // Destination was selected + mSelection.result = CmApplSettingsUi::SelectionTypeDestination; + mSelection.id = mDestinations[index]->id; + emitFinished(CmApplSettingsUi::ApplSettingsErrorNone); + } + } else { + // Dialog was cancelled - user clicked "Cancel" + emitFinished(CmApplSettingsUi::ApplSettingsErrorCancel); + } + + OstTraceFunctionExit0(CMAPPLSETTINGSUIPRIVATE_DESTINATIONDIALOGRESULT_EXIT); +} + +/*! + Connection method dialog result handling slot. + + @param success Connection method dialog result - TRUE if accepted. + */ +void CmApplSettingsUiPrivate::connMethodDialogResult(bool success) +{ + OstTraceFunctionEntry0(CMAPPLSETTINGSUIPRIVATE_CONNMETHODDIALOGRESULT_ENTRY); + + if (success) { + // Dialog was accepted - user clicked "OK" + int index = mConnMethodDialog->selected(); + mSelection.result = CmApplSettingsUi::SelectionTypeConnectionMethod; + mSelection.id = mConnMethods[index]->id; + emitFinished(CmApplSettingsUi::ApplSettingsErrorNone); + } else { + // Dialog was cancelled - user clicked "Cancel" + emitFinished(CmApplSettingsUi::ApplSettingsErrorCancel); + } + + OstTraceFunctionExit0(CMAPPLSETTINGSUIPRIVATE_CONNMETHODDIALOGRESULT_EXIT); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/src/cmradiodialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/src/cmradiodialog.cpp Mon May 03 12:53:07 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: +* Dialog implementation for the CM Manager Application Settings UI. +* +*/ + +// System includes + +#include +#include +#include +#include +#include + +// User includes + +#include "cmradiodialog.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmradiodialogTraces.h" +#endif + + +/*! + \class CmRadioDialog + \brief Radio dutton dialog class for Application Settings UI. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. + + @param parent Parent object. +*/ +CmRadioDialog::CmRadioDialog(QObject *parent) : + QObject(parent), + mType(CmRadioDialogTypeDestination), + mLoader(), + mListItems(), + mDialog(), + mHeading(0), + mList(0), + mOkAction(0) +{ + OstTraceFunctionEntry0(CMRADIODIALOG_CMRADIODIALOG_ENTRY); + + mLoader = QSharedPointer(new HbDocumentLoader()); + loadDocml(); + + OstTraceFunctionExit0(CMRADIODIALOG_CMRADIODIALOG_EXIT); +} + +/*! + Destructor. +*/ +CmRadioDialog::~CmRadioDialog() +{ + OstTraceFunctionEntry0(DUP1_CMRADIODIALOG_CMRADIODIALOG_ENTRY); + OstTraceFunctionExit0(DUP1_CMRADIODIALOG_CMRADIODIALOG_EXIT); +} + +/*! + Heading setter. + + @param type Dialog type. +*/ +void CmRadioDialog::setType(CmRadioDialogType type) +{ + OstTraceFunctionEntry0(CMRADIODIALOG_SETTYPE_ENTRY); + + mType = type; + + OstTraceFunctionExit0(CMRADIODIALOG_SETTYPE_EXIT); +} + +/*! + Options setter. + + @param options Dialog options. + */ +void CmRadioDialog::setOptions(const QSet &options) +{ + OstTraceFunctionEntry0(CMRADIODIALOG_SETOPTIONS_ENTRY); + + mOptions = options; + + OstTraceFunctionExit0(CMRADIODIALOG_SETOPTIONS_EXIT); +} + +/*! + Radio button list items setter. + + @param list List of radio button item strings. +*/ +void CmRadioDialog::setItems(const QStringList &list) +{ + OstTraceFunctionEntry0(CMRADIODIALOG_SETITEMS_ENTRY); + + // Store the new items + mListItems = list; + + // Append "Dedicated access point" + if (mOptions.contains(CmRadioDialogOptDedicatedAP)) { + mListItems.append(hbTrId("txt_occ_list_dedicated_access_point")); + } + + // Set the items to the radio list + mList->setItems(mListItems); + + OstTraceFunctionExit0(CMRADIODIALOG_SETITEMS_EXIT); +} + +/*! + Setter for current selection. + + @param index Radio list item current selection setter. Indexing from zero. +*/ +void CmRadioDialog::setSelected(int index) +{ + OstTraceFunctionEntry0(CMRADIODIALOG_SETSELECTED_ENTRY); + + OstTrace1( + TRACE_NORMAL, + CMRADIODIALOG_SETSELECTED, + "CmRadioDialog::setSelected;index=%d", + index); + + // The index must be valid + Q_ASSERT(index < mList->items().count()); + + // Set the current selection + mList->setSelected(index); + + OstTraceFunctionExit0(CMRADIODIALOG_SETSELECTED_EXIT); +} + +/*! + Getter for current selection. + + @return Current selection index. Indexing from zero. +*/ +int CmRadioDialog::selected() const +{ + OstTraceFunctionEntry0(CMRADIODIALOG_SELECTED_ENTRY); + + int selection = mList->selected(); + + OstTrace1( + TRACE_NORMAL, + CMRADIODIALOG_SELECTED, + "CmRadioDialog::selected;index=%d", + index); + + OstTraceFunctionExit0(CMRADIODIALOG_SELECTED_EXIT); + return selection; +} + +/*! + Run the dialog asynchronously. When the dialog has finished, the signal + finished(bool) is sent. +*/ +void CmRadioDialog::open() +{ + OstTraceFunctionEntry0(CMRADIODIALOG_EXEC_ENTRY); + + setHeading(); + mDialog->open(this, SLOT(dialogClosed(HbAction*))); + + OstTraceFunctionExit0(CMRADIODIALOG_EXEC_EXIT); +} + +/*! + Dialog result handling slot. + + @param action Selected action. + */ +void CmRadioDialog::dialogClosed(HbAction *action) +{ + OstTraceFunctionEntry0(CMRADIODIALOG_DIALOGCLOSED_ENTRY); + + // Extract the selection status + bool success; + if (action == mOkAction) { + success = true; + } else { + success = false; + } + emit finished(success); + + OstTraceExt1( + TRACE_NORMAL, + CMRADIODIALOG_EXEC_RESULT, + "CmRadioDialog::exec;success=%hhu", + success); + + OstTraceFunctionExit0(CMRADIODIALOG_DIALOGCLOSED_EXIT); +} + +/*! + Dialog heading setter. + */ +void CmRadioDialog::setHeading() +{ + OstTraceFunctionEntry0(CMRADIODIALOG_SETHEADING_ENTRY); + + QString heading; + + // Select correct header based on dialog type + switch (mType) { + case CmRadioDialogTypeDestination: + heading = hbTrId("txt_occ_title_network_connection"); + break; + + case CmRadioDialogTypeAccessPoint: + heading = hbTrId("txt_occ_title_access_point"); + break; + +#ifndef QT_NO_DEBUG + default: + // Unsupported dialog type detected + Q_ASSERT(0); + break; +#endif + } + + mHeading->setPlainText(heading); + + OstTraceFunctionExit0(CMRADIODIALOG_SETHEADING_EXIT); +} + +/*! + Docml loading for the dialog. +*/ +void CmRadioDialog::loadDocml() +{ + OstTraceFunctionEntry0(CMRADIODIALOG_LOADDOCML_ENTRY); + bool ok = false; + + // Load the common section + mLoader->load(":/docml/cmradiodialog.docml", &ok); + Q_ASSERT(ok); + + mDialog = QSharedPointer(qobject_cast(mLoader->findWidget("dialog"))); + Q_ASSERT(mDialog); + + mHeading = qobject_cast(mLoader->findWidget("heading")); + Q_ASSERT(mHeading); + + mList = qobject_cast(mLoader->findWidget("radioButtonList")); + Q_ASSERT(mList); + + mOkAction = qobject_cast(mLoader->findObject("okAction")); + Q_ASSERT(mOkAction); + + OstTraceFunctionExit0(CMRADIODIALOG_LOADDOCML_EXIT); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/src/cmsettingdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/src/cmsettingdata.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,324 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Data handling encapsulation for CM Application Settings UI. +* +*/ + +// System includes +#include + +// User includes +#include "cmsettingdata.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmsettingdataTraces.h" +#endif + + +/*! + \class CmSettingData + \brief Cm Manager settings data wrapper class for Application Settings UI. + + This class fetches, catches exceptions, filters and orders the + destinations and connection methods needed by Application Settings UI. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. +*/ +CmSettingData::CmSettingData() : + mBearers(), + mCmManager() +{ + OstTraceFunctionEntry0(CMSETTINGDATA_CMSETTINGDATA_ENTRY); + OstTraceFunctionExit0(CMSETTINGDATA_CMSETTINGDATA_EXIT); +} + +/*! + Destructor. +*/ +CmSettingData::~CmSettingData() +{ + OstTraceFunctionEntry0(DUP1_CMSETTINGDATA_CMSETTINGDATA_ENTRY); + OstTraceFunctionExit0(DUP1_CMSETTINGDATA_CMSETTINGDATA_EXIT); +} + +/*! + Bearer filter setter function. + + @param[in] bearers Connection Method bearer filter. +*/ +void CmSettingData::setBearerFilter(const QSet &bearers) +{ + OstTraceFunctionEntry0(CMSETTINGDATA_SETBEARERFILTER_ENTRY); + + mBearers = bearers; + + OstTraceFunctionExit0(CMSETTINGDATA_SETBEARERFILTER_EXIT); +} + +/*! + Fetches destinations suitable for Application Selection UI Dialog. + + @param[out] destinations Destination list. + + @return Settings fetching status - true if reading succeeded. +*/ +bool CmSettingData::fetchDestinations( + QList< QSharedPointer > &destinations) +{ + OstTraceFunctionEntry0(CMSETTINGDATA_FETCHDESTINATIONS_ENTRY); + + bool success = false; + + // Clear the list just in case + destinations.clear(); + + // Catch all CM Manager exceptions + try { + getCmManager(); + + // Fetch all destinations + QList destArray; + mCmManager->allDestinations(destArray); + int count = destArray.count(); + + OstTrace1( + TRACE_NORMAL, + CMSETTINGDATA_FETCHDESTINATIONS_RETRIEVED, + "CmSettingData::fetchDestinations retrieved;count=%d", + count); + + // Go through all destinations + for (int i=0; i < count; i++) { + QSharedPointer destination; + destination = QSharedPointer( + mCmManager->destination(destArray[i])); + // Append to list if destination is OK + if (validateDestination(destination.data())) { + QSharedPointer dest(new Destination); + dest->id = destination->id(); + dest->name = destination->name(); + destinations.append(dest); + } + } + + // Destinations fetched successfully + success = true; + } catch (const std::exception &ex) { + int error = qt_symbian_exception2Error(ex); + OstTrace1( + TRACE_NORMAL, + CMSETTINGDATA_FETCHDESTINATIONS_EXCEPTION, + "CmSettingData::fetchDestinations exception;error=%d", + error); + } + + OstTraceFunctionExit0(CMSETTINGDATA_FETCHDESTINATIONS_EXIT); + return success; +} + +/*! + Fetching of connection methods suitable for Application Selection UI Dialog. + + @param[out] connMethods Connection Method list. + + @return Settings fetching status - true if reading succeeded. + */ +bool CmSettingData::fetchConnMethods( + QList< QSharedPointer > &connMethods) +{ + OstTraceFunctionEntry0(CMSETTINGDATA_FETCHCONNMETHODS_ENTRY); + + bool success = false; + + // Clear the list just in case + connMethods.clear(); + + // Catch all CM Manager exceptions + try { + getCmManager(); + + // Fetch all connection methods + QList connMethodList; + mCmManager->connectionMethod(connMethodList, false); + int count = connMethodList.count(); + + OstTrace1( + TRACE_NORMAL, + CMSETTINGDATA_FETCHCONNMETHODS_RETRIEVED, + "CmSettingData::fetchConnMethods retrieved;count=%d", + count); + + // Go through all connection methods + for (int i=0; i < count; i++) { + QSharedPointer connMethod; + connMethod = QSharedPointer( + mCmManager->connectionMethod(connMethodList[i])); + // Append to list if connection method is OK + if (validateConnMethod(connMethod.data())) { + QSharedPointer connectionMethod(new ConnMethod); + connectionMethod->id = connMethod->getIntAttribute( + CMManagerShim::CmId); + connectionMethod->name = connMethod->getStringAttribute( + CMManagerShim::CmName); + connMethods.append(connectionMethod); + } + } + + // Destinations fetched successfully + success = true; + } catch (const std::exception &ex) { + int error = qt_symbian_exception2Error(ex); + OstTrace1( + TRACE_NORMAL, + CMSETTINGDATA_FETCHCONNMETHODS_EXCEPTION, + "CmSettingData::fetchDestinations exception;error=%d", + error); + } + + // Order the list by connection method name + qSort( + connMethods.begin(), + connMethods.end(), + CmSettingData::connMethodLessThan); + + OstTraceFunctionExit0(CMSETTINGDATA_FETCHCONNMETHODS_EXIT); + return success; +} + +/*! + Instantiates Cm Manager Shim for this setting data object. + This is a member function since this can throw an exception and it + needs to be catched. + */ +void CmSettingData::getCmManager() +{ + if (!mCmManager) { + mCmManager = QSharedPointer(new CmManagerShim()); + } +} + +/*! + Validates the given destination. + This function checks that the following criterias match: + -The destination is not empty (i.e. it has least one Connection Method). + This covers also the bearer filter, so there must be at least one + Connection Method after the bearer filtering. + -The destination is not hidden. + + @param[in] destination Destination to validate. + + @return Validation result - true if valid. + */ +bool CmSettingData::validateDestination(CmDestinationShim *destination) const +{ + OstTraceFunctionEntry0(CMSETTINGDATA_VALIDATEDESTINATION_ENTRY); + + bool valid = true; + + // Destination must not be hidden or empty + if (destination->isHidden() || + destination->connectionMethodCount() == 0) { + valid = false; + } else if (!mBearers.isEmpty()) { + // If filter is empty, all bearers are supported + + // Check that there is at least one Connection Method that + // matches after bearer filtering + valid = false; + for (int i=0; i < destination->connectionMethodCount(); i++) { + QSharedPointer connMethod; + connMethod = QSharedPointer( + destination->connectionMethod(i)); + int bearer = connMethod->getIntAttribute(CMManagerShim::CmBearerType); + if (mBearers.contains(bearer)) { + // Matching bearer found from this Connection Method + valid = true; + break; + } + } + } + + OstTraceExt2( + TRACE_NORMAL, + CMSETTINGDATA_VALIDATEDESTINATION_RESULT, + "CmSettingData::validateDestination result;destination=%d;valid=%hhd", + (TInt32)destination->id(), + valid); + + OstTraceFunctionExit0(CMSETTINGDATA_VALIDATEDESTINATION_EXIT); + return valid; +} + +/*! + Validates the given connection method. + This function checks that the following criterias match: + -The bearer type of the connection method matches the set filter. + -The connection method is not hidden. + + @param[in] connMethod Connection method to validate. + + @return Validation result - true if valid. + */ +bool CmSettingData::validateConnMethod(CmConnectionMethodShim *connMethod) const +{ + OstTraceFunctionEntry0(CMSETTINGDATA_VALIDATECONNMETHOD_ENTRY); + + bool valid = true; + + int bearer = connMethod->getIntAttribute(CMManagerShim::CmBearerType); + bool hidden = connMethod->getBoolAttribute(CMManagerShim::CmHidden); + if (hidden || (!mBearers.isEmpty() && !mBearers.contains(bearer))) { + valid = false; + } + + OstTraceExt4( + TRACE_NORMAL, + CMSETTINGDATA_VALIDATECONNMETHOD_RESULT, + "CmSettingData::validateConnMethod result;id=%d;valid=%hhd;hidden=%hhd;bearer=%d", + connMethod->getIntAttribute(CMManagerShim::CmId), + valid, + hidden, + bearer); + + OstTraceFunctionEntry0(CMSETTINGDATA_VALIDATECONNMETHOD_EXIT); + return valid; +} + +/*! + Compares two Connection Methods. + + @param[in] connMethod1 Connection method to compare with. + @param[in] connMethod2 Connection method to compare. + + @return Returns true if the first connection method is "less than" + the second one. + */ +bool CmSettingData::connMethodLessThan( + const QSharedPointer connMethod1, + const QSharedPointer connMethod2) +{ + int result = HbStringUtil::compareC(connMethod1->name, connMethod2->name); + return (result < 0) ? true : false; +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/traces/OstTraceDefinitions.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,20 @@ +/* + * 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 OSTTRACEDEFINITIONS_H +#define OSTTRACEDEFINITIONS_H +#include +#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/tsrc.pro Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,26 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +SUBDIRS += \ + tst_applsettingsui + +CONFIG += ordered + +symbian: { + SYMBIAN_PLATFORMS = WINSCW ARMV5 +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/inc/applsettester.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/inc/applsettester.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Dialog implementaton for test application +* for testing CM Manager Application Settings Ui. +*/ + +#ifndef APPLSETTESTER_H +#define APPLSETTESTER_H + +#include +#include + +#include "cmapplsettingsui.h" + +class HbDocumentLoader; +class HbCheckBox; +class HbAction; +class HbLabel; +class HbLineEdit; +class HbComboBox; + +class ApplSettTester : public HbMainWindow +{ + Q_OBJECT + +public: + ApplSettTester(QWidget *parent = 0); + ~ApplSettTester(); + +private slots: + void runTest(); + void docmlLoad(Qt::Orientation orientation); + void orientationChange(Qt::Orientation); + void showResult(uint retval); + +private: + + HbDocumentLoader *docLoader; + HbView *view; + HbAction *action; + HbCheckBox *checkboxDest; + HbCheckBox *checkboxCM; + HbCheckBox *checkboxWlan; + HbCheckBox *checkboxGprs; + HbLabel *labelResult; + HbLineEdit *selectionId; + HbComboBox *selectionMode; + + CmApplSettingsUi *applSett; + + CmApplSettingsUi::SettingSelection mSelection; +}; + +#endif // APPLSETTESTER_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/res/tst_applsettingsui.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/res/tst_applsettingsui.qrc Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,5 @@ + + + tst_applsettingsui.docml + + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/rom/tst_applsettingsui.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/rom/tst_applsettingsui.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,31 @@ +/* + * 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 CMAPPLSETTINGSUI_TEST_IBY +#define CMAPPLSETTINGSUI_TEST_IBY + +#include + +#define UPGRADABLE_APP_REG_RSC(NAME) data=DATAZ_\PRIVATE\10003A3F\IMPORT\APPS\ ## NAME ## _reg.rsc Private\10003a3f\import\apps\ ## NAME ## _reg.rsc + +S60_APP_EXE(tst_applsettingsui) +S60_APP_RESOURCE(tst_applsettingsui) +UPGRADABLE_APP_REG_RSC(tst_applsettingsui) + +data=DATAZ_\system\install\tst_applsettingsui_stub.sis system\install\tst_applsettingsui_stub.sis + +#endif // CMAPPLSETTINGSUI_TEST_IBY diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/rom/tst_applsettingsui_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/rom/tst_applsettingsui_stub.pkg Mon May 03 12:53:07 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: This is the stub package file for tst_applsettingsui SIS creation +; + +; Languages +&EN + +; Header +#{"tst_applsettingsui"},(0x2002E69A),1,0,0,TYPE=SA + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Stub Files +""-"z:\sys\bin\tst_applsettingsui.exe" +""-"z:\private\10003a3f\import\apps\tst_applsettingsui_reg.rsc" +""-"z:\resource\apps\tst_applsettingsui.r*" diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/rom/tst_applsettingsui_stub.sis Binary file cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/rom/tst_applsettingsui_stub.sis has changed diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/src/applsettester.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/src/applsettester.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,167 @@ +/* +* 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: +* Dialog implementaton for test application +* for testing CM Manager Application Settings Ui. +*/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "cmapplsettingsui.h" +#include "cmmanagerdefines_shim.h" + +#include "applsettester.h" + +#define TEST_DOCML ":/docml/tst_applsettingsui.docml" + +ApplSettTester::ApplSettTester(QWidget *parent) : HbMainWindow(parent) +{ + applSett = new CmApplSettingsUi(this); + + // Clear initial selection + mSelection.result = CmApplSettingsUi::SelectionTypeDestination; + mSelection.id = 0; + + bool status = connect( + this, + SIGNAL(orientationChanged(Qt::Orientation)), + this, + SLOT(orientationChange(Qt::Orientation))); + Q_ASSERT(status); + + docLoader = new HbDocumentLoader(); + docmlLoad(this->orientation()); +} + +ApplSettTester::~ApplSettTester() +{ + delete docLoader; +} + +void ApplSettTester::docmlLoad(Qt::Orientation orientation) +{ + bool ok = true; + + docLoader->reset(); + // First load the common section + docLoader->load(TEST_DOCML, &ok); + + if (ok) { + // Then load the orientation specific section + orientationChange(orientation); + + QGraphicsWidget *widget = docLoader->findWidget(QString("testApplView")); + if (widget) { + view = qobject_cast(widget); + this->addView(view); + this->setCurrentView(view); + + checkboxDest = qobject_cast(docLoader->findWidget("checkbox_dest")); + Q_ASSERT(checkboxDest); + checkboxCM = qobject_cast(docLoader->findWidget("checkbox_cm")); + Q_ASSERT(checkboxCM); + + checkboxWlan = qobject_cast(docLoader->findWidget("checkbox_wlan")); + Q_ASSERT(checkboxWlan); + checkboxGprs = qobject_cast(docLoader->findWidget("checkbox_gprs")); + Q_ASSERT(checkboxGprs); + + selectionMode = qobject_cast(docLoader->findWidget("mode")); + Q_ASSERT(selectionMode); + selectionId = qobject_cast(docLoader->findWidget("id")); + Q_ASSERT(selectionId); + + labelResult = qobject_cast(docLoader->findWidget("result")); + Q_ASSERT(labelResult); + + action = qobject_cast(docLoader->findObject("testAction")); + Q_ASSERT(action); + + bool status = connect(action, SIGNAL(triggered()), this, SLOT(runTest())); + Q_ASSERT(status); + } + } +} + +void ApplSettTester::orientationChange(Qt::Orientation orientation) +{ + bool ok = true; + if (orientation == Qt::Vertical) { + // reading "portrait" section + docLoader->load(TEST_DOCML, "portrait", &ok); + } else { + // reading "landscape" section + docLoader->load(TEST_DOCML, "landscape", &ok); + } +} + +void ApplSettTester::runTest() +{ + QFlags listItems; + QSet filter; + + // Dialog type selection + if (checkboxDest->checkState()) { + listItems |= CmApplSettingsUi::ShowDestinations; + } + if (checkboxCM->checkState()) { + listItems |= CmApplSettingsUi::ShowConnectionMethods; + } + + // Bearer filtering + if (checkboxWlan->checkState()) { + filter |= CMManagerShim::BearerTypeWlan; + } + if (checkboxGprs->checkState()) { + filter |= CMManagerShim::BearerTypePacketData; + } + + // Setting selection value + mSelection.result = + (CmApplSettingsUi::SelectionType)selectionMode->currentIndex(); + mSelection.id = selectionId->text().toUInt();; + + applSett->setOptions(listItems, filter); + applSett->setSelection(mSelection); + + // Connect finished(uint) signal and handle result via it + connect(applSett, SIGNAL(finished(uint)), this, SLOT(showResult(uint))); + + // Start CmApplSettingsUi + applSett->open(); +} + +void ApplSettTester::showResult(uint retval) +{ + if (retval == CmApplSettingsUi::ApplSettingsErrorNone) { + mSelection = applSett->selection(); + selectionMode->setCurrentIndex(mSelection.result); + selectionId->setText(QString::number(mSelection.id)); + } + labelResult->setNumber(int(retval)); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/src/tst_applsettingsui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/src/tst_applsettingsui.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,30 @@ +/* +* 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: Simple test/example client for Qt Application Settings UI interface. +* +*/ +#include + +#include "cmapplsettingsui.h" +#include "applsettester.h" + +int main(int argc, char *argv[]) +{ + HbApplication app(argc, argv); + + ApplSettTester tester; + tester.show(); + + return app.exec(); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/tst_applsettingsui.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/tst_applsettingsui/tst_applsettingsui.pro Mon May 03 12:53:07 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: +# + +TEMPLATE = app +TARGET = tst_applsettingsui +TARGET.CAPABILITY = ALL -TCB +DEPENDPATH += . +INCLUDEPATH += \ + . \ + inc \ + ../../inc \ + ../../../../inc +load(hb.prf) +RESOURCES = res/tst_applsettingsui.qrc +MOC_DIR = moc + +# Input +HEADERS += \ + inc/applsettester.h +SOURCES += \ + src/applsettester.cpp \ + src/tst_applsettingsui.cpp + +symbian*: { + CONFIG -= symbian_i18n + LIBS += -lcmapplsettingsui + TARGET.UID3 = 0x2002E69A + SYMBIAN_PLATFORMS = WINSCW ARMV5 +} + +symbian: { + BLD_INF_RULES.prj_exports += "rom/tst_applsettingsui.iby CORE_MW_LAYER_IBY_EXPORT_PATH(tst_applsettingsui.iby)" + BLD_INF_RULES.prj_exports += "rom/tst_applsettingsui_stub.sis /epoc32/data/z/system/install/tst_applsettingsui_stub.sis" +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/ut/hbautotest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/ut/hbautotest.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,831 @@ +/* +* 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 "hbautotest.h" +#include +#include + + +const qreal STEP = 4; //How many pixels to drag before sending an event + +//Init static members +bool HbAutoTest::pointerPressed = false; +QPointF HbAutoTest::pressPoint = QPointF(); + +void HbAutoTest::mouseMove (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos, int delay) +{ + if (delay!=-1) { + QTest::qWait(delay); + } + QPointF targetPoint=QPointF(); + if (pos==QPointF()) { + targetPoint = middlePointOfWidget(widget); + } else { + targetPoint = widget->mapToScene(pos); + } + if (pointerPressed) { + //Now we should drag an item + drag(window, targetPoint); + HbAutoTestMouseEvent me ( + QEvent::MouseMove, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::NoButton, + Qt::NoButton, + Qt::NoModifier); + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + QTest::qWait(1); + } else { + HbAutoTestMouseEvent me ( + QEvent::MouseMove, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::NoButton, + Qt::NoButton, + Qt::NoModifier); + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + QTest::qWait(1); + + } + QTest::qWait(1); + QTest::qWait(1); +} + +void HbAutoTest::mousePress (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos, int delay) +{ + if (delay!=-1) { + QTest::qWait(delay); + } + pointerPressed=true; + QPointF targetPoint=QPointF(); + if (pos==QPointF()) { + targetPoint = middlePointOfWidget(widget); + } else { + targetPoint = widget->mapToScene(pos); + } + QCursor::setPos(window->mapToGlobal(targetPoint.toPoint())); + + pressPoint=targetPoint; + + HbAutoTestMouseEvent me ( + QEvent::MouseButtonPress, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::LeftButton, + Qt::LeftButton, + Qt::NoModifier); + + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + QCoreApplication::sendPostedEvents(); + QTest::qWait(1); +} + +void HbAutoTest::mouseRelease (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos, int delay) +{ + if (delay!=-1) { + QTest::qWait(delay); + } + pointerPressed=false; + QPointF targetPoint=QPointF(); + if (pos==QPointF()) { + targetPoint = middlePointOfWidget(widget); + } else { + targetPoint = widget->mapToScene(pos); + } + QCursor::setPos(window->mapToGlobal(targetPoint.toPoint())); + pressPoint=QPointF(); + HbAutoTestMouseEvent me ( + QEvent::MouseButtonRelease, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::LeftButton, + Qt::NoButton, + Qt::NoModifier); + + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + + QTest::qWait(1); + QTest::qWait(1); +} + +void HbAutoTest::mouseClick (HbAutoTestMainWindow *window, const HbWidget *widget, QPointF pos, int delay) +{ + if (delay!=-1) { + QTest::qWait(delay); + } + QPointF targetPoint=QPointF(); + if (pos==QPointF()) { + targetPoint = middlePointOfWidget(widget); + } else { + targetPoint = widget->mapToScene(pos); + } + + QCursor::setPos(window->mapToGlobal(targetPoint.toPoint())); + + HbAutoTestMouseEvent me ( + QEvent::MouseButtonPress, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::LeftButton, + Qt::LeftButton, + Qt::NoModifier); + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + QTest::qWait(1); + + if (delay!=-1) { + QTest::qWait(delay); + } + HbAutoTestMouseEvent me2 ( + QEvent::MouseButtonRelease, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::LeftButton, + Qt::NoButton, + Qt::NoModifier); + + QSpontaneKeyEvent::setSpontaneous(&me2); + qApp->notify((window->viewport()), &me2); + QCoreApplication::sendPostedEvents(); + + QTest::qWait(1); + QTest::qWait(1); +} + +QPointF HbAutoTest::middlePointOfWidget( const HbWidget* widget) +{ + QRectF widgetRect = widget->rect(); + QRectF widgetSceneRect = widget->mapRectToScene(widgetRect); + qreal middleX = ((widgetSceneRect.right() - widgetSceneRect.left())/2)+widgetSceneRect.left(); + qreal middleY = ((widgetSceneRect.bottom() - widgetSceneRect.top())/2)+widgetSceneRect.top(); + return QPointF(middleX,middleY); +} + + + +void HbAutoTest::drag(HbAutoTestMainWindow *window, QPointF targetPoint) +{ + qreal tempX = targetPoint.x() - pressPoint.x(); + qreal tempY = targetPoint.y() - pressPoint.y(); + qreal totalTrip = sqrt ((tempX * tempX) + (tempY * tempY)); + + int numberOfSteps = qRound(totalTrip / STEP); + HbAutoTestMouseEvent me ( + QEvent::MouseMove, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::NoButton , + Qt::LeftButton, + Qt::NoModifier); + + QPointF nextPanPoint=pressPoint; + for (int i=1; imapToGlobal(nextPanPoint.toPoint())); + + me = HbAutoTestMouseEvent (QEvent::MouseMove, + nextPanPoint.toPoint(), + window->viewport()->mapToGlobal(nextPanPoint.toPoint()), + Qt::NoButton, + Qt::LeftButton, + Qt::NoModifier); + + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + } + + QCursor::setPos(window->mapToGlobal(targetPoint.toPoint())); + + //One more (or the only one) step to the target + me = HbAutoTestMouseEvent (QEvent::MouseMove, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::NoButton, + Qt::LeftButton, + Qt::NoModifier); + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); +} + + +void HbAutoTest::simulateEvent(QWidget *widget, bool press, int code, + Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay) + { + //Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + /*extern int Q_TESTLIB_EXPORT defaultKeyDelay(); + + if (delay == -1 || delay < defaultKeyDelay()) + delay = defaultKeyDelay(); + if(delay > 0) + QTest::qWait(delay);*/ + Q_UNUSED(delay); + QTest::qWait(10); //TODO: Remove this and reveal above out-commented code + + HbAutoTestKeyEvent a(press ? QEvent::KeyPress : QEvent::KeyRelease, code, modifier, text, repeat); + QSpontaneKeyEvent::setSpontaneous(&a); + if (!qApp->notify(widget, &a)) + QTest::qWarn("Keyboard event not accepted by receiving widget"); + } + +void HbAutoTest::sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, + QString text, Qt::KeyboardModifiers modifier, int delay) + { + QTEST_ASSERT(qApp); + + if (!widget) + widget = QWidget::keyboardGrabber(); + if (!widget) { + if (QWidget *apw = QApplication::activePopupWidget()) + widget = apw->focusWidget() ? apw->focusWidget() : apw; + else + widget = QApplication::focusWidget(); + } + if (!widget) + widget = QApplication::activeWindow(); + + QTEST_ASSERT(widget); + + if (action == QTest::Click) { + QPointer ptr(widget); + sendKeyEvent(QTest::Press, widget, code, text, modifier, delay); + if (!ptr) { + // if we send key-events to embedded widgets, they might be destroyed + // when the user presses Return + return; + } + sendKeyEvent(QTest::Release, widget, code, text, modifier, delay); + return; + } + + bool repeat = false; + + if (action == QTest::Press) { + if (modifier & Qt::ShiftModifier) + simulateEvent(widget, true, Qt::Key_Shift, 0, QString(), false, delay); + + if (modifier & Qt::ControlModifier) + simulateEvent(widget, true, Qt::Key_Control, modifier & Qt::ShiftModifier, QString(), false, delay); + + if (modifier & Qt::AltModifier) + simulateEvent(widget, true, Qt::Key_Alt, + modifier & (Qt::ShiftModifier | Qt::ControlModifier), QString(), false, delay); + if (modifier & Qt::MetaModifier) + simulateEvent(widget, true, Qt::Key_Meta, modifier & (Qt::ShiftModifier + | Qt::ControlModifier | Qt::AltModifier), QString(), false, delay); + simulateEvent(widget, true, code, modifier, text, repeat, delay); + } else if (action == QTest::Release) { + simulateEvent(widget, false, code, modifier, text, repeat, delay); + + if (modifier & Qt::MetaModifier) + simulateEvent(widget, false, Qt::Key_Meta, modifier, QString(), false, delay); + if (modifier & Qt::AltModifier) + simulateEvent(widget, false, Qt::Key_Alt, modifier & + (Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier), QString(), false, delay); + + if (modifier & Qt::ControlModifier) + simulateEvent(widget, false, Qt::Key_Control, + modifier & (Qt::ShiftModifier | Qt::ControlModifier), QString(), false, delay); + + if (modifier & Qt::ShiftModifier) + simulateEvent(widget, false, Qt::Key_Shift, modifier & Qt::ShiftModifier, QString(), false, delay); + } + } + +void HbAutoTest::sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, + char ascii, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + QString text; + if (ascii) + text = QString(QChar::fromLatin1(ascii)); + sendKeyEvent(action, widget, code, text, modifier, delay); + } + +void HbAutoTest::keyEvent(QTest::KeyAction action, QWidget *widget, char ascii, + Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + sendKeyEvent(action, widget, asciiToKey(ascii), ascii, modifier, delay); + } + +void HbAutoTest::keyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key key, + Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + sendKeyEvent(action, widget, key, keyToAscii(key), modifier, delay); + } + +void HbAutoTest::keyClicks(QWidget *widget, const QString &sequence, + Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + for (int i=0; i < sequence.length(); i++) + keyEvent(QTest::Click, widget, sequence.at(i).toLatin1(), modifier, delay); + } + +void HbAutoTest::keyPress(QWidget *widget, char key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Press, widget, key, modifier, delay); + } + +void HbAutoTest::keyRelease(QWidget *widget, char key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Release, widget, key, modifier, delay); + } + +void HbAutoTest::keyClick(QWidget *widget, char key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Click, widget, key, modifier, delay); + } + +void HbAutoTest::keyPress(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Press, widget, key, modifier, delay); + } + +void HbAutoTest::keyRelease(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Release, widget, key, modifier, delay); } + +void HbAutoTest::keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Click, widget, key, modifier, delay); + } + +Qt::Key HbAutoTest::asciiToKey(char ascii) +{ + switch ((unsigned char)ascii) { + case 0x08: return Qt::Key_Backspace; + case 0x09: return Qt::Key_Tab; + case 0x0b: return Qt::Key_Backtab; + case 0x0d: return Qt::Key_Return; + case 0x1b: return Qt::Key_Escape; + case 0x20: return Qt::Key_Space; + case 0x21: return Qt::Key_Exclam; + case 0x22: return Qt::Key_QuoteDbl; + case 0x23: return Qt::Key_NumberSign; + case 0x24: return Qt::Key_Dollar; + case 0x25: return Qt::Key_Percent; + case 0x26: return Qt::Key_Ampersand; + case 0x27: return Qt::Key_Apostrophe; + case 0x28: return Qt::Key_ParenLeft; + case 0x29: return Qt::Key_ParenRight; + case 0x2a: return Qt::Key_Asterisk; + case 0x2b: return Qt::Key_Plus; + case 0x2c: return Qt::Key_Comma; + case 0x2d: return Qt::Key_Minus; + case 0x2e: return Qt::Key_Period; + case 0x2f: return Qt::Key_Slash; + case 0x30: return Qt::Key_0; + case 0x31: return Qt::Key_1; + case 0x32: return Qt::Key_2; + case 0x33: return Qt::Key_3; + case 0x34: return Qt::Key_4; + case 0x35: return Qt::Key_5; + case 0x36: return Qt::Key_6; + case 0x37: return Qt::Key_7; + case 0x38: return Qt::Key_8; + case 0x39: return Qt::Key_9; + case 0x3a: return Qt::Key_Colon; + case 0x3b: return Qt::Key_Semicolon; + case 0x3c: return Qt::Key_Less; + case 0x3d: return Qt::Key_Equal; + case 0x3e: return Qt::Key_Greater; + case 0x3f: return Qt::Key_Question; + case 0x40: return Qt::Key_At; + case 0x41: return Qt::Key_A; + case 0x42: return Qt::Key_B; + case 0x43: return Qt::Key_C; + case 0x44: return Qt::Key_D; + case 0x45: return Qt::Key_E; + case 0x46: return Qt::Key_F; + case 0x47: return Qt::Key_G; + case 0x48: return Qt::Key_H; + case 0x49: return Qt::Key_I; + case 0x4a: return Qt::Key_J; + case 0x4b: return Qt::Key_K; + case 0x4c: return Qt::Key_L; + case 0x4d: return Qt::Key_M; + case 0x4e: return Qt::Key_N; + case 0x4f: return Qt::Key_O; + case 0x50: return Qt::Key_P; + case 0x51: return Qt::Key_Q; + case 0x52: return Qt::Key_R; + case 0x53: return Qt::Key_S; + case 0x54: return Qt::Key_T; + case 0x55: return Qt::Key_U; + case 0x56: return Qt::Key_V; + case 0x57: return Qt::Key_W; + case 0x58: return Qt::Key_X; + case 0x59: return Qt::Key_Y; + case 0x5a: return Qt::Key_Z; + case 0x5b: return Qt::Key_BracketLeft; + case 0x5c: return Qt::Key_Backslash; + case 0x5d: return Qt::Key_BracketRight; + case 0x5e: return Qt::Key_AsciiCircum; + case 0x5f: return Qt::Key_Underscore; + case 0x60: return Qt::Key_QuoteLeft; + case 0x61: return Qt::Key_A; + case 0x62: return Qt::Key_B; + case 0x63: return Qt::Key_C; + case 0x64: return Qt::Key_D; + case 0x65: return Qt::Key_E; + case 0x66: return Qt::Key_F; + case 0x67: return Qt::Key_G; + case 0x68: return Qt::Key_H; + case 0x69: return Qt::Key_I; + case 0x6a: return Qt::Key_J; + case 0x6b: return Qt::Key_K; + case 0x6c: return Qt::Key_L; + case 0x6d: return Qt::Key_M; + case 0x6e: return Qt::Key_N; + case 0x6f: return Qt::Key_O; + case 0x70: return Qt::Key_P; + case 0x71: return Qt::Key_Q; + case 0x72: return Qt::Key_R; + case 0x73: return Qt::Key_S; + case 0x74: return Qt::Key_T; + case 0x75: return Qt::Key_U; + case 0x76: return Qt::Key_V; + case 0x77: return Qt::Key_W; + case 0x78: return Qt::Key_X; + case 0x79: return Qt::Key_Y; + case 0x7a: return Qt::Key_Z; + case 0x7b: return Qt::Key_BraceLeft; + case 0x7c: return Qt::Key_Bar; + case 0x7d: return Qt::Key_BraceRight; + case 0x7e: return Qt::Key_AsciiTilde; + + // Latin 1 codes adapted from X: keysymdef.h,v 1.21 94/08/28 16:17:06 + case 0xa0: return Qt::Key_nobreakspace; + case 0xa1: return Qt::Key_exclamdown; + case 0xa2: return Qt::Key_cent; + case 0xa3: return Qt::Key_sterling; + case 0xa4: return Qt::Key_currency; + case 0xa5: return Qt::Key_yen; + case 0xa6: return Qt::Key_brokenbar; + case 0xa7: return Qt::Key_section; + case 0xa8: return Qt::Key_diaeresis; + case 0xa9: return Qt::Key_copyright; + case 0xaa: return Qt::Key_ordfeminine; + case 0xab: return Qt::Key_guillemotleft; + case 0xac: return Qt::Key_notsign; + case 0xad: return Qt::Key_hyphen; + case 0xae: return Qt::Key_registered; + case 0xaf: return Qt::Key_macron; + case 0xb0: return Qt::Key_degree; + case 0xb1: return Qt::Key_plusminus; + case 0xb2: return Qt::Key_twosuperior; + case 0xb3: return Qt::Key_threesuperior; + case 0xb4: return Qt::Key_acute; + case 0xb5: return Qt::Key_mu; + case 0xb6: return Qt::Key_paragraph; + case 0xb7: return Qt::Key_periodcentered; + case 0xb8: return Qt::Key_cedilla; + case 0xb9: return Qt::Key_onesuperior; + case 0xba: return Qt::Key_masculine; + case 0xbb: return Qt::Key_guillemotright; + case 0xbc: return Qt::Key_onequarter; + case 0xbd: return Qt::Key_onehalf; + case 0xbe: return Qt::Key_threequarters; + case 0xbf: return Qt::Key_questiondown; + case 0xc0: return Qt::Key_Agrave; + case 0xc1: return Qt::Key_Aacute; + case 0xc2: return Qt::Key_Acircumflex; + case 0xc3: return Qt::Key_Atilde; + case 0xc4: return Qt::Key_Adiaeresis; + case 0xc5: return Qt::Key_Aring; + case 0xc6: return Qt::Key_AE; + case 0xc7: return Qt::Key_Ccedilla; + case 0xc8: return Qt::Key_Egrave; + case 0xc9: return Qt::Key_Eacute; + case 0xca: return Qt::Key_Ecircumflex; + case 0xcb: return Qt::Key_Ediaeresis; + case 0xcc: return Qt::Key_Igrave; + case 0xcd: return Qt::Key_Iacute; + case 0xce: return Qt::Key_Icircumflex; + case 0xcf: return Qt::Key_Idiaeresis; + case 0xd0: return Qt::Key_ETH; + case 0xd1: return Qt::Key_Ntilde; + case 0xd2: return Qt::Key_Ograve; + case 0xd3: return Qt::Key_Oacute; + case 0xd4: return Qt::Key_Ocircumflex; + case 0xd5: return Qt::Key_Otilde; + case 0xd6: return Qt::Key_Odiaeresis; + case 0xd7: return Qt::Key_multiply; + case 0xd8: return Qt::Key_Ooblique; + case 0xd9: return Qt::Key_Ugrave; + case 0xda: return Qt::Key_Uacute; + case 0xdb: return Qt::Key_Ucircumflex; + case 0xdc: return Qt::Key_Udiaeresis; + case 0xdd: return Qt::Key_Yacute; + case 0xde: return Qt::Key_THORN; + case 0xdf: return Qt::Key_ssharp; + case 0xe5: return Qt::Key_Aring; + case 0xe6: return Qt::Key_AE; + case 0xf7: return Qt::Key_division; + case 0xf8: return Qt::Key_Ooblique; + case 0xff: return Qt::Key_ydiaeresis; + default: QTEST_ASSERT(false); return Qt::Key(0); + } +} + +char HbAutoTest::keyToAscii(Qt::Key key) +{ + switch (key) { + case Qt::Key_Backspace: return 0x8; //BS + case Qt::Key_Tab: return 0x09; // HT + case Qt::Key_Backtab: return 0x0b; // VT + case Qt::Key_Enter: + case Qt::Key_Return: return 0x0d; // CR + case Qt::Key_Escape: return 0x1b; // ESC + case Qt::Key_Space: return 0x20; // 7 bit printable ASCII + case Qt::Key_Exclam: return 0x21; + case Qt::Key_QuoteDbl: return 0x22; + case Qt::Key_NumberSign: return 0x23; + case Qt::Key_Dollar: return 0x24; + case Qt::Key_Percent: return 0x25; + case Qt::Key_Ampersand: return 0x26; + case Qt::Key_Apostrophe: return 0x27; + case Qt::Key_ParenLeft: return 0x28; + case Qt::Key_ParenRight: return 0x29; + case Qt::Key_Asterisk: return 0x2a; + case Qt::Key_Plus: return 0x2b; + case Qt::Key_Comma: return 0x2c; + case Qt::Key_Minus: return 0x2d; + case Qt::Key_Period: return 0x2e; + case Qt::Key_Slash: return 0x2f; + case Qt::Key_0: return 0x30; + case Qt::Key_1: return 0x31; + case Qt::Key_2: return 0x32; + case Qt::Key_3: return 0x33; + case Qt::Key_4: return 0x34; + case Qt::Key_5: return 0x35; + case Qt::Key_6: return 0x36; + case Qt::Key_7: return 0x37; + case Qt::Key_8: return 0x38; + case Qt::Key_9: return 0x39; + case Qt::Key_Colon: return 0x3a; + case Qt::Key_Semicolon: return 0x3b; + case Qt::Key_Less: return 0x3c; + case Qt::Key_Equal: return 0x3d; + case Qt::Key_Greater: return 0x3e; + case Qt::Key_Question: return 0x3f; + case Qt::Key_At: return 0x40; + case Qt::Key_A: return 0x61; // 0x41 == 'A', 0x61 == 'a' + case Qt::Key_B: return 0x62; + case Qt::Key_C: return 0x63; + case Qt::Key_D: return 0x64; + case Qt::Key_E: return 0x65; + case Qt::Key_F: return 0x66; + case Qt::Key_G: return 0x67; + case Qt::Key_H: return 0x68; + case Qt::Key_I: return 0x69; + case Qt::Key_J: return 0x6a; + case Qt::Key_K: return 0x6b; + case Qt::Key_L: return 0x6c; + case Qt::Key_M: return 0x6d; + case Qt::Key_N: return 0x6e; + case Qt::Key_O: return 0x6f; + case Qt::Key_P: return 0x70; + case Qt::Key_Q: return 0x71; + case Qt::Key_R: return 0x72; + case Qt::Key_S: return 0x73; + case Qt::Key_T: return 0x74; + case Qt::Key_U: return 0x75; + case Qt::Key_V: return 0x76; + case Qt::Key_W: return 0x77; + case Qt::Key_X: return 0x78; + case Qt::Key_Y: return 0x79; + case Qt::Key_Z: return 0x7a; + case Qt::Key_BracketLeft: return 0x5b; + case Qt::Key_Backslash: return 0x5c; + case Qt::Key_BracketRight: return 0x5d; + case Qt::Key_AsciiCircum: return 0x5e; + case Qt::Key_Underscore: return 0x5f; + case Qt::Key_QuoteLeft: return 0x60; + + case Qt::Key_BraceLeft: return 0x7b; + case Qt::Key_Bar: return 0x7c; + case Qt::Key_BraceRight: return 0x7d; + case Qt::Key_AsciiTilde: return 0x7e; + + case Qt::Key_Delete: return 0; + case Qt::Key_Insert: return 0; // = 0x1006, + case Qt::Key_Pause: return 0; // = 0x1008, + case Qt::Key_Print: return 0; // = 0x1009, + case Qt::Key_SysReq: return 0; // = 0x100a, + + case Qt::Key_Clear: return 0; // = 0x100b, + + case Qt::Key_Home: return 0; // = 0x1010, // cursor movement + case Qt::Key_End: return 0; // = 0x1011, + case Qt::Key_Left: return 0; // = 0x1012, + case Qt::Key_Up: return 0; // = 0x1013, + case Qt::Key_Right: return 0; // = 0x1014, + case Qt::Key_Down: return 0; // = 0x1015, + case Qt::Key_PageUp: return 0; // = 0x1016, + case Qt::Key_PageDown: return 0; // = 0x1017, + case Qt::Key_Shift: return 0; // = 0x1020, // modifiers + case Qt::Key_Control: return 0; // = 0x1021, + case Qt::Key_Meta: return 0; // = 0x1022, + case Qt::Key_Alt: return 0; // = 0x1023, + case Qt::Key_CapsLock: return 0; // = 0x1024, + case Qt::Key_NumLock: return 0; // = 0x1025, + case Qt::Key_ScrollLock: return 0; // = 0x1026, + case Qt::Key_F1: return 0; // = 0x1030, // function keys + case Qt::Key_F2: return 0; // = 0x1031, + case Qt::Key_F3: return 0; // = 0x1032, + case Qt::Key_F4: return 0; // = 0x1033, + case Qt::Key_F5: return 0; // = 0x1034, + case Qt::Key_F6: return 0; // = 0x1035, + case Qt::Key_F7: return 0; // = 0x1036, + case Qt::Key_F8: return 0; // = 0x1037, + case Qt::Key_F9: return 0; // = 0x1038, + case Qt::Key_F10: return 0; // = 0x1039, + case Qt::Key_F11: return 0; // = 0x103a, + case Qt::Key_F12: return 0; // = 0x103b, + case Qt::Key_F13: return 0; // = 0x103c, + case Qt::Key_F14: return 0; // = 0x103d, + case Qt::Key_F15: return 0; // = 0x103e, + case Qt::Key_F16: return 0; // = 0x103f, + case Qt::Key_F17: return 0; // = 0x1040, + case Qt::Key_F18: return 0; // = 0x1041, + case Qt::Key_F19: return 0; // = 0x1042, + case Qt::Key_F20: return 0; // = 0x1043, + case Qt::Key_F21: return 0; // = 0x1044, + case Qt::Key_F22: return 0; // = 0x1045, + case Qt::Key_F23: return 0; // = 0x1046, + case Qt::Key_F24: return 0; // = 0x1047, + case Qt::Key_F25: return 0; // = 0x1048, // F25 .. F35 only on X11 + case Qt::Key_F26: return 0; // = 0x1049, + case Qt::Key_F27: return 0; // = 0x104a, + case Qt::Key_F28: return 0; // = 0x104b, + case Qt::Key_F29: return 0; // = 0x104c, + case Qt::Key_F30: return 0; // = 0x104d, + case Qt::Key_F31: return 0; // = 0x104e, + case Qt::Key_F32: return 0; // = 0x104f, + case Qt::Key_F33: return 0; // = 0x1050, + case Qt::Key_F34: return 0; // = 0x1051, + case Qt::Key_F35: return 0; // = 0x1052, + case Qt::Key_Super_L: return 0; // = 0x1053, // extra keys + case Qt::Key_Super_R: return 0; // = 0x1054, + case Qt::Key_Menu: return 0; // = 0x1055, + case Qt::Key_Hyper_L: return 0; // = 0x1056, + case Qt::Key_Hyper_R: return 0; // = 0x1057, + case Qt::Key_Help: return 0; // = 0x1058, + case Qt::Key_Direction_L: return 0; // = 0x1059, + case Qt::Key_Direction_R: return 0; // = 0x1060, + + // Latin 1 codes adapted from X: keysymdef.h,v 1.21 94/08/28 16:17:06 + case Qt::Key_nobreakspace: return char(0xa0); + case Qt::Key_exclamdown: return char(0xa1); + case Qt::Key_cent: return char(0xa2); + case Qt::Key_sterling: return char(0xa3); + case Qt::Key_currency: return char(0xa4); + case Qt::Key_yen: return char(0xa5); + case Qt::Key_brokenbar: return char(0xa6); + case Qt::Key_section: return char(0xa7); + case Qt::Key_diaeresis: return char(0xa8); + case Qt::Key_copyright: return char(0xa9); + case Qt::Key_ordfeminine: return char(0xaa); + case Qt::Key_guillemotleft: return char(0xab); // left angle quotation mar + case Qt::Key_notsign: return char(0xac); + case Qt::Key_hyphen: return char(0xad); + case Qt::Key_registered: return char(0xae); + case Qt::Key_macron: return char(0xaf); + case Qt::Key_degree: return char(0xb0); + case Qt::Key_plusminus: return char(0xb1); + case Qt::Key_twosuperior: return char(0xb2); + case Qt::Key_threesuperior: return char(0xb3); + case Qt::Key_acute: return char(0xb4); + case Qt::Key_mu: return char(0xb5); + case Qt::Key_paragraph: return char(0xb6); + case Qt::Key_periodcentered: return char(0xb7); + case Qt::Key_cedilla: return char(0xb8); + case Qt::Key_onesuperior: return char(0xb9); + case Qt::Key_masculine: return char(0xba); + case Qt::Key_guillemotright: return char(0xbb); // right angle quotation mar + case Qt::Key_onequarter: return char(0xbc); + case Qt::Key_onehalf: return char(0xbd); + case Qt::Key_threequarters: return char(0xbe); + case Qt::Key_questiondown: return char(0xbf); + case Qt::Key_Agrave: return char(0xc0); + case Qt::Key_Aacute: return char(0xc1); + case Qt::Key_Acircumflex: return char(0xc2); + case Qt::Key_Atilde: return char(0xc3); + case Qt::Key_Adiaeresis: return char(0xc4); + case Qt::Key_Aring: return char(0xe5); + case Qt::Key_AE: return char(0xe6); + case Qt::Key_Ccedilla: return char(0xc7); + case Qt::Key_Egrave: return char(0xc8); + case Qt::Key_Eacute: return char(0xc9); + case Qt::Key_Ecircumflex: return char(0xca); + case Qt::Key_Ediaeresis: return char(0xcb); + case Qt::Key_Igrave: return char(0xcc); + case Qt::Key_Iacute: return char(0xcd); + case Qt::Key_Icircumflex: return char(0xce); + case Qt::Key_Idiaeresis: return char(0xcf); + case Qt::Key_ETH: return char(0xd0); + case Qt::Key_Ntilde: return char(0xd1); + case Qt::Key_Ograve: return char(0xd2); + case Qt::Key_Oacute: return char(0xd3); + case Qt::Key_Ocircumflex: return char(0xd4); + case Qt::Key_Otilde: return char(0xd5); + case Qt::Key_Odiaeresis: return char(0xd6); + case Qt::Key_multiply: return char(0xd7); + case Qt::Key_Ooblique: return char(0xf8); + case Qt::Key_Ugrave: return char(0xd9); + case Qt::Key_Uacute: return char(0xda); + case Qt::Key_Ucircumflex: return char(0xdb); + case Qt::Key_Udiaeresis: return char(0xdc); + case Qt::Key_Yacute: return char(0xdd); + case Qt::Key_THORN: return char(0xde); + case Qt::Key_ssharp: return char(0xdf); + case Qt::Key_division: return char(0xf7); + case Qt::Key_ydiaeresis: return char(0xff); + + // multimedia/internet keys - ignored by default - see QKeyEvent c'tor + + case Qt::Key_Back : return 0; // = 0x1061, + case Qt::Key_Forward : return 0; // = 0x1062, + case Qt::Key_Stop : return 0; // = 0x1063, + case Qt::Key_Refresh : return 0; // = 0x1064, + + case Qt::Key_VolumeDown: return 0; // = 0x1070, + case Qt::Key_VolumeMute : return 0; // = 0x1071, + case Qt::Key_VolumeUp: return 0; // = 0x1072, + case Qt::Key_BassBoost: return 0; // = 0x1073, + case Qt::Key_BassUp: return 0; // = 0x1074, + case Qt::Key_BassDown: return 0; // = 0x1075, + case Qt::Key_TrebleUp: return 0; // = 0x1076, + case Qt::Key_TrebleDown: return 0; // = 0x1077, + + case Qt::Key_MediaPlay : return 0; // = 0x1080, + case Qt::Key_MediaStop : return 0; // = 0x1081, + case Qt::Key_MediaPrevious : return 0; // = 0x1082, + case Qt::Key_MediaNext : return 0; // = 0x1083, + case Qt::Key_MediaRecord: return 0; // = 0x1084, + + case Qt::Key_HomePage : return 0; // = 0x1090, + case Qt::Key_Favorites : return 0; // = 0x1091, + case Qt::Key_Search : return 0; // = 0x1092, + case Qt::Key_Standby: return 0; // = 0x1093, + case Qt::Key_OpenUrl: return 0; // = 0x1094, + + case Qt::Key_LaunchMail : return 0; // = 0x10a0, + case Qt::Key_LaunchMedia: return 0; // = 0x10a1, + case Qt::Key_Launch0 : return 0; // = 0x10a2, + case Qt::Key_Launch1 : return 0; // = 0x10a3, + case Qt::Key_Launch2 : return 0; // = 0x10a4, + case Qt::Key_Launch3 : return 0; // = 0x10a5, + case Qt::Key_Launch4 : return 0; // = 0x10a6, + case Qt::Key_Launch5 : return 0; // = 0x10a7, + case Qt::Key_Launch6 : return 0; // = 0x10a8, + case Qt::Key_Launch7 : return 0; // = 0x10a9, + case Qt::Key_Launch8 : return 0; // = 0x10aa, + case Qt::Key_Launch9 : return 0; // = 0x10ab, + case Qt::Key_LaunchA : return 0; // = 0x10ac, + case Qt::Key_LaunchB : return 0; // = 0x10ad, + case Qt::Key_LaunchC : return 0; // = 0x10ae, + case Qt::Key_LaunchD : return 0; // = 0x10af, + case Qt::Key_LaunchE : return 0; // = 0x10b0, + case Qt::Key_LaunchF : return 0; // = 0x10b1, + + default: QTEST_ASSERT(false); return 0; + } +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/ut/hbautotest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/ut/hbautotest.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,279 @@ +/* +* 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 HBAUTOTEST_H +#define HBAUTOTEST_H + +#include +#include +#include + +class HbMainWindow; +class HbWidget; +class HbAutoTestMainWindow; +class HbAutoTest; +class HbAutoTestMouseEvent; +/* +INSTRUCTIONS: +The class HbAutoTest is meant to be used with Orbit applications auto testing instead of GUI testing APIs of QTestLib. + +The functions of this class is to used similarily to the related QTestLib functions. + +Use HbAutoTestMainWindow (defined below) instead of HbMainWindow to enble filtering. +Filterin filters out UI events that are not sent by function defined in HbAutoTest class. + +*/ + +class HbAutoTestMouseEvent : public QMouseEvent +{ +public: + HbAutoTestMouseEvent(Type type, const QPoint & pos, const QPoint & globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers ) + : QMouseEvent(type,pos,globalPos,button,buttons,modifiers){} +}; + +class HbAutoTestKeyEvent : public QKeyEvent +{ +public: + HbAutoTestKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text = QString(), + bool autorep = false, ushort count = 1 ) + : QKeyEvent(type, key, modifiers, text, autorep, count){} +}; + +class HbAutoTest +{ +public: + + static void mouseMove (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos = QPointF(), int delay = -1 ); + static void mousePress (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos = QPointF(), int delay = -1); + static void mouseRelease (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos = QPointF(), int delay = -1); + static void mouseClick (HbAutoTestMainWindow *window, const HbWidget *widget, QPointF pos = QPointF(), int delay = -1); + +private: + static void drag(HbAutoTestMainWindow *window, QPointF targetPoint); + static QPointF middlePointOfWidget( const HbWidget* widget); + + static bool pointerPressed; + static QPointF pressPoint; + +//Key event Part: copy-pasted from QTestLib and modified to support HbAutoTestKeyEvent to enable filtering. +//see HbAutoTestMainWindow below. +public: + + static Qt::Key asciiToKey(char ascii); + static char keyToAscii(Qt::Key key); + + static void simulateEvent(QWidget *widget, bool press, int code, + Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay=-1); + + static void sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, + QString text, Qt::KeyboardModifiers modifier, int delay=-1); + + static void sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, + char ascii, Qt::KeyboardModifiers modifier, int delay=-1); + + static void keyEvent(QTest::KeyAction action, QWidget *widget, char ascii, + Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key key, + Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyClicks(QWidget *widget, const QString &sequence, + Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyPress(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyRelease(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyClick(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyPress(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyRelease(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); +}; + +class HbTestEvent +{ +public: + virtual void simulate(QWidget *w) = 0; + virtual HbTestEvent *clone() const = 0; + + virtual ~HbTestEvent() {} +}; + +class HbTestKeyEvent: public HbTestEvent +{ +public: + inline HbTestKeyEvent(QTest::KeyAction action, Qt::Key key, Qt::KeyboardModifiers modifiers, int delay) + : _action(action), _delay(delay), _modifiers(modifiers), _ascii(0), _key(key) {} + inline HbTestKeyEvent(QTest::KeyAction action, char ascii, Qt::KeyboardModifiers modifiers, int delay) + : _action(action), _delay(delay), _modifiers(modifiers), + _ascii(ascii), _key(Qt::Key_unknown) {} + inline HbTestEvent *clone() const { return new HbTestKeyEvent(*this); } + + inline void simulate(QWidget *w) + { + if (_ascii == 0) + HbAutoTest::keyEvent(_action, w, _key, _modifiers, _delay); + else + HbAutoTest::keyEvent(_action, w, _ascii, _modifiers, _delay); + } + +protected: + QTest::KeyAction _action; + int _delay; + Qt::KeyboardModifiers _modifiers; + char _ascii; + Qt::Key _key; +}; + +class HbTestKeyClicksEvent: public HbTestEvent +{ +public: + inline HbTestKeyClicksEvent(const QString &keys, Qt::KeyboardModifiers modifiers, int delay) + : _keys(keys), _modifiers(modifiers), _delay(delay) {} + inline HbTestEvent *clone() const { return new HbTestKeyClicksEvent(*this); } + + inline void simulate(QWidget *w) + { + HbAutoTest::keyClicks(w, _keys, _modifiers, _delay); + } + +private: + QString _keys; + Qt::KeyboardModifiers _modifiers; + int _delay; +}; + +class HbTestDelayEvent: public HbTestEvent +{ +public: + inline HbTestDelayEvent(int msecs): _delay(msecs) {} + inline HbTestEvent *clone() const { return new HbTestDelayEvent(*this); } + + inline void simulate(QWidget * /*w*/) { QTest::qWait(_delay); } + +private: + int _delay; +}; + +class HbTestEventList: public QList +{ +public: + inline HbTestEventList() {} + inline HbTestEventList(const HbTestEventList &other): QList() + { for (int i = 0; i < other.count(); ++i) append(other.at(i)->clone()); } + inline ~HbTestEventList() + { clear(); } + inline void clear() + { qDeleteAll(*this); QList::clear(); } + + inline void addKeyClick(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Click, qtKey, modifiers, msecs); } + inline void addKeyPress(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Press, qtKey, modifiers, msecs); } + inline void addKeyRelease(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Release, qtKey, modifiers, msecs); } + inline void addKeyEvent(QTest::KeyAction action, Qt::Key qtKey, + Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { append(new HbTestKeyEvent(action, qtKey, modifiers, msecs)); } + + inline void addKeyClick(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Click, ascii, modifiers, msecs); } + inline void addKeyPress(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Press, ascii, modifiers, msecs); } + inline void addKeyRelease(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Release, ascii, modifiers, msecs); } + inline void addKeyClicks(const QString &keys, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { append(new HbTestKeyClicksEvent(keys, modifiers, msecs)); } + inline void addKeyEvent(QTest::KeyAction action, char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { append(new HbTestKeyEvent(action, ascii, modifiers, msecs)); } + + inline void addDelay(int msecs) + { append(new HbTestDelayEvent(msecs)); } + + inline void simulate(QWidget *w) + { + for (int i = 0; i < count(); ++i) + at(i)->simulate(w); + } +}; + +class HbAutoTestMainWindow : public HbMainWindow +{ +public: + HbAutoTestMainWindow() : HbMainWindow() {} + + void mousePressEvent(QMouseEvent *event) + { + qDebug( + "HbAutoTestMainWindow::mousePressEvent: x(%d) y(%d)", + event->x(), + event->y()); + if ( dynamic_cast(event) ) { + HbMainWindow::mousePressEvent(event); + } else { + ;//Do nothing + } + } + + void mouseMoveEvent(QMouseEvent *event) + { + if ( dynamic_cast(event) ) { + HbMainWindow::mouseMoveEvent(event); + } else { + ;//Do nothing + } + } + + void mouseReleaseEvent(QMouseEvent *event) + { + if ( dynamic_cast(event) ) { + HbMainWindow::mouseReleaseEvent(event); + } else { + ;//Do nothing + } + } + + void keyPressEvent(QKeyEvent *event) + { + if ( dynamic_cast(event) ) { + HbMainWindow::keyPressEvent(event); + } else { + ;//Do nothing + } + } + void keyReleaseEvent(QKeyEvent *event) + { + if ( dynamic_cast(event) ) { + HbMainWindow::keyReleaseEvent(event); + } else { + ;//Do nothing + } + } + + void mouseDoubleClickEvent(QMouseEvent *event) + { + Q_UNUSED(event); + //Just ignore, not supported in Orbit + } +}; + + +Q_DECLARE_METATYPE(HbTestEventList) +#endif //HBAUTOTEST_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/ut/testcmapplsettingsui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/ut/testcmapplsettingsui.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,632 @@ +/* +* 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: +* CM Application Settings UI unit testing. +*/ + +#include + +#include +#include +#include +#include +#include +#include + +#include "cmapplsettingsui_p.h" +#include "cmradiodialog.h" + +#include "hbautotest.h" +#include "testcmapplsettingsui.h" + +// ----------------------------------------------------------------------------- +// STATIC TEST DATA +// ----------------------------------------------------------------------------- + +// Time to wait before continuing after an UI step +static const int waitTime = 10; + +// Destination list item for Connection Method selection +static const QString dedicatedAccessPoint = "Dedicated access point"; + +static const QStringList allDestinations = QStringList() << + "Internet" << + "My Snap" << + dedicatedAccessPoint; + +static const QStringList allConnectionMethods = QStringList() + << "Home WLAN" + << "packet data 1" + << "packet data 2" + << "packet data 3" + << "Streaming" + << "WLAN IAP 1" + << "WLAN IAP 2" + << "WLAN IAP 3"; + +static const QStringList gprsConnectionMethods = QStringList() + << "packet data 1" + << "packet data 2" + << "packet data 3" + << "Streaming"; + +static const QStringList wlanConnectionMethods = QStringList() + << "Home WLAN" + << "WLAN IAP 1" + << "WLAN IAP 2" + << "WLAN IAP 3"; + +// ----------------------------------------------------------------------------- +// FRAMEWORK FUNCTIONS +// ----------------------------------------------------------------------------- + +/** + * Test main function. Runs all test cases. + */ +#ifndef TESTCMAPPLSETTINGSUI_NO_OUTPUT_REDIRECT +int main(int argc, char *argv[]) +{ + HbApplication app(argc, argv); + app.setApplicationName("TestCmApplSettingsUi"); + + char *pass[3]; + pass[0] = argv[0]; + pass[1] = "-o"; + pass[2] = "c:\\data\\TestCmApplSettingsUi.txt"; + + TestCmApplSettingsUi tc; + int res = QTest::qExec(&tc, 3, pass); + + return res; +} +#else +QTEST_MAIN(TestCmApplSettingsUi) +#endif + +/** + * This function is be called before the first test case is executed. + */ +void TestCmApplSettingsUi::initTestCase() +{ + mMainWindow = new HbAutoTestMainWindow; + //mMainWindow = new HbMainWindow; + mMainWindow->show(); + mSelection.result = CmApplSettingsUi::SelectionTypeDestination; + mSelection.id = 0; + mSignalFinished = NULL; +} + +/** + * This function is be called after the last test case was executed. + */ +void TestCmApplSettingsUi::cleanupTestCase() +{ + delete mMainWindow; + mMainWindow = 0; +} + +/** + * This function is be called before each test case is executed. + */ +void TestCmApplSettingsUi::init() +{ + // Initialize the CmApplSettingsUI object + mApplSettUi = new CmApplSettingsUi; + + // Initialize code references + mApplSettingsPriv = mApplSettUi->d_ptr; + QVERIFY(mApplSettingsPriv != NULL); + + // CmApplSettingsUI finished(uint) signal watcher + mSignalFinished = new QSignalSpy(mApplSettUi, SIGNAL(finished(uint))); + QVERIFY(mSignalFinished->isValid() == true); +} + +/** + * This function is be called after each test case is executed. + */ +void TestCmApplSettingsUi::cleanup() +{ + delete mApplSettUi; + mApplSettUi = NULL; + + mApplSettingsPriv = NULL; + + QCOMPARE(mSignalFinished->count(), 0); + delete mSignalFinished; + mSignalFinished = NULL; +} + +// ----------------------------------------------------------------------------- +// TEST CASES +// ----------------------------------------------------------------------------- + +void TestCmApplSettingsUi::tcConfigAndDelete() +{ + // Form the configuration parameters + mSelection.result = CmApplSettingsUi::SelectionTypeDestination; + mSelection.id = 0; + QFlags listItems; + listItems |= CmApplSettingsUi::ShowDestinations; + listItems |= CmApplSettingsUi::ShowConnectionMethods; + QSet filter; + + // Configure the dialog + mApplSettUi->setOptions(listItems, filter); + mApplSettUi->setSelection(mSelection); + + // Skip execution, to test premature deletion +} + +void TestCmApplSettingsUi::tcNoContentToShow() +{ + // Configure the dialog + QFlags listItems; + QSet filter; + mApplSettUi->setOptions(listItems, filter); + + // Run the dialog + mApplSettUi->open(); + + // The dialog should fail to no content error code, + // since no selection dialog items were selected. + subCatchSignalFinished(CmApplSettingsUi::ApplSettingsErrorNoContent); +} + +void TestCmApplSettingsUi::tcDestinationSelect() +{ + // Configure the dialog + QFlags listItems; + listItems |= CmApplSettingsUi::ShowDestinations; + QSet filter; + mApplSettUi->setOptions(listItems, filter); + + // Run the dialog + mApplSettUi->open(); + + // Validate the dialog content + QStringList destinations; + destinations + << "Internet" + << "My Snap"; + subCheckDialog( + mApplSettingsPriv->mDestinationDialog, + destinations, + 0); + + // Click "OK" + subDismissDialog(mApplSettingsPriv->mDestinationDialog->mDialog, true); + + // The dialog should succeed + subCatchSignalFinished(CmApplSettingsUi::ApplSettingsErrorNone); + + // Selection should be Internet Destination + mSelection.result = CmApplSettingsUi::SelectionTypeDestination; + mSelection.id = 4099; + subVerifySelection(mSelection); +} + +void TestCmApplSettingsUi::tcDestinationCancel() +{ + // Run the dialog with default parameters + mApplSettUi->open(); + + // Validate the dialog content + subCheckDialog( + mApplSettingsPriv->mDestinationDialog, + allDestinations, + 0); + + // Click "Cancel" + subDismissDialog(mApplSettingsPriv->mDestinationDialog->mDialog, false); + + // The dialog should succeed + subCatchSignalFinished(CmApplSettingsUi::ApplSettingsErrorCancel); +} + +void TestCmApplSettingsUi::tcDestinationFilterWlan() +{ + // Configure the dialog + QFlags listItems; + listItems |= CmApplSettingsUi::ShowDestinations; + QSet filter; + filter |= CMManagerShim::BearerTypeWlan; + mApplSettUi->setOptions(listItems, filter); + + // Run the dialog + mApplSettUi->open(); + + // Validate the dialog content + QStringList destinations; + destinations + << "Internet" + << "My Snap"; + subCheckDialog( + mApplSettingsPriv->mDestinationDialog, + destinations, + 0); + + // Select "My Snap" + subSelectDialogItem( + mApplSettingsPriv->mDestinationDialog, + 1); + + // Click "OK" + subDismissDialog(mApplSettingsPriv->mDestinationDialog->mDialog, true); + + // The dialog should succeed + subCatchSignalFinished(CmApplSettingsUi::ApplSettingsErrorNone); + + // Selection should be "My Snap" Destination + mSelection.result = CmApplSettingsUi::SelectionTypeDestination; + mSelection.id = 4102; + subVerifySelection(mSelection); +} + +void TestCmApplSettingsUi::tcDestinationFilterUnknown() +{ + // Configure the dialog + QFlags listItems; + listItems |= CmApplSettingsUi::ShowDestinations; + listItems |= CmApplSettingsUi::ShowConnectionMethods; + QSet filter; + filter |= 0x10281BB7; // Obsolete CSD bearer type + mApplSettUi->setOptions(listItems, filter); + + // Run the dialog with default parameters + mApplSettUi->open(); + + // The dialog should fail since there's nothing to show + subCatchSignalFinished(CmApplSettingsUi::ApplSettingsErrorNoContent); +} + +void TestCmApplSettingsUi::tcDedicatedConnMethodSelect() +{ + // Configure the dialog + mSelection.result = CmApplSettingsUi::SelectionTypeDestination; + mSelection.id = 4099; + mApplSettUi->setSelection(mSelection); + + // Run the dialog with default parameters + mApplSettUi->open(); + + // Validate the dialog content + subCheckDialog( + mApplSettingsPriv->mDestinationDialog, + allDestinations, + 0); + + // Select "Dedicated access point" + subSelectDialogItem( + mApplSettingsPriv->mDestinationDialog, + 2); + + // Click "OK" + subDismissDialog(mApplSettingsPriv->mDestinationDialog->mDialog, true); + + // Connection method list should open + subCheckDialog( + mApplSettingsPriv->mConnMethodDialog, + allConnectionMethods, + 0); + + // Click "OK" + subDismissDialog(mApplSettingsPriv->mConnMethodDialog->mDialog, true); + + // The dialog should succeed + subCatchSignalFinished(CmApplSettingsUi::ApplSettingsErrorNone); + + // Selection should be Connection Method "Home WLAN" + mSelection.result = CmApplSettingsUi::SelectionTypeConnectionMethod; + mSelection.id = 8; + subVerifySelection(mSelection); +} + +void TestCmApplSettingsUi::tcDedicatedConnMethodCancel() +{ + // Configure the dialog + mSelection.result = CmApplSettingsUi::SelectionTypeConnectionMethod; + mSelection.id = 1; + mApplSettUi->setSelection(mSelection); + + // Run the dialog with default parameters + mApplSettUi->open(); + + // Validate the dialog content + subCheckDialog( + mApplSettingsPriv->mDestinationDialog, + allDestinations, + 2); + + // Click "OK" + subDismissDialog(mApplSettingsPriv->mDestinationDialog->mDialog, true); + + // Connection method list should open + subCheckDialog( + mApplSettingsPriv->mConnMethodDialog, + allConnectionMethods, + 1); + + // Click "Cancel" + subDismissDialog(mApplSettingsPriv->mConnMethodDialog->mDialog, false); + + // The dialog should be cancelled + subCatchSignalFinished(CmApplSettingsUi::ApplSettingsErrorCancel); +} + +void TestCmApplSettingsUi::tcConnMethodSelect() +{ + // Configure the dialog + QFlags listItems; + listItems |= CmApplSettingsUi::ShowConnectionMethods; + QSet filter; + mApplSettUi->setOptions(listItems, filter); + mSelection.result = CmApplSettingsUi::SelectionTypeConnectionMethod; + mSelection.id = 1; + mApplSettUi->setSelection(mSelection); + + // Run the dialog + mApplSettUi->open(); + + // Validate the dialog content + subCheckDialog( + mApplSettingsPriv->mConnMethodDialog, + allConnectionMethods, + 1); + + // Select "WLAN IAP 1" + subSelectDialogItem( + mApplSettingsPriv->mConnMethodDialog, + 3); + + // Click "OK" + subDismissDialog(mApplSettingsPriv->mConnMethodDialog->mDialog, true); + + // The dialog should succeed + subCatchSignalFinished(CmApplSettingsUi::ApplSettingsErrorNone); + + // Selection should be Connection Method "packet data 3" + mSelection.result = CmApplSettingsUi::SelectionTypeConnectionMethod; + mSelection.id = 4; + subVerifySelection(mSelection); +} + +void TestCmApplSettingsUi::tcConnMethodCancel() +{ + // Configure the dialog + QFlags listItems; + listItems |= CmApplSettingsUi::ShowConnectionMethods; + QSet filter; + mApplSettUi->setOptions(listItems, filter); + + // Run the dialog + mApplSettUi->open(); + + // Validate the dialog content + subCheckDialog( + mApplSettingsPriv->mConnMethodDialog, + allConnectionMethods, + 0); + + // Click "Cancel" + subDismissDialog(mApplSettingsPriv->mConnMethodDialog->mDialog, false); + + // The dialog should succeed + subCatchSignalFinished(CmApplSettingsUi::ApplSettingsErrorCancel); +} + +void TestCmApplSettingsUi::tcConnMethodFilterGprs() +{ + // Configure the dialog + QFlags listItems; + listItems |= CmApplSettingsUi::ShowConnectionMethods; + QSet filter; + filter |= CMManagerShim::BearerTypePacketData; + mApplSettUi->setOptions(listItems, filter); + mSelection.result = CmApplSettingsUi::SelectionTypeConnectionMethod; + mSelection.id = 9; + mApplSettUi->setSelection(mSelection); + + // Run the dialog + mApplSettUi->open(); + + // Validate the dialog content + subCheckDialog( + mApplSettingsPriv->mConnMethodDialog, + gprsConnectionMethods, + 3); + + // Select "packet data 3" + subSelectDialogItem( + mApplSettingsPriv->mConnMethodDialog, + 2); + + // Click "OK" + subDismissDialog(mApplSettingsPriv->mConnMethodDialog->mDialog, true); + + // The dialog should succeed + subCatchSignalFinished(CmApplSettingsUi::ApplSettingsErrorNone); + + // Selection should be Connection Method "packet data 3" + mSelection.result = CmApplSettingsUi::SelectionTypeConnectionMethod; + mSelection.id = 4; + subVerifySelection(mSelection); +} + +void TestCmApplSettingsUi::tcConnMethodFilterWlan() +{ + // Configure the dialog + QFlags listItems; + listItems |= CmApplSettingsUi::ShowConnectionMethods; + QSet filter; + filter |= CMManagerShim::BearerTypeWlan; + mApplSettUi->setOptions(listItems, filter); + mSelection.result = CmApplSettingsUi::SelectionTypeConnectionMethod; + mSelection.id = 6; + mApplSettUi->setSelection(mSelection); + + // Run the dialog + mApplSettUi->open(); + + // Validate the dialog content + subCheckDialog( + mApplSettingsPriv->mConnMethodDialog, + wlanConnectionMethods, + 2); + + // Select "WLAN IAP 1" + subSelectDialogItem( + mApplSettingsPriv->mConnMethodDialog, + 1); + + // Click "OK" + subDismissDialog(mApplSettingsPriv->mConnMethodDialog->mDialog, true); + + // The dialog should succeed + subCatchSignalFinished(CmApplSettingsUi::ApplSettingsErrorNone); + + // Selection should be Connection Method "WLAN IAP 1" + mSelection.result = CmApplSettingsUi::SelectionTypeConnectionMethod; + mSelection.id = 5; + subVerifySelection(mSelection); +} + +void TestCmApplSettingsUi::tcConnMethodFilterUnknown() +{ + // Configure the dialog + QFlags listItems; + listItems |= CmApplSettingsUi::ShowConnectionMethods; + QSet filter; + filter |= 0x10281BB7; // Obsolete CSD bearer type + mApplSettUi->setOptions(listItems, filter); + + // Run the dialog + mApplSettUi->open(); + + // The dialog should fail since there's nothing to show + subCatchSignalFinished(CmApplSettingsUi::ApplSettingsErrorNoContent); +} + +// ----------------------------------------------------------------------------- +// SUB TEST CASES +// ----------------------------------------------------------------------------- + +/** + * Catch and verify the signal "finished(int)" emitted by mSignalFinished. + */ +void TestCmApplSettingsUi::subCatchSignalFinished(uint status) +{ + QTest::qWait(waitTime); + QCOMPARE(mSignalFinished->count(), 1); // A sole signal + QList arguments = mSignalFinished->takeFirst(); + // Verify the first result status + QVERIFY(arguments.at(0).toUInt() == status); +} + +/** + * Verify the current selection against given selection + */ +void TestCmApplSettingsUi::subVerifySelection(CmApplSettingsUi::SettingSelection selection) +{ + mSelection = mApplSettUi->selection(); + QCOMPARE(mSelection.result, selection.result); + QCOMPARE(mSelection.id, selection.id); +} + +/** + * Application settings ui dialog content validation subtestcase. + * Checks: + * -The dialog's radiobutton list content. + * -Dialog's current selection. + */ +void TestCmApplSettingsUi::subCheckDialog( + CmRadioDialog *radioDialog, + QStringList items, + int selected) +{ + // Wait for the dialog to show properly + QTest::qWait(waitTime); + + QVERIFY(radioDialog != NULL); + QVERIFY(radioDialog->mList != NULL); + QCOMPARE(radioDialog->mList->items(), items); + QCOMPARE(radioDialog->mList->selected(), selected); +} + +/** + * Select an item from the radio dialog. + */ +void TestCmApplSettingsUi::subSelectDialogItem( + CmRadioDialog *radioDialog, + int selected) +{ + // Wait for the dialog to show properly + QTest::qWait(waitTime); + + QVERIFY(radioDialog != NULL); + QVERIFY(radioDialog->mList != NULL); + HbRadioButtonList *radioList = radioDialog->mList; + + // Calculate radio list item center location inside the + // radio list widget + QSizeF radioListSize = radioList->size(); + qDebug( + "Radio List size height(%f) width(%f)", + radioListSize.height(), + radioListSize.width()); + int itemCount = radioList->items().count(); + qDebug("Radio List item count: %d", itemCount); + qreal buttonHeight = radioListSize.height() / itemCount; + QPoint point( + radioListSize.width() / 2, + buttonHeight * (selected + 0.5)); + + // Click the button + HbAutoTest::mouseClick(mMainWindow, radioList, point, waitTime); + + // Verify that the selection succeeded + QCOMPARE(radioDialog->mList->selected(), selected); +} + +/** + * Dismiss the dialog by pressing either "OK" or "Cancel". + */ +void TestCmApplSettingsUi::subDismissDialog( + QSharedPointer dialog, + bool accept) +{ + // Wait for the dialog to show properly + QTest::qWait(waitTime); + + QVERIFY(dialog != NULL); + + // Calculate button center location inside the dialog + QSizeF dialogSize = dialog->size(); + qDebug( + "Dialog size height(%f) width(%f)", + dialogSize.height(), + dialogSize.width()); + QPoint point; + if (accept) { + // Left button: "OK" + point.setX(dialogSize.width() / 4); + } else { + // Right button: "Cancel" + point.setX(dialogSize.width() - (dialogSize.width() / 4)); + } + point.setY(dialogSize.height() - 30); + + // Click the button + HbAutoTest::mouseClick(mMainWindow, dialog.data(), point, waitTime); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/ut/testcmapplsettingsui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/ut/testcmapplsettingsui.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CM Application Settings UI unit testing. +*/ + +#include +#include +#include + +#include "cmapplsettingsui.h" + +class HbDialog; +class CmRadioDialog; +class HbMainWindow; +class HbAutoTestMainWindow; + +class TestCmApplSettingsUi : public QObject +{ + Q_OBJECT + + public slots: + // Test framework functions + void initTestCase(); + void cleanupTestCase(); + void init(); + void cleanup(); + + private slots: + // Test cases + void tcConfigAndDelete(); + void tcNoContentToShow(); + void tcDestinationSelect(); + void tcDestinationCancel(); + void tcDestinationFilterWlan(); + void tcDestinationFilterUnknown(); + void tcDedicatedConnMethodSelect(); + void tcDedicatedConnMethodCancel(); + void tcConnMethodSelect(); + void tcConnMethodCancel(); + void tcConnMethodFilterGprs(); + void tcConnMethodFilterWlan(); + void tcConnMethodFilterUnknown(); + + private: + // Sub test cases + void subCatchSignalFinished(uint status); + void subVerifySelection(CmApplSettingsUi::SettingSelection selection); + void subCheckDialog( + CmRadioDialog *radioDialog, + QStringList items, + int selection); + void subSelectDialogItem( + CmRadioDialog *radioDialog, + int selected); + void subDismissDialog( + QSharedPointer dialog, + bool accept); + + private: + // Code references + CmApplSettingsUiPrivate *mApplSettingsPriv; + + // Test data + HbAutoTestMainWindow *mMainWindow; + CmApplSettingsUi::SettingSelection mSelection; + CmApplSettingsUi *mApplSettUi; + QSignalSpy *mSignalFinished; +}; diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/ut/testcmapplsettingsui.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/ut/testcmapplsettingsui.pro Mon May 03 12:53:07 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 CM Application Settings UI Unit Tests. + +TEMPLATE = app + +TARGET = testcmapplsettingsui + +CONFIG += hb qtestlib + +INCLUDEPATH += . ../../inc +DEPENDPATH += . + +HEADERS += \ + hbautotest.h \ + testcmapplsettingsui.h +SOURCES += \ + hbautotest.cpp \ + testcmapplsettingsui.cpp + +LIBS += -lcmapplsettingsui + +symbian: { + TARGET.CAPABILITY = ALL -TCB +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/ut/tools/applsettingsui_ctc.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/ut/tools/applsettingsui_ctc.bat Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,89 @@ +:: +:: Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +:: All rights reserved. +:: This component and the accompanying materials are made available +:: under the terms of "Eclipse Public License v1.0" +:: which accompanies this distribution, and is available +:: at the URL "http://www.eclipse.org/legal/epl-v10.html". +:: +:: Initial Contributors: +:: Nokia Corporation - initial contribution. +:: +:: Contributors: +:: +:: Description: +:: Script running Application Settings UI test cases with CTC analysis. + +@echo off + +:: ----------------------------------------------------------------------------- +:: Instructions +:: ----------------------------------------------------------------------------- +:: +:: Remember to use the test CommsDat that can be set and restored with the +:: helper scripts: +:: - commsdat_set.bat +:: - commsdat_restore.bat + +::----------------------------------------------------------------------------- +:: Set the local variables +::----------------------------------------------------------------------------- + +:: Cm Application Settings UI base directory +set cmapplsettingsui_dir=..\..\.. +pushd %cmapplsettingsui_dir% + +:: CTC instrumentation excludes +set ctc_excludes=-C EXCLUDE=* -C NO_EXCLUDE=src\*.cpp + + +::----------------------------------------------------------------------------- +:: Remove old coverage data +::----------------------------------------------------------------------------- + +echo Cleaning up... +del MON.* ctcerr.txt profile.txt +rd /s /q CTCHTML +echo ...done + +::----------------------------------------------------------------------------- +:: Build & instrument code +::----------------------------------------------------------------------------- + +echo Building code and instrumenting.. +call del MON.* ctcerr.txt profile.txt +call make distclean +call qmake +call ctcwrap -i d -2comp %ctc_excludes% sbs -c winscw_udeb +echo ...done + +::----------------------------------------------------------------------------- +:: Build test code +::----------------------------------------------------------------------------- + +echo Building test code... +call cd tsrc\ut +call make distclean +call qmake +call sbs -c winscw_udeb +echo ...done + +::----------------------------------------------------------------------------- +:: Execute the tests +::----------------------------------------------------------------------------- + +echo Running tests.. +cd ..\.. +call \epoc32\release\winscw\udeb\testcmapplsettingsui.exe +echo ...done + +::----------------------------------------------------------------------------- +:: Create coverage results +::----------------------------------------------------------------------------- + +echo Creating results... +call ctcpost -p profile.txt +call ctc2html -i profile.txt +echo ...done + +popd diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/ut/tools/commsdat_restore.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/ut/tools/commsdat_restore.bat Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,17 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem Script for restoring backup of commsdat. + +copy backup\cccccc00.cre \epoc32\winscw\c\private\10202be9\persists\cccccc00.cre diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/ut/tools/commsdat_set.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmapplsettingsui/tsrc/ut/tools/commsdat_set.bat Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,19 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem Script for setting test commsdat. + +md backup +copy \epoc32\winscw\c\private\10202be9\persists\cccccc00.cre backup\ +copy default.cre \epoc32\winscw\c\private\10202be9\persists\cccccc00.cre diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmapplsettingsui/tsrc/ut/tools/default.cre Binary file cmmanager/cmapplsettingsui/tsrc/ut/tools/default.cre has changed diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmanager.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmanager.pro Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,31 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +SUBDIRS += \ + connection_settings_shim \ + cmapplsettingsui \ + cpipsettingsplugin \ + cpdestinationplugin \ + cppacketdataapplugin \ + cpwlanapplugin + +CONFIG += ordered + +symbian*: { + SYMBIAN_PLATFORMS = WINSCW ARMV5 +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/BWinsCw/CmManager_prot_setupU.DEF --- a/cmmanager/cmmgr/Framework/BWinsCw/CmManager_prot_setupU.DEF Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,392 +0,0 @@ -EXPORTS - ??0CCmPluginBaseEng@@IAE@PAVTCmPluginInitParam@@@Z @ 1 NONAME ; CCmPluginBaseEng::CCmPluginBaseEng(class TCmPluginInitParam *) - ??0CCmPluginLanBase@@IAE@PAVTCmPluginInitParam@@@Z @ 2 NONAME ; CCmPluginLanBase::CCmPluginLanBase(class TCmPluginInitParam *) - ??0CmPluginBaseSettingsDlg@@QAE@AAVCCmPluginBaseEng@@@Z @ 3 NONAME ; CmPluginBaseSettingsDlg::CmPluginBaseSettingsDlg(class CCmPluginBaseEng &) - ??0CmPluginBaseSettingsDlgAdv@@QAE@AAVCCmPluginBaseEng@@@Z @ 4 NONAME ; CmPluginBaseSettingsDlgAdv::CmPluginBaseSettingsDlgAdv(class CCmPluginBaseEng &) - ??0CmPluginBaseSettingsDlgIp@@QAE@AAVCCmPluginBaseEng@@@Z @ 5 NONAME ; CmPluginBaseSettingsDlgIp::CmPluginBaseSettingsDlgIp(class CCmPluginBaseEng &) - ??0RCmDestination@@QAE@ABV0@@Z @ 6 NONAME ; RCmDestination::RCmDestination(class RCmDestination const &) - ??0RCmDestinationExt@@QAE@ABV0@@Z @ 7 NONAME ; RCmDestinationExt::RCmDestinationExt(class RCmDestinationExt const &) - ??1CCmApplicationSettingsUi@@UAE@XZ @ 8 NONAME ; CCmApplicationSettingsUi::~CCmApplicationSettingsUi(void) - ??1CCmPluginBaseEng@@UAE@XZ @ 9 NONAME ; CCmPluginBaseEng::~CCmPluginBaseEng(void) - ??1CCmPluginLanBase@@MAE@XZ @ 10 NONAME ; CCmPluginLanBase::~CCmPluginLanBase(void) - ??1CCmSettingsUi@@UAE@XZ @ 11 NONAME ; CCmSettingsUi::~CCmSettingsUi(void) - ??1CmPluginBaseSettingsDlg@@UAE@XZ @ 12 NONAME ; CmPluginBaseSettingsDlg::~CmPluginBaseSettingsDlg(void) - ??1CmPluginBaseSettingsDlgAdv@@UAE@XZ @ 13 NONAME ; CmPluginBaseSettingsDlgAdv::~CmPluginBaseSettingsDlgAdv(void) - ??1CmPluginBaseSettingsDlgIp@@UAE@XZ @ 14 NONAME ; CmPluginBaseSettingsDlgIp::~CmPluginBaseSettingsDlgIp(void) - ??1RCmDestination@@QAE@XZ @ 15 NONAME ; RCmDestination::~RCmDestination(void) - ??1RCmDestinationExt@@QAE@XZ @ 16 NONAME ; RCmDestinationExt::~RCmDestinationExt(void) - ??4RCmDestination@@QAEAAV0@ABV0@@Z @ 17 NONAME ; class RCmDestination & RCmDestination::operator=(class RCmDestination const &) - ??4RCmDestinationExt@@QAEAAV0@ABV0@@Z @ 18 NONAME ; class RCmDestinationExt & RCmDestinationExt::operator=(class RCmDestinationExt const &) - ?AddCommonConversionTableL@CCmPluginBaseEng@@IAEXPBUTCmCommonAttrConvArrayItem@@@Z @ 19 NONAME ; void CCmPluginBaseEng::AddCommonConversionTableL(struct TCmCommonAttrConvArrayItem const *) - ?AddConnectionMethodL@RCmDestinationExt@@QAEHVRCmConnectionMethodExt@@@Z @ 20 NONAME ; int RCmDestinationExt::AddConnectionMethodL(class RCmConnectionMethodExt) - ?AddConverstionTableL@CCmPluginBaseEng@@IAEXPAPAVCCDRecordBase@CommsDat@@PAHPBUTCmAttribConvTable@@@Z @ 21 NONAME ; void CCmPluginBaseEng::AddConverstionTableL(class CommsDat::CCDRecordBase * *, int *, struct TCmAttribConvTable const *) - ?AddEmbeddedDestinationL@RCmDestinationExt@@QAEHABV1@@Z @ 22 NONAME ; int RCmDestinationExt::AddEmbeddedDestinationL(class RCmDestinationExt const &) - ?AddResourceFileL@CCmPluginBaseEng@@IAEXABVTDesC16@@@Z @ 23 NONAME ; void CCmPluginBaseEng::AddResourceFileL(class TDesC16 const &) - ?AllDestinationsL@CCmManagerImpl@@QAEXAAV?$RArray@K@@@Z @ 24 NONAME ; void CCmManagerImpl::AllDestinationsL(class RArray &) - ?AllDestinationsL@RCmManager@@QBEXAAV?$RArray@K@@@Z @ 25 NONAME ; void RCmManager::AllDestinationsL(class RArray &) const - ?AllDestinationsL@RCmManagerExt@@QAEXAAV?$RArray@K@@@Z @ 26 NONAME ; void RCmManagerExt::AllDestinationsL(class RArray &) - ?AllocReadL@CCmPluginBaseEng@@IBEPAVHBufC16@@H@Z @ 27 NONAME ; class HBufC16 * CCmPluginBaseEng::AllocReadL(int) const - ?AppendSettingTextsL@CmPluginBaseSettingsDlg@@IAEXAAVCDesC16Array@@HH@Z @ 28 NONAME ; void CmPluginBaseSettingsDlg::AppendSettingTextsL(class CDesC16Array &, int, int) - ?AppendSettingTextsL@CmPluginBaseSettingsDlg@@IAEXAAVCDesC16Array@@HPBVHBufC16@@@Z @ 29 NONAME ; void CmPluginBaseSettingsDlg::AppendSettingTextsL(class CDesC16Array &, int, class HBufC16 const *) - ?AppendSettingTextsL@CmPluginBaseSettingsDlg@@IBEXAAVCDesC16Array@@HHABVTDesC16@@H@Z @ 30 NONAME ; void CmPluginBaseSettingsDlg::AppendSettingTextsL(class CDesC16Array &, int, int, class TDesC16 const &, int) const - ?AppendSettingTextsL@CmPluginBaseSettingsDlg@@IBEXAAVCDesC16Array@@HHHH@Z @ 31 NONAME ; void CmPluginBaseSettingsDlg::AppendSettingTextsL(class CDesC16Array &, int, int, int, int) const - ?BearerPriorityArrayL@RCmManager@@QBEXAAV?$RArray@VTBearerPriority@@@@@Z @ 32 NONAME ; void RCmManager::BearerPriorityArrayL(class RArray &) const - ?BearerPriorityArrayL@RCmManagerExt@@QBEXAAV?$RArray@VTBearerPriority@@@@@Z @ 33 NONAME ; void RCmManagerExt::BearerPriorityArrayL(class RArray &) const - ?BearerRecordIdLC@CCmPluginLanBase@@MAEXAAPAVHBufC16@@AAK@Z @ 34 NONAME ; void CCmPluginLanBase::BearerRecordIdLC(class HBufC16 * &, unsigned long &) - ?CheckDNSServerAddressL@CCmPluginBaseEng@@QAEXHAAV?$CMDBField@VTDesC16@@@CommsDat@@0AAV?$CMDBField@H@3@@Z @ 35 NONAME ; void CCmPluginBaseEng::CheckDNSServerAddressL(int, class CommsDat::CMDBField &, class CommsDat::CMDBField &, class CommsDat::CMDBField &) - ?CheckIPv4ValidityL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 36 NONAME ; int CheckIPv4ValidityL(class CCmPluginBaseEng *, unsigned long, void const *) - ?CheckIPv6ValidityL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 37 NONAME ; int CheckIPv6ValidityL(class CCmPluginBaseEng *, unsigned long, void const *) - ?CheckIfAlreadyConnected@CCmPluginBaseEng@@MBEHXZ @ 38 NONAME ; int CCmPluginBaseEng::CheckIfAlreadyConnected(void) const - ?CheckIfNameModifiedL@CCmPluginBaseEng@@IBEXPAVCCDRecordBase@CommsDat@@@Z @ 39 NONAME ; void CCmPluginBaseEng::CheckIfNameModifiedL(class CommsDat::CCDRecordBase *) const - ?CheckPortNumberValidityL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 40 NONAME ; int CheckPortNumberValidityL(class CCmPluginBaseEng *, unsigned long, void const *) - ?CheckRecordIdValidityL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 41 NONAME ; int CheckRecordIdValidityL(class CCmPluginBaseEng *, unsigned long, void const *) - ?CheckWAPWspOptionValidityL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 42 NONAME ; int CheckWAPWspOptionValidityL(class CCmPluginBaseEng *, unsigned long, void const *) - ?ClassifyIPv6Address@@YA?AW4TIPv6Types@CMManager@@ABVTDesC16@@@Z @ 43 NONAME ; enum CMManager::TIPv6Types ClassifyIPv6Address(class TDesC16 const &) - ?CleanupGlobalPriorityArray@RCmManager@@QBEXAAV?$RArray@VTBearerPriority@@@@@Z @ 44 NONAME ; void RCmManager::CleanupGlobalPriorityArray(class RArray &) const - ?CleanupGlobalPriorityArray@RCmManagerExt@@QBEXAAV?$RArray@VTBearerPriority@@@@@Z @ 45 NONAME ; void RCmManagerExt::CleanupGlobalPriorityArray(class RArray &) const - ?Close@CCmTransactionHandler@@QAEXXZ @ 46 NONAME ABSENT ; void CCmTransactionHandler::Close(void) - ?Close@RCmConnectionMethod@@QAEXXZ @ 47 NONAME ; void RCmConnectionMethod::Close(void) - ?Close@RCmConnectionMethodExt@@QAEXXZ @ 48 NONAME ; void RCmConnectionMethodExt::Close(void) - ?Close@RCmDestination@@QAEXXZ @ 49 NONAME ; void RCmDestination::Close(void) - ?Close@RCmDestinationExt@@QAEXXZ @ 50 NONAME ; void RCmDestinationExt::Close(void) - ?Close@RCmManager@@QAEXXZ @ 51 NONAME ; void RCmManager::Close(void) - ?Close@RCmManagerExt@@QAEXXZ @ 52 NONAME ; void RCmManagerExt::Close(void) - ?ConnectionMethodByIDL@RCmDestination@@QBE?AVRCmConnectionMethod@@H@Z @ 53 NONAME ; class RCmConnectionMethod RCmDestination::ConnectionMethodByIDL(int) const - ?ConnectionMethodByIDL@RCmDestinationExt@@QAE?AVRCmConnectionMethodExt@@H@Z @ 54 NONAME ; class RCmConnectionMethodExt RCmDestinationExt::ConnectionMethodByIDL(int) - ?ConnectionMethodCount@CCmDestinationImpl@@QAEHXZ @ 55 NONAME ; int CCmDestinationImpl::ConnectionMethodCount(void) - ?ConnectionMethodCount@RCmDestination@@QBEHXZ @ 56 NONAME ; int RCmDestination::ConnectionMethodCount(void) const - ?ConnectionMethodCount@RCmDestinationExt@@QAEHXZ @ 57 NONAME ; int RCmDestinationExt::ConnectionMethodCount(void) - ?ConnectionMethodL@CCmDestinationImpl@@QAEPAVCCmPluginBaseEng@@H@Z @ 58 NONAME ; class CCmPluginBaseEng * CCmDestinationImpl::ConnectionMethodL(int) - ?ConnectionMethodL@CCmManagerImpl@@QAEPAVCCmPluginBaseEng@@K@Z @ 59 NONAME ; class CCmPluginBaseEng * CCmManagerImpl::ConnectionMethodL(unsigned long) - ?ConnectionMethodL@CCmManagerImpl@@QAEXAAV?$RArray@K@@HHHH@Z @ 60 NONAME ; void CCmManagerImpl::ConnectionMethodL(class RArray &, int, int, int, int) - ?ConnectionMethodL@RCmDestination@@QBE?AVRCmConnectionMethod@@H@Z @ 61 NONAME ; class RCmConnectionMethod RCmDestination::ConnectionMethodL(int) const - ?ConnectionMethodL@RCmDestinationExt@@QAE?AVRCmConnectionMethodExt@@H@Z @ 62 NONAME ; class RCmConnectionMethodExt RCmDestinationExt::ConnectionMethodL(int) - ?ConnectionMethodL@RCmManager@@QBE?AVRCmConnectionMethod@@K@Z @ 63 NONAME ; class RCmConnectionMethod RCmManager::ConnectionMethodL(unsigned long) const - ?ConnectionMethodL@RCmManager@@QBEXAAV?$RArray@K@@HHH@Z @ 64 NONAME ; void RCmManager::ConnectionMethodL(class RArray &, int, int, int) const - ?ConnectionMethodL@RCmManagerExt@@QAE?AVRCmConnectionMethodExt@@K@Z @ 65 NONAME ; class RCmConnectionMethodExt RCmManagerExt::ConnectionMethodL(unsigned long) - ?ConnectionMethodL@RCmManagerExt@@QAEXAAV?$RArray@K@@HHH@Z @ 66 NONAME ; void RCmManagerExt::ConnectionMethodL(class RArray &, int, int, int) - ?ConstructAndRunLD@CmPluginBaseSettingsDlg@@QAEHXZ @ 67 NONAME ; int CmPluginBaseSettingsDlg::ConstructAndRunLD(void) - ?ConstructL@CCmPluginBaseEng@@MAEXXZ @ 68 NONAME ; void CCmPluginBaseEng::ConstructL(void) - ?ConstructL@CCmPluginLanBase@@MAEXXZ @ 69 NONAME ; void CCmPluginLanBase::ConstructL(void) - ?ConvTableItem@CCmPluginBaseEng@@QAEPBUTCmAttribConvTable@@K@Z @ 70 NONAME ; struct TCmAttribConvTable const * CCmPluginBaseEng::ConvTableItem(unsigned long) - ?CopyConnectionMethodL@RCmManagerExt@@QAEHAAVRCmDestinationExt@@AAVRCmConnectionMethodExt@@@Z @ 71 NONAME ; int RCmManagerExt::CopyConnectionMethodL(class RCmDestinationExt &, class RCmConnectionMethodExt &) - ?CreateConnectionMethodL@RCmDestinationExt@@QAE?AVRCmConnectionMethodExt@@K@Z @ 72 NONAME ; class RCmConnectionMethodExt RCmDestinationExt::CreateConnectionMethodL(unsigned long) - ?CreateConnectionMethodL@RCmManagerExt@@QAE?AVRCmConnectionMethodExt@@K@Z @ 73 NONAME ; class RCmConnectionMethodExt RCmManagerExt::CreateConnectionMethodL(unsigned long) - ?CreateCopyL@CCmPluginBaseEng@@UBEPAV1@XZ @ 74 NONAME ; class CCmPluginBaseEng * CCmPluginBaseEng::CreateCopyL(void) const - ?CreateCopyL@RCmConnectionMethodExt@@QAE?AV1@XZ @ 75 NONAME ; class RCmConnectionMethodExt RCmConnectionMethodExt::CreateCopyL(void) - ?CreateDestinationL@RCmManagerExt@@QAE?AVRCmDestinationExt@@ABVTDesC16@@@Z @ 76 NONAME ; class RCmDestinationExt RCmManagerExt::CreateDestinationL(class TDesC16 const &) - ?CreateNewL@CCmPluginBaseEng@@UAEXXZ @ 77 NONAME ; void CCmPluginBaseEng::CreateNewL(void) - ?CreateNewServiceRecordL@CCmPluginLanBase@@MAEXXZ @ 78 NONAME ; void CCmPluginLanBase::CreateNewServiceRecordL(void) - ?DeleteConnectionMethodL@RCmDestinationExt@@QAEXAAVRCmConnectionMethodExt@@@Z @ 79 NONAME ; void RCmDestinationExt::DeleteConnectionMethodL(class RCmConnectionMethodExt &) - ?DeleteL@CCmPluginBaseEng@@UAEHHH@Z @ 80 NONAME ; int CCmPluginBaseEng::DeleteL(int, int) - ?DeleteL@RCmConnectionMethodExt@@QAEHXZ @ 81 NONAME ; int RCmConnectionMethodExt::DeleteL(void) - ?DeleteLD@CCmDestinationImpl@@QAEXXZ @ 82 NONAME ; void CCmDestinationImpl::DeleteLD(void) - ?DeleteLD@RCmDestinationExt@@QAEXXZ @ 83 NONAME ; void RCmDestinationExt::DeleteLD(void) - ?Destination@CCmPluginBaseEng@@UBEPAVCCmDestinationImpl@@XZ @ 84 NONAME ; class CCmDestinationImpl * CCmPluginBaseEng::Destination(void) const - ?DestinationL@CCmManagerImpl@@QAEPAVCCmDestinationImpl@@K@Z @ 85 NONAME ; class CCmDestinationImpl * CCmManagerImpl::DestinationL(unsigned long) - ?DestinationL@RCmConnectionMethod@@QBE?AVRCmDestination@@XZ @ 86 NONAME ; class RCmDestination RCmConnectionMethod::DestinationL(void) const - ?DestinationL@RCmConnectionMethodExt@@QBE?AVRCmDestinationExt@@XZ @ 87 NONAME ; class RCmDestinationExt RCmConnectionMethodExt::DestinationL(void) const - ?DestinationL@RCmManager@@QBE?AVRCmDestination@@K@Z @ 88 NONAME ; class RCmDestination RCmManager::DestinationL(unsigned long) const - ?DestinationL@RCmManagerExt@@QAE?AVRCmDestinationExt@@K@Z @ 89 NONAME ; class RCmDestinationExt RCmManagerExt::DestinationL(unsigned long) - ?DynInitMenuPaneL@CmPluginBaseSettingsDlg@@MAEXHPAVCEikMenuPane@@@Z @ 90 NONAME ; void CmPluginBaseSettingsDlg::DynInitMenuPaneL(int, class CEikMenuPane *) - ?DynInitMenuPaneL@CmPluginBaseSettingsDlgAdv@@UAEXHPAVCEikMenuPane@@@Z @ 91 NONAME ; void CmPluginBaseSettingsDlgAdv::DynInitMenuPaneL(int, class CEikMenuPane *) - ?DynInitMenuPaneL@CmPluginBaseSettingsDlgIp@@UAEXHPAVCEikMenuPane@@@Z @ 92 NONAME ; void CmPluginBaseSettingsDlgIp::DynInitMenuPaneL(int, class CEikMenuPane *) - ?EasyWlanIdL@CCmManagerImpl@@QAEKXZ @ 93 NONAME ; unsigned long CCmManagerImpl::EasyWlanIdL(void) - ?EasyWlanIdL@RCmManager@@QBEKXZ @ 94 NONAME ; unsigned long RCmManager::EasyWlanIdL(void) const - ?EasyWlanIdL@RCmManagerExt@@QAEKXZ @ 95 NONAME ; unsigned long RCmManagerExt::EasyWlanIdL(void) - ?ElementId@RCmDestination@@QBEKXZ @ 96 NONAME ; unsigned long RCmDestination::ElementId(void) const - ?ElementId@RCmDestinationExt@@QAEKXZ @ 97 NONAME ; unsigned long RCmDestinationExt::ElementId(void) - ?EnableChargeCardL@CCmPluginBaseEng@@AAEXH@Z @ 98 NONAME ABSENT ; void CCmPluginBaseEng::EnableChargeCardL(int) - ?EnableLocationL@CCmPluginBaseEng@@AAEXH@Z @ 99 NONAME ABSENT ; void CCmPluginBaseEng::EnableLocationL(int) - ?EnableProxyL@CCmPluginBaseEng@@AAEXH@Z @ 100 NONAME ABSENT ; void CCmPluginBaseEng::EnableProxyL(int) - ?FeatureSupported@CCmPluginBaseEng@@SAHH@Z @ 101 NONAME ; int CCmPluginBaseEng::FeatureSupported(int) - ?GetBearerInfoBoolL@CCmManagerImpl@@QBEHKK@Z @ 102 NONAME ; int CCmManagerImpl::GetBearerInfoBoolL(unsigned long, unsigned long) const - ?GetBearerInfoBoolL@RCmManager@@QBEHKK@Z @ 103 NONAME ; int RCmManager::GetBearerInfoBoolL(unsigned long, unsigned long) const - ?GetBearerInfoBoolL@RCmManagerExt@@QBEHKK@Z @ 104 NONAME ; int RCmManagerExt::GetBearerInfoBoolL(unsigned long, unsigned long) const - ?GetBearerInfoIntL@CCmManagerImpl@@QBEKKK@Z @ 105 NONAME ; unsigned long CCmManagerImpl::GetBearerInfoIntL(unsigned long, unsigned long) const - ?GetBearerInfoIntL@RCmManager@@QBEKKK@Z @ 106 NONAME ; unsigned long RCmManager::GetBearerInfoIntL(unsigned long, unsigned long) const - ?GetBearerInfoIntL@RCmManagerExt@@QBEKKK@Z @ 107 NONAME ; unsigned long RCmManagerExt::GetBearerInfoIntL(unsigned long, unsigned long) const - ?GetBearerInfoString8L@CCmManagerImpl@@QBEPAVHBufC8@@KK@Z @ 108 NONAME ; class HBufC8 * CCmManagerImpl::GetBearerInfoString8L(unsigned long, unsigned long) const - ?GetBearerInfoString8L@RCmManager@@QBEPAVHBufC8@@KK@Z @ 109 NONAME ; class HBufC8 * RCmManager::GetBearerInfoString8L(unsigned long, unsigned long) const - ?GetBearerInfoString8L@RCmManagerExt@@QBEPAVHBufC8@@KK@Z @ 110 NONAME ; class HBufC8 * RCmManagerExt::GetBearerInfoString8L(unsigned long, unsigned long) const - ?GetBearerInfoStringL@CCmManagerImpl@@QBEPAVHBufC16@@KK@Z @ 111 NONAME ; class HBufC16 * CCmManagerImpl::GetBearerInfoStringL(unsigned long, unsigned long) const - ?GetBearerInfoStringL@RCmManager@@QBEPAVHBufC16@@KK@Z @ 112 NONAME ; class HBufC16 * RCmManager::GetBearerInfoStringL(unsigned long, unsigned long) const - ?GetBearerInfoStringL@RCmManagerExt@@QBEPAVHBufC16@@KK@Z @ 113 NONAME ; class HBufC16 * RCmManagerExt::GetBearerInfoStringL(unsigned long, unsigned long) const - ?GetBoolAttributeL@CCmPluginBaseEng@@UBEHK@Z @ 114 NONAME ; int CCmPluginBaseEng::GetBoolAttributeL(unsigned long) const - ?GetBoolAttributeL@RCmConnectionMethod@@QBEHK@Z @ 115 NONAME ; int RCmConnectionMethod::GetBoolAttributeL(unsigned long) const - ?GetBoolAttributeL@RCmConnectionMethodExt@@QBEHK@Z @ 116 NONAME ; int RCmConnectionMethodExt::GetBoolAttributeL(unsigned long) const - ?GetConnectionMethodInfoBoolL@CCmManagerImpl@@QBEHKK@Z @ 117 NONAME ; int CCmManagerImpl::GetConnectionMethodInfoBoolL(unsigned long, unsigned long) const - ?GetConnectionMethodInfoBoolL@RCmManager@@QBEHKK@Z @ 118 NONAME ; int RCmManager::GetConnectionMethodInfoBoolL(unsigned long, unsigned long) const - ?GetConnectionMethodInfoBoolL@RCmManagerExt@@QBEHKK@Z @ 119 NONAME ; int RCmManagerExt::GetConnectionMethodInfoBoolL(unsigned long, unsigned long) const - ?GetConnectionMethodInfoIntL@CCmManagerImpl@@QBEKKK@Z @ 120 NONAME ; unsigned long CCmManagerImpl::GetConnectionMethodInfoIntL(unsigned long, unsigned long) const - ?GetConnectionMethodInfoIntL@RCmManager@@QBEKKK@Z @ 121 NONAME ; unsigned long RCmManager::GetConnectionMethodInfoIntL(unsigned long, unsigned long) const - ?GetConnectionMethodInfoIntL@RCmManagerExt@@QBEKKK@Z @ 122 NONAME ; unsigned long RCmManagerExt::GetConnectionMethodInfoIntL(unsigned long, unsigned long) const - ?GetConnectionMethodInfoString8L@CCmManagerImpl@@QBEPAVHBufC8@@KK@Z @ 123 NONAME ; class HBufC8 * CCmManagerImpl::GetConnectionMethodInfoString8L(unsigned long, unsigned long) const - ?GetConnectionMethodInfoString8L@RCmManager@@QBEPAVHBufC8@@KK@Z @ 124 NONAME ; class HBufC8 * RCmManager::GetConnectionMethodInfoString8L(unsigned long, unsigned long) const - ?GetConnectionMethodInfoString8L@RCmManagerExt@@QBEPAVHBufC8@@KK@Z @ 125 NONAME ; class HBufC8 * RCmManagerExt::GetConnectionMethodInfoString8L(unsigned long, unsigned long) const - ?GetConnectionMethodInfoStringL@CCmManagerImpl@@QBEPAVHBufC16@@KK@Z @ 126 NONAME ; class HBufC16 * CCmManagerImpl::GetConnectionMethodInfoStringL(unsigned long, unsigned long) const - ?GetConnectionMethodInfoStringL@RCmManager@@QBEPAVHBufC16@@KK@Z @ 127 NONAME ; class HBufC16 * RCmManager::GetConnectionMethodInfoStringL(unsigned long, unsigned long) const - ?GetConnectionMethodInfoStringL@RCmManagerExt@@QBEPAVHBufC16@@KK@Z @ 128 NONAME ; class HBufC16 * RCmManagerExt::GetConnectionMethodInfoStringL(unsigned long, unsigned long) const - ?GetHelpContext@CmPluginBaseSettingsDlg@@UBEXAAVTCoeHelpContext@@@Z @ 129 NONAME ; void CmPluginBaseSettingsDlg::GetHelpContext(class TCoeHelpContext &) const - ?GetIPv6DNSTypeL@CmPluginBaseSettingsDlg@@QAEHKK@Z @ 130 NONAME ; int CmPluginBaseSettingsDlg::GetIPv6DNSTypeL(unsigned long, unsigned long) - ?GetIntAttributeL@CCmPluginBaseEng@@UBEKK@Z @ 131 NONAME ; unsigned long CCmPluginBaseEng::GetIntAttributeL(unsigned long) const - ?GetIntAttributeL@RCmConnectionMethod@@QBEKK@Z @ 132 NONAME ; unsigned long RCmConnectionMethod::GetIntAttributeL(unsigned long) const - ?GetIntAttributeL@RCmConnectionMethodExt@@QBEKK@Z @ 133 NONAME ; unsigned long RCmConnectionMethodExt::GetIntAttributeL(unsigned long) const - ?GetString8AttributeL@CCmPluginBaseEng@@UBEPAVHBufC8@@K@Z @ 134 NONAME ; class HBufC8 * CCmPluginBaseEng::GetString8AttributeL(unsigned long) const - ?GetString8AttributeL@RCmConnectionMethod@@QBEPAVHBufC8@@K@Z @ 135 NONAME ; class HBufC8 * RCmConnectionMethod::GetString8AttributeL(unsigned long) const - ?GetString8AttributeL@RCmConnectionMethodExt@@QBEPAVHBufC8@@K@Z @ 136 NONAME ; class HBufC8 * RCmConnectionMethodExt::GetString8AttributeL(unsigned long) const - ?GetStringAttributeL@CCmPluginBaseEng@@UBEPAVHBufC16@@K@Z @ 137 NONAME ; class HBufC16 * CCmPluginBaseEng::GetStringAttributeL(unsigned long) const - ?GetStringAttributeL@RCmConnectionMethod@@QBEPAVHBufC16@@K@Z @ 138 NONAME ; class HBufC16 * RCmConnectionMethod::GetStringAttributeL(unsigned long) const - ?GetStringAttributeL@RCmConnectionMethodExt@@QBEPAVHBufC16@@K@Z @ 139 NONAME ; class HBufC16 * RCmConnectionMethodExt::GetStringAttributeL(unsigned long) const - ?GlobalBearerPriority@CCmPluginBaseEng@@IBEHABVTDesC16@@@Z @ 140 NONAME ; int CCmPluginBaseEng::GlobalBearerPriority(class TDesC16 const &) const - ?GlobalUiBearerPriority@CCmPluginBaseEng@@IBEHABVTDesC16@@@Z @ 141 NONAME ; int CCmPluginBaseEng::GlobalUiBearerPriority(class TDesC16 const &) const - ?HandleListBoxEventL@CmPluginBaseSettingsDlg@@MAEXPAVCEikListBox@@W4TListBoxEvent@MEikListBoxObserver@@@Z @ 142 NONAME ; void CmPluginBaseSettingsDlg::HandleListBoxEventL(class CEikListBox *, enum MEikListBoxObserver::TListBoxEvent) - ?HandleListboxDataChangeL@CmPluginBaseSettingsDlg@@QAEXXZ @ 143 NONAME ; void CmPluginBaseSettingsDlg::HandleListboxDataChangeL(void) - ?IAPRecordElementId@CCmPluginBaseEng@@QBEKXZ @ 144 NONAME ; unsigned long CCmPluginBaseEng::IAPRecordElementId(void) const - ?IconL@CCmDestinationImpl@@QAEPAVCGulIcon@@XZ @ 145 NONAME ; class CGulIcon * CCmDestinationImpl::IconL(void) - ?IconL@RCmDestination@@QBEPAVCGulIcon@@XZ @ 146 NONAME ; class CGulIcon * RCmDestination::IconL(void) const - ?IconL@RCmDestinationExt@@QAEPAVCGulIcon@@XZ @ 147 NONAME ; class CGulIcon * RCmDestinationExt::IconL(void) - ?Id@RCmDestination@@QBEKXZ @ 148 NONAME ; unsigned long RCmDestination::Id(void) const - ?Id@RCmDestinationExt@@QAEKXZ @ 149 NONAME ; unsigned long RCmDestinationExt::Id(void) - ?InitTextsL@CmPluginBaseSettingsDlg@@UAEXXZ @ 150 NONAME ; void CmPluginBaseSettingsDlg::InitTextsL(void) - ?InitializeWithUiL@CCmPluginLanBase@@UAEHH@Z @ 151 NONAME ; int CCmPluginLanBase::InitializeWithUiL(int) - ?IsConnectedL@CCmDestinationImpl@@QBEHXZ @ 152 NONAME ; int CCmDestinationImpl::IsConnectedL(void) const - ?IsConnectedL@RCmDestination@@QBEHXZ @ 153 NONAME ; int RCmDestination::IsConnectedL(void) const - ?IsConnectedL@RCmDestinationExt@@QBEHXZ @ 154 NONAME ; int RCmDestinationExt::IsConnectedL(void) const - ?IsHidden@CCmDestinationImpl@@QAEHXZ @ 155 NONAME ; int CCmDestinationImpl::IsHidden(void) - ?IsHidden@RCmDestination@@QBEHXZ @ 156 NONAME ; int RCmDestination::IsHidden(void) const - ?IsHidden@RCmDestinationExt@@QAEHXZ @ 157 NONAME ; int RCmDestinationExt::IsHidden(void) - ?IsProtected@CCmPluginBaseEng@@QBEHXZ @ 158 NONAME ; int CCmPluginBaseEng::IsProtected(void) const - ?IsUnspecifiedIPv4Address@@YAHABVTDesC16@@@Z @ 159 NONAME ; int IsUnspecifiedIPv4Address(class TDesC16 const &) - ?LoadL@CCmPluginBaseEng@@UAEXK@Z @ 160 NONAME ; void CCmPluginBaseEng::LoadL(unsigned long) - ?LoadResourceL@CmPluginBaseSettingsDlg@@IAEHABVTDesC16@@@Z @ 161 NONAME ; int CmPluginBaseSettingsDlg::LoadResourceL(class TDesC16 const &) - ?LoadServiceSettingL@CCmPluginBaseEng@@MAEXXZ @ 162 NONAME ; void CCmPluginBaseEng::LoadServiceSettingL(void) - ?LoadServiceSettingL@CCmPluginLanBase@@UAEXXZ @ 163 NONAME ; void CCmPluginLanBase::LoadServiceSettingL(void) - ?MetadataL@RCmDestination@@QBEKW4TSnapMetadataField@CMManager@@@Z @ 164 NONAME ; unsigned long RCmDestination::MetadataL(enum CMManager::TSnapMetadataField) const - ?MetadataL@RCmDestinationExt@@QBEKW4TSnapMetadataField@CMManager@@@Z @ 165 NONAME ; unsigned long RCmDestinationExt::MetadataL(enum CMManager::TSnapMetadataField) const - ?ModifyPriorityL@RCmDestinationExt@@QAEXAAVRCmConnectionMethodExt@@I@Z @ 166 NONAME ; void RCmDestinationExt::ModifyPriorityL(class RCmConnectionMethodExt &, unsigned int) - ?MoveConnectionMethodL@RCmManagerExt@@QAEHAAVRCmDestinationExt@@0AAVRCmConnectionMethodExt@@@Z @ 167 NONAME ; int RCmManagerExt::MoveConnectionMethodL(class RCmDestinationExt &, class RCmDestinationExt &, class RCmConnectionMethodExt &) - ?NameLC@CCmDestinationImpl@@QAEPAVHBufC16@@XZ @ 168 NONAME ; class HBufC16 * CCmDestinationImpl::NameLC(void) - ?NameLC@RCmDestination@@QBEPAVHBufC16@@XZ @ 169 NONAME ; class HBufC16 * RCmDestination::NameLC(void) const - ?NameLC@RCmDestinationExt@@QAEPAVHBufC16@@XZ @ 170 NONAME ; class HBufC16 * RCmDestinationExt::NameLC(void) - ?NewL@CCmApplicationSettingsUi@@SAPAV1@XZ @ 171 NONAME ; class CCmApplicationSettingsUi * CCmApplicationSettingsUi::NewL(void) - ?NewL@CCmApplicationSettingsUiImpl@@SAPAV1@XZ @ 172 NONAME ; class CCmApplicationSettingsUiImpl * CCmApplicationSettingsUiImpl::NewL(void) - ?NewL@CCmConnSettingsUiImpl@@SAPAV1@PAVCCmManagerImpl@@@Z @ 173 NONAME ; class CCmConnSettingsUiImpl * CCmConnSettingsUiImpl::NewL(class CCmManagerImpl *) - ?NewL@CCmDestinationImpl@@SAPAV1@AAVCCmManagerImpl@@ABVTDesC16@@@Z @ 174 NONAME ; class CCmDestinationImpl * CCmDestinationImpl::NewL(class CCmManagerImpl &, class TDesC16 const &) - ?NewL@CCmDestinationImpl@@SAPAV1@AAVCCmManagerImpl@@I@Z @ 175 NONAME ; class CCmDestinationImpl * CCmDestinationImpl::NewL(class CCmManagerImpl &, unsigned int) - ?NewL@CCmPluginMultiLineDialog@@SAPAV1@AAVTDes16@@0W4TTone@CAknQueryDialog@@@Z @ 176 NONAME ; class CCmPluginMultiLineDialog * CCmPluginMultiLineDialog::NewL(class TDes16 &, class TDes16 &, enum CAknQueryDialog::TTone) - ?NewL@CCmSettingsUi@@SAPAV1@XZ @ 177 NONAME ; class CCmSettingsUi * CCmSettingsUi::NewL(void) - ?NewLC@CCmApplicationSettingsUi@@SAPAV1@XZ @ 178 NONAME ; class CCmApplicationSettingsUi * CCmApplicationSettingsUi::NewLC(void) - ?NumOfConnMethodReferencesL@CCmPluginBaseEng@@UAEHXZ @ 179 NONAME ; int CCmPluginBaseEng::NumOfConnMethodReferencesL(void) - ?OkToExitL@CmPluginBaseSettingsDlg@@MAEHH@Z @ 180 NONAME ; int CmPluginBaseSettingsDlg::OkToExitL(int) - ?OpenL@RCmManager@@QAEXXZ @ 181 NONAME ; void RCmManager::OpenL(void) - ?OpenL@RCmManagerExt@@QAEXXZ @ 182 NONAME ; void RCmManagerExt::OpenL(void) - ?OpenLC@RCmManager@@QAEXXZ @ 183 NONAME ; void RCmManager::OpenLC(void) - ?OpenLC@RCmManagerExt@@QAEXXZ @ 184 NONAME ; void RCmManagerExt::OpenLC(void) - ?PreLayoutDynInitL@CmPluginBaseSettingsDlg@@MAEXXZ @ 185 NONAME ; void CmPluginBaseSettingsDlg::PreLayoutDynInitL(void) - ?PrepareToLoadRecordsL@CCmPluginBaseEng@@MAEXXZ @ 186 NONAME ; void CCmPluginBaseEng::PrepareToLoadRecordsL(void) - ?PrepareToUpdateRecordsL@CCmPluginBaseEng@@MAEXXZ @ 187 NONAME ; void CCmPluginBaseEng::PrepareToUpdateRecordsL(void) - ?PrepareToUpdateRecordsL@CCmPluginLanBase@@UAEXXZ @ 188 NONAME ; void CCmPluginLanBase::PrepareToUpdateRecordsL(void) - ?PriorityL@CCmDestinationImpl@@QAEIAAVCCmPluginBaseEng@@@Z @ 189 NONAME ABSENT ; unsigned int CCmDestinationImpl::PriorityL(class CCmPluginBaseEng &) - ?PriorityL@RCmDestination@@QBEIABVRCmConnectionMethod@@@Z @ 190 NONAME ; unsigned int RCmDestination::PriorityL(class RCmConnectionMethod const &) const - ?PriorityL@RCmDestinationExt@@QAEIABVRCmConnectionMethodExt@@@Z @ 191 NONAME ; unsigned int RCmDestinationExt::PriorityL(class RCmConnectionMethodExt const &) - ?ProcessCommandL@CmPluginBaseSettingsDlg@@UAEXH@Z @ 192 NONAME ; void CmPluginBaseSettingsDlg::ProcessCommandL(int) - ?ProtectionLevel@CCmDestinationImpl@@QAE?AW4TProtectionLevel@CMManager@@XZ @ 193 NONAME ; enum CMManager::TProtectionLevel CCmDestinationImpl::ProtectionLevel(void) - ?ProtectionLevel@RCmDestination@@QBE?AW4TProtectionLevel@CMManager@@XZ @ 194 NONAME ; enum CMManager::TProtectionLevel RCmDestination::ProtectionLevel(void) const - ?ProtectionLevel@RCmDestinationExt@@QAE?AW4TProtectionLevel@CMManager@@XZ @ 195 NONAME ; enum CMManager::TProtectionLevel RCmDestinationExt::ProtectionLevel(void) - ?ReadDefConnL@RCmManager@@QAEXAAUTCmDefConnValue@@@Z @ 196 NONAME ; void RCmManager::ReadDefConnL(struct TCmDefConnValue &) - ?ReadDefConnL@RCmManagerExt@@QAEXAAUTCmDefConnValue@@@Z @ 197 NONAME ; void RCmManagerExt::ReadDefConnL(struct TCmDefConnValue &) - ?ReadOnlyAttributeL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 198 NONAME ; int ReadOnlyAttributeL(class CCmPluginBaseEng *, unsigned long, void const *) - ?RemoveAllReferencesL@RCmManagerExt@@QAEXAAVRCmConnectionMethodExt@@@Z @ 199 NONAME ; void RCmManagerExt::RemoveAllReferencesL(class RCmConnectionMethodExt &) - ?RemoveCommonConversionTable@CCmPluginBaseEng@@IAEXPBUTCmCommonAttrConvArrayItem@@@Z @ 200 NONAME ; void CCmPluginBaseEng::RemoveCommonConversionTable(struct TCmCommonAttrConvArrayItem const *) - ?RemoveConnectionMethodL@RCmDestinationExt@@QAEXVRCmConnectionMethodExt@@@Z @ 201 NONAME ; void RCmDestinationExt::RemoveConnectionMethodL(class RCmConnectionMethodExt) - ?RemoveConnectionMethodL@RCmManagerExt@@QAEXAAVRCmDestinationExt@@AAVRCmConnectionMethodExt@@@Z @ 202 NONAME ; void RCmManagerExt::RemoveConnectionMethodL(class RCmDestinationExt &, class RCmConnectionMethodExt &) - ?RemoveConversionTable@CCmPluginBaseEng@@IAEXPBUTCmAttribConvTable@@@Z @ 203 NONAME ; void CCmPluginBaseEng::RemoveConversionTable(struct TCmAttribConvTable const *) - ?RemoveFromPool@CCmDestinationImpl@@QAEXXZ @ 204 NONAME ; void CCmDestinationImpl::RemoveFromPool(void) - ?RemoveResourceFile@CCmPluginBaseEng@@IAEXABVTDesC16@@@Z @ 205 NONAME ; void CCmPluginBaseEng::RemoveResourceFile(class TDesC16 const &) - ?Reset@CCmPluginBaseEng@@IAEXXZ @ 206 NONAME ; void CCmPluginBaseEng::Reset(void) - ?RestoreAttributeL@CCmPluginBaseEng@@UAEXK@Z @ 207 NONAME ; void CCmPluginBaseEng::RestoreAttributeL(unsigned long) - ?RunAdvancedSettingsL@CmPluginBaseSettingsDlgAdv@@UAEXXZ @ 208 NONAME ; void CmPluginBaseSettingsDlgAdv::RunAdvancedSettingsL(void) - ?RunAdvancedSettingsL@CmPluginBaseSettingsDlgIp@@UAEXXZ @ 209 NONAME ; void CmPluginBaseSettingsDlgIp::RunAdvancedSettingsL(void) - ?RunApplicationSettingsL@CCmApplicationSettingsUi@@QAEHAAUTCmSettingSelection@@@Z @ 210 NONAME ; int CCmApplicationSettingsUi::RunApplicationSettingsL(struct TCmSettingSelection &) - ?RunApplicationSettingsL@CCmApplicationSettingsUi@@QAEHAAUTCmSettingSelection@@IAAV?$RArray@K@@@Z @ 211 NONAME ; int CCmApplicationSettingsUi::RunApplicationSettingsL(struct TCmSettingSelection &, unsigned int, class RArray &) - ?RunApplicationSettingsL@CCmApplicationSettingsUiImpl@@QAEHAAUTCmSettingSelection@@@Z @ 212 NONAME ; int CCmApplicationSettingsUiImpl::RunApplicationSettingsL(struct TCmSettingSelection &) - ?RunApplicationSettingsL@CCmConnSettingsUiImpl@@QAEHAAUTCmSettingSelection@@IAAV?$RArray@K@@@Z @ 213 NONAME ; int CCmConnSettingsUiImpl::RunApplicationSettingsL(struct TCmSettingSelection &, unsigned int, class RArray &) - ?RunSettingsL@CCmPluginLanBase@@UAEHXZ @ 214 NONAME ; int CCmPluginLanBase::RunSettingsL(void) - ?RunSettingsL@CCmSettingsUi@@QAE?AW4TResult@1@XZ @ 215 NONAME ; enum CCmSettingsUi::TResult CCmSettingsUi::RunSettingsL(void) - ?SelectDestinationDlgL@CCmSettingsUi@@QAEHAAK@Z @ 216 NONAME ; int CCmSettingsUi::SelectDestinationDlgL(unsigned long &) - ?SelectItem@CmPluginBaseSettingsDlg@@IAEXH@Z @ 217 NONAME ; void CmPluginBaseSettingsDlg::SelectItem(int) - ?ServiceRecord@CCmPluginLanBase@@ABEAAVCCDLANServiceRecord@CommsDat@@XZ @ 218 NONAME ; class CommsDat::CCDLANServiceRecord & CCmPluginLanBase::ServiceRecord(void) const - ?ServiceRecordIdLC@CCmPluginLanBase@@MAEXAAPAVHBufC16@@AAK@Z @ 219 NONAME ; void CCmPluginLanBase::ServiceRecordIdLC(class HBufC16 * &, unsigned long &) - ?Session@CCmPluginBaseEng@@QBEAAVCMDBSession@CommsDat@@XZ @ 220 NONAME ; class CommsDat::CMDBSession & CCmPluginBaseEng::Session(void) const - ?SetBoolAttributeL@CCmPluginBaseEng@@UAEXKH@Z @ 221 NONAME ; void CCmPluginBaseEng::SetBoolAttributeL(unsigned long, int) - ?SetBoolAttributeL@RCmConnectionMethodExt@@QAEXKH@Z @ 222 NONAME ; void RCmConnectionMethodExt::SetBoolAttributeL(unsigned long, int) - ?SetDNSServerAddressL@CCmPluginBaseEng@@QAEXKABVTDesC16@@K0KH@Z @ 223 NONAME ; void CCmPluginBaseEng::SetDNSServerAddressL(unsigned long, class TDesC16 const &, unsigned long, class TDesC16 const &, unsigned long, int) - ?SetHiddenL@CCmDestinationImpl@@QAEXH@Z @ 224 NONAME ; void CCmDestinationImpl::SetHiddenL(int) - ?SetHiddenL@RCmDestinationExt@@QAEXH@Z @ 225 NONAME ; void RCmDestinationExt::SetHiddenL(int) - ?SetIconL@CCmDestinationImpl@@QAEXK@Z @ 226 NONAME ; void CCmDestinationImpl::SetIconL(unsigned long) - ?SetIconL@RCmDestinationExt@@QAEXK@Z @ 227 NONAME ; void RCmDestinationExt::SetIconL(unsigned long) - ?SetIntAttributeL@CCmPluginBaseEng@@UAEXKK@Z @ 228 NONAME ; void CCmPluginBaseEng::SetIntAttributeL(unsigned long, unsigned long) - ?SetIntAttributeL@RCmConnectionMethodExt@@QAEXKK@Z @ 229 NONAME ; void RCmConnectionMethodExt::SetIntAttributeL(unsigned long, unsigned long) - ?SetMetadataL@RCmDestinationExt@@QAEXW4TSnapMetadataField@CMManager@@K@Z @ 230 NONAME ; void RCmDestinationExt::SetMetadataL(enum CMManager::TSnapMetadataField, unsigned long) - ?SetNameL@CCmDestinationImpl@@QAEXABVTDesC16@@@Z @ 231 NONAME ; void CCmDestinationImpl::SetNameL(class TDesC16 const &) - ?SetNameL@RCmDestinationExt@@QAEXABVTDesC16@@@Z @ 232 NONAME ; void RCmDestinationExt::SetNameL(class TDesC16 const &) - ?SetProtectionL@CCmDestinationImpl@@QAEXW4TProtectionLevel@CMManager@@@Z @ 233 NONAME ; void CCmDestinationImpl::SetProtectionL(enum CMManager::TProtectionLevel) - ?SetProtectionL@RCmDestinationExt@@QAEXW4TProtectionLevel@CMManager@@@Z @ 234 NONAME ; void RCmDestinationExt::SetProtectionL(enum CMManager::TProtectionLevel) - ?SetProxyServerNameL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 235 NONAME ; int SetProxyServerNameL(class CCmPluginBaseEng *, unsigned long, void const *) - ?SetString8AttributeL@CCmPluginBaseEng@@UAEXKABVTDesC8@@@Z @ 236 NONAME ; void CCmPluginBaseEng::SetString8AttributeL(unsigned long, class TDesC8 const &) - ?SetString8AttributeL@RCmConnectionMethodExt@@QAEXKABVTDesC8@@@Z @ 237 NONAME ; void RCmConnectionMethodExt::SetString8AttributeL(unsigned long, class TDesC8 const &) - ?SetStringAttributeL@CCmPluginBaseEng@@UAEXKABVTDesC16@@@Z @ 238 NONAME ; void CCmPluginBaseEng::SetStringAttributeL(unsigned long, class TDesC16 const &) - ?SetStringAttributeL@RCmConnectionMethodExt@@QAEXKABVTDesC16@@@Z @ 239 NONAME ; void RCmConnectionMethodExt::SetStringAttributeL(unsigned long, class TDesC16 const &) - ?ShowConfirmationQueryL@TCmCommonUi@@SAHH@Z @ 240 NONAME ; int TCmCommonUi::ShowConfirmationQueryL(int) - ?ShowConfirmationQueryL@TCmCommonUi@@SAHHABVTDesC16@@@Z @ 241 NONAME ; int TCmCommonUi::ShowConfirmationQueryL(int, class TDesC16 const &) - ?ShowConfirmationQueryWithInputL@TCmCommonUi@@SAHHAAVTDes16@@@Z @ 242 NONAME ; int TCmCommonUi::ShowConfirmationQueryWithInputL(int, class TDes16 &) - ?ShowNoteL@TCmCommonUi@@SAHABVTDesC16@@W4TCmNoteType@1@@Z @ 243 NONAME ; int TCmCommonUi::ShowNoteL(class TDesC16 const &, enum TCmCommonUi::TCmNoteType) - ?ShowNoteL@TCmCommonUi@@SAHHABVTDesC16@@W4TCmNoteType@1@@Z @ 244 NONAME ; int TCmCommonUi::ShowNoteL(int, class TDesC16 const &, enum TCmCommonUi::TCmNoteType) - ?ShowNoteL@TCmCommonUi@@SAHHW4TCmNoteType@1@@Z @ 245 NONAME ; int TCmCommonUi::ShowNoteL(int, enum TCmCommonUi::TCmNoteType) - ?ShowPopupIPv4DNSEditorL@CmPluginBaseSettingsDlg@@QAEHKKKK@Z @ 246 NONAME ; int CmPluginBaseSettingsDlg::ShowPopupIPv4DNSEditorL(unsigned long, unsigned long, unsigned long, unsigned long) - ?ShowPopupIPv6DNSEditorL@CmPluginBaseSettingsDlg@@QAEHPBKKKK@Z @ 247 NONAME ; int CmPluginBaseSettingsDlg::ShowPopupIPv6DNSEditorL(unsigned long const *, unsigned long, unsigned long, unsigned long) - ?ShowPopupIpSettingPageL@CmPluginBaseSettingsDlg@@QAEHKK@Z @ 248 NONAME ; int CmPluginBaseSettingsDlg::ShowPopupIpSettingPageL(unsigned long, unsigned long) - ?ShowPopupListL@TCmCommonUi@@SAHABVTDesC16@@PAVCDesC16ArrayFlat@@PAV?$CArrayPtr@VCGulIcon@@@@IAAH@Z @ 249 NONAME ; int TCmCommonUi::ShowPopupListL(class TDesC16 const &, class CDesC16ArrayFlat *, class CArrayPtr *, unsigned int, int &) - ?ShowPopupPasswordSettingPageL@CmPluginBaseSettingsDlg@@QAEHKK@Z @ 250 NONAME ; int CmPluginBaseSettingsDlg::ShowPopupPasswordSettingPageL(unsigned long, unsigned long) - ?ShowPopupPortNumSettingPageL@CmPluginBaseSettingsDlg@@QAEHKK@Z @ 251 NONAME ; int CmPluginBaseSettingsDlg::ShowPopupPortNumSettingPageL(unsigned long, unsigned long) - ?ShowPopupSettingPageL@CmPluginBaseSettingsDlg@@MAEHKH@Z @ 252 NONAME ; int CmPluginBaseSettingsDlg::ShowPopupSettingPageL(unsigned long, int) - ?ShowPopupSettingPageL@CmPluginBaseSettingsDlgAdv@@MAEHHH@Z @ 253 NONAME ; int CmPluginBaseSettingsDlgAdv::ShowPopupSettingPageL(int, int) - ?ShowPopupTextSettingPageL@CmPluginBaseSettingsDlg@@QAEHKK@Z @ 254 NONAME ; int CmPluginBaseSettingsDlg::ShowPopupTextSettingPageL(unsigned long, unsigned long) - ?ShowRadioButtonSettingPageL@CmPluginBaseSettingsDlg@@QAEHAAVCDesC16ArrayFlat@@AAHK@Z @ 255 NONAME ; int CmPluginBaseSettingsDlg::ShowRadioButtonSettingPageL(class CDesC16ArrayFlat &, int &, unsigned long) - ?ShowRadioButtonSettingPageL@CmPluginBaseSettingsDlg@@QAEHPBKAAHK@Z @ 256 NONAME ; int CmPluginBaseSettingsDlg::ShowRadioButtonSettingPageL(unsigned long const *, int &, unsigned long) - ?StringAttributeWithDefaultL@CmPluginBaseSettingsDlg@@IAEPAVHBufC16@@KK@Z @ 257 NONAME ; class HBufC16 * CmPluginBaseSettingsDlg::StringAttributeWithDefaultL(unsigned long, unsigned long) - ?SupportedBearersL@RCmManagerExt@@QBEXAAV?$RArray@K@@@Z @ 258 NONAME ; void RCmManagerExt::SupportedBearersL(class RArray &) const - ?UncategorizedIconL@RCmManagerExt@@QBEPAVCGulIcon@@XZ @ 259 NONAME ; class CGulIcon * RCmManagerExt::UncategorizedIconL(void) const - ?UpdateBearerPriorityArrayL@RCmManagerExt@@QAEXABV?$RArray@VTBearerPriority@@@@@Z @ 260 NONAME ; void RCmManagerExt::UpdateBearerPriorityArrayL(class RArray const &) - ?UpdateL@CCmDestinationImpl@@QAEXXZ @ 261 NONAME ; void CCmDestinationImpl::UpdateL(void) - ?UpdateL@CCmPluginBaseEng@@UAEXXZ @ 262 NONAME ; void CCmPluginBaseEng::UpdateL(void) - ?UpdateL@RCmConnectionMethodExt@@QAEXXZ @ 263 NONAME ; void RCmConnectionMethodExt::UpdateL(void) - ?UpdateL@RCmDestinationExt@@QAEXXZ @ 264 NONAME ; void RCmDestinationExt::UpdateL(void) - ?UpdateListBoxContentL@CmPluginBaseSettingsDlg@@MAEXXZ @ 265 NONAME ; void CmPluginBaseSettingsDlg::UpdateListBoxContentL(void) - ?UpdateListBoxContentL@CmPluginBaseSettingsDlgAdv@@MAEXXZ @ 266 NONAME ; void CmPluginBaseSettingsDlgAdv::UpdateListBoxContentL(void) - ?UpdateListBoxContentL@CmPluginBaseSettingsDlgIp@@MAEXXZ @ 267 NONAME ; void CmPluginBaseSettingsDlgIp::UpdateListBoxContentL(void) - ?UpdateProxyRecordL@CCmPluginBaseEng@@AAEXXZ @ 268 NONAME ABSENT ; void CCmPluginBaseEng::UpdateProxyRecordL(void) - ?UpdateServiceRecordL@CCmPluginBaseEng@@MAEXXZ @ 269 NONAME ; void CCmPluginBaseEng::UpdateServiceRecordL(void) - ?WriteDefConnL@RCmManagerExt@@QAEXABUTCmDefConnValue@@@Z @ 270 NONAME ; void RCmManagerExt::WriteDefConnL(struct TCmDefConnValue const &) - ??0RCmDestination@@QAE@XZ @ 271 NONAME ; RCmDestination::RCmDestination(void) - ??0RCmDestinationExt@@QAE@XZ @ 272 NONAME ; RCmDestinationExt::RCmDestinationExt(void) - ??8RCmDestination@@QBEHABV0@@Z @ 273 NONAME ; int RCmDestination::operator==(class RCmDestination const &) const - ??8RCmDestinationExt@@QBEHABV0@@Z @ 274 NONAME ; int RCmDestinationExt::operator==(class RCmDestinationExt const &) const - ??9RCmDestination@@QBEHABV0@@Z @ 275 NONAME ; int RCmDestination::operator!=(class RCmDestination const &) const - ??9RCmDestinationExt@@QBEHABV0@@Z @ 276 NONAME ; int RCmDestinationExt::operator!=(class RCmDestinationExt const &) const - ??0CCmPluginBase@@QAE@PAVCCmPluginBaseEng@@@Z @ 277 NONAME ; CCmPluginBase::CCmPluginBase(class CCmPluginBaseEng *) - ??1CCmPluginBase@@UAE@XZ @ 278 NONAME ; CCmPluginBase::~CCmPluginBase(void) - ?AddResourceFileL@CCmPluginBase@@IAEXABVTDesC16@@@Z @ 279 NONAME ; void CCmPluginBase::AddResourceFileL(class TDesC16 const &) - ?AllocReadL@CCmPluginBase@@IBEPAVHBufC16@@H@Z @ 280 NONAME ; class HBufC16 * CCmPluginBase::AllocReadL(int) const - ?CmMgr@CCmPluginBase@@QBEAAVCCmManagerImpl@@XZ @ 281 NONAME ; class CCmManagerImpl & CCmPluginBase::CmMgr(void) const - ?ConstructL@CCmPluginBase@@IAEXXZ @ 282 NONAME ; void CCmPluginBase::ConstructL(void) - ?CreateCopyL@CCmPluginBase@@QBEPAV1@XZ @ 283 NONAME ; class CCmPluginBase * CCmPluginBase::CreateCopyL(void) const - ?CreateNewL@CCmPluginBase@@QAEXXZ @ 284 NONAME ; void CCmPluginBase::CreateNewL(void) - ?DeleteL@CCmPluginBase@@QAEHHH@Z @ 285 NONAME ; int CCmPluginBase::DeleteL(int, int) - ?Destination@CCmPluginBase@@QBEPAVCCmDestinationImpl@@XZ @ 286 NONAME ; class CCmDestinationImpl * CCmPluginBase::Destination(void) const - ?EnableChargeCardL@CCmPluginBase@@AAEXH@Z @ 287 NONAME ; void CCmPluginBase::EnableChargeCardL(int) - ?EnableLocationL@CCmPluginBase@@AAEXH@Z @ 288 NONAME ; void CCmPluginBase::EnableLocationL(int) - ?EnableProxyL@CCmPluginBase@@AAEXH@Z @ 289 NONAME ; void CCmPluginBase::EnableProxyL(int) - ?GetBoolAttributeL@CCmPluginBase@@QBEHK@Z @ 290 NONAME ; int CCmPluginBase::GetBoolAttributeL(unsigned long) const - ?GetConnectionMethodL@CCmDestinationImpl@@QAEPAVCCmPluginBase@@H@Z @ 291 NONAME ; class CCmPluginBase * CCmDestinationImpl::GetConnectionMethodL(int) - ?GetConnectionMethodL@CCmManagerImpl@@QAEPAVCCmPluginBase@@K@Z @ 292 NONAME ; class CCmPluginBase * CCmManagerImpl::GetConnectionMethodL(unsigned long) - ?GetIntAttributeL@CCmPluginBase@@QBEKK@Z @ 293 NONAME ; unsigned long CCmPluginBase::GetIntAttributeL(unsigned long) const - ?GetString8AttributeL@CCmPluginBase@@QBEPAVHBufC8@@K@Z @ 294 NONAME ; class HBufC8 * CCmPluginBase::GetString8AttributeL(unsigned long) const - ?GetStringAttributeL@CCmPluginBase@@QBEPAVHBufC16@@K@Z @ 295 NONAME ; class HBufC16 * CCmPluginBase::GetStringAttributeL(unsigned long) const - ?IAPRecordElementId@CCmPluginBase@@QBEKXZ @ 296 NONAME ; unsigned long CCmPluginBase::IAPRecordElementId(void) const - ?LoadL@CCmPluginBase@@QAEXK@Z @ 297 NONAME ; void CCmPluginBase::LoadL(unsigned long) - ?LoadServiceSettingL@CCmPluginBase@@IAEXXZ @ 298 NONAME ; void CCmPluginBase::LoadServiceSettingL(void) - ?NumOfConnMethodReferencesL@CCmPluginBase@@QAEHXZ @ 299 NONAME ; int CCmPluginBase::NumOfConnMethodReferencesL(void) - ?ParentDestination@CCmPluginBase@@QBEPAVCCmDestinationImpl@@XZ @ 300 NONAME ; class CCmDestinationImpl * CCmPluginBase::ParentDestination(void) const - ?Plugin@CCmPluginBase@@QBEPAVCCmPluginBaseEng@@XZ @ 301 NONAME ; class CCmPluginBaseEng * CCmPluginBase::Plugin(void) const - ?PrepareToLoadRecordsL@CCmPluginBase@@IAEXXZ @ 302 NONAME ; void CCmPluginBase::PrepareToLoadRecordsL(void) - ?PrepareToUpdateRecordsL@CCmPluginBase@@IAEXXZ @ 303 NONAME ; void CCmPluginBase::PrepareToUpdateRecordsL(void) - ?RemoveResourceFile@CCmPluginBase@@IAEXABVTDesC16@@@Z @ 304 NONAME ; void CCmPluginBase::RemoveResourceFile(class TDesC16 const &) - ?RestoreAttributeL@CCmPluginBase@@QAEXK@Z @ 305 NONAME ; void CCmPluginBase::RestoreAttributeL(unsigned long) - ?Session@CCmPluginBase@@QBEAAVCMDBSession@CommsDat@@XZ @ 306 NONAME ; class CommsDat::CMDBSession & CCmPluginBase::Session(void) const - ?SetBoolAttributeL@CCmPluginBase@@QAEXKH@Z @ 307 NONAME ; void CCmPluginBase::SetBoolAttributeL(unsigned long, int) - ?SetIntAttributeL@CCmPluginBase@@QAEXKK@Z @ 308 NONAME ; void CCmPluginBase::SetIntAttributeL(unsigned long, unsigned long) - ?SetString8AttributeL@CCmPluginBase@@QAEXKABVTDesC8@@@Z @ 309 NONAME ; void CCmPluginBase::SetString8AttributeL(unsigned long, class TDesC8 const &) - ?SetStringAttributeL@CCmPluginBase@@QAEXKABVTDesC16@@@Z @ 310 NONAME ; void CCmPluginBase::SetStringAttributeL(unsigned long, class TDesC16 const &) - ?UpdateL@CCmPluginBase@@QAEXXZ @ 311 NONAME ; void CCmPluginBase::UpdateL(void) - ?UpdateProxyRecordL@CCmPluginBase@@AAEXXZ @ 312 NONAME ; void CCmPluginBase::UpdateProxyRecordL(void) - ?UpdateServiceRecordL@CCmPluginBase@@IAEXXZ @ 313 NONAME ; void CCmPluginBase::UpdateServiceRecordL(void) - ??0RCmConnectionMethod@@QAE@XZ @ 314 NONAME ; RCmConnectionMethod::RCmConnectionMethod(void) - ??0RCmConnectionMethodExt@@QAE@XZ @ 315 NONAME ; RCmConnectionMethodExt::RCmConnectionMethodExt(void) - ??4RCmConnectionMethod@@QAEAAV0@ABV0@@Z @ 316 NONAME ; class RCmConnectionMethod & RCmConnectionMethod::operator=(class RCmConnectionMethod const &) - ??4RCmConnectionMethodExt@@QAEAAV0@ABV0@@Z @ 317 NONAME ; class RCmConnectionMethodExt & RCmConnectionMethodExt::operator=(class RCmConnectionMethodExt const &) - ??8RCmConnectionMethod@@QBEHAAV0@@Z @ 318 NONAME ; int RCmConnectionMethod::operator==(class RCmConnectionMethod &) const - ??8RCmConnectionMethodExt@@QBEHAAV0@@Z @ 319 NONAME ; int RCmConnectionMethodExt::operator==(class RCmConnectionMethodExt &) const - ??9RCmConnectionMethod@@QBEHAAV0@@Z @ 320 NONAME ; int RCmConnectionMethod::operator!=(class RCmConnectionMethod &) const - ??9RCmConnectionMethodExt@@QBEHAAV0@@Z @ 321 NONAME ; int RCmConnectionMethodExt::operator!=(class RCmConnectionMethodExt &) const - ??1RCmConnectionMethod@@QAE@XZ @ 322 NONAME ; RCmConnectionMethod::~RCmConnectionMethod(void) - ??1RCmConnectionMethodExt@@QAE@XZ @ 323 NONAME ; RCmConnectionMethodExt::~RCmConnectionMethodExt(void) - ?ClearDestinationArrayToUse@CCmConnSettingsUiImpl@@QAEXXZ @ 324 NONAME ; void CCmConnSettingsUiImpl::ClearDestinationArrayToUse(void) - ?SetDestinationArrayToUseL@CCmConnSettingsUiImpl@@QAEXV?$RArray@K@@@Z @ 325 NONAME ; void CCmConnSettingsUiImpl::SetDestinationArrayToUseL(class RArray) - ?GetAdditionalUids@CCmPluginBase@@QAEXAAV?$RArray@K@@@Z @ 326 NONAME ; void CCmPluginBase::GetAdditionalUids(class RArray &) - ?GetAdditionalUids@CCmPluginBaseEng@@UAEXAAV?$RArray@K@@@Z @ 327 NONAME ; void CCmPluginBaseEng::GetAdditionalUids(class RArray &) - ?WrapCmManager@CCmManagerImpl@@QAEXAAVRCmManagerExt@@@Z @ 328 NONAME ; void CCmManagerImpl::WrapCmManager(class RCmManagerExt &) - ?CombineArraysForPriorityOrderL@CCmManagerImpl@@AAEXAAV?$RPointerArray@VCCmPluginBase@@@@0@Z @ 329 NONAME ; void CCmManagerImpl::CombineArraysForPriorityOrderL(class RPointerArray &, class RPointerArray &) - ?CreateFlatCMListL@CCmManagerImpl@@QAEXKAAV?$RPointerArray@VCCmPluginBase@@@@@Z @ 330 NONAME ; void CCmManagerImpl::CreateFlatCMListL(unsigned long, class RPointerArray &) - ?FilterOutVirtualsL@CCmManagerImpl@@QAEXAAV?$RPointerArray@VCCmPluginBase@@@@@Z @ 331 NONAME ; void CCmManagerImpl::FilterOutVirtualsL(class RPointerArray &) - ?CreateFlatCMListLC@CCmManagerImpl@@QAEXKAAV?$RPointerArray@VCCmPluginBase@@@@@Z @ 332 NONAME ; void CCmManagerImpl::CreateFlatCMListLC(unsigned long, class RPointerArray &) - ??0RCmConnectionMethod@@QAE@ABV0@@Z @ 333 NONAME ; RCmConnectionMethod::RCmConnectionMethod(class RCmConnectionMethod const &) - ??0RCmConnectionMethodExt@@QAE@ABV0@@Z @ 334 NONAME ; RCmConnectionMethodExt::RCmConnectionMethodExt(class RCmConnectionMethodExt const &) - ?IsLinkedToIap@CCmPluginBase@@QAEHK@Z @ 335 NONAME ; int CCmPluginBase::IsLinkedToIap(unsigned long) - ?IsLinkedToSnap@CCmPluginBase@@QAEHK@Z @ 336 NONAME ; int CCmPluginBase::IsLinkedToSnap(unsigned long) - ?ParentDestination@CCmPluginBaseEng@@QBEPAVCCmDestinationImpl@@XZ @ 337 NONAME ; class CCmDestinationImpl * CCmPluginBaseEng::ParentDestination(void) const - ?CreateTablesAndOpenL@RCmManagerExt@@QAEXXZ @ 338 NONAME ; void RCmManagerExt::CreateTablesAndOpenL(void) - ?CreateConnectionMethodL@RCmDestinationExt@@QAE?AVRCmConnectionMethodExt@@KK@Z @ 339 NONAME ; class RCmConnectionMethodExt RCmDestinationExt::CreateConnectionMethodL(unsigned long, unsigned long) - ?CreateConnectionMethodL@RCmManagerExt@@QAE?AVRCmConnectionMethodExt@@KK@Z @ 340 NONAME ; class RCmConnectionMethodExt RCmManagerExt::CreateConnectionMethodL(unsigned long, unsigned long) - ?CreateDestinationL@RCmManagerExt@@QAE?AVRCmDestinationExt@@ABVTDesC16@@K@Z @ 341 NONAME ; class RCmDestinationExt RCmManagerExt::CreateDestinationL(class TDesC16 const &, unsigned long) - ?SetPreDefinedId@CCmPluginBaseEng@@QAEXK@Z @ 342 NONAME ; void CCmPluginBaseEng::SetPreDefinedId(unsigned long) - ?HandleResourceChange@CmPluginBaseSettingsDlg@@UAEXH@Z @ 343 NONAME ; void CmPluginBaseSettingsDlg::HandleResourceChange(int) - ?Execute@CmPluginBaseSettingsDlg@@UAEXXZ @ 344 NONAME ; void CmPluginBaseSettingsDlg::Execute(void) - ?CheckSpaceBelowCriticalLevelL@CCmPluginBaseEng@@QBEHXZ @ 345 NONAME ; int CCmPluginBaseEng::CheckSpaceBelowCriticalLevelL(void) const - ?HandleLeaveError@CmPluginBaseSettingsDlg@@UAEXH@Z @ 346 NONAME ; void CmPluginBaseSettingsDlg::HandleLeaveError(int) - ?AddConnectionMethodL@RCmDestination@@QAEHVRCmConnectionMethod@@@Z @ 347 NONAME ; int RCmDestination::AddConnectionMethodL(class RCmConnectionMethod) - ?AddEmbeddedDestinationL@RCmDestination@@QAEHABV1@@Z @ 348 NONAME ; int RCmDestination::AddEmbeddedDestinationL(class RCmDestination const &) - ?CopyConnectionMethodL@RCmManager@@QAEHAAVRCmDestination@@AAVRCmConnectionMethod@@@Z @ 349 NONAME ; int RCmManager::CopyConnectionMethodL(class RCmDestination &, class RCmConnectionMethod &) - ?CreateConnectionMethodL@RCmDestination@@QAE?AVRCmConnectionMethod@@K@Z @ 350 NONAME ; class RCmConnectionMethod RCmDestination::CreateConnectionMethodL(unsigned long) - ?CreateConnectionMethodL@RCmDestination@@QAE?AVRCmConnectionMethod@@KK@Z @ 351 NONAME ; class RCmConnectionMethod RCmDestination::CreateConnectionMethodL(unsigned long, unsigned long) - ?CreateConnectionMethodL@RCmManager@@QAE?AVRCmConnectionMethod@@K@Z @ 352 NONAME ; class RCmConnectionMethod RCmManager::CreateConnectionMethodL(unsigned long) - ?CreateConnectionMethodL@RCmManager@@QAE?AVRCmConnectionMethod@@KK@Z @ 353 NONAME ; class RCmConnectionMethod RCmManager::CreateConnectionMethodL(unsigned long, unsigned long) - ?CreateCopyL@RCmConnectionMethod@@QAE?AV1@XZ @ 354 NONAME ; class RCmConnectionMethod RCmConnectionMethod::CreateCopyL(void) - ?CreateDestinationL@RCmManager@@QAE?AVRCmDestination@@ABVTDesC16@@@Z @ 355 NONAME ; class RCmDestination RCmManager::CreateDestinationL(class TDesC16 const &) - ?CreateDestinationL@RCmManager@@QAE?AVRCmDestination@@ABVTDesC16@@K@Z @ 356 NONAME ; class RCmDestination RCmManager::CreateDestinationL(class TDesC16 const &, unsigned long) - ?CreateTablesAndOpenL@RCmManager@@QAEXXZ @ 357 NONAME ; void RCmManager::CreateTablesAndOpenL(void) - ?DeleteConnectionMethodL@RCmDestination@@QAEXAAVRCmConnectionMethod@@@Z @ 358 NONAME ; void RCmDestination::DeleteConnectionMethodL(class RCmConnectionMethod &) - ?DeleteL@RCmConnectionMethod@@QAEHXZ @ 359 NONAME ; int RCmConnectionMethod::DeleteL(void) - ?DeleteLD@RCmDestination@@QAEXXZ @ 360 NONAME ; void RCmDestination::DeleteLD(void) - ?ModifyPriorityL@RCmDestination@@QAEXAAVRCmConnectionMethod@@I@Z @ 361 NONAME ; void RCmDestination::ModifyPriorityL(class RCmConnectionMethod &, unsigned int) - ?MoveConnectionMethodL@RCmManager@@QAEHAAVRCmDestination@@0AAVRCmConnectionMethod@@@Z @ 362 NONAME ; int RCmManager::MoveConnectionMethodL(class RCmDestination &, class RCmDestination &, class RCmConnectionMethod &) - ?RemoveAllReferencesL@RCmManager@@QAEXAAVRCmConnectionMethod@@@Z @ 363 NONAME ; void RCmManager::RemoveAllReferencesL(class RCmConnectionMethod &) - ?RemoveConnectionMethodL@RCmDestination@@QAEXVRCmConnectionMethod@@@Z @ 364 NONAME ; void RCmDestination::RemoveConnectionMethodL(class RCmConnectionMethod) - ?RemoveConnectionMethodL@RCmManager@@QAEXAAVRCmDestination@@AAVRCmConnectionMethod@@@Z @ 365 NONAME ; void RCmManager::RemoveConnectionMethodL(class RCmDestination &, class RCmConnectionMethod &) - ?SetBoolAttributeL@RCmConnectionMethod@@QAEXKH@Z @ 366 NONAME ; void RCmConnectionMethod::SetBoolAttributeL(unsigned long, int) - ?SetHiddenL@RCmDestination@@QAEXH@Z @ 367 NONAME ; void RCmDestination::SetHiddenL(int) - ?SetIconL@RCmDestination@@QAEXK@Z @ 368 NONAME ; void RCmDestination::SetIconL(unsigned long) - ?SetIntAttributeL@RCmConnectionMethod@@QAEXKK@Z @ 369 NONAME ; void RCmConnectionMethod::SetIntAttributeL(unsigned long, unsigned long) - ?SetMetadataL@RCmDestination@@QAEXW4TSnapMetadataField@CMManager@@K@Z @ 370 NONAME ; void RCmDestination::SetMetadataL(enum CMManager::TSnapMetadataField, unsigned long) - ?SetNameL@RCmDestination@@QAEXABVTDesC16@@@Z @ 371 NONAME ; void RCmDestination::SetNameL(class TDesC16 const &) - ?SetProtectionL@RCmDestination@@QAEXW4TProtectionLevel@CMManager@@@Z @ 372 NONAME ; void RCmDestination::SetProtectionL(enum CMManager::TProtectionLevel) - ?SetString8AttributeL@RCmConnectionMethod@@QAEXKABVTDesC8@@@Z @ 373 NONAME ; void RCmConnectionMethod::SetString8AttributeL(unsigned long, class TDesC8 const &) - ?SetStringAttributeL@RCmConnectionMethod@@QAEXKABVTDesC16@@@Z @ 374 NONAME ; void RCmConnectionMethod::SetStringAttributeL(unsigned long, class TDesC16 const &) - ?SupportedBearersL@RCmManager@@QBEXAAV?$RArray@K@@@Z @ 375 NONAME ; void RCmManager::SupportedBearersL(class RArray &) const - ?UncategorizedIconL@RCmManager@@QBEPAVCGulIcon@@XZ @ 376 NONAME ; class CGulIcon * RCmManager::UncategorizedIconL(void) const - ?UpdateBearerPriorityArrayL@RCmManager@@QAEXABV?$RArray@VTBearerPriority@@@@@Z @ 377 NONAME ; void RCmManager::UpdateBearerPriorityArrayL(class RArray const &) - ?UpdateL@RCmConnectionMethod@@QAEXXZ @ 378 NONAME ; void RCmConnectionMethod::UpdateL(void) - ?UpdateL@RCmDestination@@QAEXXZ @ 379 NONAME ; void RCmDestination::UpdateL(void) - ?WriteDefConnL@RCmManager@@QAEXABUTCmDefConnValue@@@Z @ 380 NONAME ; void RCmManager::WriteDefConnL(struct TCmDefConnValue const &) - ?WriteGenConnSettingsL@RCmManager@@QAEXABUTCmGenConnSettings@@@Z @ 381 NONAME ; void RCmManager::WriteGenConnSettingsL(struct TCmGenConnSettings const &) - ?ReadGenConnSettingsL@RCmManager@@QAEXAAUTCmGenConnSettings@@@Z @ 382 NONAME ; void RCmManager::ReadGenConnSettingsL(struct TCmGenConnSettings &) - ?WatcherRegisterL@CCmManagerImpl@@QAEXPAVMCmCommsDatWatcher@@@Z @ 383 NONAME ; void CCmManagerImpl::WatcherRegisterL(class MCmCommsDatWatcher *) - ?DestinationStillExistedL@CCmManagerImpl@@QAEHPAVCCmDestinationImpl@@@Z @ 384 NONAME ; int CCmManagerImpl::DestinationStillExistedL(class CCmDestinationImpl *) - ?IsIapStillInDestL@CCmManagerImpl@@QAEHPAVCCmDestinationImpl@@ABVCCmPluginBaseEng@@@Z @ 385 NONAME ; int CCmManagerImpl::IsIapStillInDestL(class CCmDestinationImpl *, class CCmPluginBaseEng const &) - ?IapStillExistedL@CCmManagerImpl@@QAEHABVCCmPluginBaseEng@@@Z @ 386 NONAME ; int CCmManagerImpl::IapStillExistedL(class CCmPluginBaseEng const &) - ?WatcherUnRegister@CCmManagerImpl@@QAEXXZ @ 387 NONAME ; void CCmManagerImpl::WatcherUnRegister(void) - ?RemoveDestFromPool@CCmManagerImpl@@QAEXPAVCCmDestinationImpl@@@Z @ 388 NONAME ; void CCmManagerImpl::RemoveDestFromPool(class CCmDestinationImpl *) - ?OfferKeyEventL@CmPluginBaseSettingsDlg@@MAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 389 NONAME ; enum TKeyResponse CmPluginBaseSettingsDlg::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode) - - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/EABI/CmManager_prot_setupU.def --- a/cmmanager/cmmgr/Framework/EABI/CmManager_prot_setupU.def Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,438 +0,0 @@ -EXPORTS - _Z18CheckIPv4ValidityLP16CCmPluginBaseEngmPKv @ 1 NONAME - _Z18CheckIPv6ValidityLP16CCmPluginBaseEngmPKv @ 2 NONAME - _Z18ReadOnlyAttributeLP16CCmPluginBaseEngmPKv @ 3 NONAME - _Z19ClassifyIPv6AddressRK7TDesC16 @ 4 NONAME - _Z19SetProxyServerNameLP16CCmPluginBaseEngmPKv @ 5 NONAME - _Z22CheckRecordIdValidityLP16CCmPluginBaseEngmPKv @ 6 NONAME - _Z24CheckPortNumberValidityLP16CCmPluginBaseEngmPKv @ 7 NONAME - _Z24IsUnspecifiedIPv4AddressRK7TDesC16 @ 8 NONAME - _Z26CheckWAPWspOptionValidityLP16CCmPluginBaseEngmPKv @ 9 NONAME - _ZN10RCmManager12ReadDefConnLER15TCmDefConnValue @ 10 NONAME - _ZN10RCmManager5CloseEv @ 11 NONAME - _ZN10RCmManager5OpenLEv @ 12 NONAME - _ZN10RCmManager6OpenLCEv @ 13 NONAME - _ZN11TCmCommonUi14ShowPopupListLERK7TDesC16P16CDesC16ArrayFlatP9CArrayPtrI8CGulIconEjRi @ 14 NONAME - _ZN11TCmCommonUi22ShowConfirmationQueryLEi @ 15 NONAME - _ZN11TCmCommonUi22ShowConfirmationQueryLEiRK7TDesC16 @ 16 NONAME - _ZN11TCmCommonUi31ShowConfirmationQueryWithInputLEiR6TDes16 @ 17 NONAME - _ZN11TCmCommonUi9ShowNoteLERK7TDesC16NS_11TCmNoteTypeE @ 18 NONAME - _ZN11TCmCommonUi9ShowNoteLEiNS_11TCmNoteTypeE @ 19 NONAME - _ZN11TCmCommonUi9ShowNoteLEiRK7TDesC16NS_11TCmNoteTypeE @ 20 NONAME - _ZN13CCmSettingsUi12RunSettingsLEv @ 21 NONAME - _ZN13CCmSettingsUi21SelectDestinationDlgLERm @ 22 NONAME - _ZN13CCmSettingsUi4NewLEv @ 23 NONAME - _ZN13CCmSettingsUiD0Ev @ 24 NONAME - _ZN13CCmSettingsUiD1Ev @ 25 NONAME - _ZN13CCmSettingsUiD2Ev @ 26 NONAME - _ZN13RCmManagerExt11EasyWlanIdLEv @ 27 NONAME - _ZN13RCmManagerExt12DestinationLEm @ 28 NONAME - _ZN13RCmManagerExt12ReadDefConnLER15TCmDefConnValue @ 29 NONAME - _ZN13RCmManagerExt13WriteDefConnLERK15TCmDefConnValue @ 30 NONAME - _ZN13RCmManagerExt16AllDestinationsLER6RArrayImE @ 31 NONAME - _ZN13RCmManagerExt17ConnectionMethodLER6RArrayImEiii @ 32 NONAME - _ZN13RCmManagerExt17ConnectionMethodLEm @ 33 NONAME - _ZN13RCmManagerExt18CreateDestinationLERK7TDesC16 @ 34 NONAME - _ZN13RCmManagerExt20RemoveAllReferencesLER22RCmConnectionMethodExt @ 35 NONAME - _ZN13RCmManagerExt21CopyConnectionMethodLER17RCmDestinationExtR22RCmConnectionMethodExt @ 36 NONAME - _ZN13RCmManagerExt21MoveConnectionMethodLER17RCmDestinationExtS1_R22RCmConnectionMethodExt @ 37 NONAME - _ZN13RCmManagerExt23CreateConnectionMethodLEm @ 38 NONAME - _ZN13RCmManagerExt23RemoveConnectionMethodLER17RCmDestinationExtR22RCmConnectionMethodExt @ 39 NONAME - _ZN13RCmManagerExt26UpdateBearerPriorityArrayLERK6RArrayI15TBearerPriorityE @ 40 NONAME - _ZN13RCmManagerExt5CloseEv @ 41 NONAME - _ZN13RCmManagerExt5OpenLEv @ 42 NONAME - _ZN13RCmManagerExt6OpenLCEv @ 43 NONAME - _ZN14CCmManagerImpl11EasyWlanIdLEv @ 44 NONAME - _ZN14CCmManagerImpl12DestinationLEm @ 45 NONAME - _ZN14CCmManagerImpl16AllDestinationsLER6RArrayImE @ 46 NONAME - _ZN14CCmManagerImpl17ConnectionMethodLER6RArrayImEiiii @ 47 NONAME - _ZN14CCmManagerImpl17ConnectionMethodLEm @ 48 NONAME - _ZN14RCmDestination5CloseEv @ 49 NONAME - _ZN14RCmDestinationC1ERKS_ @ 50 NONAME - _ZN14RCmDestinationC2ERKS_ @ 51 NONAME - _ZN14RCmDestinationD1Ev @ 52 NONAME - _ZN14RCmDestinationD2Ev @ 53 NONAME - _ZN14RCmDestinationaSERKS_ @ 54 NONAME - _ZN16CCmPluginBaseEng10ConstructLEv @ 55 NONAME - _ZN16CCmPluginBaseEng10CreateNewLEv @ 56 NONAME - _ZN16CCmPluginBaseEng12EnableProxyLEi @ 57 NONAME ABSENT - _ZN16CCmPluginBaseEng13ConvTableItemEm @ 58 NONAME - _ZN16CCmPluginBaseEng15EnableLocationLEi @ 59 NONAME ABSENT - _ZN16CCmPluginBaseEng16AddResourceFileLERK7TDesC16 @ 60 NONAME - _ZN16CCmPluginBaseEng16FeatureSupportedEi @ 61 NONAME - _ZN16CCmPluginBaseEng16SetIntAttributeLEmm @ 62 NONAME - _ZN16CCmPluginBaseEng17EnableChargeCardLEi @ 63 NONAME ABSENT - _ZN16CCmPluginBaseEng17RestoreAttributeLEm @ 64 NONAME - _ZN16CCmPluginBaseEng17SetBoolAttributeLEmi @ 65 NONAME - _ZN16CCmPluginBaseEng18RemoveResourceFileERK7TDesC16 @ 66 NONAME - _ZN16CCmPluginBaseEng18UpdateProxyRecordLEv @ 67 NONAME ABSENT - _ZN16CCmPluginBaseEng19LoadServiceSettingLEv @ 68 NONAME - _ZN16CCmPluginBaseEng19SetStringAttributeLEmRK7TDesC16 @ 69 NONAME - _ZN16CCmPluginBaseEng20AddConverstionTableLEPPN8CommsDat13CCDRecordBaseEPiPK18TCmAttribConvTable @ 70 NONAME - _ZN16CCmPluginBaseEng20SetDNSServerAddressLEmRK7TDesC16mS2_mi @ 71 NONAME - _ZN16CCmPluginBaseEng20SetString8AttributeLEmRK6TDesC8 @ 72 NONAME - _ZN16CCmPluginBaseEng20UpdateServiceRecordLEv @ 73 NONAME - _ZN16CCmPluginBaseEng21PrepareToLoadRecordsLEv @ 74 NONAME - _ZN16CCmPluginBaseEng21RemoveConversionTableEPK18TCmAttribConvTable @ 75 NONAME - _ZN16CCmPluginBaseEng22CheckDNSServerAddressLEiRN8CommsDat9CMDBFieldI7TDesC16EES4_RNS1_IiEE @ 76 NONAME - _ZN16CCmPluginBaseEng23PrepareToUpdateRecordsLEv @ 77 NONAME - _ZN16CCmPluginBaseEng25AddCommonConversionTableLEPK26TCmCommonAttrConvArrayItem @ 78 NONAME - _ZN16CCmPluginBaseEng26NumOfConnMethodReferencesLEv @ 79 NONAME - _ZN16CCmPluginBaseEng27RemoveCommonConversionTableEPK26TCmCommonAttrConvArrayItem @ 80 NONAME - _ZN16CCmPluginBaseEng5LoadLEm @ 81 NONAME - _ZN16CCmPluginBaseEng5ResetEv @ 82 NONAME - _ZN16CCmPluginBaseEng7DeleteLEii @ 83 NONAME - _ZN16CCmPluginBaseEng7UpdateLEv @ 84 NONAME - _ZN16CCmPluginBaseEngC2EP18TCmPluginInitParam @ 85 NONAME - _ZN16CCmPluginBaseEngD0Ev @ 86 NONAME - _ZN16CCmPluginBaseEngD1Ev @ 87 NONAME - _ZN16CCmPluginBaseEngD2Ev @ 88 NONAME - _ZN16CCmPluginLanBase10ConstructLEv @ 89 NONAME - _ZN16CCmPluginLanBase12RunSettingsLEv @ 90 NONAME - _ZN16CCmPluginLanBase16BearerRecordIdLCERP7HBufC16Rm @ 91 NONAME - _ZN16CCmPluginLanBase17InitializeWithUiLEi @ 92 NONAME - _ZN16CCmPluginLanBase17ServiceRecordIdLCERP7HBufC16Rm @ 93 NONAME - _ZN16CCmPluginLanBase19LoadServiceSettingLEv @ 94 NONAME - _ZN16CCmPluginLanBase23CreateNewServiceRecordLEv @ 95 NONAME - _ZN16CCmPluginLanBase23PrepareToUpdateRecordsLEv @ 96 NONAME - _ZN16CCmPluginLanBaseC2EP18TCmPluginInitParam @ 97 NONAME - _ZN16CCmPluginLanBaseD0Ev @ 98 NONAME - _ZN16CCmPluginLanBaseD1Ev @ 99 NONAME - _ZN16CCmPluginLanBaseD2Ev @ 100 NONAME - _ZN17RCmDestinationExt10SetHiddenLEi @ 101 NONAME - _ZN17RCmDestinationExt12SetMetadataLEN9CMManager18TSnapMetadataFieldEm @ 102 NONAME - _ZN17RCmDestinationExt14SetProtectionLEN9CMManager16TProtectionLevelE @ 103 NONAME - _ZN17RCmDestinationExt15ModifyPriorityLER22RCmConnectionMethodExtj @ 104 NONAME - _ZN17RCmDestinationExt15ProtectionLevelEv @ 105 NONAME - _ZN17RCmDestinationExt17ConnectionMethodLEi @ 106 NONAME - _ZN17RCmDestinationExt20AddConnectionMethodLE22RCmConnectionMethodExt @ 107 NONAME - _ZN17RCmDestinationExt21ConnectionMethodByIDLEi @ 108 NONAME - _ZN17RCmDestinationExt21ConnectionMethodCountEv @ 109 NONAME - _ZN17RCmDestinationExt23AddEmbeddedDestinationLERKS_ @ 110 NONAME - _ZN17RCmDestinationExt23CreateConnectionMethodLEm @ 111 NONAME - _ZN17RCmDestinationExt23DeleteConnectionMethodLER22RCmConnectionMethodExt @ 112 NONAME - _ZN17RCmDestinationExt23RemoveConnectionMethodLE22RCmConnectionMethodExt @ 113 NONAME - _ZN17RCmDestinationExt2IdEv @ 114 NONAME - _ZN17RCmDestinationExt5CloseEv @ 115 NONAME - _ZN17RCmDestinationExt5IconLEv @ 116 NONAME - _ZN17RCmDestinationExt6NameLCEv @ 117 NONAME - _ZN17RCmDestinationExt7UpdateLEv @ 118 NONAME - _ZN17RCmDestinationExt8DeleteLDEv @ 119 NONAME - _ZN17RCmDestinationExt8IsHiddenEv @ 120 NONAME - _ZN17RCmDestinationExt8SetIconLEm @ 121 NONAME - _ZN17RCmDestinationExt8SetNameLERK7TDesC16 @ 122 NONAME - _ZN17RCmDestinationExt9ElementIdEv @ 123 NONAME - _ZN17RCmDestinationExt9PriorityLERK22RCmConnectionMethodExt @ 124 NONAME - _ZN17RCmDestinationExtC1ERKS_ @ 125 NONAME - _ZN17RCmDestinationExtC2ERKS_ @ 126 NONAME - _ZN17RCmDestinationExtD1Ev @ 127 NONAME - _ZN17RCmDestinationExtD2Ev @ 128 NONAME - _ZN17RCmDestinationExtaSERKS_ @ 129 NONAME - _ZN18CCmDestinationImpl10SetHiddenLEi @ 130 NONAME - _ZN18CCmDestinationImpl14RemoveFromPoolEv @ 131 NONAME - _ZN18CCmDestinationImpl14SetProtectionLEN9CMManager16TProtectionLevelE @ 132 NONAME - _ZN18CCmDestinationImpl15ProtectionLevelEv @ 133 NONAME - _ZN18CCmDestinationImpl17ConnectionMethodLEi @ 134 NONAME - _ZN18CCmDestinationImpl21ConnectionMethodCountEv @ 135 NONAME - _ZN18CCmDestinationImpl4NewLER14CCmManagerImplRK7TDesC16 @ 136 NONAME - _ZN18CCmDestinationImpl4NewLER14CCmManagerImplj @ 137 NONAME - _ZN18CCmDestinationImpl5IconLEv @ 138 NONAME - _ZN18CCmDestinationImpl6NameLCEv @ 139 NONAME - _ZN18CCmDestinationImpl7UpdateLEv @ 140 NONAME - _ZN18CCmDestinationImpl8DeleteLDEv @ 141 NONAME - _ZN18CCmDestinationImpl8IsHiddenEv @ 142 NONAME - _ZN18CCmDestinationImpl8SetNameLERK7TDesC16 @ 143 NONAME - _ZN18CCmDestinationImpl9PriorityLER16CCmPluginBaseEng @ 144 NONAME ABSENT - _ZN19RCmConnectionMethod5CloseEv @ 145 NONAME - _ZN21CCmConnSettingsUiImpl23RunApplicationSettingsLER19TCmSettingSelectionjR6RArrayImE @ 146 NONAME - _ZN21CCmConnSettingsUiImpl4NewLEP14CCmManagerImpl @ 147 NONAME - _ZN21CCmTransactionHandler5CloseEv @ 148 NONAME ABSENT - _ZN22RCmConnectionMethodExt11CreateCopyLEv @ 149 NONAME - _ZN22RCmConnectionMethodExt16SetIntAttributeLEmm @ 150 NONAME - _ZN22RCmConnectionMethodExt17SetBoolAttributeLEmi @ 151 NONAME - _ZN22RCmConnectionMethodExt19SetStringAttributeLEmRK7TDesC16 @ 152 NONAME - _ZN22RCmConnectionMethodExt20SetString8AttributeLEmRK6TDesC8 @ 153 NONAME - _ZN22RCmConnectionMethodExt5CloseEv @ 154 NONAME - _ZN22RCmConnectionMethodExt7DeleteLEv @ 155 NONAME - _ZN22RCmConnectionMethodExt7UpdateLEv @ 156 NONAME - _ZN23CmPluginBaseSettingsDlg10InitTextsLEv @ 157 NONAME - _ZN23CmPluginBaseSettingsDlg10SelectItemEi @ 158 NONAME - _ZN23CmPluginBaseSettingsDlg13LoadResourceLERK7TDesC16 @ 159 NONAME - _ZN23CmPluginBaseSettingsDlg15GetIPv6DNSTypeLEmm @ 160 NONAME - _ZN23CmPluginBaseSettingsDlg15ProcessCommandLEi @ 161 NONAME - _ZN23CmPluginBaseSettingsDlg16DynInitMenuPaneLEiP12CEikMenuPane @ 162 NONAME - _ZN23CmPluginBaseSettingsDlg17ConstructAndRunLDEv @ 163 NONAME - _ZN23CmPluginBaseSettingsDlg17PreLayoutDynInitLEv @ 164 NONAME - _ZN23CmPluginBaseSettingsDlg19AppendSettingTextsLER12CDesC16ArrayiPK7HBufC16 @ 165 NONAME - _ZN23CmPluginBaseSettingsDlg19AppendSettingTextsLER12CDesC16Arrayii @ 166 NONAME - _ZN23CmPluginBaseSettingsDlg19HandleListBoxEventLEP11CEikListBoxN19MEikListBoxObserver13TListBoxEventE @ 167 NONAME - _ZN23CmPluginBaseSettingsDlg21ShowPopupSettingPageLEmi @ 168 NONAME - _ZN23CmPluginBaseSettingsDlg21UpdateListBoxContentLEv @ 169 NONAME - _ZN23CmPluginBaseSettingsDlg23ShowPopupIPv4DNSEditorLEmmmm @ 170 NONAME - _ZN23CmPluginBaseSettingsDlg23ShowPopupIPv6DNSEditorLEPKmmmm @ 171 NONAME - _ZN23CmPluginBaseSettingsDlg23ShowPopupIpSettingPageLEmm @ 172 NONAME - _ZN23CmPluginBaseSettingsDlg24HandleListboxDataChangeLEv @ 173 NONAME - _ZN23CmPluginBaseSettingsDlg25ShowPopupTextSettingPageLEmm @ 174 NONAME - _ZN23CmPluginBaseSettingsDlg27ShowRadioButtonSettingPageLEPKmRim @ 175 NONAME - _ZN23CmPluginBaseSettingsDlg27ShowRadioButtonSettingPageLER16CDesC16ArrayFlatRim @ 176 NONAME - _ZN23CmPluginBaseSettingsDlg27StringAttributeWithDefaultLEmm @ 177 NONAME - _ZN23CmPluginBaseSettingsDlg28ShowPopupPortNumSettingPageLEmm @ 178 NONAME - _ZN23CmPluginBaseSettingsDlg29ShowPopupPasswordSettingPageLEmm @ 179 NONAME - _ZN23CmPluginBaseSettingsDlg9OkToExitLEi @ 180 NONAME - _ZN23CmPluginBaseSettingsDlgC2ER16CCmPluginBaseEng @ 181 NONAME - _ZN23CmPluginBaseSettingsDlgD0Ev @ 182 NONAME - _ZN23CmPluginBaseSettingsDlgD1Ev @ 183 NONAME - _ZN23CmPluginBaseSettingsDlgD2Ev @ 184 NONAME - _ZN24CCmApplicationSettingsUi23RunApplicationSettingsLER19TCmSettingSelection @ 185 NONAME - _ZN24CCmApplicationSettingsUi23RunApplicationSettingsLER19TCmSettingSelectionjR6RArrayImE @ 186 NONAME - _ZN24CCmApplicationSettingsUi4NewLEv @ 187 NONAME - _ZN24CCmApplicationSettingsUi5NewLCEv @ 188 NONAME - _ZN24CCmApplicationSettingsUiD0Ev @ 189 NONAME - _ZN24CCmApplicationSettingsUiD1Ev @ 190 NONAME - _ZN24CCmApplicationSettingsUiD2Ev @ 191 NONAME - _ZN24CCmPluginMultiLineDialog4NewLER6TDes16S1_N15CAknQueryDialog5TToneE @ 192 NONAME - _ZN25CmPluginBaseSettingsDlgIp16DynInitMenuPaneLEiP12CEikMenuPane @ 193 NONAME - _ZN25CmPluginBaseSettingsDlgIp20RunAdvancedSettingsLEv @ 194 NONAME - _ZN25CmPluginBaseSettingsDlgIp21UpdateListBoxContentLEv @ 195 NONAME - _ZN25CmPluginBaseSettingsDlgIpC1ER16CCmPluginBaseEng @ 196 NONAME - _ZN25CmPluginBaseSettingsDlgIpC2ER16CCmPluginBaseEng @ 197 NONAME - _ZN25CmPluginBaseSettingsDlgIpD0Ev @ 198 NONAME - _ZN25CmPluginBaseSettingsDlgIpD1Ev @ 199 NONAME - _ZN25CmPluginBaseSettingsDlgIpD2Ev @ 200 NONAME - _ZN26CmPluginBaseSettingsDlgAdv16DynInitMenuPaneLEiP12CEikMenuPane @ 201 NONAME - _ZN26CmPluginBaseSettingsDlgAdv20RunAdvancedSettingsLEv @ 202 NONAME - _ZN26CmPluginBaseSettingsDlgAdv21ShowPopupSettingPageLEii @ 203 NONAME - _ZN26CmPluginBaseSettingsDlgAdv21UpdateListBoxContentLEv @ 204 NONAME - _ZN26CmPluginBaseSettingsDlgAdvC1ER16CCmPluginBaseEng @ 205 NONAME - _ZN26CmPluginBaseSettingsDlgAdvC2ER16CCmPluginBaseEng @ 206 NONAME - _ZN26CmPluginBaseSettingsDlgAdvD0Ev @ 207 NONAME - _ZN26CmPluginBaseSettingsDlgAdvD1Ev @ 208 NONAME - _ZN26CmPluginBaseSettingsDlgAdvD2Ev @ 209 NONAME - _ZN28CCmApplicationSettingsUiImpl23RunApplicationSettingsLER19TCmSettingSelection @ 210 NONAME - _ZN28CCmApplicationSettingsUiImpl4NewLEv @ 211 NONAME - _ZNK10RCmManager11EasyWlanIdLEv @ 212 NONAME - _ZNK10RCmManager12DestinationLEm @ 213 NONAME - _ZNK10RCmManager16AllDestinationsLER6RArrayImE @ 214 NONAME - _ZNK10RCmManager17ConnectionMethodLER6RArrayImEiii @ 215 NONAME - _ZNK10RCmManager17ConnectionMethodLEm @ 216 NONAME - _ZNK10RCmManager17GetBearerInfoIntLEmm @ 217 NONAME - _ZNK10RCmManager18GetBearerInfoBoolLEmm @ 218 NONAME - _ZNK10RCmManager20BearerPriorityArrayLER6RArrayI15TBearerPriorityE @ 219 NONAME - _ZNK10RCmManager20GetBearerInfoStringLEmm @ 220 NONAME - _ZNK10RCmManager21GetBearerInfoString8LEmm @ 221 NONAME - _ZNK10RCmManager26CleanupGlobalPriorityArrayER6RArrayI15TBearerPriorityE @ 222 NONAME - _ZNK10RCmManager27GetConnectionMethodInfoIntLEmm @ 223 NONAME - _ZNK10RCmManager28GetConnectionMethodInfoBoolLEmm @ 224 NONAME - _ZNK10RCmManager30GetConnectionMethodInfoStringLEmm @ 225 NONAME - _ZNK10RCmManager31GetConnectionMethodInfoString8LEmm @ 226 NONAME - _ZNK13RCmManagerExt17GetBearerInfoIntLEmm @ 227 NONAME - _ZNK13RCmManagerExt17SupportedBearersLER6RArrayImE @ 228 NONAME - _ZNK13RCmManagerExt18GetBearerInfoBoolLEmm @ 229 NONAME - _ZNK13RCmManagerExt18UncategorizedIconLEv @ 230 NONAME - _ZNK13RCmManagerExt20BearerPriorityArrayLER6RArrayI15TBearerPriorityE @ 231 NONAME - _ZNK13RCmManagerExt20GetBearerInfoStringLEmm @ 232 NONAME - _ZNK13RCmManagerExt21GetBearerInfoString8LEmm @ 233 NONAME - _ZNK13RCmManagerExt26CleanupGlobalPriorityArrayER6RArrayI15TBearerPriorityE @ 234 NONAME - _ZNK13RCmManagerExt27GetConnectionMethodInfoIntLEmm @ 235 NONAME - _ZNK13RCmManagerExt28GetConnectionMethodInfoBoolLEmm @ 236 NONAME - _ZNK13RCmManagerExt30GetConnectionMethodInfoStringLEmm @ 237 NONAME - _ZNK13RCmManagerExt31GetConnectionMethodInfoString8LEmm @ 238 NONAME - _ZNK14CCmManagerImpl17GetBearerInfoIntLEmm @ 239 NONAME - _ZNK14CCmManagerImpl18GetBearerInfoBoolLEmm @ 240 NONAME - _ZNK14CCmManagerImpl20GetBearerInfoStringLEmm @ 241 NONAME - _ZNK14CCmManagerImpl21GetBearerInfoString8LEmm @ 242 NONAME - _ZNK14CCmManagerImpl27GetConnectionMethodInfoIntLEmm @ 243 NONAME - _ZNK14CCmManagerImpl28GetConnectionMethodInfoBoolLEmm @ 244 NONAME - _ZNK14CCmManagerImpl30GetConnectionMethodInfoStringLEmm @ 245 NONAME - _ZNK14CCmManagerImpl31GetConnectionMethodInfoString8LEmm @ 246 NONAME - _ZNK14RCmDestination12IsConnectedLEv @ 247 NONAME - _ZNK14RCmDestination15ProtectionLevelEv @ 248 NONAME - _ZNK14RCmDestination17ConnectionMethodLEi @ 249 NONAME - _ZNK14RCmDestination21ConnectionMethodByIDLEi @ 250 NONAME - _ZNK14RCmDestination21ConnectionMethodCountEv @ 251 NONAME - _ZNK14RCmDestination2IdEv @ 252 NONAME - _ZNK14RCmDestination5IconLEv @ 253 NONAME - _ZNK14RCmDestination6NameLCEv @ 254 NONAME - _ZNK14RCmDestination8IsHiddenEv @ 255 NONAME - _ZNK14RCmDestination9ElementIdEv @ 256 NONAME - _ZNK14RCmDestination9MetadataLEN9CMManager18TSnapMetadataFieldE @ 257 NONAME - _ZNK14RCmDestination9PriorityLERK19RCmConnectionMethod @ 258 NONAME - _ZNK16CCmPluginBaseEng10AllocReadLEi @ 259 NONAME - _ZNK16CCmPluginBaseEng11CreateCopyLEv @ 260 NONAME - _ZNK16CCmPluginBaseEng11DestinationEv @ 261 NONAME - _ZNK16CCmPluginBaseEng16GetIntAttributeLEm @ 262 NONAME - _ZNK16CCmPluginBaseEng17GetBoolAttributeLEm @ 263 NONAME - _ZNK16CCmPluginBaseEng19GetStringAttributeLEm @ 264 NONAME - _ZNK16CCmPluginBaseEng20CheckIfNameModifiedLEPN8CommsDat13CCDRecordBaseE @ 265 NONAME - _ZNK16CCmPluginBaseEng20GetString8AttributeLEm @ 266 NONAME - _ZNK16CCmPluginBaseEng20GlobalBearerPriorityERK7TDesC16 @ 267 NONAME - _ZNK16CCmPluginBaseEng22GlobalUiBearerPriorityERK7TDesC16 @ 268 NONAME - _ZNK16CCmPluginBaseEng23CheckIfAlreadyConnectedEv @ 269 NONAME - _ZNK16CCmPluginBaseEng7SessionEv @ 270 NONAME - _ZNK16CCmPluginLanBase13ServiceRecordEv @ 271 NONAME - _ZNK17RCmDestinationExt12IsConnectedLEv @ 272 NONAME - _ZNK17RCmDestinationExt9MetadataLEN9CMManager18TSnapMetadataFieldE @ 273 NONAME - _ZNK18CCmDestinationImpl12IsConnectedLEv @ 274 NONAME - _ZNK19RCmConnectionMethod12DestinationLEv @ 275 NONAME - _ZNK19RCmConnectionMethod16GetIntAttributeLEm @ 276 NONAME - _ZNK19RCmConnectionMethod17GetBoolAttributeLEm @ 277 NONAME - _ZNK19RCmConnectionMethod19GetStringAttributeLEm @ 278 NONAME - _ZNK19RCmConnectionMethod20GetString8AttributeLEm @ 279 NONAME - _ZNK22RCmConnectionMethodExt12DestinationLEv @ 280 NONAME - _ZNK22RCmConnectionMethodExt16GetIntAttributeLEm @ 281 NONAME - _ZNK22RCmConnectionMethodExt17GetBoolAttributeLEm @ 282 NONAME - _ZNK22RCmConnectionMethodExt19GetStringAttributeLEm @ 283 NONAME - _ZNK22RCmConnectionMethodExt20GetString8AttributeLEm @ 284 NONAME - _ZNK23CmPluginBaseSettingsDlg14GetHelpContextER15TCoeHelpContext @ 285 NONAME - _ZNK23CmPluginBaseSettingsDlg19AppendSettingTextsLER12CDesC16ArrayiiRK7TDesC16i @ 286 NONAME - _ZNK23CmPluginBaseSettingsDlg19AppendSettingTextsLER12CDesC16Arrayiiii @ 287 NONAME - _ZTI16CCmPluginBaseEng @ 288 NONAME ; ## - _ZTI16CCmPluginLanBase @ 289 NONAME ; ## - _ZTI23CmPluginBaseSettingsDlg @ 290 NONAME ; ## - _ZTI25CmPluginBaseSettingsDlgIp @ 291 NONAME ; ## - _ZTI26CmPluginBaseSettingsDlgAdv @ 292 NONAME ; ## - _ZTIN11TCmCommonUi12CCmDesCArrayE @ 293 NONAME ; ## - _ZTV16CCmPluginBaseEng @ 294 NONAME ; ## - _ZTV16CCmPluginLanBase @ 295 NONAME ; ## - _ZTV23CmPluginBaseSettingsDlg @ 296 NONAME ; ## - _ZTV25CmPluginBaseSettingsDlgIp @ 297 NONAME ; ## - _ZTV26CmPluginBaseSettingsDlgAdv @ 298 NONAME ; ## - _ZTVN11TCmCommonUi12CCmDesCArrayE @ 299 NONAME ; ## - _ZThn156_N23CmPluginBaseSettingsDlg15ProcessCommandLEi @ 300 NONAME ; ## - _ZThn156_N23CmPluginBaseSettingsDlg16DynInitMenuPaneLEiP12CEikMenuPane @ 301 NONAME ; ## - _ZThn156_N25CmPluginBaseSettingsDlgIp16DynInitMenuPaneLEiP12CEikMenuPane @ 302 NONAME ; ## - _ZThn156_N26CmPluginBaseSettingsDlgAdv16DynInitMenuPaneLEiP12CEikMenuPane @ 303 NONAME ; ## - _ZThn176_N23CmPluginBaseSettingsDlg19HandleListBoxEventLEP11CEikListBoxN19MEikListBoxObserver13TListBoxEventE @ 304 NONAME ; ## - _ZN14RCmDestinationC1Ev @ 305 NONAME - _ZN14RCmDestinationC2Ev @ 306 NONAME - _ZN17RCmDestinationExtC1Ev @ 307 NONAME - _ZN17RCmDestinationExtC2Ev @ 308 NONAME - _ZNK14RCmDestinationeqERKS_ @ 309 NONAME - _ZNK14RCmDestinationneERKS_ @ 310 NONAME - _ZNK17RCmDestinationExteqERKS_ @ 311 NONAME - _ZNK17RCmDestinationExtneERKS_ @ 312 NONAME - _ZN13CCmPluginBase10ConstructLEv @ 313 NONAME - _ZN13CCmPluginBase10CreateNewLEv @ 314 NONAME - _ZN13CCmPluginBase12EnableProxyLEi @ 315 NONAME - _ZN13CCmPluginBase15EnableLocationLEi @ 316 NONAME - _ZN13CCmPluginBase16AddResourceFileLERK7TDesC16 @ 317 NONAME - _ZN13CCmPluginBase16SetIntAttributeLEmm @ 318 NONAME - _ZN13CCmPluginBase17EnableChargeCardLEi @ 319 NONAME - _ZN13CCmPluginBase17RestoreAttributeLEm @ 320 NONAME - _ZN13CCmPluginBase17SetBoolAttributeLEmi @ 321 NONAME - _ZN13CCmPluginBase18RemoveResourceFileERK7TDesC16 @ 322 NONAME - _ZN13CCmPluginBase18UpdateProxyRecordLEv @ 323 NONAME - _ZN13CCmPluginBase19LoadServiceSettingLEv @ 324 NONAME - _ZN13CCmPluginBase19SetStringAttributeLEmRK7TDesC16 @ 325 NONAME - _ZN13CCmPluginBase20SetString8AttributeLEmRK6TDesC8 @ 326 NONAME - _ZN13CCmPluginBase20UpdateServiceRecordLEv @ 327 NONAME - _ZN13CCmPluginBase21PrepareToLoadRecordsLEv @ 328 NONAME - _ZN13CCmPluginBase23PrepareToUpdateRecordsLEv @ 329 NONAME - _ZN13CCmPluginBase26NumOfConnMethodReferencesLEv @ 330 NONAME - _ZN13CCmPluginBase5LoadLEm @ 331 NONAME - _ZN13CCmPluginBase7DeleteLEii @ 332 NONAME - _ZN13CCmPluginBase7UpdateLEv @ 333 NONAME - _ZN13CCmPluginBaseC1EP16CCmPluginBaseEng @ 334 NONAME - _ZN13CCmPluginBaseC2EP16CCmPluginBaseEng @ 335 NONAME - _ZN13CCmPluginBaseD0Ev @ 336 NONAME - _ZN13CCmPluginBaseD1Ev @ 337 NONAME - _ZN13CCmPluginBaseD2Ev @ 338 NONAME - _ZN14CCmManagerImpl20GetConnectionMethodLEm @ 339 NONAME - _ZN18CCmDestinationImpl20GetConnectionMethodLEi @ 340 NONAME - _ZNK13CCmPluginBase10AllocReadLEi @ 341 NONAME - _ZNK13CCmPluginBase11CreateCopyLEv @ 342 NONAME - _ZNK13CCmPluginBase11DestinationEv @ 343 NONAME - _ZNK13CCmPluginBase16GetIntAttributeLEm @ 344 NONAME - _ZNK13CCmPluginBase17GetBoolAttributeLEm @ 345 NONAME - _ZNK13CCmPluginBase17ParentDestinationEv @ 346 NONAME - _ZNK13CCmPluginBase19GetStringAttributeLEm @ 347 NONAME - _ZNK13CCmPluginBase20GetString8AttributeLEm @ 348 NONAME - _ZNK13CCmPluginBase5CmMgrEv @ 349 NONAME - _ZNK13CCmPluginBase6PluginEv @ 350 NONAME - _ZNK13CCmPluginBase7SessionEv @ 351 NONAME - _ZTI13CCmPluginBase @ 352 NONAME ; ## - _ZTV13CCmPluginBase @ 353 NONAME ; ## - _ZN19RCmConnectionMethodC1Ev @ 354 NONAME - _ZN19RCmConnectionMethodC2Ev @ 355 NONAME - _ZN19RCmConnectionMethodaSERKS_ @ 356 NONAME - _ZN22RCmConnectionMethodExtC1Ev @ 357 NONAME - _ZN22RCmConnectionMethodExtC2Ev @ 358 NONAME - _ZN22RCmConnectionMethodExtaSERKS_ @ 359 NONAME - _ZNK19RCmConnectionMethodeqERS_ @ 360 NONAME - _ZNK19RCmConnectionMethodneERS_ @ 361 NONAME - _ZNK22RCmConnectionMethodExteqERS_ @ 362 NONAME - _ZNK22RCmConnectionMethodExtneERS_ @ 363 NONAME - _ZN19RCmConnectionMethodD1Ev @ 364 NONAME - _ZN19RCmConnectionMethodD2Ev @ 365 NONAME - _ZN22RCmConnectionMethodExtD1Ev @ 366 NONAME - _ZN22RCmConnectionMethodExtD2Ev @ 367 NONAME - _ZN21CCmConnSettingsUiImpl25SetDestinationArrayToUseLE6RArrayImE @ 368 NONAME - _ZN21CCmConnSettingsUiImpl26ClearDestinationArrayToUseEv @ 369 NONAME - _ZN13CCmPluginBase17GetAdditionalUidsER6RArrayImE @ 370 NONAME - _ZN14CCmManagerImpl13WrapCmManagerER13RCmManagerExt @ 371 NONAME - _ZN16CCmPluginBaseEng17GetAdditionalUidsER6RArrayImE @ 372 NONAME - _ZN14CCmManagerImpl17CreateFlatCMListLEmR13RPointerArrayI13CCmPluginBaseE @ 373 NONAME - _ZN14CCmManagerImpl18FilterOutVirtualsLER13RPointerArrayI13CCmPluginBaseE @ 374 NONAME - _ZN14CCmManagerImpl30CombineArraysForPriorityOrderLER13RPointerArrayI13CCmPluginBaseES3_ @ 375 NONAME - _ZN14CCmManagerImpl18CreateFlatCMListLCEmR13RPointerArrayI13CCmPluginBaseE @ 376 NONAME - _ZN19RCmConnectionMethodC1ERKS_ @ 377 NONAME - _ZN19RCmConnectionMethodC2ERKS_ @ 378 NONAME - _ZN22RCmConnectionMethodExtC1ERKS_ @ 379 NONAME - _ZN22RCmConnectionMethodExtC2ERKS_ @ 380 NONAME - _ZN13CCmPluginBase13IsLinkedToIapEm @ 381 NONAME - _ZN13CCmPluginBase14IsLinkedToSnapEm @ 382 NONAME - _ZNK16CCmPluginBaseEng17ParentDestinationEv @ 383 NONAME - _ZN13RCmManagerExt20CreateTablesAndOpenLEv @ 384 NONAME - _ZN13RCmManagerExt18CreateDestinationLERK7TDesC16m @ 385 NONAME - _ZN13RCmManagerExt23CreateConnectionMethodLEmm @ 386 NONAME - _ZN16CCmPluginBaseEng15SetPreDefinedIdEm @ 387 NONAME - _ZN17RCmDestinationExt23CreateConnectionMethodLEmm @ 388 NONAME - _ZN23CmPluginBaseSettingsDlg20HandleResourceChangeEi @ 389 NONAME - _ZN23CmPluginBaseSettingsDlg7ExecuteEv @ 390 NONAME - _ZThn180_N23CmPluginBaseSettingsDlg7ExecuteEv @ 391 NONAME ; ## - _ZN23CmPluginBaseSettingsDlg16HandleLeaveErrorEi @ 392 NONAME - _ZThn180_N23CmPluginBaseSettingsDlg16HandleLeaveErrorEi @ 393 NONAME ; ## - _ZN10RCmManager13WriteDefConnLERK15TCmDefConnValue @ 394 NONAME - _ZN10RCmManager18CreateDestinationLERK7TDesC16 @ 395 NONAME - _ZN10RCmManager18CreateDestinationLERK7TDesC16m @ 396 NONAME - _ZN10RCmManager20CreateTablesAndOpenLEv @ 397 NONAME - _ZN10RCmManager20RemoveAllReferencesLER19RCmConnectionMethod @ 398 NONAME - _ZN10RCmManager21CopyConnectionMethodLER14RCmDestinationR19RCmConnectionMethod @ 399 NONAME - _ZN10RCmManager21MoveConnectionMethodLER14RCmDestinationS1_R19RCmConnectionMethod @ 400 NONAME - _ZN10RCmManager23CreateConnectionMethodLEm @ 401 NONAME - _ZN10RCmManager23CreateConnectionMethodLEmm @ 402 NONAME - _ZN10RCmManager23RemoveConnectionMethodLER14RCmDestinationR19RCmConnectionMethod @ 403 NONAME - _ZN10RCmManager26UpdateBearerPriorityArrayLERK6RArrayI15TBearerPriorityE @ 404 NONAME - _ZN14RCmDestination10SetHiddenLEi @ 405 NONAME - _ZN14RCmDestination12SetMetadataLEN9CMManager18TSnapMetadataFieldEm @ 406 NONAME - _ZN14RCmDestination14SetProtectionLEN9CMManager16TProtectionLevelE @ 407 NONAME - _ZN14RCmDestination15ModifyPriorityLER19RCmConnectionMethodj @ 408 NONAME - _ZN14RCmDestination20AddConnectionMethodLE19RCmConnectionMethod @ 409 NONAME - _ZN14RCmDestination23AddEmbeddedDestinationLERKS_ @ 410 NONAME - _ZN14RCmDestination23CreateConnectionMethodLEm @ 411 NONAME - _ZN14RCmDestination23CreateConnectionMethodLEmm @ 412 NONAME - _ZN14RCmDestination23DeleteConnectionMethodLER19RCmConnectionMethod @ 413 NONAME - _ZN14RCmDestination23RemoveConnectionMethodLE19RCmConnectionMethod @ 414 NONAME - _ZN14RCmDestination7UpdateLEv @ 415 NONAME - _ZN14RCmDestination8DeleteLDEv @ 416 NONAME - _ZN14RCmDestination8SetIconLEm @ 417 NONAME - _ZN14RCmDestination8SetNameLERK7TDesC16 @ 418 NONAME - _ZN19RCmConnectionMethod11CreateCopyLEv @ 419 NONAME - _ZN19RCmConnectionMethod16SetIntAttributeLEmm @ 420 NONAME - _ZN19RCmConnectionMethod17SetBoolAttributeLEmi @ 421 NONAME - _ZN19RCmConnectionMethod19SetStringAttributeLEmRK7TDesC16 @ 422 NONAME - _ZN19RCmConnectionMethod20SetString8AttributeLEmRK6TDesC8 @ 423 NONAME - _ZN19RCmConnectionMethod7DeleteLEv @ 424 NONAME - _ZN19RCmConnectionMethod7UpdateLEv @ 425 NONAME - _ZNK10RCmManager17SupportedBearersLER6RArrayImE @ 426 NONAME - _ZNK10RCmManager18UncategorizedIconLEv @ 427 NONAME - _ZN10RCmManager20ReadGenConnSettingsLER18TCmGenConnSettings @ 428 NONAME - _ZN10RCmManager21WriteGenConnSettingsLERK18TCmGenConnSettings @ 429 NONAME - _ZN14CCmManagerImpl16IapStillExistedLERK16CCmPluginBaseEng @ 430 NONAME - _ZN14CCmManagerImpl16WatcherRegisterLEP18MCmCommsDatWatcher @ 431 NONAME - _ZN14CCmManagerImpl17IsIapStillInDestLEP18CCmDestinationImplRK16CCmPluginBaseEng @ 432 NONAME - _ZN14CCmManagerImpl17WatcherUnRegisterEv @ 433 NONAME - _ZN14CCmManagerImpl18RemoveDestFromPoolEP18CCmDestinationImpl @ 434 NONAME - _ZN14CCmManagerImpl24DestinationStillExistedLEP18CCmDestinationImpl @ 435 NONAME - _ZN23CmPluginBaseSettingsDlg14OfferKeyEventLERK9TKeyEvent10TEventCode @ 436 NONAME - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Group/bld.inf --- a/cmmanager/cmmgr/Framework/Group/bld.inf Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build file for Connection Method Manager's framework. -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -// export localised loc file -../loc/cmmanager.loc MW_LAYER_LOC_EXPORT_PATH(cmmanager.loc) -../conf/cmmanager.confml MW_LAYER_CONFML(cmmanager.confml) -../conf/cmmanager_10207376.crml MW_LAYER_CRML(cmmanager_10207376.crml) - -PRJ_MMPFILES -cmmanager.mmp - -PRJ_EXTENSIONS -START EXTENSION s60/mifconv -OPTION TARGETFILE cmmanager.mif -OPTION HEADERFILE cmmanager.mbg -OPTION SOURCES -c8,8 qgn_indi_sett_protected_add\ - -c8,8 qgn_prop_set_conn_dest_add\ - -c8,8 qgn_prop_set_conn_dest_internet\ - -c8,8 qgn_prop_set_conn_dest_wap\ - -c8,8 qgn_prop_set_conn_dest_mms\ - -c8,8 qgn_prop_set_conn_dest_intranet\ - -c8,8 qgn_prop_set_conn_dest_operator\ - -c8,8 qgn_prop_set_conn_dest_icon1\ - -c8,8 qgn_prop_set_conn_dest_icon2\ - -c8,8 qgn_prop_set_conn_dest_icon3\ - -c8,8 qgn_prop_set_conn_dest_icon4\ - -c8,8 qgn_prop_set_conn_dest_icon5\ - -c8,8 qgn_prop_set_conn_dest_icon6\ - -c8,8 qgn_prop_set_conn_dest_default\ - -c8,8 qgn_prop_set_conn_dest_uncategorized\ - -c8,8 qgn_prop_set_conn_bearer_avail_wlan\ - -c8,8 qgn_prop_set_conn_bearer_avail_packetdata\ - -c8,8 qgn_prop_set_conn_wlan_easy\ - -c8,8 qgn_prop_set_conn_dest_internet_small\ - -c8,8 qgn_prop_set_conn_dest_wap_small\ - -c8,8 qgn_prop_set_conn_dest_mms_small\ - -c8,8 qgn_prop_set_conn_dest_intranet_small\ - -c8,8 qgn_prop_set_conn_dest_operator_small\ - -c8,8 qgn_prop_set_conn_dest_icon1_small\ - -c8,8 qgn_prop_set_conn_dest_icon2_small\ - -c8,8 qgn_prop_set_conn_dest_icon3_small\ - -c8,8 qgn_prop_set_conn_dest_icon4_small\ - -c8,8 qgn_prop_set_conn_dest_icon5_small\ - -c8,8 qgn_prop_set_conn_dest_icon6_small\ - -c8,8 qgn_prop_set_conn_dest_default_small\ - -c8,8 qgn_indi_cb_hot_add\ - -c8,8 qgn_indi_default_conn_add -END diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Group/cmmanager.mmp --- a/cmmanager/cmmgr/Framework/Group/cmmanager.mmp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Makefile of Connection Method Manager's framework. -* -*/ - -#include -#include - -TARGET cmmanager.dll -TARGETTYPE dll -UID 0x1000008d 0x10207376 -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -SOURCEPATH ../Src - -SOURCE cmmanager.cpp -SOURCE cmmanagerext.cpp -SOURCE cmmanagerimpl.cpp -SOURCE cmdestination.cpp -SOURCE cmdestinationext.cpp -SOURCE cmdestinationimpl.cpp -SOURCE ccmpluginbaseeng.cpp -SOURCE cmpluginbase.cpp -SOURCE cmsettingsui.cpp -SOURCE cmapplicationsettingsui.cpp -SOURCE cmapplicationsettingsuiimpl.cpp //just here to avoid bc break -SOURCE cmsettingsuiimpl.cpp -SOURCE cmconnsettingsuiimpl.cpp -SOURCE cmlogger.cpp -SOURCE destdlg.cpp -SOURCE destlistbox.cpp -SOURCE destlistboxmodel.cpp -SOURCE destlistitem.cpp -SOURCE destlistitemlist.cpp -SOURCE cmdlg.cpp -SOURCE cmlistbox.cpp -SOURCE cmlistboxmodel.cpp -SOURCE cmlistitem.cpp -SOURCE cmlistitemlist.cpp -SOURCE cmpbasesettingsdlg.cpp -SOURCE cmconnectionmethod.cpp -SOURCE cmconnectionmethodext.cpp -SOURCE cmcommonui.cpp -SOURCE cmwizard.cpp -SOURCE cmconnselectrbpage.cpp -SOURCE cmconnectionmethodinfo.cpp -SOURCE cmtransactionhandler.cpp -SOURCE uncatdlg.cpp -SOURCE selectdestination.cpp -SOURCE cmdesticondialog.cpp -SOURCE cmdesticonmap.cpp -SOURCE cmpluginlanbase.cpp -SOURCE cmpbasesettingsdlgadv.cpp -SOURCE cmpbasesettingsdlgip.cpp -SOURCE cmpluginmultilinedialog.cpp -SOURCE cmobjectpool.cpp -SOURCE ccmdexec.cpp -SOURCE cmcommsdatnotifier.cpp - -START RESOURCE ../SrcData/cmmanager.rss -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END // RESOURCE - -USERINCLUDE ../SrcData -USERINCLUDE ../../Plugins/cmpluginembdestination/inc // cmpluginembdestinationdef.h - -// Component specific internal headers -USERINCLUDE ../Inc - -// ADO specific internal headers -SYSTEMINCLUDE ../../../../inc - -//Macro to /epoc32 headers -MW_LAYER_SYSTEMINCLUDE - -#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -APP_LAYER_SYSTEMINCLUDE -#endif - -LIBRARY hlplch.lib - -LIBRARY euser.lib -LIBRARY ECom.lib -LIBRARY COMMSDAT.lib -LIBRARY flogger.lib -LIBRARY FeatMgr.lib - - -LIBRARY eikcore.lib egul.lib -LIBRARY eikcoctl.lib avkon.lib eikdlg.lib -LIBRARY eikctl.lib cone.lib CommonEngine.lib -LIBRARY bafl.lib fbscli.lib efsrv.lib CommonUI.LIB -LIBRARY AknSkins.lib CdlEngine.lib -LIBRARY ESock.lib -LIBRARY AknLayout.lib -LIBRARY AknLayout2.lib -LIBRARY AknLayout2scalable.lib -LIBRARY aknicon.lib -LIBRARY ws32.lib -LIBRARY cmmanagerdatabase.lib -LIBRARY insock.lib -LIBRARY sysutil.lib -LIBRARY connectionuiutilities.lib -LIBRARY touchfeedback.lib -LIBRARY centralrepository.lib - -#if defined(ARMCC) - DEFFILE ../EABI/CmManager_prot_setup.def -#elif defined( WINSCW ) - DEFFILE ../BWinsCw/CmManager_prot_setup.DEF -#elif defined( WINS ) - DEFFILE ../BWins/CmManager_prot_setup.def -#else - DEFFILE ../BMarm/CmManager_prot_setup.def -#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Group/framework_icons.mk --- a/cmmanager/cmmgr/Framework/Group/framework_icons.mk Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -# -# Copyright (c) Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: icons makefile for project CMManager Framework -# -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z -else -ZDIR=\epoc32\data\z -endif - - -TARGETDIR=$(ZDIR)\resource\apps -ICONTARGETFILENAME=$(TARGETDIR)\cmmanager.mif - -HEADERDIR=\epoc32\include -HEADERFILENAME=$(HEADERDIR)\cmmanager.mbg - -do_nothing : - @rem do_nothing - -MAKMAKE : do_nothing - -BLD : do_nothing - -CLEAN : do_nothing - -LIB : do_nothing - -CLEANLIB : do_nothing - -# ---------------------------------------------------------------------------- -# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by -# MifConv if the mask detph is defined. -# -# NOTE 2: Usually, source paths should not be included in the bitmap -# definitions. MifConv searches for the icons in all icon directories in a -# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps. -# The directory \s60\icons is included in the search only if the feature flag -# __SCALABLE_ICONS is defined. -# ---------------------------------------------------------------------------- - -RESOURCE : - mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ - /c8,8 qgn_indi_sett_protected_add.bmp\ - /c8,8 qgn_prop_set_conn_dest_add.bmp\ - /c8,8 qgn_prop_set_conn_dest_internet.bmp\ - /c8,8 qgn_prop_set_conn_dest_wap.bmp\ - /c8,8 qgn_prop_set_conn_dest_mms.bmp\ - /c8,8 qgn_prop_set_conn_dest_intranet.bmp\ - /c8,8 qgn_prop_set_conn_dest_operator.bmp\ - /c8,8 qgn_prop_set_conn_dest_icon1.bmp\ - /c8,8 qgn_prop_set_conn_dest_icon2.bmp\ - /c8,8 qgn_prop_set_conn_dest_icon3.bmp\ - /c8,8 qgn_prop_set_conn_dest_icon4.bmp\ - /c8,8 qgn_prop_set_conn_dest_icon5.bmp\ - /c8,8 qgn_prop_set_conn_dest_icon6.bmp\ - /c8,8 qgn_prop_set_conn_dest_default.bmp\ - /c8,8 qgn_prop_set_conn_dest_uncategorized.bmp\ - /c8,8 qgn_prop_set_conn_bearer_avail_wlan.bmp\ - /c8,8 qgn_prop_set_conn_bearer_avail_packetdata.bmp\ - /c8,8 qgn_prop_set_conn_wlan_easy.bmp\ - /c8,8 qgn_prop_set_conn_dest_internet_small.bmp\ - /c8,8 qgn_prop_set_conn_dest_wap_small.bmp\ - /c8,8 qgn_prop_set_conn_dest_mms_small.bmp\ - /c8,8 qgn_prop_set_conn_dest_intranet_small.bmp\ - /c8,8 qgn_prop_set_conn_dest_operator_small.bmp\ - /c8,8 qgn_prop_set_conn_dest_icon1_small.bmp\ - /c8,8 qgn_prop_set_conn_dest_icon2_small.bmp\ - /c8,8 qgn_prop_set_conn_dest_icon3_small.bmp\ - /c8,8 qgn_prop_set_conn_dest_icon4_small.bmp\ - /c8,8 qgn_prop_set_conn_dest_icon5_small.bmp\ - /c8,8 qgn_prop_set_conn_dest_icon6_small.bmp\ - /c8,8 qgn_prop_set_conn_dest_default_small.bmp\ - /c8,8 qgn_indi_cb_hot_add.bmp\ - /c8,8 qgn_indi_default_conn_add.bmp - -FREEZE : do_nothing - -SAVESPACE : do_nothing - -RELEASABLES : - @echo $(HEADERFILENAME)&& \ - @echo $(ICONTARGETFILENAME) - -FINAL : do_nothing diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/ccmdexec.h --- a/cmmanager/cmmgr/Framework/Inc/ccmdexec.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Signaling class for destination edit. -* -*/ - - -#ifndef C_CCMDEXEC_H -#define C_CCMDEXEC_H - -class MCmdExec; - -NONSHARABLE_CLASS(CCmdExec) : public CActive - { - -public: - - /** - * Destructor. - */ - virtual ~CCmdExec(); - - void Execute(); - -// from base class CActive -public: - virtual void RunL(); - - virtual TInt RunError( TInt /*aError*/ ); - - virtual void DoCancel(); - - CCmdExec(MCmdExec& aOwner); - -protected: // data - - /** - * Owner - * Not own. - */ - MCmdExec& iOwner; - }; - -#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmapplicationsettingsuiimpl.h --- a/cmmanager/cmmgr/Framework/Inc/cmapplicationsettingsuiimpl.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of application selection dialog -* -*/ - -#ifndef C_CMAPLICATIONSETTINGSUIIMPL_H -#define C_CMAPLICATIONSETTINGSUIIMPL_H - -#include -#include -#include -#include // CDesCArrayFlat -#include "cmmanager.hrh" -#include "cmapplicationsettingsui.h" - -class TCmSettingSelection; -class CCmManagerImpl; -class CCmDestinationImpl; - - -//IMPLEMENTATION REMOVED!!!! -//JUST HERE TO MANTAIN BC COMPATIBILITY!!! -/** - * Implementation of application setting UI. - * - * @lib cmmanage.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS(CCmApplicationSettingsUiImpl) : public CBase - { - - public: - - IMPORT_C static CCmApplicationSettingsUiImpl* NewL(); - - - //========================================================================= - // UI API - // - public: - - /** - * Launches the 'easy to use' Settings UI provided for applications - * for handling Destinations and Connection Methods - * @since 3.1U - * @params aSelection User selection. - * @returns ETrue if a selection was made - */ - TBool RunApplicationSettingsL( TCmSettingSelection& aSelection ); - - - /** - * Enables/Disabled AlwaysAsk - * - * @param ETrue enables - * @since S60 3.2 - */ - inline void EnableAlwaysAsk( TBool aEnable ) - { iShowAlwaysAsk = aEnable; } - - /** - * Enables/Disabled EasyWlan - * - * @param ETrue enables - * @since S60 3.2 - */ - inline void EnableEasyWlan( TBool aEnable ) - { iShowEasyWlan = aEnable; } - - /** - * Enables/Disabled VirtualCMs - * - * @param ETrue enables - * @since S60 3.2 - */ - inline void EnableVirtualCMs( TBool aEnable ) - { iShowVirtualCMs = aEnable; } - - /** - * Enables/Disabled EmptyDestinations - * - * @param ETrue enables - * @since S60 3.2 - */ - inline void EnableEmptyDestinations( TBool aEnable ) - { iShowEmptyDestinations = aEnable; } - - /** - * Sets a destination id which should be omitted from the list - * typically this will be the parent destination of a virtual CM - * - * @param aDestinationId - * @since S60 3.2 - */ - inline void SetDestinationToOmit( TUint32 aDestinationId ) - { iDestinationToOmit = aDestinationId; } - - - private: // data - - /** - * pointer to the CmManager - OWNED - */ - CCmManagerImpl* iCmManagerImpl; - - /** - * resource loader - */ - RConeResourceLoader iResourceReader; - - /** - * List of destination IDs to show - */ - RArray iDestinations; - - /** - * Indicates whether Always Ask should be shown in the page - */ - TBool iShowAlwaysAsk; - - /** - * Indicates whether EasyWlan should be shown in the page - */ - TBool iShowEasyWlan; - - /** - * Indicates whether virtual iaps should be shown in the page - */ - TBool iShowVirtualCMs; - - /** - * Indicates whether Empty destinations should be shown in the page - */ - TBool iShowEmptyDestinations; - - /** - * Indicates the id of destination to specifically omit (usually a parent destination) - * if zero, it can be ignored - */ - TUint iDestinationToOmit; - }; - -#endif // C_CMAPLICATIONSETTINGSUIIMPL_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmcommsdatnotifier.h --- a/cmmanager/cmmgr/Framework/Inc/cmcommsdatnotifier.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Listens for changes in one CommsDat table through CenRep. -* -*/ - -#ifndef CMCOMMSDATNOTIFIER_H -#define CMCOMMSDATNOTIFIER_H - -_LIT( KIapDisappear, "Iap disappears from CommsDat" ); -_LIT( KDestDisappear, "Destination disappears from CommsDat" ); - -class CCmManagerImpl; -class CRepository; -class MCmCommsDatWatcher; - -// A stack to store watchers -typedef CArrayPtrFlat CCmCallBackArray; - -// Used to notify parent view what happens during son's view editing. -const TInt KCmNotifiedNone = 0; -const TInt KCmNotifiedDestinationDisappear = 1; -const TInt KCmNotifiedIapIsNotInThisDestination = 2; -const TInt KCmNotifiedIapDisappear = 3; - -class MCmCommsDatWatcher - { -public: - // watcher should implement this function to get the notification of CommsDat changes. - // see class CCmManagerImpl for watcher registration - virtual void CommsDatChangesL() = 0; - }; - -// Used for son's watcher to notify parent watcher that CommsDat has changes -// if farther watcher wants to know what heppens when son's watcher exiting -class CCmParentViewNotifier - { -public: - virtual void NotifyParentView( TInt aValue ) = 0; - }; - -/* - * CommsDat can suddenly change with some reasons, e.g., an application may suddenly add/delete a destination - * and Iap. Those changes may affect CmManager. This class will listen to changes in one CommsDat table - * through CenRep and inform related watcher that is interesting in CommsDat changes. - */ -NONSHARABLE_CLASS( CCmCommsDatNotifier ) : public CActive - { -public: - - static CCmCommsDatNotifier* NewL( TUint32 aTableId ); - - static CCmCommsDatNotifier* NewLC( TUint32 aTableId ); - - virtual ~CCmCommsDatNotifier(); - - void WatcherRegisterL( MCmCommsDatWatcher* aWatcher ); - void WatcherUnRegister( ); - -private: - CCmCommsDatNotifier( TUint32 aTableId ); - - void ConstructL(); - TInt RequestNotifications(); - - void DeleteCallBackArray(); - -private: // Methods from base class - void DoCancel(); - void RunL(); - -private: - TUint32 iTableId; - CRepository* iRepository; - MCmCommsDatWatcher* iWatcher; // callback object that wants to see changes in CommsDat - CCmCallBackArray* iCallBackArray; // used as stack to go to the next view - }; - -#endif // CMCOMMSDATNOTIFIER_H - -// End-of-file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmconnectionmethodinfo.h --- a/cmmanager/cmmgr/Framework/Inc/cmconnectionmethodinfo.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Connection Method interface class. -* -*/ - -#ifndef CMCONNECTIONMETHODINFO_H -#define CMCONNECTIONMETHODINFO_H - -#include - -/** - * Acts as a connection method that has no bearer type. - * Client applications can query connection method, but non-bearer specific - * attributes by calling RCmManager/Ext::GetConnectionMethodInfoXXXL() - * functions. - * Modification and update of a connetion method is not supported. - * Common records of a connection method are loaded, and kept in memory - * as long as the client application queries attribute of another connection - * method. - * - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CCmConnectionMethodInfo ) : public CCmPluginBaseEng - { - public: - - static CCmConnectionMethodInfo* NewL( TCmPluginInitParam *aInitParam ); - - static CCmConnectionMethodInfo* NewLC( TCmPluginInitParam *aInitParam ); - - virtual ~CCmConnectionMethodInfo(); - - virtual CCmPluginBaseEng* - CreateInstanceL( TCmPluginInitParam& /*aInitParam*/ ) const; - virtual CCmPluginBaseEng* CreateCopyL() const; - - public: // new functions - - virtual TUint32 GetConnectionInfoIntL( const TUint32 aIapId, - const TUint32 aAttribute ); - - virtual TBool GetConnectionInfoBoolL( const TUint32 aIapId, - const TUint32 aAttribute ); - - virtual HBufC* GetConnectionInfoStringL( const TUint32 aIapId, - const TUint32 aAttribute ); - - virtual HBufC8* GetConnectionInfoString8L( const TUint32 aIapId, - const TUint32 aAttribute ); - - virtual void AdditionalReset(){}; - - void ResetIfInMemory( CCmPluginBaseEng* aCM ); - - private: // from CCmPluginBaseEng - - virtual TInt RunSettingsL(); - virtual TBool InitializeWithUiL( TBool aManuallyConfigure ); - virtual TBool CanHandleIapIdL( TUint32 aIapId ) const; - virtual TBool CanHandleIapIdL( CommsDat::CCDIAPRecord* aIapRecord ) const; - virtual void CopyAdditionalDataL( CCmPluginBaseEng* aDestInst ); - - private: - - virtual void ServiceRecordIdLC( HBufC* &aServiceName, - TUint32& aRecordId ); - virtual void BearerRecordIdLC( HBufC* &aBearerName, - TUint32& aRecordId ); - virtual void CreateNewServiceRecordL(); - - void ResetAndLoadL( TUint32 aIapId ); - - private: - - CCmConnectionMethodInfo( TCmPluginInitParam *aInitParam ); - - void ConstructL(); - - private: // new functions - - private: // data - }; - - -#endif // CMCONNECTIONMETHODINFO_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmconnselectrbpage.h --- a/cmmanager/cmmgr/Framework/Inc/cmconnselectrbpage.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Dialog for setting the gateway. It's used temporarily. -* -*/ - -#ifndef C_CMCONNSELECTRBPAGE_H -#define C_CMCONNSELECTRBPAGE_H - -#include -#include -#include - -#include "cmmanagerimpl.h" -#include "cmconnsettingsuiimpl.h" - -/** - * Application Settings UI radio button page - * - * @lib cmmanager.lib - * @since S60 3.2 - */ -NONSHARABLE_CLASS(CCMConnSelectRBPage) : public CAknRadioButtonSettingPage - { - - public: // construction/destruction - - /** - * Constructor - * - * @since S60 3.2 - * @param aDialogResourceId resource id for the dialog - * @param aCurrentSelectionIndex the item to be highlighted - * @param aItemArray the items to be displayed - * @param aCmManagerImpl reference to the cm manager - * @param aSelectionMode the selected item type - * @param aHelpContext help context to use when Help menuitem is selected - */ - CCMConnSelectRBPage( TInt aDialogResourceId, - TInt& aCurrentSelectionIndex, - const MDesCArray* aItemArray, - CCmManagerImpl& aCmManagerImpl, - CMManager::TCmDCSettingSelectionMode& aSelectionMode, - RArray& aDestinations, - TBool areDestinations, - TBool aOpenDestination, - TCoeContextName& aHelpContext ); - - /** - * Destructor - */ - ~CCMConnSelectRBPage(); - - public: // derived functions - - /** - * From CCoeControl - * - * @since S60 3.2 - * @param aKeyEvent The key event. - * @param aType Key event type. - * @return key response (was the key event consumed?). - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ); - - /** - * Returns the help context - * From CCoeControl - * - * @since S60 3.2 - * @param aContext the returned help context - */ - void GetHelpContext( TCoeHelpContext& aContext ) const; - - /** - * Handle list box events - * From CCoeControl - * - * @since S60 5.0 - * @param aListBox Reference to list box object. - * @param aEventType Type of event. - */ - void HandleListBoxEventL(CEikListBox* aListBox, MEikListBoxObserver::TListBoxEvent aEventType); - - private: // derived functions - - /* - * From CEikDialog - * - * @since S60 3.2 - * @param aButtonId - */ - TBool OkToExitL( TInt aButtonId ); - - /* - * From MEikMenuObserver - * - * @since S60 3.2 - * @param aResourceId - * @param aMenuPane - */ - void DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ); - - /** - * From MEikCommandObserver - * - * @since S60 3.2 - * @param aCommandId - */ - void ProcessCommandL( TInt aCommandId ); - - private: // data - - /** - * Resource id of the used dialog type - */ - TInt iDialogResourceId; - - /** - * reference to the cm manager - */ - CCmManagerImpl& iCmManagerImpl; - - /** - * The selection made by the user - */ - CMManager::TCmDCSettingSelectionMode& iSelectionMode; - - /** - * A list of destination ids - */ - RArray& iDestinations; - /** - * Indicates whether iDestinations holds destinatos or CMs - */ - TBool iAreDestinations; - /** - * Indicates whether iDestinations should be openable - */ - TBool iOpenDestination; - /** - * help context - */ - TCoeContextName iHelpContext; - /** - * Previously selected item - */ - TInt iPrevItem; - }; - -#endif // C_CMAPPSETTRBPAGE_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmconnsettingsuiimpl.h --- a/cmmanager/cmmgr/Framework/Inc/cmconnsettingsuiimpl.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,566 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of application selection dialog -* -*/ - -#ifndef C_CMCONNSETTINGSUIIMPL_H -#define C_CMCONNSETTINGSUIIMPL_H - -#include -#include -#include -#include // CDesCArrayFlat -#include -#include - -#include "cmmanager.hrh" -#include "cmapplicationsettingsui.h" - -class TCmDCSettingSelection; -class CCmManagerImpl; -class CCmDestinationImpl; -class CCmPluginBase; - -//CONSTS -const TInt KCmDefConnIndex = 0; -const TInt KCmUserDefinedIndex = 1; - -namespace CMManager - { - enum TCmDCSettingSelectionMode - { - EDCAlwaysAsk, /**< - * The user selected Always Ask - */ - EDCAskOnce, /**< - * The user selected Ask Once - */ - EDCDestination, /**< - * The user selected a destination - */ - EDCConnectionMethod, /**< - * The user selected a connection method - */ - EDCDefaultConnection /**< - * The user selected a connection method - */ - }; - } //namespace CmManager - -/** - * Stores the details of a setting selection - * - * @since S60 3.2 - */ -NONSHARABLE_STRUCT( TCmDCSettingSelection ) //extended with Ask Once - { - /** - * Selection that the user made - */ - CMManager::TCmDCSettingSelectionMode iResult; - - /** - * Id of the selected destination or connection method - */ - TUint iId; - // ----------------------------------------------------------------------------- - // TCmDCSettingSelection::operator== - // ----------------------------------------------------------------------------- - // - inline TBool TCmDCSettingSelection::operator==( TCmDCSettingSelection& aDCSettingSelection ) const - { - return ( (iResult == aDCSettingSelection.iResult) && ( iId == aDCSettingSelection.iId ) ); - }; - - // ----------------------------------------------------------------------------- - // TCmDCSettingSelection::operator!= - // ----------------------------------------------------------------------------- - // - inline TBool TCmDCSettingSelection::operator!=( TCmDCSettingSelection& aDCSettingSelection ) const - { - return (!( (iResult == aDCSettingSelection.iResult) && ( iId == aDCSettingSelection.iId ) )); - }; - // ----------------------------------------------------------------------------- - // TCmDCSettingSelection::ConvertToDefConn - // ----------------------------------------------------------------------------- - // - inline TCmDefConnValue TCmDCSettingSelection::ConvertToDefConn( ) const - { - TCmDefConnValue defConnValue; - defConnValue.iType = ECmDefConnAlwaysAsk; - defConnValue.iId = 0; - switch ( iResult ) - { - case CMManager::EDCAlwaysAsk : - { - defConnValue.iType = ECmDefConnAlwaysAsk; - break; - } - case CMManager::EDCAskOnce : - { - defConnValue.iType = ECmDefConnAskOnce; - break; - } - case CMManager::EDCDestination : - { - defConnValue.iType = ECmDefConnDestination; - defConnValue.iId = iId; - break; - } - case CMManager::EDCConnectionMethod : - { - defConnValue.iType = ECmDefConnConnectionMethod; - defConnValue.iId = iId; - break; - } - case CMManager::EDCDefaultConnection : - { - defConnValue.iType = ECmDefConnAlwaysAsk; //default value - break; - } - default: - { - defConnValue.iType = ECmDefConnAlwaysAsk; //default value - break; - } - }; - return defConnValue; - }; - }; - - - -/** - * Implementation of application setting UI. - * - * @lib cmmanage.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS(CCmConnSettingsUiImpl) : public CBase - { - - public: - - IMPORT_C static CCmConnSettingsUiImpl* NewL( CCmManagerImpl* aCCmManagerImpl = NULL ); - static CCmConnSettingsUiImpl* NewWithoutTablesL(); - - virtual ~CCmConnSettingsUiImpl(); - - //========================================================================= - // UI API - // - public: - - /** - * Launches the 'easy to use' Settings UI provided for applications - * for handling Destinations and Connection Methods - * - * @since 3.2 - * @param aSelection If initialised to a valid value, sets the higlight to the - * corresponding list item at startup. If a list of Destinations is displayed, and - * the initial highlight is set to a Connection Method, the parent Destination - * gets highlighted. On return, holds user selection. - * @param aListItems A bit field which indicates which items shoud be - * shown in the selection dialog. The bitmasks are - * defined in the TCmSelectionDialogItems enum. - * - * The function leaves with KErrNotSupported if all the items which - * were set to be shown are not supported/enabled. - * E.g. Default Connection availability/support is controlled by the - * Feature Manager so if only EShowDefaultConnection is set and the - * Default Connection feature is not enabled than the function leaves - * with KErrNotSupported. - * - * In other cases (when an item or items are not supported/enabled but - * not all) the selected but not supported/enabled items are not added - * to the list. The request to show such an item is silently ignored. - * - * - * Special note about the EShowDestinations and EShowConnectionMethods - * bitmasks: - * The following enumerations controls how how destinations and - * Connection Methods are presented in the selection UI. - * General rule about the EShowDestinations: - * Destinations which does not contain any Connection Methods are - * not shown in the selection dialog. The same rule is applied if - * the Destination containes Connection Methods but all of them - * are filtered out by the filtering criteria. - * EShowDestinations is set and EShowConnectionMethods is set: - * Destination list is added to the selection UI and a Connection - * Method can be selected inside a Destination. - * EShowDestinations is set and EShowConnectionMethods is not set: - * Destination list is added to the selection UI and no Connection - * Method can be selected inside a Destination. - * EShowDestinations is not set and EShowConnectionMethods is set: - * Connection Method list is added to the selection UI. Connection - * Methods are ordered according to the global bearer type - * priorities. Destination cannot be selected. - * EShowDestinations is not set and EShowConnectionMethods is not set: - * The selection UI will not contain any Destination or Connection - * Method. E.g. If EShowAlwaysAsk and EShowDefaultConnection was - * set then the selection UI will contain two entries (AlwaysAsk - * and DefaultConnection). - * - * @param aFilterArray Only Connection Methods with bearer types from - * the aFilterArray will be showed. - * All Connection Methods will be listed if the - * array has no element. - * @return TBool seleceted or not. - * - * @leave KErrArgument If the selection dialog would have zero - * elements based on the aListItems bitmask - * (aListItems is equal to zero). - * - * @leave KErrNotSupported - * If the selection dialog would have zero - * elements based on the aListItems bitmask - * (all the selected elements in aListItems - * are not supported/disabled). - * E.g. aListItems = EShowDefaultConnection but - * Default Connection feature is not enabled. - * - * @leave KErrNotFound If the selection dialog would have zero - * elements caused by filtering out all the - * Connection Methods with the aFilterArray - * and not requesting other list elements by - * the aListItems bitfield than an error note - * is shown and the function call leaves with - * KErrNotFound error code. - * E.g. - * - aListItems = EShowConnectionMethods - * but all Connection Methods are filtered - * out by the aFilterArray. - */ - IMPORT_C TBool RunApplicationSettingsL( - TCmSettingSelection& aSelection, - TUint aListItems, - TBearerFilterArray& aFilterArray); - - /** - * Launches the Default Connection Radio Button Page - * for use in Destinations View - * @since 3.1U - * @params aSelection User selection. - * @returns ETrue if a selection was made - */ - TBool RunDefaultConnecitonRBPageL ( TCmDCSettingSelection& aSelection ); - - /** - * Creates and returns a string which contains the default connection name - * for use in Destinations View - * @since 3.1U - * @params aSelection User selection. - * @returns the default connection name - */ - HBufC* CreateDefaultConnectionNameL( TCmDefConnValue aSelection ); - - /** - * Enables/Disables AlwaysAsk - * - * @param ETrue enables - * @since S60 3.2 - */ - inline void EnableAlwaysAsk( TBool aEnable ) - { iShowAlwaysAsk = aEnable; } - - /** - * Enables/Disables EasyWlan - * - * @param ETrue enables - * @since S60 3.2 - */ - inline void EnableEasyWlan( TBool aEnable ) - { iShowEasyWlan = aEnable; } - - /** - * Enables/Disables VirtualCMs - * - * @param ETrue enables - * @since S60 3.2 - */ - inline void EnableVirtualCMs( TBool aEnable ) - { iShowVirtualCMs = aEnable; } - - /** - * Enables/Disables EmptyDestinations - * - * @param ETrue enables - * @since S60 3.2 - */ - inline void EnableEmptyDestinations( TBool aEnable ) - { iShowEmptyDestinations = aEnable; } - - /** - * Sets a destination id which should be omitted from the list - * typically this will be the parent destination of a virtual CM - * - * @param aDestinationId - * @since S60 3.2 - */ - inline void SetDestinationToOmit( TUint32 aDestinationId ) - { iDestinationToOmit = aDestinationId; } - - /** - * Enables/Disables Ask Once - * - * @param ETrue enables - * @since S60 3.2 - */ - inline void EnableAskOnce( TBool aEnable ) - { iShowAskOnce = aEnable; } - - /** - * Enables/Disables Uncategorised item - * - * @param ETrue enables - * @since S60 3.2 - */ - inline void EnableUncat( TBool aEnable ) - { iShowUncat = aEnable; } - - /** - * Enables/Disables Default Connection item - * - * @param ETrue enables - * @since S60 3.2 - */ - inline void EnableDefConn( TBool aEnable ) - { iShowDefConn = aEnable; } - - - - /** - * Sets the array of destinations to be used. - * Typically this routine will be used by plugins having - * restrictions on possible destinations. - * - * @param aDestinationArray - * @since S60 3.2 - */ - IMPORT_C void SetDestinationArrayToUseL( RArray aDestinationArray ); - - /** - * Clear previously passed destinations and return to normal use. - * - * @since S60 3.2 - */ - IMPORT_C void ClearDestinationArrayToUse(); - - private: - - CCmConnSettingsUiImpl(); - - void ConstructL( CCmManagerImpl* aCCmManagerImpl = NULL ); - - TInt LoadResourceL (); - - /** - * Displays a set of destinations for selecting a network connection - * - * @param aSelection If initialised to a valid value, sets the higlight to the - * corresponding list item at startup. If a list of Destinations is displayed, and - * the initial highlight is set to a Connection Method, the parent Destination - * gets highlighted. On return, holds user selection. - * @return soft key selection - */ - TBool ShowConnSelectRadioPageL( TCmDCSettingSelection& aSelection, - const TInt aTitleStringResource, - TBearerFilterArray& aFilterArray ); - - /** - * Displays a the Default Connection/User Defined radio button page - * - * @param aSelection If initialised to a valid value, sets the higlight to the - * corresponding list item at startup. If a list of Destinations is displayed, and - * the initial highlight is set to a Connection Method, the parent Destination - * gets highlighted. On return, holds user selection. - * @return soft key selection - */ - // TBool ShowDefConnRadioPageL( TInt& aSelection ); - - - /** - * Return array of destination of which have at least connection method - * @param aItems array of destination names - */ - void BuildDestinationArrayL( CDesCArrayFlat* aItems, - TBearerFilterArray& aFilterArray ); - - /** - * Return array of CMs of which have at least connection method - * @param aItems array of destination names - */ - void BuildCMArrayL( CDesCArrayFlat* aItems, - TBearerFilterArray& aFilterArray ); - - /** - * Put the array of CMs into iConnMethods - */ - void GetCMArrayL( ); - - /** - * Build uncategorized connection method array and append - * 'Uncategorized' item if there's any. - * @param aUncatArray array of uncategorized connection method ids. - * @param aItems array of destination names - */ - void BuildUncatArrayL( RPointerArray& aUncatArray, - CDesCArrayFlat* aItems, - TBearerFilterArray& aFilterArray ); - /** - * Show destination selection dialog. - * @param aDestSelected index of selected destination - * @param aItems array of destination names - * @param aSelection If initialised to a valid value, sets the higlight to the - * corresponding list item at startup. If a list of Destinations is displayed, and - * the initial highlight is set to a Connection Method, the parent Destination - * gets highlighted. On return, holds user selection. - * @return ETrue if a selection was made - */ - TBool UserSelectionDlgL( TInt& aDestSelected, - CDesCArrayFlat* aItems, - TCmDCSettingSelection& aSelection, - const TInt aTitleStringResource, - TBool aOpenDestination ); - - /** - * Show uncategorized connection method selection dialog - * @param aUncatArray list of uncategorized connection methods. - * @param aSelection If initialised to a valid value, sets the higlight to the - * corresponding list item at startup. On return, holds user selection. - * @return softkey selection. - */ - TBool UserSelectedUncatItemL( RPointerArray& aUncatArray, - TCmDCSettingSelection& aSelection, - const TInt aTitleStringResource ); - - /** - * A radio button page of all the connection methods belonging to - * a the specified destination - * - * @param aDestinationId the destination from which a connection - * method will be selected - * @param aSelection If initialised to a valid value, sets the higlight to the - * corresponding list item at startup. On return, holds user selection. - * @return soft key selection - */ - TBool ShowConnectionMethodsL( RPointerArray& aCmArray, - TCmDCSettingSelection& aSelection, - const TInt aTitleStringResource, - TBearerFilterArray& aFilterArray ); - - /** - * Checks if a Connection method is virtual - * - * @since S60 3.2 - * @param aCmIapId the iap id of the CM - * @return ETrue if virtual - */ - TBool IsCmVirtualL( TUint32 aCmIapId ); - - private: // data - - /** - * pointer to the CmManager - OWNED - */ - CCmManagerImpl* iCmManagerImpl; - - /** - * resource loader - */ - RConeResourceLoader iResourceReader; - - /** - * List of destination or CM IDs to show - */ - RArray iItems; - /** - * Indicates whether iItems holds destinatos or CMs - */ - TBool iAreDestinations; - - /** - * Indicates whether Always Ask should be shown in the page - */ - TBool iShowAlwaysAsk; - - /** - * Indicates whether EasyWlan should be shown in the page - */ - TBool iShowEasyWlan; - - /** - * Indicates whether virtual iaps should be shown in the page - */ - TBool iShowVirtualCMs; - - /** - * Indicates whether Empty destinations should be shown in the page - */ - TBool iShowEmptyDestinations; - - /** - * Indicates the id of destination to specifically omit (usually a parent destination) - * if zero, it can be ignored - */ - TUint iDestinationToOmit; - - /** - * Indicates whether Ask Once item should be shown in the page - */ - TBool iShowAskOnce; - - /** - * Indicates whether Uncategorized item should be shown in the page - */ - TBool iShowUncat; - - /** - * Indicates whether Default Connection item should be shown in the page - */ - TBool iShowDefConn; - - /** - * Indicates whether we have an own CmManager that we have to create and destroy - */ - TBool iOwnCmManager; - - /** - * Indicates whether the selected destinaton should be opened - */ - TBool iOpenDestination; - - /** - * Indicates whether to use a passed list of destinations - * or use our own algorithm to get the list of possible destinations. - */ - TBool iUsePassedDestinationArray; - - /** - * An Array to hold the passed destinations. - */ - RArray iPassedDestinations; - - /** - * help context - */ - TCoeContextName iHelpContext; - - /** - * Indicates whether the tables should be created - */ - TBool iCreateTables; - }; -#endif // C_CMCONNSETTINGSUIIMPL_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmdesticondialog.h --- a/cmmanager/cmmgr/Framework/Inc/cmdesticondialog.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Destination icon dialog -* -*/ - -#ifndef CMDESTICONDIALOG_H -#define CMDESTICONDIALOG_H - -#include // - -/** - * Change Icon table for destinations.Contains all the icon available - */ -NONSHARABLE_CLASS(CCmDestinationIconDialog) : public CAknDialog - { - public: - - /** - * Destinations change Icon table constructor. - * - * @param aIconIndex selected icon index. - * - */ - CCmDestinationIconDialog( TInt& aIconIndex ); - - /** - * Destinations change Icon table destructor. - * C++ destructor - */ - ~CCmDestinationIconDialog(); - - public: // from CEikDialog - - /** - * Prepares and runs the dialog and returns the id of the button used to - * dismiss it. The dialog is constructed from the resource with id - * aResourceId and is destroyed on exit. - * - * @return Id of the button used to dismiss dialog. - */ - TInt ExecuteLD(); - -#ifdef RD_SCALABLE_UI_V2 - - //From MCoeControlObserver - void HandleControlEventL( CCoeControl* aControl, - TCoeEvent aEventType ); - void HandleDialogPageEventL( TInt aEventID ); - -#endif // RD_SCALABLE_UI_V2 - - public: // from CCoeControl - - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode /*aType*/ ); - void HandleResourceChange(TInt aType); - SEikControlInfo CreateCustomControlL(TInt aControlType); - - protected: // from CEikDialog - - virtual TBool OkToExitL(TInt); - virtual void PreLayoutDynInitL(); - virtual void SetSizeAndPosition(const TSize& aSize); - - private: - - virtual void CEikDialog_Reserved_1(); - virtual void CEikDialog_Reserved_2(); - - private: // new function - - virtual void CAknIconMapDialog_Reserved(); - - private: - - TInt* iIconIndex; - -#ifdef RD_SCALABLE_UI_V2 - - TBool iConSelected; - -#endif // RD_SCALABLE_UI_V2 - }; - -#endif // LMKICONDIALOG_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmdesticonmap.h --- a/cmmanager/cmmgr/Framework/Inc/cmdesticonmap.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,251 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Destination icon map -* -*/ - -#ifndef CMDESTICONMAP_H -#define CMDESTICONMAP_H - -#include -#include -#include -#include - - -class CCmDestinationIconMapExtension; -class CEikScrollBarFrame; -class CCmDestinationIconMapExtension; - - -/** - * Change Icon Dialog table Destination UI. - * - */ -NONSHARABLE_CLASS(CCmDestinationIconMap) : public CCoeControl - , public MEikScrollBarObserver - { - public: - - /** - * CCmDestinationIconMap two phase constructor - */ - static CCmDestinationIconMap* NewL(); - - /** - * CCmDestinationIconMap destructor - */ - ~CCmDestinationIconMap(); - - /** - * CCmDestinationIconMap resource constructor. - * @param aReader Icon Dialog table Resource - */ - void ConstructFromResourceL( TResourceReader& aReader ); - - /** - * Number of rows in the icon table. - * @return Number of rows in icon table. - */ - TInt HeightInRows(); - - /** - * Create the scrollbar Ptr and set the No of Rows in the - * Icon table depends upon the Icon array count. - */ - void CreateScrollBarAndIconRowL(); - - /** - * Sets reference to the index where selected icon index is put. - * @param aIconIndex Reference to the integer where selected icon - * index is put. - */ - void SetIndex(TInt& aIconIndex); - - private: - - /** - * CCmDestinationIconMap constructor - */ - CCmDestinationIconMap(); - - /** - * CCmDestinationIconMap two phase constructor - */ - void ConstructL(); - - public: // from CCoeControl - - TSize MinimumSize(); - TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode); - TCoeInputCapabilities InputCapabilities() const; - virtual void ActivateL(); - -#ifdef RD_SCALABLE_UI_V2 - - void HandlePointerEventL( const TPointerEvent& aPointerEvent ); - void SetObserver( MCoeControlObserver* aObserver ); - -#endif //RD_SCALABLE_UI_V2 - - protected: // from CCoeControl - - void SizeChanged(); - void HandleResourceChange(TInt aType); - TInt CountComponentControls() const; - CCoeControl* ComponentControl(TInt aIndex) const; - - public: - - /** - * DrawOffscreenBackgroundIfRequired(). - * - * @Description:Draw the offscreen bitmap if applicable. - * Specially in case of Skin change - */ - void DrawOffscreenBackgroundIfRequired() const; - - /** - * DoLayout() - * @Description: Sets the Layout of the Icon table. - */ - void DoLayout(); - - private: - - /** - * Draw(). - * - * @Description: - */ - void Draw(const TRect& aRect) const; - - /** - * DrawItem(). - * - * @Description: - */ - void DrawItem( CWindowGc& aGc, - const TRect& aSctPosition, - TInt aIconIndex, - TBool aHighlighted, - TBool aDrawBackground ) const; - - /** - * DrawCursor(). - * - * @Description: - */ - void DrawCursor() const; - - /** - * MoveCursorL(). - * - * @Description: - */ - void MoveCursorL( TInt aX, TInt aY ); - - /** - * DrawCell(). - * - * @Description: - */ - void DrawCell( TInt aCursorPos, TBool aHighLighted ) const; - - /** - * CursorRect(). - * - * @Description: - */ - TRect CursorRect( TInt aCursorPos ) const; - - /** - * CursorPoint(). - * - * @Description: - */ - TPoint CursorPoint( TInt aCursorPos ) const; - - /** - * UpdateScrollIndicatorL(). - * - * @Description: - */ - void UpdateScrollIndicatorL(); - - /** - * CountMaxColumnsAndCellSizes(). - * - * @Description: - */ - void CountMaxColumnsAndCellSizes(); - - /** - * LoadIconL(). - * This fucton leaves if the client does not have a valid UI context - * - * @Description: - */ - void LoadIconL(); - - /** - * Extension(). - * - * @Description: - */ - CCmDestinationIconMapExtension* Extension() const; - - private: //from CCoeContrl - - void Reserved_1(); - void Reserved_2(); - - public: - - void HandleScrollEventL( CEikScrollBar* aScrollBar, - TEikScrollEvent aEventType); - - private: - TInt iGridItemWidth; - TInt iGridItemHeight; - TBool iIsMirrored; - TInt iRows; - TInt iFirstVisibleRow; - TPoint iOffset; - TPoint iGridTopLeft; - - TPoint iCursorPos; - TPoint iOldCursorPos; - mutable TBool iDrawnBefore; - - CEikScrollBarFrame* iSBFrame; - TInt* iIconIndex; - - TBool iAnimated; - - CFbsBitmap* iOffscreenBg; - CFbsBitmapDevice* iBitmapDevice; - CFbsBitGc* iBitmapGc; - TBool iHasBitmapBackground; - mutable TBool iOffscreenBgDrawn; - - TInt iMaxColumns; - TInt iCurrentPage; - TInt iNumPages; - CCmDestinationIconMapExtension* iExtension; - CArrayPtr* iConsArray; - TBool iDragAlreadyActive; - }; - -#endif // __CMDESTICONMAP_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmdestinationimpl.h --- a/cmmanager/cmmgr/Framework/Inc/cmdestinationimpl.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,992 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of destination class. -* -*/ - -#ifndef DESTINATIONIMPL_H -#define DESTINATIONIMPL_H - -// User includes -#include "cmmanager.hrh" -#include - -// System includes -#include -#include -#include -#include - -// CONSTANTS -const TInt KCmInitIndex = 1; -const TInt KNumOfIcons = 12; - -#define RECORD_FROM_ELEMENT_ID( elementId ) \ - (( elementId & KCDMaskShowRecordId ) >> 8 ) - -enum TSnapMetadataProtecionLevel - { - EProtectionLevel0 = 0x00000000, - EProtectionLevel1 = 0x10000000, - EProtectionLevel2 = 0x20000000 - }; - -#define KSnapMetadataProtecionLevelMask 0xF0000000; - -// DATA TYPES - -// FORWARD DECLARATIONS -class CCmManagerImpl; -class CCmPluginBaseEng; -class CCmPluginBase; -class TCmPluginInitParam; -class CPluginItem; -class CCDDataMobilitySelectionPolicyRecord; -class CGulIcon; -class CCmTransactionHandler; -class CCDSNAPMetadataRecord; - -typedef CArrayPtrFlat CCmArray; - -#define KFlagRemove 0x00000001 - -typedef CCDDataMobilitySelectionPolicyRecord CCDSnapRecord; - -const TUint32 KCmDefaultDestinationAPTagId = 0x1000; - -// CLASS DECLARATION -NONSHARABLE_CLASS(CPluginItem) : public CBase - { - public: - - enum - { - ERemoveCm = 0x00000001 - }; - - public: - - CCDSnapRecord* iDNRecord; - CCmPluginBase* iPlugin; - TUint32 iFlags; - }; - -/** - * Holds all the destination specific data of the CCmDestinationImpl - * This class is put in the object pool and may be shared - * among CCmDestinationImpl objects - */ -NONSHARABLE_CLASS( CCmDestinationData ): public CBase - { - //===================================================================== - // Constructors/Destructors - // - public: - CCmDestinationData( CCmManagerImpl& aCmMgr ); - ~CCmDestinationData(); - /** - * Increments the reference counter. Used by the object pool. - */ - void IncrementRefCounter(); - /** - * Increments the reference counter. Used by the object pool. - */ - void DecrementRefCounter(); - private: - /** - * Reset and, if needed, destroy the passed array. - * @since S60 3.2 - * @param aArray array to be reseted and deleted - * @parar aDestroy ETrue if array has to be deleted - */ - void ResetAndDestroyArray( CCmArray* &aArray, TBool aDestroy ); - - public: - /** - * Returns the number of connection methods of the destination - * @param None - * @return TInt - */ - TInt ConnectionMethodCount(); - - /** - * Returns the destination's Id attribute - * @param None - * @return TUint32 - */ - inline TUint32 Id(){return iDestAPRecord->iRecordTag;}; - - /** - * Returns the destination's ElementId attribute - * @param None - * @return TUint32 - */ - inline TUint32 ElementId() - { return iNetworkRecord->ElementId() & KCDMaskShowField;}; - - /** - * Returns that the destination is protected or not. - * @return protection level - */ - CMManager::TProtectionLevel ProtectionLevel(); - - /** - * Returns that the destination is hidden or not. - * @param None - * @return TBool - */ - TBool IsHiddenL(); - - /** - * Indicates if the Id is valid or if this is a new object which sitll - * haven't been updated. - * Used by the object pool. - * @return TBool - */ - TBool IdIsValid(); - - /** - * Returns the reference counter. Used by the object pool. - * @return TInt - */ - TInt GetRefCounter(); - /** - * Returns pointer to the CmManager object - * Used in 'R' classes - */ - CCmManagerImpl* Cmmgr(); - - /** - * Returns the Metadata - * @param None - * @return TUint32 - */ - TUint32 MetadataL( CMManager::TSnapMetadataField aMetaField ) const; - - private: - CCmManagerImpl& iCmMgr; //< Not owned - CommsDat::CCDNetworkRecord* iNetworkRecord; - - //To store Connection methods that belong to this destination - CCmArray* iConnMethodArray; - CCmArray* iDeleteCmArray; - - // DN_IAP Table has to be update if - // - new CM is added to the destination - // - CM is delete from the destination - // - CM priority modified - TBool iDNTableChanged; - - //Protection changed - TBool iProtectionChanged; - //The last protection level of the destination - TUint iLastProtectionLevel; - - CCDSNAPMetadataRecord* iMetaDataRec; - //Reference counter for the object pool - TInt iRefCounter; - //indicates if the Id is valid or not (for the object pool) - TBool iIdIsValid; - CommsDat::CCDAccessPointRecord* iDestAPRecord; - - friend class CCmDestinationImpl; - friend class CCmManagerImpl; - TBool iNewWithId; - }; -/** - * RCmDestination is for getting/setting values of a network destination. - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CCmDestinationImpl ) : public CBase - { - public: - //===================================================================== - // Constructors/Destructors - // - public: - - /** Destructor. */ - ~CCmDestinationImpl(); - - /** Epoc constructor - * This should be used only by the object pool - */ - IMPORT_C static CCmDestinationImpl* NewL( CCmManagerImpl& aCmMgr, - const TDesC& aName ); - - /** Epoc constructor - * This should be used only by the object pool - */ - static CCmDestinationImpl* NewL( CCmManagerImpl& aCmMgr, - CCmDestinationData* aData ); - - /** Epoc constructor - * This should be used only by the 'R' classes - */ - static CCmDestinationImpl* NewLC( CCmDestinationData* aData ); - - /** Epoc constructor - * This should be used only by the object pool - */ - IMPORT_C static CCmDestinationImpl* NewL( CCmManagerImpl& aCmMgr, - TUint aDestinationId ); - - public: - /** - * Returns pointer to the CmManager object - * Used in 'R' classes - */ - CCmManagerImpl* Cmmgr(); - //===================================================================== - // Conn method handling - - /** - * Create a connection method belonging to the destination - * @param aImplementationUid - implementation uid of the connection - * method - * @return CCmPluginBaseEng* - */ - CCmPluginBase* CreateConnectionMethodL( TUint32 aBearerType ); - - /** - * Create a connection method belonging to the destination - * @param aBearerType - implementation uid of the connection - * method - * @param aConnMethId - Predefined id for the connection method. - * @return CCmPluginBaseEng* - */ - CCmPluginBase* CreateConnectionMethodL( TUint32 aBearerType, - TUint32 aConnMethId ); - /* - * Adds an existing connection method to a destination - * @param - * @return TInt - index in the Connection Method list - */ - TInt AddConnectionMethodL( CCmPluginBase& aConnectionMethod ); - - /* - * Embeds an existing destination to the destination - * @param CCmDestinationImpl - Destinatio to be embedded - * @return TInt - index in the Connection Method list - */ - TInt AddEmbeddedDestinationL( CCmDestinationImpl& aDestination ); - - /** - * Remove a connection method from a destination and delete it - * on update. - * Exception: conenction method is not deleted if it's referenced - * from any other destination. - * @param aConnectionMethod the connection method to be deleted - * @return none. - */ - void DeleteConnectionMethodL( CCmPluginBase& aConnectionMethod ); - - /** - * Remove connection method from the destination - * @param aConnectionMethod connection method to be removed - */ - void RemoveConnectionMethodL( const CCmPluginBase& aConnectionMethod ); - - /** - * Remove connection method from the destination - * @param aConnectionMethod connection method to be removed - */ - void RemoveConnectionMethodL( const CCmPluginBaseEng& aConnectionMethod ); - - /** - * Notification from child plugin that it was deleted. - * Remove it from the array and update priorities. - * @param aConnectionMethod child connection method that was deleted. - */ - void ConnectionMethodDeletedL( const CCmPluginBase& aConnectionMethod ); - - /** - * Set the CCMItem's priority based on the passed new index - * @param aCCMItem The connection method item - * @param aIndex The new index of the item in the list - */ - void ModifyPriorityL( CCmPluginBase& aCCMItem, TUint aIndex ); - - /** - * Obsolete - */ - TUint PriorityL( CCmPluginBaseEng& aCCMItem ); - - /** - * Return the priority of the passed connection method - * @param aCCMItem queried connection method - * @return the priority of the queried connection method - */ - TUint PriorityL( CCmPluginBase& aCCMItem ); - - /** - * Returns the number of connection methods of the destination - * @param None - * @return TInt - */ - IMPORT_C TInt ConnectionMethodCount(); - - //Operator - - /** - * Obsolete - */ - IMPORT_C CCmPluginBaseEng* ConnectionMethodL( TInt anIndex ); - - /** - * Returns a reference to the connection method. - * The index must be less than the return value of ConnMethodCount() - * @param anIndex - * @return plugin instance - ownership NOT passed - */ - IMPORT_C CCmPluginBase* GetConnectionMethodL( TInt anIndex ); - - /** - * Returns a reference to the connection method. - * The index must be less than the return value of ConnMethodCount() - * @param anIapId IAP id of the queried connection method - * @return plugin instance - ownership NOT passed - */ - CCmPluginBase* ConnectionMethodByIDL( TUint32 anIapId ); - - void ConnectMethodIdArrayL( RArray& aCmIds ); - - //Getting attributes - - /** - * Returns the destination's Name attribute - * HBuf ownership is passed to the caller - * @param None - * @return name of the destination. ownership is passed. - */ - IMPORT_C HBufC* NameLC(); - - /** - * Returns the destination's Id attribute - * @param None - * @return TUint32 - */ - inline TUint32 Id(){return iData->Id();}; - - /** - * Returns the destination's ElementId attribute - * @param None - * @return TUint32 - */ - inline TUint32 ElementId(){ return iData->ElementId();}; - - /** - * Returns the Icon pointer - * This fucton leaves if the client does not have a valid UI context - * @param None - * @return TUint32 - */ - IMPORT_C CGulIcon* IconL(); - - /** - * Returns the Metadata - * @param None - * @return TUint32 - */ - TUint32 MetadataL( CMManager::TSnapMetadataField aMetaField ) const; - - /** - * Returns if there's connection created with any of the destination's - * connection method. - * @return ETrue if there's connection with any of the destination's - * connection method. - */ - IMPORT_C TBool IsConnectedL() const; - - //===================================================================== - //Setting Attributes - - /** - * Set the destination's Name attribute. Leaves if the name already - * exists - * @param aDestinationName value to set - * @return None - */ - IMPORT_C void SetNameL( const TDesC& aName ); - - /** - * Set the destination's Icon index. - * This fucton leaves if the client does not have a valid UI context - * @param aIconIndex value to set - * @return None - */ - IMPORT_C void SetIconL( TUint32 anIndex ); - - /** - * Set the Metadata - * @param aMetaField field to be modified - * @param aValue value to be set - */ - void SetMetadataL( CMManager::TSnapMetadataField aMetaField, - TUint32 aValue ); - - /** - * Returns that the destination is protected or not. - * @return protection level - */ - IMPORT_C CMManager::TProtectionLevel ProtectionLevel(); - - /** - * Set the protection of the destination. - * @param aProtectionLevel - * @return None - */ - IMPORT_C void SetProtectionL( CMManager::TProtectionLevel aProtectionLevel ); - - /** - * Update all the attributes of the Connection Methods and the - * Destination. - * @return None - */ - IMPORT_C void UpdateL(); - - /** - * Deletes it's connection methods from comms.dat (unless shared) - * then deletes itself - */ - IMPORT_C void DeleteLD(); - - /** - * Performs RollbackTransactionL(). - */ - void Close(); - - /** - * Set iPlugin to NULL in plugin array, but not delete it. - * Next reference to this connection method will load the - * plugin again. - */ - void PluginClosed( CCmPluginBase* aPlugin ); - - /** - * Returns that the destination is hidden or not. - * @param None - * @return TBool - */ - IMPORT_C TBool IsHidden(); - - /** - * Set that the destination is hidden or not. - * @param aHidden - True if it is hidden. - * @return None - */ - IMPORT_C void SetHiddenL( TBool aHidden ); - - /** - * Check if the destination element id is already embeded. - * Leaves with KErrNotSupported (multiple levels of embedding is not - * supported) - */ - void CheckIfEmbeddedL( TInt aId ); - - - static CGulIcon* IconIdL( CCmManagerImpl& aCmMgr, - CommsDat::TMDBElementId aId ); - - static CMManager::TProtectionLevel ProtectionLevelL( CCmManagerImpl& aCmMgr, - CommsDat::TMDBElementId aId ); - - /** - * Removes this destination from the object pool. - */ - IMPORT_C void RemoveFromPool(); - - /** - * Increments the reference counter. Used by the object pool. - */ - void IncrementRefCounter(); - /** - * Increments the reference counter. Used by the object pool. - */ - void DecrementRefCounter(); - /** - * Returns the reference counter. Used by the object pool. - * @return TInt - */ - TInt GetRefCounter(); - - /** - * Returns iData. Used by the object pool and the API oprators. - * @return TInt - */ - CCmDestinationData* GetData(); - /** - * Used by the object pool and the API oprators. - */ - void SetData(CCmDestinationData* aData); - /** - * Indicates if the Id is valid or if this is a new object which sitll - * haven't been updated. - * Used by the object pool. - * @return TBool - */ - TBool IdIsValid(); - - /** - * Returns pointer to embedded destination if there is any - * @return CCmDestinationImpl* Pointer to embedded destination - * Contains NULL if there is no destination embedded - */ - CCmDestinationImpl* EmbeddedL(); - - /** - * Checks if this destination plus a possible embedded destinaion - * contains a connection method which can be used for a connection - * Doesn't check VPNs! - * @return TBool ETrue if this destination or a destination embedded into - * it contains a connection method. Otherwise returns EFalse - */ - TBool CanUseToConnectL(); - - - /** - * Reload connection method under this destination so as to - * keep synchronization with CommsDat - */ - void ReLoadConnectionMethodsL(); - - /** Epoc constructor - * This should be used only by the object pool - */ - static CCmDestinationImpl* NewL( CCmManagerImpl& aCmMgr, - const TDesC& aName, - TUint32 aDestId); - - - /** - * Returns the Id of this Destination which is used to identify the Destination. - * It is the Id saved to Destination Access Point's Tag field. - */ - TUint32 GetDestinationAPTagId(); - - /** - * Checks if this destination already contains the given Connection Method - * @param aConnectionMethod Connection Method to be checked whether it - * already exists. - * @return TBool ETrue if this Destination contais already the given CM. If the - * Destination does not contain the given CM returns EFalse. Otherwise leaves - * with system-wide error code. - */ - TBool CheckIfCMExistsL( CCmPluginBase& aConnectionMethod ); - - - //========================================================================= - // Construction - // - private: - - /** - * Default constructor. - * @param aCmManager connection method manager - */ - CCmDestinationImpl( CCmManagerImpl& aCmMgr ); - - /* - * Create a new destination with the specified name - */ - void ConstructL( const TDesC& aName ); - - void ConstructL( const TDesC& aName, TUint32 aDestId ); - - /* - * Create a destination and initializes it - * from the commsdat based on the id - */ - void ConstructL( TUint aDestinationId ); - - //========================================================================= - // New functions - // - private: - - /** - * Check if the destination contains and embedded destination - * @since S60 3.2 - * @return ETrue if the destination contains and embedded destination - */ - TBool HasEmbeddedL(); - - /** - * - Check if transaction is already opened - * - Set iOwnTransaction is not and opens it and - put 'this' on cleanup&close stack - */ - void OpenTransactionLC(); - - /** - * - Check if the transaction is ours. - * - If yes, commits the transaction. - * - anyway does nothing - * @praram aError - error id - */ - void CommitTransactionL( TInt aError ); - - /** - * Rollback transaction. - */ - void RollbackTransaction(); - - /** - * Returns the CommsDat session. - * Do not close! - * @return commsdat session - */ - CommsDat::CMDBSession& Session()const; - - /** - * Find the connection method in iConnMethodArray. - * @param aConnectionMethod connection method to be searched for - * @return index of the found item - */ - TInt FindConnectionMethodL( const CCmPluginBase& aConnectionMethod ); - - /** - * Find the connection method in iConnMethodArray. - * @param aConnectionMethod connection method to be searched for - * @return index of the found item - */ - TInt FindConnectionMethodL( const CCmPluginBaseEng& aConnectionMethod ); - - /** - * Update protection attributes of every connection method if changed. - */ - void UpdateProtectionL(); - - /** - * Update every connection method. - */ - void UpdateConnectionMethodsL(); - - /** - * Create or update the record of the network table for this - * destination. - */ - void UpdateNetworkRecordL(); - - /** - * Update the SNAP table - */ - void UpdateSNAPTableL(); - - /** - * Update the SNAP Metadata table - */ - void UpdateSNAPMetadataTableL(); - - /** - * Load network record. Destination id is passed, because - * id is from the client application, and destinaion id - * is the network id for them. :) - * @param aDestinationId network record id - */ - void LoadNetworkRecordL( TUint32 aDestinationId ); - - /** - * Load Destination AP record. Destination id is passed, because - * id is from the client application, and destinaion id - * is the network id for them. :) - * @param aDestinationId network record id - */ - void LoadDestAPRecordL( TUint32 aDestinationId ); - - /** - * Load connection methods of the destination - */ - void LoadConnectionMethodsL(); - - /** - * Load SNAP Metadata table - */ - void LoadSNAPMetadataTableL(); - - /** - * Create a connection method belonging to the destination - * @param aImplementationUid - implementation uid of the connection - * method - * @param aParams - plugin init param - * @return CCmPluginBaseEng* - */ - CCmPluginBase* CreateConnectionMethodL( TUid aImplementationUid, - TCmPluginInitParam& aParams ); - - /** - * Compare two records from DNIAP by their priority field. - * @param aLeft one record from DN_IAP table. - * @param aRight one record from DN_IAP table. - * @return - * - negative value, if aLeft is less than aRight; - * - 0, if aLeft equals to aRight; - * - positive value, if aLeft is greater than aRight. - */ - static TInt SortRecordsByPriority( const CommsDat::CMDBRecordBase& aLeft, - const CommsDat::CMDBRecordBase& aRight); - - /** - * Add an item to the Connection Method array based on bearer priority - * table. - * @param aItem An item to be added. - * @return TInt the index of the added item. The array contains an initial item, - * so always SUBTRACT KCmInitIndex to get the connection method index number!!! - */ - TInt AddToArrayL( CPluginItem* aItem ); - - /** - * IAP is considered to be removed from the commsdat by third - * party (someone else external). - * Seamlessness entries should also be removed. - * @param aIapId Iap was removed - */ - void CleanUpSeamlessnessTableL( TUint32 aIapId ); - - /** - * Embedded dest is considered to be removed from the commsdat - * by third party (someone else external). - * Snap Metadata entries should also be removed. - * @param aSnap Id was removed - */ - void CleanUpSnapMetadataTableL( TUint32 aSnap ); - - /** - * Embedded dest is considered to be removed from the commsdat - * by third party (someone else external). - * Snap Metadata entries should also be removed. - * @param aSnap Id was removed - */ - void CleanUpEmbeddedL( TUint32 aDestId ); - - /** - * Create and load plugin. - * @param item where plugin has to be loaded. - */ - void LoadPluginL( CPluginItem& aItem ); - - - /** - * Create embedded destination plugin. - * @param aItem - plugin item - * @param TUint32 destination id - */ - void CreateEmbeddedDestinationPluginL( CPluginItem& aItem, - TInt aDestinationId ); - /** - * Load embedded destination plugin. - * @param aItem - plugin item - */ - void LoadEmbeddedDestinationPluginL( CPluginItem& aItem ); - - /** - * Check if there is destination with this name. - * Leaves with KErrAlreadyExists if name already exists - * @param aName destination name - */ - void CheckIfDestinationNameExistL( const TDesC& aName ); - - /** - * Set or clear attribute - * @aRecord record of which the attribute is to be set or clear - * @aAttribute attribute to be set or clear - * @aSet ETrue to set - */ - void SetAttribute( CommsDat::CMDBRecordBase* aRecord, - TUint32 aAttribute, - TBool aSet ); - - - /** - * Delete all connection methods. - * @since S60 3.2 - */ - void DeleteConnectionMethodsL(); - - /** - * Reference to a non-existing IAP found in the SNAP table. - * Remove the SNAP record and the metadata record of this - * IAP. IAP is most probably deleted by APEngine. - * @param aSnapRecord SNAP record point to a non-existing IAP - */ - void DeleteIAPRecordsL( CommsDat::CMDBRecordBase* aSnapRecord ); - - /** - * Check if the name of the passed record is the same as the name of - * network one, and update it if not. - * @param aRecord record to be checked and updated if needed - */ - void CheckIfNameModifiedL( CCDSnapRecord* aRecord ); - - /** - * Checks if there's another SNAP with Internet bit set. - * Leaves with KErrAlreadyExists if so. - */ - void CheckIfInternetExistsL(); - - /** - * Return the index value of the connection method. - * @param aCmId id of the connection method - * @return index value in iConnMethodArray - */ - TInt ConnectionMethodIndex( TUint32 aCmId ); - - /** - * Retrieves the base of the priority counts in cm list - * It is the data of the plugin in case of none VPN. - * It is the data of the underlying cm in case of VPN over cm. - * It is "wildcard" in case of VPN over destination. - * aRetBearer and aRetExtLevel are not filled in this case - * @param aItem the plugin list item which data is get - * @param aRetPrio the default priority of the cm in return - * @param aRetBearer the bearer of the cm in return - * @param aRetExtLevel the extenson level of the cm in return - * @return ETrue if the cm is virtual else EFalse - */ - TBool PrioDataL( CPluginItem* aItem, TUint32& aRetPrio, - TUint32& aRetBearer, TUint32& aRetExtLevel ); - - - - /** - * Determines the position of the inserted item into the cm list. - * This determination is based on the similarity of the bearer types. - * The inserted position is just after the last item with the - * same bearer type and virtuality - if exist else -1. - * @param aBearerType bearer type od the inserted cm - * @param aIsVirtual virtuality of the inserted cm - * @return The position in the cm list where the item should be inserted. - * If there is no cm with same bearer type in the list then it - * returns -1; - */ - TInt InsertSameMethodL( TUint32 aBearerType, TBool aIsVirtual ); - - /** - * Determines the position of the inserted item into the cm list. - * This determination is based on the priority and the extension - * level of the cm's. - * @param aPrio default bearer type of the inserted cm - * @param aExtLevel extension level of the inserted cm - * @return The position in the cm list where the item should be inserted. - */ - TInt InsertPriorityMethodL( TUint32 aPrio, TUint32 aExtLevel ); - - /** - * Checks if there's another SNAP with the same localised bit set. - * Leaves with KErrAlreadyExists if so. - */ - void CheckIfLocalisedDestExistL( TUint32 aValue ); - - /** - * Checks if there's another SNAP with the same purpose bit set. - * Leaves with KErrAlreadyExists if so. - */ - void CheckIfPurposeExistL( TUint32 aValue ); - - static CGulIcon* IconL( TInt aIconIndex ); - static CMManager::TProtectionLevel ProtectionLevel( CCDSNAPMetadataRecord* aMetaDataRec ); - - /** - * Deletes all the recordsrelated to this Destination to be - * deleted. - * @param None - * @return - */ - void DeleteRelatedRecordsL( TInt aCount ); - - /** - * Checks if this(current) destination is referenced by any - * Virtual Connection Method. - * @param None - * Leaves with KErrLocked if it's referenced. - */ - void CheckIfReferencedByVirtualCML(); - - /** - * Initializes the Destination AccessPoint record - * deleted. - * @param aDestAPRecord Record to be initialized - * @return - */ - void InitializeDestAPRecordL(); - - /** - * Sets the given (tag)id to the accesspoint record - * @param aDestId Id to be set - * @return - */ - void SetIdL( TInt aDestId ); - - /** - * Checks that there isn't any destination with the given (tag)id. - * @param aDestId Id to be checked - * @return - */ - void CheckIfDestinationIdExistsL( TUint32 aDestId ); - - /** - * Create or update the record of the accesspoint table for this - * destination. - */ - void UpdateDestAPRecordL(); - - /** - * Creates an unique (tag)id to the record of the accesspoint table for this - * destination. - */ - TUint32 CreateDestinationAPTagIdL(); - - /** - * Sets the default Tier Manager to the accesspoint record for this - * destination. - */ - void SetDefaultTierManagerL(); - - /** - * Sets the default Meta Connection Provider to the accesspoint record for this - * destination. - */ - void SetDefaultMCprL(); - - /** - * Sets the default Connection Provider to the accesspoint record for this - * destination. - */ - void SetDefaultCprL(); - - /** - * Sets the default Subconnection Provider to the accesspoint record for this - * destination. - */ - void SetDefaultSCprL(); - - /** - * Sets the default Protocol to the accesspoint record for this - * destination. - */ - void SetDefaultProtocolL(); - - //========================================================================= - // Member variables - // - private: - CCmManagerImpl& iCmMgr; //< Not owned - CCmDestinationData* iData; - private: - - friend class CCmManagerImpl; - }; - -#endif // DESTINATIONIMPL_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmdlg.h --- a/cmmanager/cmmgr/Framework/Inc/cmdlg.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,275 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Dialog for setting the gateway. It's used temporarily. -* -*/ - -#ifndef CMDIALOG_H -#define CMDIALOG_H - -// INCLUDES - -#include -#include -#include "cmlistboxmodel.h" -#include "cmlistbox.h" -#include "cmdestinationimpl.h" -#include "cmmanagerimpl.h" -#include -#include "cmcommsdatnotifier.h" - -//#include - -// CLASS DECLARATION -class CEikStatusPane; -class CAknTitlePane; -class CAknNavigationControlContainer; -class CAknNavigationDecorator; -class CCmWizard; -class CCmdExec; -class CDestDlg; - -/** - * Dialog for displaying and editing connection methods - * also base class for CUncatDlg - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CCmDlg ) : public CAknDialog - , MEikListBoxObserver - , MAknInfoPopupNoteObserver - , public MCmdExec - , public MCmCommsDatWatcher - { - public : // construction - CCmDlg( CCmManagerImpl* aCmManager, TUint32 aDestUid, - CDestDlg* aDestDlg ); - - ~CCmDlg(); - - /** - * Two-phased constructor. - */ - static CCmDlg* NewL( CCmManagerImpl* aCmManager, TUint32 aDestUid, - CDestDlg* aDestDlg ); - - TInt ConstructAndRunLD( TUint32 aHighLight, TUint32& aSelected ); - - // From MEikMenuObserver - virtual void DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ); - // From MEikCommandObserver - virtual void ProcessCommandL( TInt aCommandId ) ; - - /** - * Updates listbox data - */ - virtual void HandleListboxDataChangeL(); - - /** - * Handle key event. - * @param aKeyEvent The key event. - * @param aType Key event type. - * @return Response (was the key event consumed?). - */ - TKeyResponse OfferKeyEventL - ( const TKeyEvent& aKeyEvent, TEventCode aType ); - - public: - /** - * From base class MCmdExec - */ - void Execute(); - - public: // From CCoeControl - - /** - * Returns the help context - * From CCoeControl - * - * @since S60 3.2 - * @param aContext the returned help context - */ - void GetHelpContext( TCoeHelpContext& aContext ) const; - - /** - * Handles the resource change - * From CCoeControl - * - * @since S60 5.0 - * @param aType Type of the resource change - */ - void HandleResourceChange( TInt aType ); - - public: // From MCmCommsDatWatcher - - /** - * Watch changes in CommsDat - */ - virtual void CommsDatChangesL(); - - protected : // from CEikDialog - TBool OkToExitL( TInt aButtonId ) ; - - virtual void PreLayoutDynInitL(); - - SEikControlInfo CreateCustomControlL ( TInt aControlType ); - - // From MEikListBoxObserver - void HandleListBoxEventL( CEikListBox* aListBox, - TListBoxEvent aEventType ); - - /** - * Initialises listbox texts - */ - virtual void InitTextsL(); - - /** - * Sets the number of conn methods text on navi pane - */ - void SetNoOfCMsL(TInt aCount); - - - //from MAknInfoPopupNoteObserver - /* Handles events reported from info popup note. - * @param aController The controller that controls the note, from - * where the event originates. - * @param aEvent The event. - */ - void HandleInfoPopupNoteEvent( - CAknInfoPopupNoteController* aController, - TAknInfoPopupNoteEvent aEvent ); - - /** - * @return the currently focused connection method in the list - */ - virtual CCmPluginBase* CurrentCML(); - - /** - * @return the connection method in the list at the specified index - */ - virtual CCmPluginBase* CMByIndexL( TInt aIndex ); - - /** - * @return the connection mehtod count - */ - virtual TInt CMCount(); - - /** - * deletes the currently highlighted conneciton method - */ - void DeleteCurrentCmL(); - - void RenameConnectionMethodL(); - void PrioritiseConnectionMethodL(); - void AddConnectionMethodL(); - void CopyConnectionMethodL(); - void MoveConnectionMethodL(); - void EditConnectionMethodL(); - - /** - * Indicates if a connection is in use and displays and error message - * - * @return ETrue if in use - */ - TBool CurrentCmInUseL(); - - virtual void ConstructCMArrayL( RArray& aCmIds ); - - /** - * Remove hidden Connection Methods from the Array - */ - virtual void ClearHiddenCMsFromArrayL( RArray& aCmIds ); - - public: - /** - * From base class MCmdExec - */ - void HandleLeaveError( TInt aError ); - - private: - - /** - * Finishes the priorizing method - * - * @param aOkPushed ETrue if the OK button pushed. - * EFalse if the Cancel button pushed. - * - */ - void FinishPriorizingL( TBool aOkPushed ); - - /** - * Rebuild item index array to remove some Iap that has been deleted from - * CommsDat by other application - */ - void ReBuildItemIndexArrayL(); - - /** - * Reorder connection methods according to underlying connection in case of vpn - */ - void ReOrderCMsL(); - - - /** - * Get a proper index in list for priority - */ - TInt GetInsertIndexL( TInt aCount, TUint32 aPriority ); - - protected: - CCmListboxModel* iModel; - TUint32 iHighlight; - TUint32* iSelected; - TBool iModelPassed; - CCmListbox* iListbox; - CEikStatusPane* iStatusPane; // NOT owned - CAknTitlePane* iTitlePane; // NOT owned - CAknNavigationControlContainer* iNaviPane; // NOT owned - CAknNavigationDecorator* iNaviDecorator; // owned - HBufC* iOldTitleText; - CCmManagerImpl* iCmManager; // NOT owned - TUint32 iDestUid; // uid of the destination the - // connection mehtods belong to - TBool iPrioritising; - TInt iExitReason; // Exit reason, can be KUserExit or - // KUserBack used to pass user exit - // event - CAknInfoPopupNoteController* iInfoPopupNoteController; - - private: - - TInt iCmToPrioritise; // connection mehthod index - // selected to prioritise - CCmDestinationImpl* iCmDestinationImpl; // the destination the - - CCmWizard* iCmWizard; // wizard for connection method creation - // Indicated that Escape has arrived and it should be forwarded when CmWizard - // finished its work - TBool iEscapeArrived; - - TBool iProcessing; - TBool iAlreadyConfirmedDelete; - // connection mehtods belongs to - TBool iExitduringProcessing; - TBool iBackduringProcessing; - CDestDlg* iDestDlg; - - protected: - // This is nescessary becaue in case of not supported CMs the data base - // and the lisbox content is different.(The listbox doesn' show the - // unsupported ones.) - RArray iItemIndex; - CCmdExec* iCmdExec; - }; - -#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmlistbox.h --- a/cmmanager/cmmgr/Framework/Inc/cmlistbox.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of class CCmListbox. -* -*/ - -#ifndef CM_LISTBOX_H -#define CM_LISTBOX_H - -// INCLUDE FILES -#include - -// FORWARD DECLARATION -class CCmListboxModel; - -/** - * Model for the connection methods listbox. It is an array of CCmListItem - * pointers; items are owned. - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CCmListbox ) : public CAknDoubleGraphicStyleListBox - { - public: // Construct / cmruct - - /** - * Two-phased constructor. Leaves on failure. - * @param aParent Parent control. - * @return The constructed listbox. - */ - static CCmListbox* NewL - ( const CCoeControl* aParent ); - - /** - * Cmructor. - */ - virtual ~CCmListbox(); - - /** - * Constructor. - */ - CCmListbox(); - - public : - /** - * Handle key event. - * @param aKeyEvent The key event. - * @param aType Key event type. - * @return Response (was the key event consumed?). - */ - TKeyResponse OfferKeyEventL - ( const TKeyEvent& aKeyEvent, TEventCode aType ); - - /** - * Handle focus change. - * @param aDrawNow Draw now? - */ - void FocusChanged( TDrawNow aDrawNow ); - - /** - * Gets the UID from a given item - * @param The index of the item - * @return The UID of the item given by itemindex - */ - TUint32 Uid4Item( TInt aItem ) const; - - /** - * Gets the UID of the current item - * @return The UID of the current item - */ - TUint32 CurrentItemUid() const; - - /** - * Gets the name of the current item - * @return The name of the current item - */ - const TDesC& CurrentItemNameL(); - - // from CCoeControl - void HandleResourceChange(TInt aType); - }; - - -#endif - -// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmlistboxmodel.h --- a/cmmanager/cmmgr/Framework/Inc/cmlistboxmodel.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of class CCmListboxModel. -* -*/ - -#ifndef CMLISTBOX_LISTBOX_MODEL_H -#define CMLISTBOX_LISTBOX_MODEL_H - -// INCLUDE FILES -#include -#include "cmlistitemlist.h" -#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#else -#include -#include -#endif - -// CONSTANTS -// Granularity of the model array. -const TInt KCMGranularity = 8; - -//"1\tFirstLabel\tSecondLabel\t0\t0" /**/ -_LIT( KListItemFormatCmProt, "%d\t%S\t%S\t%d" ); -//"0\tFirstLabel\tSecondLabel" /*\t%d*/ -_LIT( KListItemFormatCm, "%d\t%S\t%S" ); -//"0\tFirstLabel" /*\t%d*/ -_LIT( KListItemFormatEmbDest, "%d\t%S\t" ); -//"0\tFirstLabel\t0\t0" /*\t%d*/ -_LIT( KListItemFormatEmbDestProt, "%d\t%S\t\t%d" ); - -const TInt KCMMaxFormatSize = sizeof( KListItemFormatCm ); -const TInt KCMMaxListItemNameLength = CommsDat::KMaxTextLength; -const TInt KMaxCmListboxName = KCMMaxListItemNameLength+KCMMaxFormatSize; - - -/** -* Buffer size for formatting listbox text. Maximum item length -* plus listbox internals (tabulators for icons etc.) must fit into it. -* -* Important note: -* The model of the listbox is a CAknFilteredTextListBoxModel. -* The *itemarray* of that model is this class. That is, whatever is in -* the model (this class), it may not be visible, if it is filtered out. -* We always must use the listbox's Model() to get visible ones. -*/ - - -// CLASS DECLARATION - -/** - * Model for the connection methods listbox. - * pointers; items are owned. - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CCmListboxModel ) : public CCmListItemList - , public MDesCArray - { - public: // Construct - - /** - * Constructor. - */ - CCmListboxModel(); - - /** - * CCmListboxructor. - */ - virtual ~CCmListboxModel(); - - public: // from MDesCArray - - /** - * Get number of items in the model. - * @return number of items. - */ - TInt MdcaCount() const; - - /** - * Text to be displayed for this item. - * @param aIndex Index of item. - * @return for this item text (text owned by the model). - */ - TPtrC MdcaPoint( TInt aIndex ) const; - - public: - - /** - * Sets the icon offset - * @param aOffset the offset of our icons in the iconarray - */ - void SetOwnIconOffset( TInt aOffset ); - - protected: // data - - /** - * Formats the text of the listbox, calls the leaving version trapped. - * @param aIndex Index of item. - * @param aBuf Buffer to store formatted text. - */ - void FormatListboxText( TInt aIndex, TDes& aBuf ) const; - - /** - * Formats the text of the listbox, leaving version. - * @param aIndex Index of item. - * @param aBuf Buffer to store formatted text. - */ - void FormatListboxTextL( TInt aIndex, TDes& aBuf ) const; - - /** - * MdcaPoint() cannot leave, so this buffer is allocated - * to allow formatting. Fortunately, doesn't have to be very - * large. - * We have to use MUTABLE CAST, as MdcaPoint is const (odd enough), - * so wouldn't allow formatting the text in a member... - */ - __MUTABLE TBuf iBuf; - TInt iOffset; - }; - -#endif // CMLISTBOX_LISTBOX_MODEL_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmlistitem.h --- a/cmmanager/cmmgr/Framework/Inc/cmlistitem.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,147 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of the CCmListItem class. -* -*/ - -#ifndef CCMLISTITEM_H -#define CCMLISTITEM_H - -// INCLUDES -#include - -/** - * Representation of a list item. - * This class is used to hold the main information of a connection method. - * It is used in CCmSelect. - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CCmListItem ) :public CBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. Leaves on failure, places instance - * on cleanup stack. - * @param aUid The ID of the connection method - * @param aName The name of the connection method - * @param aPriority The priority of the connection method - * @param aIconIndex The icon index of the connection method's - * bearer's icon - * @param aIsProtected Whether the given item is read-only or not - * @param aIsSingleLine Whether the given item has one line only - * @return The constructed CCmListItem. - */ - static CCmListItem* NewLC( TUint32 aUid, - HBufC* aName, - TInt aPriority, - TUint aIconIndex, - TBool aIsProtected, - TBool aIsVPNOverDestination, - TBool aIsSingleLine, - TBool aIsDefault); - /** - * Destructor. - */ - virtual ~CCmListItem(); - - protected: // Constructors - - /** - * C++ default constructor. - */ - CCmListItem( HBufC* aName ); - - /** - * Second-phase constructor. - * @param aUid The ID of the connection method - * @param aPriority The priority of the connection method - * @param aIconIndex The icon index of the connection method's - * bearer's icon - * @param aIsProtected Whether the given item is read-only or not - * @param aIsSingleLine Whether the given item has one line only - */ - void ConstructL( TUint32 aUid, - TInt aPriority, - TUint aIconIndex, - TBool aIsProtected, - TBool aIsVPNOverDestination, - TBool aIsSingleLine, - TBool aIsDefault); - - public: // New functions - - /** - * Gets the name of the 'current' connection method - * Ownership of the returned text is not passed. - * @return The name of the current connection method - */ - const TDesC& Name(); - - /** - * Gets the UID of the current connection method - * @return The UID of the current connection method - */ - TUint32 Uid(); - - /** - * Gets the Priority of the current connection method - * @return The Priority of the current connection method - */ - TInt Priority(); - - /** - * Gets the IconIndex of the current connection method's bearer icon - * @return The IconIndex of the current connection method's bearer icon - */ - TUint IconIndex(); - - /** - * Returns the connection method's protected flag - * @return ETrue if the connection method is protected - */ - TBool IsProtected(); - - /** - * Returns the connection method's destination flag - * @return ETrue if the item has one line only - */ - TBool IsSingleLine(); - - /** - * Returns the connection method's default flag - * @return ETrue if the item is the default connection - */ - TBool IsDefault(); - - /** - * Used to figure out whether connection is VPN over destination. - * @return ETrue if the item is VPN over destination - */ - TBool IsVpnOverDestination(); - - private: // Data - - TUint32 iUid; // The ID of the access point - HBufC* iName; // The name of the access point - TInt iPriority; // The Priority of the access point - TUint iIconIndex; // The IconIndex of the access point - TBool iIsProtected; // The IsProtected flag of the access point - TBool iIsSingleLine; // ETrue if the item has one line only - TBool iIsDefault; // ETrue if the item is the default connection - TBool iIsVpnOverDestination; // ETrue if the item is VPN over destination - }; - -#endif // CCMLISTITEM_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmlistitemlist.h --- a/cmmanager/cmmgr/Framework/Inc/cmlistitemlist.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of the CCmListItemList class. -* -*/ - -#ifndef CCMLISTITEMLIST_H -#define CCMLISTITEMLIST_H - -// INCLUDES -#include - -// FORWARD DECLARATION -class CCmListItem; - -/** - * A list of CCmListItem-s pointers; items are owned. - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CCmListItemList ) : public CArrayPtrFlat - { - public: // Constructors and destructor - - /** - * C++ default constructor. - */ - CCmListItemList(); - - /** - * Destructor. Items in the list are destroyed. - */ - virtual ~CCmListItemList(); - - public: // New methods - - /** - * Get pointer to the item having aUid, or NULL if no such item is in the - * list. - * @param aUid Uid of item to get. - * @return Pointer to the item having uid aUid, or NULL. Ownership - * not passed (the list still owns the item). - */ - CCmListItem* ItemForUid( TUint32 aUid ) const; - }; - -#endif - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmlogger.h --- a/cmmanager/cmmgr/Framework/Inc/cmlogger.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of logger -* -*/ - -#ifndef CONNECTIONMETHODLOGGER_H -#define CONNECTIONMETHODLOGGER_H - -// INCLUDE FILES -#include - -#ifdef _DEBUG - -#define __CONNECTION_METHOD_LOG__ -#include - -// CONSTANTS - -class CFunctionEntryExit; - -//Logging to file in THUMB UDEB -class TLogger - { - public: // methods - - static void CreateLogger( TAny* aOwner ); - static void CloseLogger( TAny* aOwner ); - - static void AttachLogger( const TAny* aOwner, - const TAny* aAttach1, - const TAny* aAttach2 ); - - static void NameIt( const TAny* aOwner, - TRefByValue aNameFmt, - ... ); - - static void LogIt( const TAny* aOwner, - TRefByValue aFmt, - ... ); - static void LogIt( const TAny* aOwner, - TRefByValue aFmt, - ... ); - static void LogIt( const TAny* aOwner, - TRefByValue aFmt, - VA_LIST aList ); - static void LogIt( const TAny* aOwner, - TRefByValue aFmt, - VA_LIST aList ); - - private: - - TBuf<2048> iLogBuf; - TBuf8<2048> iLogBuf8; - TInt iRefCounter; - TAny* iOwner; - }; - -NONSHARABLE_CLASS( CFunctionEntryExit ): public CBase - { - public: - - CFunctionEntryExit( const TAny* aOwner, - TRefByValue aFunc ); - ~CFunctionEntryExit(); - - public: - - TPtrC iFunc; // function name - const TAny* iOwner; - TTime iEntryTime; - }; - -#define LOGGER_ENTERFN( a ) CFunctionEntryExit entryExit( this, _L(a) ); -#define CLOG_ENTERFN_PTR( a ) CFunctionEntryExit entryExit( NULL, _L(a) ); - -#define CLOG_CREATE TLogger::CreateLogger( this ); -#define CLOG_CREATE_PTR TLogger::CreateLogger( NULL ); -#define CLOG_ATTACH( attach1, attach2 ) TLogger::AttachLogger( this, \ - attach1, \ - attach2 ); -#define CLOG_NAME( a ) TLogger::NameIt( this, a ); -#define CLOG_NAME_1( a, b ) TLogger::NameIt( this, a, b ); -#define CLOG_NAME_2( a, b, c ) TLogger::NameIt( this, a, b, c ); -#define CLOG_NAME_3( a, b, c, d ) TLogger::NameIt( this, a, b, c, d ); -#define CLOG_CLOSE TLogger::CloseLogger( this ); -#define CLOG_WRITE( a ) TLogger::LogIt( this, _L(a) ); -#define CLOG_WRITE_FORMAT( a, b ) TLogger::LogIt( this, _L(a), b ); -#define CLOG_WRITE_1( a, b ) TLogger::LogIt( this, _L(a), b ); -#define CLOG_WRITE_2( a, b, c ) TLogger::LogIt( this, _L(a), b, c ); -#define CLOG_WRITE_3( a, b, c, d ) TLogger::LogIt( this, _L(a), b, c, d ); -#define CLOG_WRITE_4( a, b, c, d, e ) TLogger::LogIt( this, \ - _L(a), b, c, d, e ); -#define CLOG_WRITE8( a ) TLogger::LogIt( this, _L8(a) ); -#define CLOG_WRITE8_1( a, b ) TLogger::LogIt( this, _L8(a), b ); -#define CLOG_WRITE8_2( a, b, c ) TLogger::LogIt( this, _L8(a), b, c ); -#define CLOG_WRITE8_3( a, b, c, d ) TLogger::LogIt( this, _L8(a), b, c, d ); -#define CLOG_WRITE8_4( a, b, c, d, e ) TLogger::LogIt( this, \ - _L8(a), b, c, d, e ); - -#define CLOG_NAME_PTR( ptr, a ) TLogger::NameIt( ptr, a ); -#define CLOG_ATTACH_PTR( ptr, attach1, attach2 ) TLogger::AttachLogger( \ - ptr, attach1, attach2 ); -#define CLOG_WRITE_PTR( ptr, a ) TLogger::LogIt( ptr, \ - _L(a) ); -#define CLOG_WRITE_1_PTR( ptr, a, b ) TLogger::LogIt( ptr, \ - _L(a), b ); -#define CLOG_WRITE_2_PTR( ptr, a, b, c ) TLogger::LogIt( ptr, \ - _L(a), b, c ); -#define CLOG_WRITE_3_PTR( ptr, a, b, c, d ) TLogger::LogIt( ptr, \ - _L(a), b, c, d ); -#define CLOG_WRITE_4_PTR( ptr, a, b, c, d, e ) TLogger::LogIt( ptr, \ - _L(a), b, c, d, e ); -#define CLOG_WRITE_FORMAT_PTR( ptr, a, b ) TLogger::LogIt( ptr, \ - _L(a), b ); -#define CLOG_CLOSE_PTR( ptr ) TLogger::CloseLogger( ptr ); - -#else // _DEBUG - -#define LOGGER_ENTERFN( a ) -#define CLOG_ENTERFN_PTR( a ) - -#define CLOG_CREATE -#define CLOG_CREATE_PTR -#define CLOG_ATTACH( attach1, attach2 ) -#define CLOG_NAME( a ) -#define CLOG_NAME_1( a, b ) -#define CLOG_NAME_2( a, b, c ) -#define CLOG_NAME_3( a, b, c, d ) -#define CLOG_CLOSE -#define CLOG_WRITE( a ) -#define CLOG_WRITE_FORMAT( a, b ) -#define CLOG_WRITE_1( a, b ) -#define CLOG_WRITE_2( a, b, c ) -#define CLOG_WRITE_3( a, b, c, d ) -#define CLOG_WRITE_4( a, b, c, d, e ) -#define CLOG_WRITE8( a ) -#define CLOG_WRITE8_1( a, b ) -#define CLOG_WRITE8_2( a, b, c ) -#define CLOG_WRITE8_3( a, b, c, d ) -#define CLOG_WRITE8_4( a, b, c, d, e ) - -#define CLOG_NAME_PTR( ptr, a ) -#define CLOG_ATTACH_PTR( ptr, attach1, attach2 ) -#define CLOG_WRITE_PTR( ptr, a ) -#define CLOG_WRITE_1_PTR( ptr, a, b ) -#define CLOG_WRITE_2_PTR( ptr, a, b, c ) -#define CLOG_WRITE_3_PTR( ptr, a, b, c, d ) -#define CLOG_WRITE_4_PTR( ptr, a, b, c, d, e ) -#define CLOG_WRITE_FORMAT_PTR( ptr, a, b ) -#define CLOG_CLOSE_PTR( ptr ) - -#endif // _DEBUG -#endif // CONNECTIONMETHODLOGGER_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmmanager.hrh --- a/cmmanager/cmmgr/Framework/Inc/cmmanager.hrh Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for connection method manager -* -*/ - -#ifndef CMMANAGER_HRH -#define CMMANAGER_HRH - -#define KDestListboxType 3432 -#define KCmListboxType 3432 -#define KCmDestIconMapType 3433 - -enum TCmManagerUiMenuCommands /// Commands. - { - ECmManagerUiCmdCmEdit =1234, - ECmManagerUiCmdCmAdd, - ECmManagerUiCmdCmRename, - ECmManagerUiCmdCmDelete, - ECmManagerUiCmdCmUserExit, - ECmManagerUiCmdCmPrioritise, - ECmManagerUiCmdCmMoveToOtherDestination, - ECmManagerUiCmdCmCopyToOtherDestination, - ECmManagerUiCmdDestEdit, - ECmManagerUiCmdDestDefaultConnection, - ECmManagerUiCmdDestUserExit, - ECmManagerUiCmdDestAdd, - ECmManagerUiCmdDestRename, - ECmManagerUiCmdDestChangeIcon, - ECmManagerUiCmdDestDelete, - ECmManagerUiCmdDestSelect, - ECmManagerUiCmdCMSelect, - ECmManagerUiCmdCmPrioOk, - ECmManagerUiCmdCmPrioCancel - }; - -#include "cmpluginmenucommands.hrh" - -enum TCmManagerUiDlgLineIds // dialog line IDs - { - KDestListboxId = 1, - KCmListboxId, - KPluginBaseListboxId, - ECmDestIconMapContentId - }; - -enum TCmDialogIds - { - ECmWaitDialog = 1 - }; - - -#endif // CMMANAGER_HRH diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmmanagerimpl.h --- a/cmmanager/cmmgr/Framework/Inc/cmmanagerimpl.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1018 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of connection method manager -* -*/ - -#ifndef CMMANAGERIMPL_H -#define CMMANAGERIMPL_H - -// User Includes -#include "cmmanager.hrh" -#include "cmobjectpool.h" -#include "cmconnectionmethodinfo.h" -#include -#include -#include -#include - -// System Includes -#include -#include -#include -#include // RFs -#include // RResourceFile -#include -#include - -// Forward Declarations -class CCmTransactionHandler; -class CCmDestination; -class CCmDestinationExt; -class CCmDestinationImpl; -class CCmPluginBaseEng; -class CCmPluginBase; -class CImplementationInformation; -class TBearerPriority; -class RConeResourceLoader; -class CCmConnectionMethodInfo; -class CGulIcon; -class CCDGlobalBearerTypePriorizationRecord; -class CCDDataMobilitySelectionPolicyRecord; -class TCmPluginInitParam; -class CCmDestinationData; -class RCmManagerExt; -class MCmCommsDatWatcher; -class CCmCommsDatNotifier; - -// DATA TYPES -typedef RPointerArray RImplInfoPtrArray; -typedef CCDGlobalBearerTypePriorizationRecord CCmBearerPriRec; -typedef CCDDataMobilitySelectionPolicyRecord CCDSnapRecord; - -typedef struct - { - RResourceFile iFile; // resource file handler - TFileName iFName; // resource filename - TInt iRefs; // number of references to this res file - }TResourceFiles; - -/*#ifdef _DEBUG -void DumIapTableL( CommsDat::CMDBSession& aSession ); -#define DUMP_IAP_TBL( session ) DumIapTableL( (session) ); -#else // _DEBUG -#define DUMP_IAP_TBL( session ) -#endif // _DEBUG*/ - -/** - * Implementation of connection method manager - * - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CCmManagerImpl ) : public CBase - { - // Construction/Destruction - public: - - /** Epoc constructor */ - static CCmManagerImpl* NewL( TBool aCreateTables = ETrue ); - - /** Destructor */ - virtual ~CCmManagerImpl(); - - protected: - - /** First stage constructor */ - CCmManagerImpl(); - - /** Epoc constructor */ - void ConstructL(); // second-phase constructor - - public: // Transaction handling API - - void OpenTransactionLC( TBool aSetAttribs = ETrue ); - void CommitTransactionL( TInt aError ); - void RollbackTransaction(); - - // This will be called when the first UI view is on - void StartCommsDatNotifierL(); - - public: // Basic CM attribute query API - - /** - * GetBearerInfoXXX function can be used to query - * bearer informantion that doesn't belong - * to a specific connection method, such as - * ECmCoverage or ECmDefaultPriority etc. - * HBuf ownership is passed to the caller - */ - IMPORT_C TUint32 GetBearerInfoIntL( TUint32 aBearerType, - TUint32 aAttribute ) const; - IMPORT_C TBool GetBearerInfoBoolL( TUint32 aBearerType, - TUint32 aAttribute ) const; - IMPORT_C HBufC* GetBearerInfoStringL( TUint32 aBearerType, - TUint32 aAttribute ) const; - IMPORT_C HBufC8* GetBearerInfoString8L( TUint32 aBearerType, - TUint32 aAttribute ) const; - - /** - * GetConnectionMethodInfoXXX function can be used to - * query any, non-bearer specific information about - * a given connection method. This can be e.g. ECmBearerType, - * ECmName, ECmStartPage etc. - * HBuf ownership is passed to the caller - */ - IMPORT_C TUint32 GetConnectionMethodInfoIntL( - TUint32 aCmId, - TUint32 aAttribute ) const; - IMPORT_C TBool GetConnectionMethodInfoBoolL( - TUint32 aCmId, - TUint32 aAttribute ) const; - IMPORT_C HBufC* GetConnectionMethodInfoStringL( - TUint32 aCmId, - TUint32 aAttribute ) const; - IMPORT_C HBufC8* GetConnectionMethodInfoString8L( - TUint32 aCmId, - TUint32 aAttribute ) const; - - - //========================================================================= - // Creation/Destruction API - // - public: - - /** - * Creates a Destination by the given name - * - * @since 3.2 - * @param aName the name of the new destination - * @return CCmDestination*, ownership is passed to the caller - */ - CCmDestinationImpl* CreateDestinationL( const TDesC& aName ); - - /** - * Creates a Destination by the given name - * - * @since 3.2 - * @param aName the name of the new destination - * @param aDestId Predefined id for the destination - * @return CCmDestination*, ownership is passed to the caller - */ - CCmDestinationImpl* CreateDestinationL( const TDesC& aName, - TUint32 aDestId ); - - - /** - * Creates a connection method does not belong to any destination - * - * @since 3.2 - * @param aImplementationUid - implementation uid of the connection - * method - * @param aParentDestination - the destination which holds the - * connection method, NULL means there is - * no parent - * @return CCmPluginBase* - */ - CCmPluginBase* CreateConnectionMethodL( TUint32 aBearerType, - CCmDestinationImpl* aParentDestination = NULL ); - - /** - * Creates a connection method does not belong to any destination - * - * @since 3.2 - * @param aImplementationUid - implementation uid of the connection - * method - * @param aConnMethodId Predefined id for the connection method - * @param aParentDestination - the destination which holds the - * connection method, NULL means there is - * no parent - * @return CCmPluginBase* - */ - CCmPluginBase* CreateConnectionMethodL( TUint32 aBearerType, - TUint32 aConnMethodId, - CCmDestinationImpl* aParentDestination = NULL ); - - /** - * Creates a connection method does not belong to any destination - * - * @since 3.2 - * @param pluginBaseEng - Object to put in the pool - * @return CCmPluginBase* - */ - CCmPluginBase* CreateConnectionMethodL( - CCmPluginBaseEng* pluginBaseEng ); - - /** - * Insert a connection method does not belong to any destination - * API doesn't use CCmPluginBase. So, nothing returns - * - * @param pluginBaseEng - Object to put in the pool - */ - void InsertConnectionMethodL( - CCmPluginBaseEng* pluginBaseEng ); - - /** - * Creates a connection method does not belong to any destination - * - * @since 3.2 - * @param aBearerType - implementation uid of the connection - * method - * @param aParams - the destination which holds the - * connection method, NULL means there is - * no parent - * @return CCmPluginBaseEng* - */ - CCmPluginBaseEng* DoCreateConnectionMethodL( TUint32 aBearerType, - TCmPluginInitParam& aParams ); - - /** - * Creates a connection method does not belong to any destination - * - * @since 3.2 - * @param aBearerType Implementation uid of the connection - * method - * @param aParams Initialization params for the plugin. - * @param aConnMethodId Predefined id for the connection method. - * @return CCmPluginBaseEng* - */ - CCmPluginBaseEng* DoCreateConnectionMethodL( TUint32 aBearerType, - TCmPluginInitParam& aParams, TUint32 aConnMethodId ); - - //========================================================================= - // Getter-Setter API - // - public: - - /** - * Calls FeatureManager::FeatureSupported directly. - * - * @since 3.2 - * @param aFeature feature ID - * @return feature support status - * @since 3.2 - */ - static TBool FeatureSupported( TInt aFeature ); - - /** - * Obsolete - */ - IMPORT_C CCmPluginBaseEng* ConnectionMethodL( TUint32 aCmId ); - - /** - * Return the connection method queried by it's ID - * - * @since 3.2 - * @param aCmId - * @return CCmPluginBase* - */ - IMPORT_C CCmPluginBase* GetConnectionMethodL( TUint32 aCmId ); - - /** - * Return the list of connection methods do not belongs to any - * destination - * - * @since 3.2 - * @param aCMArray on return it is the array of IAP ids. - * @param aCheckBearerType If ETrue only connection methods with - * supported bearer types are returned - * @param aLegacyOnly when set to ETrue only Legacy IAP ids will - * be returned - * @param aEasyWlan when set to ETrue EasyWlan id is returned, too - * @param aSortByBearer if ETrue the CMs will be ordered according - * to global bearer priority - */ - IMPORT_C void ConnectionMethodL( RArray& aCMArray, - TBool aCheckBearerType = ETrue, - TBool aLegacyOnly = ETrue, - TBool aEasyWlan = EFalse, - TBool aSortByBearer = EFalse ); - /** - * Return an array of all destinations - * - * @since 3.2 - * @param aDestArray on return it returns an array of destination ids - */ - IMPORT_C void AllDestinationsL( RArray& aDestArray ); - - /** - * Return the number of destinations - * - * @since 3.2 - * @return the number of destinations - */ - inline TUint DestinationCountL() { return iDestinationCount; } - - /** - * Return the destination implementation to which a specified - * connection method belongs, search is by destination ID ( the - * id which is made by RECORD_FROM_ELEMENT_ID from the elementID) - * If the destination implementation is allready in the object - * pool returns it. If it is not in the pool than puts it in the - * pool using the GetDestinationL funciton. - * - * @since 3.2 - * @param aId - * @return a pointer to a destination - */ - IMPORT_C CCmDestinationImpl* DestinationL( TUint32 aId ); - - /** - * Removes the destination implementation - * from the object pool - * - * @since 3.2 - * @param aId - */ - IMPORT_C void RemoveDestFromPool( CCmDestinationImpl* aDestination ); - - /** - * Removes the destination implementation - * from the object pool - * - * @since 3.2 - * @param aId - */ - void RemoveDestFromPool( CCmDestinationData* aDestination ); - - /** - * Removes the cm - * from the object pool - * - * @since 3.2 - */ - void RemoveCMFromPoolL( CCmPluginBaseEng* aCM ); - - /** - * Removes the cm - * from the object pool - * - * @since 3.2 - */ - void RemoveCMFromPoolL( CCmPluginBase* aCM ); - - /** - * The destination have been updated if it was a new destination - * than the zero id must be changed to the new one - * - * @param aDestination - the destination to change - */ - void DestinationUpdated( CCmDestinationImpl* aDestination ); - - /** - * Copie a connection method belonging to one destination to - * another. The connection method becomes shared. - * - * @since 3.2 - * @param aTargetDestination target destination - * @param aConnectionMethodId connection method to be copied - * @return index in the Connection Method list - */ - TInt CopyConnectionMethodL( CCmDestinationImpl& aTargetDestination, - CCmPluginBase& aConnectionMethod ); - - /** - * Move a connection method belonging to one destination to - * another. The connection method is removed from the source destination - * - * @since 3.2 - * @param aSourceDestination source destination - * @param aTargetDestination target destination - * @param aConnectionMethod connection method to be moved - * @return index in the Connection Method list which the connection - * method has been moved to - */ - TInt MoveConnectionMethodL( CCmDestinationImpl& aSourceDestination, - CCmDestinationImpl& aTargetDestination, - CCmPluginBase& aConnectionMethod ); - - /** - * Remove connection method from the destination - * - * @since 3.2 - * @param aDestination destination the connection method is attached to - * @param aConnectionMethod connection method to be removed - */ - void RemoveConnectionMethodL( CCmDestinationImpl& aDestination, - CCmPluginBase& aConnectionMethod ); - - /** - * Return the copy of the bearer priority array. Ownership is passed. - * - * @since 3.2 - * @param aArray bearer priority array - */ - void BearerPriorityArrayL( RArray& aArray ) const; - - /* - * Update bearer priority array - * - * @since 3.2 - * @param aArray array with new global bearer priority - */ - void UpdateBearerPriorityArrayL( const RArray& aArray ); - - /** - * Clean up passed global bearer priority array. Delete - * the elements and calls Reset and Close on the array. - * - * @since 3.2 - * @param aArray array to be cleaned up - */ - void CleanupGlobalPriorityArray( RArray& aArray ) const; - - /** - * Search service type in the global priority table and - * Return its priority. - * - * @since 3.2 - * @param aUiPriority ETrue if UI priority is requested - * @param aServiceType serched service type - * @return priority of the service type or KErrNotFound - */ - TInt GlobalBearerPriority( TBool aUiPriority, - const TDesC& aServiceType ) const; - - /* - * Query all of the supported bearer types. - * - * @since 3.2 - * @param aArray list of all supported bearer types. - */ - void SupportedBearersL( RArray& aArray ) const; - - /* - * Return "Uncategorized" icon. - * This fucton leaves if the client does not have a valid UI context - * - * @since 3.2 - * @return CGulIcon icon of uncategorized connection methods. - */ - CGulIcon* UncategorizedIconL() const; - - /** - * Returns the id of the EasyWlan connection method. - * - * @since S60 3.2 - * @return id of the EasyWLan connection method. 0 if not found - */ - IMPORT_C TUint32 EasyWlanIdL(); - - /** - * Create a SNAP record object and load it if record id not 0. - * @param aRecordId record Id. 0 means create only - * @return created/loaded SNAP record - */ - CCDSnapRecord* SNAPRecordL( TUint32 aRecordId ) const; - - CCDSnapRecord* CreateSNAPRecordL( TUint32 aRecordId ) const; - - /** - * Tells the CmManager that the given default connection is deleted, - * and it sets Default Connection to Always Ask (default value). - * - * @since S60 3.2 - */ - void HandleDefConnDeletedL( TCmDefConnValue& aDCSetting ); - /** - * Returns the default connection method/SNAP. - * - * @since S60 3.2 - */ - void ReadDefConnL( TCmDefConnValue& aDCSetting ); - /** - * Stores the default connection method/SNAP. - * - * @since S60 3.2 - */ - void WriteDefConnL( const TCmDefConnValue& aDCSetting ); - /** - * Returns the default connection method/SNAP. - * - * @since S60 3.2 - */ - void ReadDefConnWoTransL( TCmDefConnValue& aDCSetting ); - /** - * Stores the default connection method/SNAP. - * - * @since S60 3.2 - */ - void WriteDefConnWoTransL( const TCmDefConnValue& aDCSetting ); - /** - * Returs ETrue if Default Connection feature is supported. - * - * @since S60 3.2 - */ - TBool IsDefConnSupported(); - /** - * Check if memory low so that process can continue - */ - TBool IsMemoryLow(); - /** - * Returns the general connection settings. - */ - void ReadGenConnSettingsL( TCmGenConnSettings& aGenConnSettings ); - /** - * Replaces the general connection settings. - */ - void ReplaceGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings ); - /** - * Writes the general connection settings. - */ - void WriteGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings ); - - - //========================================================================= - // Resource handling - // - public: - - /** add resource file */ - void AddResourceFileL( TFileName& aName ); - - /** - * Remove resource file from array only if - * the reference count is zero. - * @param aName name of the resource file to be removed - */ - void RemoveResourceFile( TFileName& aName ); - - /** - * Read string from resource - * - * @since 3.2 - * @param aResourceId resource id of the localized string - * @return localized string - */ - HBufC* AllocReadL( TInt aResourceId ) const; - - //========================================================================= - // CM related functions - // - public: - - /** - * Return the number of references to the given connection method id - * in the DN_IAP table - * - * @since 3.2 - * @param aId ID of the connection method - * @param aRecSet entire record set of the detination table - * @return number of references to the connection method in DN_IAP table - */ - TUint32 NumOfConnMethodReferencesL( - TUint32 aId, - CommsDat::CMDBRecordSet* aRecSet = NULL - ); - - /** - * Indicates is at least one non-"level 1 protected" destinations - * - * @since S60 3.2 - * @return ETrue if at least one level 1 protected destination - */ - TBool HasUnprotectedDestinationsL(); - - /** - * Walks through every connection methods to find out - * if the passed connection method is linked to any of them. - * @param aPlugin connection method to be checked - * @return ETrue if linked - */ - TBool IsIapLinkedL( const CCmPluginBaseEng& aPlugin ); - - /** - * Removes all references to this CM from SNAP table. - */ - void RemoveAllReferencesL( const CCmPluginBaseEng& aPlugin ); - - /** - * Removes all references to this CM from SNAP table without - * transaction to commsdat. - */ - void RemoveAllReferencesWoTransL( const CCmPluginBaseEng& aPlugin ); - - /** - * Return the bearer type of connection method. - * - * @since 3.2 - * @param aId id of the connection method - * @return bearer type of the connection method - */ - TUint32 BearerTypeFromCmIdL( TUint32 aCmId ); - - /** - * Return the bearer type of connection method. - * - * @since 3.2 - * @param aIapRecord CommsDat record of the connection method - * @return bearer type of the connection method - */ - TUint32 BearerTypeFromIapRecordL( CommsDat::CCDIAPRecord* aIapRecord ) const; - - private: - - /** - * Find and create a connection method. - * - * @since 3.2 - * @param aCmId id of the connection method - * @aParentDest parent destination of the connection method. Can be NULL. - */ - CCmPluginBase* DoFindConnMethodL( TUint32 aCmId, - CCmDestinationImpl* aParentDest ); - - /** - * Find and create a connection method. - * - * @since 3.2 - * @param aCmId id of the connection method - * @aParentDest parent destination of the connection method. Can be NULL. - */ - CCmPluginBaseEng* DoFindConnMethL( TUint32 aCmId, - CCmDestinationImpl* aParentDest ); - - /** - * Check the existence of tables we need. - * Creates if it is not exist, get the table id otherwise - */ - void CheckTablesL(); - - public: - - /** - * Return the destination network table ID - * - * @since 3.2 - * @return iDestinationTableId element id of the destination table - */ - inline CommsDat::TMDBElementId DestinationTableId() const { return iDestinationTableId; }; - - /** - * Return Global Bearer Type Priorization Table ID - * - * @since 3.2 - * @return element id of the bearer type priority. - */ - inline CommsDat::TMDBElementId BearerTypePriorizationTableId() const { return iBearerTypePriorizationTableId; }; - - /** - * Return the Destination network - Icon table ID - * - * @since 3.2 - * @return element id of the icon table. - */ - inline CommsDat::TMDBElementId IconTableId() const { return iIconTableId; }; - - /** - * Return true if help is on in the FeatureManager - * - * @since 3.2 - * @return TBool. - */ - inline TBool IsHelpOn() const { return iHelp; }; - - /** - * Return the Seamlessness table ID - * - * @since 3.2 - * @return element id of the seamlessness table. - */ - inline CommsDat::TMDBElementId SeamlessnessTableId() const { return iSeamlessnessTableId; }; - - /** - * Checks if the current environment has the given capability. - * Leaves with KErrPermissionDenied if capability is missing. - * - * @since 3.2 - * @param aCapability capability to be checked - */ - static void HasCapabilityL( TCapability aCapability ); - - /** - * Return an array of all IAP records. - * @return array of all IAP records - */ - CommsDat::CMDBRecordSet* AllIapsL(); - - /** - * Return all the SNAP record. Filtering can be made on - * passed SNAP elemented id. - * @return array of SNAP records - */ - CommsDat::CMDBRecordSet* - CCmManagerImpl::AllSNAPRecordsL( TUint32 aSnapElementId ); - - public: - - CommsDat::CMDBSession& Session() const; - - /** - * Wraps this implementation to an RCmManagerExt. OWNERSHIP IS NOT PASSED - * , SO NEVER CLOSE aCmManagerExt!!! - * - * @since 3.2 - * @param aCmManagerExt class to wrap implementation into - */ - - IMPORT_C void WrapCmManager( RCmManagerExt& aCmManagerExt ); - - /** Remove the virtual methods from the passed list - * - * @since 3.2 - * @param aCmDataArray array that contains the connection methods to be filtered - */ - IMPORT_C void FilterOutVirtualsL( RPointerArray& aCmDataArray ); - - /** Create a 'flat list' of connection methods of a given destination - * ( connection methods inside embedded destinations which are in the destination, - * are also present in the list ) and - * order them according to the bearer type prioritisation rules - * and return the result in aCmArray. - * - * @since 3.2 - * @param aDestination destination that contains the connection methods - * for uncategorised connection methods, use KDestItemUncategorized - * @param aCmArray array to return the result - */ - - IMPORT_C void CreateFlatCMListL( TUint32 aDestination , - RPointerArray& aCmArray ); - - /** Create a 'flat list' of connection methods of a given destination - * ( connection methods inside embedded destinations which are in the destination, - * are also present in the list ) and - * order them according to the bearer type prioritisation rules - * and return the result in aCmArray. - * LC version - * - * @since 3.2 - * @param aDestination destination that contains the connection methods - * for uncategorised connection methods, use KDestItemUncategorized - * @param aCmArray array to return the result - */ - IMPORT_C void CreateFlatCMListLC( TUint32 aDestination , - RPointerArray& aCmArray ); - - - /** Get a list of uncategorised connection methods in an RPointerArray - * contains the parameters passed to ConnectionMethodL - * - * @since 3.2 - * @param aCmArray the returned list of uncategorised connection methods - * @param aCheckBearerType see ConnectionMethodL - * @param aLegacyOnly see ConnectionMethodL - * @param aEasyWlan see ConnectionMethodL - * @param aSortByBearer see ConnectionMethodL - */ - void AppendUncatCmListL(RPointerArray& aCmArray, - TBool aCheckBearerType = ETrue, - TBool aLegacyOnly = ETrue, - TBool aEasyWlan = EFalse, - TBool aSortByBearer = EFalse ); - - /** Get a list of uncategorised connection methods in an RPointerArray - * contains the parameters passed to ConnectionMethodL - * LC version - * - * @since 3.2 - * @param aCmArray the returned list of uncategorised connection methods - * @param aCheckBearerType see ConnectionMethodL - * @param aLegacyOnly see ConnectionMethodL - * @param aEasyWlan see ConnectionMethodL - * @param aSortByBearer see ConnectionMethodL - */ - void AppendUncatCmListLC(RPointerArray& aCmArray, - TBool aCheckBearerType = ETrue, - TBool aLegacyOnly = ETrue, - TBool aEasyWlan = EFalse, - TBool aSortByBearer = EFalse ); - - /** - * Returns a list of references to the connection methods in the destination. - * - * @since 3.2 - * @param aPluginArray A pointer array to hold the values - * ownership is passed - */ - void AppendCmListL( TUint32 aDestintaionId, RPointerArray& aCmArray); - - /** - * Returns a list of references to the connection methods in the destination. - * - * @since 3.2 - * @param aPluginArray A pointer array to hold the values - * ownership is passed - */ - // and puts it on the CleanupStack - void AppendCmListLC( TUint32 aDestintaionId, RPointerArray& aCmArray); - - /** - * Returns a list of references to the connection methods in the supported uid list . - * - * @since 3.2 - * @param aPluginArray A pointer array to hold the values - * ownership is passed - */ - void AppendCmListFromUidsL( RArray& cmIdList, RPointerArray& aCMArray ); - - /** - * Returns internet destination id. If internety destination is not found then -1 is returned. - * - * @since 5.0 - * @return Internet destination id - */ - TUint32 GetInternetDestinationIdL(); - - /** - * Register aWatcher as watcher for change of CommsDat - */ - IMPORT_C void WatcherRegisterL( MCmCommsDatWatcher* aWatcher ); - - /** - * UnRegister current watcher - */ - IMPORT_C void WatcherUnRegister(); - - /* - * Find if aDest is still existed if some change is watched - */ - IMPORT_C TBool DestinationStillExistedL( CCmDestinationImpl* aDest ); - - /* - * Find if an Iap is still existed if some change is watched - * - * The Iap, as parameter, is contained in the instance aPlugin - */ - IMPORT_C TBool IapStillExistedL( const CCmPluginBaseEng& aPlugin ); - - /* - * Find if an Iap is still in aDest if some change is watched - * - * The Iap, as parameter, is contained in the instance aPlugin - */ - IMPORT_C TBool IsIapStillInDestL( CCmDestinationImpl* aDest, const CCmPluginBaseEng& aPlugin ); - - private: - - /** - * Creates bearer priority array - * - * @since 3.2 - */ - void CreateBearerPriorityArrayL(); - - /** - * Look for the given resource file in the resource - * file array and return the index value of it. - * - * @since 3.2 - * @param aName resource file name, not localized - * @return index of the resource file in the array - */ - TInt FindResourceFile( TFileName& aName ) const; - - /** - * Build an array of all bearer specific plugins. - * - * @since 3.2 - */ - void BuildPluginArrayL(); - - /** - * Return the copy of the bearer priority array. Ownership is passed. - * - * @since 3.2 - * @param aArray bearer priority array - */ - void CopyBearerPriorityArrayL( RArray& aArray ) const; - - /** - * Return if the IAP record points to an EasyWLan service record. - * - * @since 3.2 - * @param aIapRecord IAP record to be checked - * @return ETrue if AP is EasyWLan - */ - TBool IsEasyWLanL( CommsDat::CCDIAPRecord* aIapRecord ) const; - - /** - * Replaces the Default Connection record with the new one. - * - * @since 3.2 - * @param aDCSetting Default Connection value to set - */ - void ReplaceDefConnRecordL( const TCmDefConnValue aDCSetting ); - - /** - * Combines two lists of CCmPluginBase pointers into one, according to default - * priority order - * - * @since 3.2 - * @param aCmArray first list of connection methods to combine - * @param aCmLinkedArray second list of connection methods to combine - */ - void CombineArraysForPriorityOrderL( - RPointerArray& aCmArray , - RPointerArray& aCmLinkedArray ); - - - /** - * Gets the destination for the given element ID - * - * @since 3.2 - * @param aCmId The element ID of the destination - * @return Id of the parent - */ - TUint32 ParentDestinationL( TUint32 aCmId ); - - /** - * Returns the default general connection values. - * - * @since 9.2 - * @param aGenConnSettings The general connection settings structure - */ - void SetGenConnSettingsToDefault( TCmGenConnSettings& aGenConnSettings ); - - /** - * Leaves if no sufficient is available for creation operations - * - * @since 9.2 - */ - void CheckAvailableSpaceL(); - - /** - * Get Snap Table ID from CommsDat - */ - TUint32 GetSnapTableIdL(); - - /** - * Check if the attribute is bearerspecific - * - * @since 9.2 - * @param aAttribute attribute-id to be checked - * @return ETrue if aAttribute is bearerspecific, otherwise EFalse - */ - TBool IsBearerSpecific( TUint32 aAttribute ) const; - -#include "cmmanagerimpl.inl" - //========================================================================= - // Member data - - private: - - CCmTransactionHandler* iTrans; - - RFs iFs; - CArrayPtrFlat* iResourceFiles; - - // Destination network table ID - CommsDat::TMDBElementId iDestinationTableId; - //Global Bearer Type Priorization Table - CommsDat::TMDBElementId iBearerTypePriorizationTableId; - // Destination network - Icon table - CommsDat::TMDBElementId iIconTableId; - // Destination network - Icon table - CommsDat::TMDBElementId iSeamlessnessTableId; - // Default Connection table - CommsDat::TMDBElementId iDefConnTableId; - // Bearer priorities - RArray* iBearerPriorityArray; - - CArrayPtrFlat* iPlugins; - - CCmConnectionMethodInfo* iPluginImpl; - - TUint iDestinationCount; - - CCMObjectPool* iObjectPool; - - // for the FeatureManager - TBool iIsFeatureManagerInitialised; - TBool iHelp; - TBool iDefConnSupported; - TBool iCreateTables; - TBool iWLan; - - // For CommsDat watcher - CCmCommsDatNotifier* iCommsDatIapNotifier; - CCmCommsDatNotifier* iCommsDatSnapNotifier; - private: - - friend class CCmDestinationImpl; - friend class CCMObjectPool; - friend class CCmConnectionMethodInfo; - }; - -#endif // CMMANAGERIMPL_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmmanagerimpl.inl --- a/cmmanager/cmmgr/Framework/Inc/cmmanagerimpl.inl Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of connection method manager -* -*/ - -#ifndef CMMANAGERIMPL_INL -#define CMMANAGERIMPL_INL - -public: - /** - * The cm have been updated if it was a new cm - * than the zero id must be changed to the new one - * - * @param aCM - the cm to change - */ - inline void ConnMethodUpdatedL( CCmPluginBaseEng* aCM ) - { - iObjectPool->ConnMethodUpdatedL( aCM ); - iPluginImpl->ResetIfInMemory( aCM ); - } - -public: - template - /* - * Pushes an array to the CleanupStack, calling it's ResetAndDestroy - * when destroying it. - */ - static void CleanupResetAndDestroyPushL(TArrayToCleanup& aPtr) - { - void (*p)(TAny*) = CCmManagerImpl::ResetAndDestroy; - CleanupStack::PushL( TCleanupItem(p, (void*)(&aPtr)) ); - } -private: - /** - * A cleanup function for TCleanupItem construction for - * cleanup of pointers in an RPointerArray - * usage: - * CleanupStack::PushL( TCleanupItem( CCmManagerImpl::DestroyRPointerArray, (void*)(PointerToArray)) ) - * @return TInt - */ - template - static void ResetAndDestroy(TAny* aPtr) - { - TArrayToCleanup *p = static_cast (aPtr); - p->ResetAndDestroy(); - } -#endif // CMMANAGERIMPL_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmobjectpool.h --- a/cmmanager/cmmgr/Framework/Inc/cmobjectpool.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Object pool for storing destinations and connection -* methods. -* -*/ - -#ifndef CMOBJECTPOOL_H -#define CMOBJECTPOOL_H - -class CCmPluginBaseEng; -class CCmPluginBase; -class CCmManagerImpl; - -// User includes -#include "cmdestinationimpl.h" -#include - -/** - * Object pool to hold destination implementations and - * connetion method implementations - * - * The get and remove functions must be used in pairs - */ -NONSHARABLE_CLASS( CCMObjectPool ) : public CBase - { - - public: - CCMObjectPool(CCmManagerImpl& aCmManagerImpl); - virtual ~CCMObjectPool(); - /** - * If the destinaton impl is in the pool returns a pointer to it. - * If the destinaton impl is not in the pool creates it. - * - * @param aDestinationId - ID of the destination requested - * @return pointer to the destination - ownership passed - */ - CCmDestinationImpl* GetDestinationL( TUint32 aDestinationId ); - /** - * If the destinaton impl is in the pool returns a pointer to it. - * If the destinaton impl is not in the pool creates it. - * - * @param aName - name of the destination requested - * @return pointer to the destination - ownership passed - */ - CCmDestinationImpl* GetDestinationL( const TDesC& aName ); - - /** - * Creates a destination if it does not exist. - * - * @param aName - name of the destination requested - * @param aDestId - predefined id for the destination - * @return pointer to the destination - ownership passed - */ - CCmDestinationImpl* CreateDestinationL( const TDesC& aName, TUint32 aDestId ); - - /** - * Returns a pointer to an allready existing connecton method - * - * @param aCmId - ID of the CM requested - * @param aParentDest - parent destination - * @return plugin instance - ownership passed - */ - CCmPluginBase* GetConnectionMethodL( TUint32 aCmId, - CCmDestinationImpl* aParentDest ); - /** - * Creates cm and places it into the pool. - * - * @param aImplementationUid - Bearer Type - * @param aParams Init params for the plugin - * @return plugin instance - ownership passed - */ - CCmPluginBase* CreateConnectionMethodL( TUint32 aImplementationUid, - TCmPluginInitParam& aParams ); - - /** - * Creates cm and places it into the pool. - * - * @param aImplementationUid - Bearer Type - * @param aParams Init params for the plugin - * @param aConnMethodId Predefined id for the connection method. - * @return plugin instance - ownership passed - */ - CCmPluginBase* CreateConnectionMethodL( TUint32 aImplementationUid, - TCmPluginInitParam& aParams, - TUint32 aConnMethodId ); - - /** - * Creates cm and places it into the pool. - * - * @param pluginBaseEng - Object to put in the pool - * @return plugin instance - ownership passed - */ - CCmPluginBase* CreateConnectionMethodL( CCmPluginBaseEng* pluginBaseEng ); - - /** - * Insert cm and places it into the pool. - * API doesn't use CCmPluginBase. So, nothing returns - * - * @param pluginBaseEng - Object to put in the pool - */ - void InsertConnectionMethodL( CCmPluginBaseEng* pluginBaseEng ); - - /** - * Removes a destination impl from the object pool. - * - * @param aDestination - the destination to remove - */ - void RemoveDestination( CCmDestinationImpl* aDestination ); - - /** - * Removes a destination data from the object pool. - * - * @param aDestination - the destination to remove - */ - void RemoveDestination( CCmDestinationData* aDestination ); - - /** - * Removes a connection method impl from the object pool. - * - * @param aDestinationId - ID of the connection method to remove - */ - void RemoveConnectionMethodL( CCmPluginBase* aCM ); - - /** - * Removes a connection method impl from the object pool. - * - * @param aDestinationId - ID of the connection method to remove - */ - void RemoveConnectionMethodL( CCmPluginBaseEng* aCM ); - - /** - * This is called after the new destination have been updated - * This function updates the iDestinationId - * field in the TObjectPoolDestinationItem - * - * @param aDestination - the destination to change - */ - void DestinationUpdated( CCmDestinationImpl* aDestination ); - - /** - * This is called after the new cm have been updated - * This function updates the Id - * field - * - * @param aCM - the CM to change - */ - void ConnMethodUpdatedL( CCmPluginBaseEng* aCM ); - - private: - class TObjectPoolDestinationItem - { - public: - TObjectPoolDestinationItem( - CCmDestinationData* aDestinationItem, - TUint32 aDestinationId); - TInt iDestinationId; - CCmDestinationData* iDestinationItem; - }; - class TObjectPoolCMItem - { - public: - TObjectPoolCMItem( - CCmPluginBaseEng* iConnectionMethodItem, - TUint32 iConnectionMethodId); - TInt iConnectionMethodId; - CCmPluginBaseEng* iConnectionMethodItem; - }; - private: - CCmManagerImpl& iCmManagerImpl; - // object pool for holding destination implementations - RArray iDestinationArray; - // object pool for holding connetion method implementations - RArray iConnectionMethodArray; -}; - -#endif // CMOBJECTPOOL_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmpluginmenucommands.hrh --- a/cmmanager/cmmgr/Framework/Inc/cmpluginmenucommands.hrh Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Menu command ids for connection method plugins -* -*/ - -#ifndef CMPLUGINMENUCOMMANDS_HRH -#define CMPLUGINMENUCOMMANDS_HRH - -enum TCmPluginMenuCommands /// Commands. - { - EPluginBaseCmdChange = 202, - EPluginBaseCmdAdvanced, - EPluginBaseCmdExit - }; - -#endif // CMPLUGINMENUCOMMANDS_HRH diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmpluginmultilinedialog.h --- a/cmmanager/cmmgr/Framework/Inc/cmpluginmultilinedialog.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of class CCmPluginMultiLineDialog. -* -*/ - -#ifndef CM_PLUGIN_MULTILINE_DIALOG_H -#define CM_PLUGIN_MULTILINE_DIALOG_H - -// INCLUDE FILES -#include - -/** - * A new class to extend the functionality of the existing - * CAKnMultiLineIpQueryDialog to be able to accept 0 length settings... - * Nothing else is changed. - * - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CCmPluginMultiLineDialog ) : - public CAknMultiLineDataQueryDialog - { - public: - - /** - * Multiline data query dialog, 2 lines - * @param aText1 Text1 - * @param aText2 Text2 - * @param aTone Tone - * @return A constructed CCmPluginMultiLineDialog - */ - IMPORT_C static CCmPluginMultiLineDialog* NewL( - TDes& aText1, TDes& aText2, - TTone aTone = ENoTone); - - protected: - - /** - * If the query text is ok (retrieved form query controls) then - * display the left soft key, otherwise hide it. - */ - void UpdateLeftSoftKeyL(); - - private: - - /** - * Constructor - * @param aTone Tone - */ - CCmPluginMultiLineDialog( const TTone& aTone ); - }; - -#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmsettingsuiimpl.h --- a/cmmanager/cmmgr/Framework/Inc/cmsettingsuiimpl.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of setting UI -* -*/ - -#ifndef C_CMSETTINGSUIIMPL_H -#define C_CMSETTINGSUIIMPL_H - -#include -#include -#include - -class CCmManagerImpl; - -/** - * Implementation of setting UI - * - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS(CCmSettingsUiImpl) : public CBase - { - public: - - /** Epoc constructor */ - static CCmSettingsUiImpl* NewL(); - - /** Destructor */ - virtual ~CCmSettingsUiImpl(); - - //========================================================================= - // UI API - // - public: - - /** - * Launches the Settings UI - * for handling Destinations and Connection Methods - * @since 3.2 - */ - TInt RunSettingsL(); - - /** - * Launches a dialog with a list of Destination - * @since 3.2 - * @param aDestinationId ID of the selected Destination - * @return TBool - */ - TBool SelectDestinationDlgL( TUint32& aDestinationId ); - - private: - - /** First stage constructor */ - CCmSettingsUiImpl(); - - /** Epoc constructor */ - void ConstructL(); - - /** Load resource */ - TInt LoadResourceL (); - - private: // data - - CCmManagerImpl* iCmManagerImpl; - RConeResourceLoader iResourceReader; - }; - -#endif // C_CMSETTINGSUIIMPL_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmtransactionhandler.h --- a/cmmanager/cmmgr/Framework/Inc/cmtransactionhandler.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of transaction handler -* -*/ - -#ifndef CMTRANSACTION_HANDLER_H -#define CMTRANSACTION_HANDLER_H - -#include - -/** - * Transaction handler. - * - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CCmTransactionHandler ) : public CBase - { - public: - - /** Epoc constructor */ - static CCmTransactionHandler* NewL( CommsDat::CMDBSession& aDb ); - - // destructor is intentionally not virtual. - ~CCmTransactionHandler(); - - public: - - /** - * @return commsdat session - */ - CommsDat::CMDBSession& Session()const{ return iDb; }; - - /** - * - Checks if transaction is already opened - * - Set iOwnTransaction is not and opens it and - * put 'this' on cleanup&close stack - */ - void OpenTransactionLC( TBool aSetAttribs = ETrue ); - - /** - * - Checks if the transaction is ours. - * - If yes, commits the transaction. - * - anyway does nothing - * @praram aError - error id - */ - void CommitTransactionL( TInt aError = KErrNone ); - - /** - * Performs RollbackTransactionL(). - */ - void Close(); - - private: - - /** Constructor. */ - CCmTransactionHandler( CommsDat::CMDBSession& aDb ); - - /** - * Second phase constructor. Leaves on failure. - */ - void ConstructL(); - - private: // data - - CommsDat::CMDBSession& iDb; ///< Not owned CommsDat session pointer - TUint32 iRefCount; - TUint32 iProtectionFlag; - }; - -#endif // CMTRANSACTION_HANDLER diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/cmwizard.h --- a/cmmanager/cmmgr/Framework/Inc/cmwizard.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Wizard used for adding connection methods -* -*/ - -#ifndef T_TCMWIZARD_H -#define T_TCMWIZARD_H - -// INCLUDE FILES -#include -#include - -// FORWARD DECLARATIONS -class CAknWaitDialog; -class CCmDestinationImpl; -class CCmManagerImpl; -class CCmPluginBase; - -/** - * Connection Method wizard - * - * Wizard used for creating a new Connection Method. - * - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CCmWizard ) : public CBase, - public MProgressDialogCallback - { - public: // constructor - - /** - * Constructor. - * - * @param aCmManager Connection Method Manager implementation passed - * for queries. - */ - CCmWizard( CCmManagerImpl& aCmManager ); - - /** - * Destructor. - */ - ~CCmWizard(); - - public: // public methods - - /** - * Key method for creating a new Connection Method. This function - * guides the user through several steps and then finally creates - * a new Connection Method based on the information the user has given. - * @param aTargetDestination Target destination to which the new - * connection method will be added. Can be NULL if the - * destination is to be selected by the user later on (via a dialog). - */ - TInt CreateConnectionMethodL - ( CCmDestinationImpl* aTargetDestination = NULL ); - - public: // from MProgressDialogCallback - - /** - * @see MProgressDialogCallback mixin for more details. - */ - void DialogDismissedL( TInt aButtonId ); - - private: // internal helper methods - - /** - * Shows a dialog asking the user if he/she wants to have the available - * connection methods automatically checked for. - * @return ETrue if the user wants the conn methods be automatically - * discovered, EFalse if he/she wants to discover them manually. - */ - TBool AutoCheckForCmsL() const; - - /** - * If automatic CM detection has failed, the user is prompted a dialog - * asking if he/she wants to proceed with manual configuration. - * @return ETrue if the user wants to proceed with manual configuration, - * EFalse otherwise. - */ - TBool ManualCheckForCmsL() const; - - /** - * Checks for availability of packet data and WLAN bearer types. Shows - * a wait dialog until discovery is not complete. - * @param aCoverageArray This array is supposed to hold the UIDs of - * bearers that have network coverage for the moment. - */ - void CheckForCmsL( RArray& aCoverageArray ); - - - /** - * Finds the target destination to which the currently creted VPN - * connection method points. It can be a destination or the destination - * which includes the connection method to which the VPN points. - * @param aPlugin VPN plugin. - * @return the Id of the destination - */ - TUint32 FindTargetDestinationL( CCmPluginBase* aPlugin ); - - /** - * Finds the parent destination of a connection method. - * @param Id of the connection method - * @return Id of the destination which contains cmId - */ - TUint32 FindParentDestinationL( TUint32 aCmId ); - - private: // data - - CAknWaitDialog* iCheckConnDlg; ///< Owned. - TBool iCheckConnDlgCancelled; - - CCmManagerImpl& iCmManager; ///< Only a reference == not owned. - }; - -#endif // T_TCMWIZARD_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/destdlg.h --- a/cmmanager/cmmgr/Framework/Inc/destdlg.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,249 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Dialog for displaying and editing destinations. -* -*/ - -#ifndef DESTDIALOG_H -#define DESTDIALOG_H - -// INCLUDES -#include -#include -#include "destlistboxmodel.h" -#include "destlistbox.h" -#include "cmmanagerimpl.h" -#include "cmconnsettingsuiimpl.h" -#include -#include "cmcommsdatnotifier.h" - -// CLASS DECLARATION -class CEikStatusPane; -class CAknTitlePane; -class CAknNavigationControlContainer; -class CAknNavigationDecorator; -class CCmWizard; -class CCmdExec; - -/** -* Dialog for setting the gateway's IP address -*/ -NONSHARABLE_CLASS( CDestDlg ) : public CAknDialog - , MEikListBoxObserver - , public MCmdExec - , public MCmCommsDatWatcher - { - public : // construction - - /** - * Default constructor. - */ - CDestDlg(); - - /** - * Destructor. - */ - ~CDestDlg(); - - /** - * Create and launch dialog. - * @return The code returned by the dialogs' ExecuteLD - */ - TInt ConstructAndRunLD( CCmManagerImpl* aCmManager, TUint32 aHighLight, - TUint32& aSelected, TBool& aExiting ); - - // From MEikMenuObserver - virtual void DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ); - - // From MEikCommandObserver - virtual void ProcessCommandL( TInt aCommandId ) ; - - /** - * Updates listbox data - */ - void HandleListboxDataChangeL(); - - /** - * Handle key event. - * @param aKeyEvent The key event. - * @param aType Key event type. - * @return Response (was the key event consumed?). - */ - TKeyResponse OfferKeyEventL - ( const TKeyEvent& aKeyEvent, TEventCode aType ); - - - public: - /** - * From base class MCmdExec - */ - void Execute(); - - /** - * From base class MCmdExec - */ - void CDestDlg::HandleLeaveError( TInt aError ); - - public: // From CCoeControl - - /** - * Returns the help context - * From CCoeControl - * - * @since S60 3.2 - * @param aContext the returned help context - */ - void GetHelpContext( TCoeHelpContext& aContext ) const; - - /** - * Handles the resource change - * From CCoeControl - * - * @since S60 5.0 - * @param aType Type of the resource change - */ - void HandleResourceChange( TInt aType ); - - /** - * Show default connection note - * - * @since S60 5.0 - * @param aOldConn Old default connection - */ - void ShowDefaultConnectionNoteL(TCmDefConnValue aOldDefConn); - - public: // From MCmCommsDatWatcher - - /** - * Watch changes in CommsDat - */ - void CommsDatChangesL(); - - protected : // from CEikDialog - - /** - * Set the gateway's IP address, if the user pressed OK. - * @param aButtonId The ID of the pressed button. - * @return May the dialog exit? - */ - TBool OkToExitL( TInt aButtonId ) ; - - void PreLayoutDynInitL(); - - SEikControlInfo CreateCustomControlL ( TInt aControlType ); - - // From MEikListBoxObserver - void HandleListBoxEventL( CEikListBox* aListBox, - TListBoxEvent aEventType ); - - /** - * Sets the number of connections text on navi pane - */ - void SetNoOfDestsL(TInt aCount); - - private: - - /** - * Initialises listbox texts - */ - void InitTextsL(); - - /** - * Creates a new destination and adds it to Destination view. - */ - void AddDestinationL(); - - /** - * Called when user selected edit on a destination. - */ - void OnCommandDestinationEditL(); - - /** - * Called when user selected delete on a destination. - */ - void OnCommandDestinationDeleteL(); - - /** - * Called when user selected rename on a destination. - */ - void OnCommandDestinationRenameL(); - - /** - * Called when destination is about to be deleted. - */ - TBool IsThereProtectedMethodL( CCmDestinationImpl* aDest ); - - /** - * Sets the text of the middle soft key by the text resource. - */ - void CDestDlg::SetMskL( TInt aResourceId ); - - /** - * Shows the 'Default set to:' note. - */ - void ShowDefaultSetNoteL(TCmDefConnValue aSelection); - - /** - * Shows the 'Default:' in navi pane. - */ - void SetDefaultNaviL( TCmDefConnValue aSelection ); - - /** - * Counts how many CMs can be displayed.(Shouldn't display - * CMs for which the plugin is not loaded.) - */ - TUint32 NumberOfCMsL( RArray cmArray ); - - /** - * Enforced to release allocated memory and reset protection - * when some exceptions occur - */ - void EnforcedResetCDestDlg(); - - protected: - - CDestListboxModel* iModel; - CDestListbox* iListbox; - TUint32 iHighlight; - TUint32* iSelected; - TBool iModelPassed; - CEikStatusPane* iStatusPane; // NOT owned - CAknTitlePane* iTitlePane; // NOT owned - CAknNavigationControlContainer* iNaviPane; // NOT owned - CAknNavigationDecorator* iNaviDecorator; // owned - HBufC* iOldTitleText; - CCmManagerImpl* iCmManagerImpl; // NOT owned - TInt iExitReason; // Exit reason, can be - // KUserExit or KUserBack - // used to pass user exit event - CCmConnSettingsUiImpl* iConnSettingsImpl; - CCmdExec* iCmdExec; - - private: - - CCmWizard* iCmWizard; // wizard for connection method creation - // Indicated that Escape has arrived and it should be forwarded when CmWizard - // finished its work - TBool iEscapeArrived; - - // Indicates whether the Exit button was pressed. Not owned. - TBool* iExiting; - - // This dialog shouldn't exit while processing in a plugin - // Indicates whether processing or not - TBool iProcessing; - }; - -#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/destlistbox.h --- a/cmmanager/cmmgr/Framework/Inc/destlistbox.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of class CDestListbox. -* -*/ - -#ifndef APSELECTOR_LISTBOX_H -#define APSELECTOR_LISTBOX_H - -// INCLUDE FILES -#include - -// FORWARD DECLARATION -class CDestListboxModel; - -/** - * Model for the destinations listbox. It is an array of CDestListItem - * pointers; items are owned. - * - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDestListbox ) : public CAknDoubleLargeStyleListBox - { - public: // Construct / destruct - - /** - * Two-phased constructor. Leaves on failure. - * @param aParent Parent control. - * @return The constructed listbox. - */ - static CDestListbox* NewL - ( const CCoeControl* aParent ); - - /** - * Destructor. - */ - virtual ~CDestListbox(); - - /** - * Constructor. - */ - CDestListbox(); - - public: - - /** - * Handle key event. - * @param aKeyEvent The key event. - * @param aType Key event type. - * @return Response (was the key event consumed?). - */ - TKeyResponse OfferKeyEventL - ( const TKeyEvent& aKeyEvent, TEventCode aType ); - - /** - * Handle focus change. - * @param aDrawNow Draw now? - */ - void FocusChanged( TDrawNow aDrawNow ); - - /** - * Gets the UID from a given item - * @param The index of the item - * @return The UID of the item given by itemindex - */ - TUint32 Uid4Item( TInt aItem ) const; - - /** - * Gets the UID of the current item - * @return The UID of the current item - */ - TUint32 CurrentItemUid() const; - - /** - * Gets the name of the current item - * @return The name of the current item - */ - const TDesC& CurrentItemNameL(); - - - // from CCoeControl - void HandleResourceChange(TInt aType); - }; - -#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/destlistboxmodel.h --- a/cmmanager/cmmgr/Framework/Inc/destlistboxmodel.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of class CDestListboxModel. -* -*/ - -#ifndef DESTLISTBOX_LISTBOX_MODEL_H -#define DESTLISTBOX_LISTBOX_MODEL_H - -// INCLUDE FILES -#include -#include "destlistitemlist.h" -#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#else -#include -#include -#endif - -// CONSTANTS -// Granularity of the model array. -const TInt KGranularity = 8; -_LIT( KListItemFormatDestProt, "%d\t%S\t%S\t%d" ); -_LIT( KListItemFormatDest, "%d\t%S\t%S" ); -const TInt KMaxFormatSize = sizeof( KListItemFormatDest ); -const TInt KMaxListItemNameLength = CommsDat::KMaxTextLength; -const TInt KMaxDestListboxName = KMaxListItemNameLength+KMaxFormatSize; - -/** - * Model for the destinations listbox. - * pointers; items are owned. - * - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDestListboxModel ) : public CDestListItemList - , public MDesCArray - { - public: // Construct / Destruct - - /** - * Constructor. - * @param aGraphicType The used graphic type - */ - CDestListboxModel(); - - /** - * Destructor. - */ - virtual ~CDestListboxModel(); - - public: // from MDesCArray - - /** - * Get number of items in the model. - * @return Number of items. - */ - TInt MdcaCount() const; - - /** - * Text to be displayed for this item. - * @param aIndex Index of item. - * @return TPtrC for this item text (text owned by the model). - */ - TPtrC MdcaPoint( TInt aIndex ) const; - - public: - - /** - * Sets the icon offset - * @param aOffset The offset of our icons in the iconarray - */ - void SetOwnIconOffset( TInt aOffset ); - - private: // data - - /** - * Formats the text of the listbox, calls the leaving version trapped. - * @param aIndex Index of item. - * @param aBuf Buffer to store formatted text. - */ - void FormatListboxText( TInt aIndex, TDes& aBuf ) const; - - /** - * Formats the text of the listbox, leaving version. - * @param aIndex Index of item. - * @param aBuf Buffer to store formatted text. - */ - void FormatListboxTextL( TInt aIndex, - TDes& aBuf ) const; - /** - * MdcaPoint() cannot leave, so this buffer is allocated - * to allow formatting. Fortunately, doesn't have to be very - * large. - * We have to use MUTABLE CAST, as MdcaPoint is const (odd enough), - * so wouldn't allow formatting the text in a member... - */ - __MUTABLE TBuf iBuf; - TInt iOffset; - }; - -#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/destlistitem.h --- a/cmmanager/cmmgr/Framework/Inc/destlistitem.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Declaration of the CDestSelect class. -* -*/ - - -#ifndef CDESTLISTITEM_H -#define CDESTLISTITEM_H - -#include -#include - -/** - * Representation of a destinations list item. - * This class is used to hold the main information of a destination. - * - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDestListItem ) : public CBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. Leaves on failure, places instance - * on cleanup stack. - * @param aUid The ID of the destination - * @param aName The name of the destination - * @param aNumOfCMs the number of connection methods belonging to the destination - * @param aIconIndex The icon index of the destination - * @param aIsProtected Whether the given item is read-only or not - * @return The constructed CDestListItem. - */ - static CDestListItem* NewLC( TUint32 aUid, - HBufC* aName, - TInt aNumOfCMs, - TUint aIconIndex, - CMManager::TProtectionLevel aProtectionLevel, - TBool aIsDefault ); - - /** - * Destructor. - */ - virtual ~CDestListItem(); - - protected: // Constructors - - /** - * C++ default constructor. - */ - CDestListItem( HBufC* aName ); - - /** - * Second-phase constructor. - * @param aUid The ID of the destination - * @param aNumOfCMs the number of connection methods belonging to the destination - * @param aIconIndex The icon index of the destination - * @param aIsProtected Whether the given item is read-only or not - * @return The constructed CDestListItem. - */ - void ConstructL( TUint32 aUid, - TInt aNumOfCMs, - TUint aIconIndex, - CMManager::TProtectionLevel aProtectionLevel, - TBool aIsDefault ); - public: // New functions - - /** - * Gets the name of the 'current' destination - * Ownership of the returned text is not passed. - * @return The name of the current destination - */ - const TDesC& Name(); - - /** - * Gets the UID of the current destination - * @return The UID of the current destination - */ - TUint32 Uid(); - - /** - * Gets the number of connection mehtods belonging to the current destination - * @return The number of connection mehtods belonging to the current destination - */ - TInt NumOfCMs(); - - /** - * Gets the IconIndex of the current destination - * @return The IconIndex of the current destination - */ - TUint IconIndex(); - - /** - * Returns the destination's protected flag - * @return ETrue if the destination is protected - */ - TUint IsProtected(); - /** - * Returns the Protection Level - * @return TProtectionLevel - */ - CMManager::TProtectionLevel GetProtectionLevel(); - TUint IsDefault(); - - private: // Data - - TUint32 iUid; ///< The ID of the destination - HBufC* iName; ///< The name of the destination - TInt iNumOfCMs; ///< The number of connection mehtods belonging to the - //// destination - TUint iIconIndex; ///< The iIconIndex of the destination - TBool iIsProtected; ///< The IsProtected flag of the destination - TBool iIsDefault; ///< The IsDefault flag of the destination - CMManager::TProtectionLevel iProtectionLevel; - }; - -#endif // CDESTLISTITEM_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/destlistitemlist.h --- a/cmmanager/cmmgr/Framework/Inc/destlistitemlist.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of the CDestListItemList class. -* -*/ - -#ifndef CDestLISTITEMLIST_H -#define CDestLISTITEMLIST_H - -// INCLUDES -#include - -// FORWARD DECLARATION -class CDestListItem; - -/** - * A list of CDestListItem-s pointers; items are owned. - * - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CDestListItemList ) : public CArrayPtrFlat - { - public: // Constructors and destructor - - /** - * C++ default constructor. - */ - CDestListItemList(); - - /** - * Destructor. Items in the list are destroyed. - */ - virtual ~CDestListItemList(); - - public: // New methods - - /** - * Get pointer to the item having aUid, - * or NULL if no such item is in the - * list. - * @param aUid Uid of item to get. - * @return Pointer to the item having uid aUid, or NULL. Ownership - * not passed (the list still owns the item). - */ - CDestListItem* ItemForUid( TUint32 aUid ) const; - }; - -#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/selectdestinationdlg.h --- a/cmmanager/cmmgr/Framework/Inc/selectdestinationdlg.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shows the "Select destination:" dialog, where the user can - select one of the available destinations. -* -*/ - -#ifndef SELECTDESTINATIONDLG_H -#define SELECTDESTINATIONDLG_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CCmManagerImpl; -class CCmDestinationImpl; - -// CLASS DECLARATION - -/** - * Show a query containing a title, a message box (contain a short explanation - * of the query) and a listbox. The listbox contains a list of available - * destinations from which the user can choose. - * - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CSelectDestinationDlg ) : public CAknListQueryDialog - { - public: // Constructors, destructor - - /** - * Two-phase constructor. - * @param aDestinationId Variable reference used to hold the return - * value of list selection. - * @param aCmManager Reference to CM Manager implementation used for - * querying destination specific data. - * @return Newly created dialog object. - */ - static CSelectDestinationDlg* NewL( - TUint32& aDestinationId, - CCmManagerImpl& aCmManager, - RArray* aDestArray = NULL); - - /** - * Two-phase constructor. - * @param aDestinationId Variable reference used to hold the return - * value of list selection. - * @param aCmManager Reference to CM Manager implementation used for - * querying destination specific data. - * @return Newly created dialog object. - */ - static CSelectDestinationDlg* NewLC( - TUint32& aDestinationId, - CCmManagerImpl& aCmManager, - RArray* aDestArray = NULL); - - /** - * Destructor. - */ - ~CSelectDestinationDlg(); - - private: // constructors - - /** - * Constructor. - */ - CSelectDestinationDlg( TInt aDummyIndex, TUint32& aDestinationId ); - - /** - * Second-phase constructor. - * @param aCmManager Reference to CM Manager implementation used for - * querying destination specific data. - */ - void ConstructL( CCmManagerImpl& aCmManager, - RArray* aDestArray ); - - private: // From CAknListQueryDialog - - /** - * @see CAknListQueryDialog - */ - virtual void PreLayoutDynInitL(); - - /** - * @see CAknListQueryDialog - */ - TBool OkToExitL( TInt aButtonId ); - - private: // internal helper methods - - /** - * Handle resource change events. - * @param aType: The type of resources that have changed - */ - void HandleResourceChange( TInt aType ); - - private: // New functions - - /** - * Sets graphic icons - */ - void SetIconsL(); - - private: //data - - TUint32& iDestinationId; - RPointerArray iDestinations; - }; - -#endif // SELECTDESTINATIONDLG_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Inc/uncatdlg.h --- a/cmmanager/cmmgr/Framework/Inc/uncatdlg.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Dialog for displaying and editing legacy connection methods -* -*/ - -#ifndef UNCATDIALOG_H -#define UNCATDIALOG_H - -// INCLUDES -#include "cmdlg.h" - -// CLASS DECLARATION -class CEikStatusPane; -class CAknTitlePane; -class CAknNavigationControlContainer; -class CAknNavigationDecorator; - -typedef struct - { - CCmPluginBase* iPlugin; - TUint32 iCmId; - }TUncatItem; - -/** - * Dialog for displaying and editing legacy iaps - * - * @lib cmmanager.lib - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CUncatDlg ) : public CCmDlg - { - public : // construction - - /** Epoc constructor */ - static CUncatDlg* NewL( CCmManagerImpl* aCmManager ); - - /** Destructor. */ - ~CUncatDlg(); - - public: // New functions - - /** - * Create and launch dialog. - * @return The code returned by the dialogs' ExecuteLD - */ - TInt ConstructAndRunLD( TUint32 aHighLight, TUint32& aSelected ); - - // From MEikMenuObserver - void DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ); - - // From MEikCommandObserver - void ProcessCommandL( TInt aCommandId ) ; - - /** - * Updates listbox data - */ - void ConstructCMArrayL( RArray& aCmIds ); - - /** - * Remove hidden Connection Methods from the Array - */ - void ClearHiddenCMsFromArrayL( RArray& aCmIds ); - - public: // From MCmCommsDatWatcher - - /** - * Watch changes in CommsDat - */ - void CommsDatChangesL(); - - private: // Constructor - - /** - * Default constructor. - */ - CUncatDlg( CCmManagerImpl* aCmManager ); - - private : // from CEikDialog - - /** - * Set the gateway's IP address, if the user pressed OK. - * @param aButtonId The ID of the pressed button. - * @return May the dialog exit? - */ - void InitTextsL(); - - /** - * Returns the currently focused connection method in the list - */ - CCmPluginBase* CurrentCML(); - - /** - * Returns the connection method in the list at the specified index - */ - CCmPluginBase* CMByIndexL( TInt aIndex ); - - /** - * Returns the connection mehtod count - */ - TInt CMCount(); - - /** - * Cleans up iCmUncatItems - * - * @param aReuse whether the array will be used again or not - * @since S60 3.2 - */ - void CleanupUncatArray( TBool aReuseArray = EFalse ); - - protected: - - RArray iCmUncatItems; - }; - -#endif - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/ccmdexec.cpp --- a/cmmanager/cmmgr/Framework/Src/ccmdexec.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Execute command without blocking the process. Needed for -* touch UI implementation. -* -*/ - -#include -#include -#include "ccmdexec.h" - -// ---------------------------------------------------------------------------- -// C++ default constructor can NOT contain any code, that might leave. -// ---------------------------------------------------------------------------- -// -CCmdExec::CCmdExec(MCmdExec& aOwner) : - CActive( CActive::EPriorityStandard ), - iOwner(aOwner) - { - CActiveScheduler::Add(this); - } - -// ---------------------------------------------------------------------------- -// Destructor. -// ---------------------------------------------------------------------------- -// -CCmdExec::~CCmdExec() - { - Cancel(); - } - -void CCmdExec::Execute() - { - // Cancel possible previous request - Cancel(); - - // Do request - TRequestStatus *requestStatus = &iStatus; - User::RequestComplete(requestStatus, KErrNone); - SetActive(); - } - -void CCmdExec::RunL() - { - iOwner.Execute(); - } - -TInt CCmdExec::RunError( TInt aError ) - { - if (aError != 0) - iOwner.HandleLeaveError( aError ); - return KErrNone; - } - -void CCmdExec::DoCancel() - { - - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/ccmpluginbaseeng.cpp --- a/cmmanager/cmmgr/Framework/Src/ccmpluginbaseeng.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3553 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of plugin base class -* -*/ -#include -#include // RSocketServ, RConnection -#include // KAfInet -#include // TConnectionInfo -#include -#include -#include -#include - -#include -#include "cmmanagerimpl.h" -#include "cmdestinationimpl.h" -#include -#include -#include "cmlogger.h" -#include - -using namespace CMManager; -using namespace CommsDat; - -// EXTERNAL LINKS - -// MACROS - -#undef _IPV6_DISABLED - -// CONSTANTS -const TInt KApMaxConnNameLength = 30; -_LIT(KFormatPostfix, "%02d"); -_LIT(KFormatLargePostfix, "%d"); -_LIT(KFormatNameWithPostfix, "%S(%S)" ); -_LIT(KFormatNoPostfix, "%S"); -const TInt KMaxPostfixLength = 5; -const TInt KEstimatedOverhead = 8192; - -_LIT( KDefWapGatewayIpAddress, "0.0.0.0" ); - -_LIT( KLocationName, "Mobile" ); - -static const TCmAttribConvTable SIapConvTbl[] = - { - // iAttribId, iCommsDatId, iValidFuncL, - // iTitleId, - // iMaxLength, iAttribFlags, iDefValueResId, iEditorResId, iNotUsed1, iNotUsed2 - // first element describes the min-max values, does not connects to DB! - { ECmName, ECmIapId, NULL }, - { ECmName, KCDTIdRecordName, NULL, - R_CMMANAGERUI_CONNECTION_NAME, - KMaxConnNameLength, EConvNoZeroLength | EConvCompulsory, - 0, R_TEXT_SETTING_PAGE_CONN_NAME, NULL, NULL }, - { ECmIapId, KCDTIdRecordTag, NULL }, - { 0, 0, NULL }, - }; - -static const TCmAttribConvTable SProxyConvTbl[] = - { - // iAttribId, iCommsDatId, iValidFuncL, - // iTitleId, - // iMaxLength, iAttribFlags, iDefValueResId, iEditorResId, iNotUsed1, iNotUsed2 - { ECmProxyUsageEnabled, ECmProxyRangeMax, NULL }, - { ECmProxyUsageEnabled, KCDTIdUseProxyServer, NULL }, - { ECmProxyServerName, KCDTIdServerName, &SetProxyServerNameL, - R_QTN_SET_PROXY_SERVER_ADDRESS, - KMaxProxyServerLength, 0, R_QTN_SET_PROXY_SERVER_ADDRESS_NONE, R_TEXT_SETTING_PAGE_PROXY_SERVER_ADDR, NULL, NULL }, - { ECmProxyProtocolName, KCDTIdProtocolName, NULL }, - { ECmProxyPortNumber, KCDTIdPortNumber, &CheckPortNumberValidityL, - R_QTN_SET_PROXY_PORT_NUMBER, - KMaxProxyPortNumberLength, EConvNumber, 0, 0, NULL, NULL }, - { ECmProxyExceptions, KCDTIdExceptions, NULL }, - { 0, 0, NULL }, - }; - -static const TCmAttribConvTable SChargeCardConvTbl[] = - { - { ECmChargeCardUsageEnabled, ECmChargeCardRangeMax, NULL }, - { ECmChargeCardAccountNumber, KCDTIdAccountNo, NULL }, - { ECmChargeCardPIN, KCDTIdPin, NULL }, - { ECmChargeCardLocalRule, KCDTIdLocalRule, NULL }, - { ECmChargeCardNatRule, KCDTIdNatRule, NULL }, - { ECmChargeCardIntlRule, KCDTIdIntlRule, NULL }, - { 0, 0, NULL }, - }; - -static const TCmAttribConvTable SLocationConvTbl[] = - { - { ECmLocationUsageEnabled, ECmLocationRangeMax, NULL }, - { ECmLocationIntlPrefixCode, KCDTIdIntlPrefixCode, NULL }, - { ECmLocationNatPrefixCode, KCDTIdNatPrefixCode, NULL }, - { ECmLocationNatCode, KCDTIdNatCode, NULL }, - { ECmLocationAreaCode, KCDTIdAreaCode, NULL }, - { ECmLocationDialOutCode, KCDTIdDialOutCode, NULL }, - { ECmLocationDisableCallWaitingCode, KCDTIdDisableCallWaitingCode, NULL }, - { ECmLocationMobile, KCDTIdMobile, NULL }, - { ECmLocationUsePulseDial, KCDTIdUsePulseDial, NULL }, - { ECmLocationWaitForDialTone, KCDTIdWaitForDialTone, NULL }, - { ECmLocationPauseAfterDialOut, KCDTIdPauseAfterDialOut, NULL }, - { 0, 0, NULL }, - }; - -static const TCmAttribConvTable SWapConvTbl[] = - { - { ECmWapIPGatewayAddress, ECmWapRangeMax, NULL }, - { ECmWapIPGatewayAddress, KCDTIdWAPGatewayAddress, &CheckIPv4ValidityL }, - { ECmWapIPWSPOption, KCDTIdWAPWSPOption, &CheckWAPWspOptionValidityL }, - { ECmWapIPSecurity, KCDTIdWAPSecurity, NULL }, - { ECmWapIPProxyPort, KCDTIdWAPProxyPort, &CheckPortNumberValidityL }, - { ECmWapIPProxyLoginName, KCDTIdWAPProxyLoginName, NULL }, - { ECmWapIPProxyLoginPass, KCDTIdWAPProxyLoginPass, NULL }, - { 0, 0, NULL }, - }; - -static const TCmAttribConvTable SUiTable[] = - { - { ECmName, 0, NULL, - R_CMMANAGERUI_CONNECTION_NAME, - KMaxConnNameLength, EConvNoZeroLength | EConvCompulsory, 0, R_TEXT_SETTING_PAGE_CONN_NAME, NULL, NULL }, - { ECmBearerSettingName, 0, NULL, - R_PLUGIN_BASE_SET_AP_BEARER, - 0, 0, 0, 0, NULL, NULL }, - { ECmStartPage, 0, NULL, - R_QTN_SET_STARTING_PAGE, - KMaxStartPageLength, 0, R_QTN_SET_HOME_PAGE_NONE, R_TEXT_SETTING_PAGE_STARTING_PAGE, - R_START_PAGE_DEF_VALUE, NULL, NULL }, - { 0, 0, NULL, - 0, - 0, 0, 0, NULL, NULL }, - }; - -/** - * Private data of plugin base - */ -NONSHARABLE_CLASS( CCmPluginBasePrivate ) : public CBase - { - public: - - CCmPluginBasePrivate(); - ~CCmPluginBasePrivate(); - - public: - - CCDWAPAccessPointRecord* iWapAPRecord; - CCDWAPIPBearerRecord* iWapIPBearerRecord; - CCDIAPMetadataRecord* iMetaDataRecord; - - TNamingMethod iNamingMethod; - - CArrayPtrFlat* iConvTblArray; - RArray iCommonConvTblArray; - - TInt iLoadResult; - }; - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// ReadOnlyAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C TBool ReadOnlyAttributeL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ) - { - User::Leave( KErrNotSupported ); - - (void)aThis; - (void)aAttribute; - (void)aValue; - - return EFalse; - } - -// --------------------------------------------------------------------------- -// CheckIPv4ValidityL -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CheckIPv4ValidityL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ) - { - (void)aThis; - (void)aAttribute; - (void)aValue; - - return EFalse; - } - -// --------------------------------------------------------------------------- -// CheckIPv6ValidityL -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CheckIPv6ValidityL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ) - { - (void)aThis; - (void)aAttribute; - (void)aValue; - - return EFalse; - } - -// --------------------------------------------------------------------------- -// CheckPortNumberValidityL -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CheckPortNumberValidityL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ) - { - (void)aThis; - (void)aAttribute; - (void)aValue; - - return EFalse; - } - -// --------------------------------------------------------------------------- -// CheckRecordIdValidityL -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CheckRecordIdValidityL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ) - { - TUint32 recId = *(TUint32*)aValue; - - if( recId < 1 || recId > 254 ) - { - CLOG_WRITE_1_PTR( aThis, "Not valid Rec id: [%d]", recId ); - User::Leave( KErrArgument ); - } - - (void)aThis; - (void)aAttribute; - (void)aValue; - - return EFalse; - } - -// --------------------------------------------------------------------------- -// CheckWAPWspOptionValidityL -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CheckWAPWspOptionValidityL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ) - { - TUint32 wspOpt = (TUint32)aValue; - - - if( wspOpt != ECmWapWspOptionConnectionless && - wspOpt != ECmWapWspOptionConnectionOriented ) - { - User::Leave( KErrArgument ); - } - - (void)aThis; - (void)aAttribute; - (void)aValue; - - return EFalse; - } - -// --------------------------------------------------------------------------- -// IsUnspecifiedIPv4Address -// --------------------------------------------------------------------------- -// -EXPORT_C TBool IsUnspecifiedIPv4Address( const TDesC& aIpv4Address ) - { - if( aIpv4Address.Length() == 0 || - !aIpv4Address.CompareF( KUnspecifiedIPv4 ) ) - { - return ETrue; - } - - return EFalse; - } - -// --------------------------------------------------------------------------- -// ClassifyIPv6Address -// --------------------------------------------------------------------------- -// -EXPORT_C TIPv6Types ClassifyIPv6Address( const TDesC& aIpv6Address ) - { - if( aIpv6Address.Length() == 0 || - !aIpv6Address.CompareF( KDynamicIpv6Address ) ) - { - return EIPv6Unspecified; - } - else if( !aIpv6Address.CompareF( KKnownIp6NameServer1 ) || - !aIpv6Address.CompareF( KKnownIp6NameServer2 ) ) - { - return EIPv6WellKnown; - } - - return EIPv6UserDefined; - } - -// --------------------------------------------------------------------------- -// SetProxyServerNameL -// --------------------------------------------------------------------------- -// -EXPORT_C TBool SetProxyServerNameL( CCmPluginBaseEng* aThis, - TUint32 /*aAttribute*/, - const TAny* aValue ) - { - const TDesC* proxyServer = (const TDesC*)aValue; - - return aThis->SetProxyServerNameL( *proxyServer ); - } - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// TCmPluginInitParam::TCmPluginInitParam -// --------------------------------------------------------------------------- -// -TCmPluginInitParam::TCmPluginInitParam( CCmManagerImpl& aCmMgr ) - : iCmMgr( aCmMgr ) - { - iParentDest = 0; - iNotused1 = NULL; - iNotused2 = NULL; - } - -// --------------------------------------------------------------------------- -// CCmPluginBasePrivate::CCmPluginBasePrivate -// --------------------------------------------------------------------------- -// -CCmPluginBasePrivate::CCmPluginBasePrivate() - : iNamingMethod( ENamingUnique ) - , iCommonConvTblArray( KDefAttrsArrayGranSize ) - { - } - -// --------------------------------------------------------------------------- -// CCmPluginBasePrivate::~CCmPluginBasePrivate -// --------------------------------------------------------------------------- -// -CCmPluginBasePrivate::~CCmPluginBasePrivate() - { - delete iWapAPRecord; - delete iWapIPBearerRecord; - delete iMetaDataRecord; - - if ( iConvTblArray ) - { - iConvTblArray->ResetAndDestroy(); - delete iConvTblArray; - } - - iCommonConvTblArray.Reset(); - iCommonConvTblArray.Close(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::CCmPluginBaseEng -// --------------------------------------------------------------------------- -// -EXPORT_C CCmPluginBaseEng::CCmPluginBaseEng( TCmPluginInitParam *aInitParam ) - : iCmMgr( aInitParam->iCmMgr ) - , iParentDest( aInitParam->iParentDest ) - { - CLOG_CREATE; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::~CCmPluginBaseEng -// --------------------------------------------------------------------------- -// -EXPORT_C CCmPluginBaseEng::~CCmPluginBaseEng() - { - Reset(); - - delete iPriv; - - REComSession::DestroyedImplementation( iDtor_ID_Key ); - CLOG_CLOSE; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::ConstructL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::ConstructL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::ConstructL" ); - - iPriv = new (ELeave) CCmPluginBasePrivate; - - // 4 for our tables + 4 for bearer specific ones. - iPriv->iConvTblArray = new (ELeave)CArrayPtrFlat( 8 ); - - AddConverstionTableL( (CCDRecordBase**)&iIapRecord, - NULL, SIapConvTbl ); - AddConverstionTableL( (CCDRecordBase**)&iProxyRecord, - NULL, SProxyConvTbl ); - AddConverstionTableL( (CCDRecordBase**)&iChargeCardRecord, - &iChargeCardEnabled, SChargeCardConvTbl ); - AddConverstionTableL( (CCDRecordBase**)&iLocationRecord, - &iLocationEnabled, SLocationConvTbl ); - AddConverstionTableL( (CCDRecordBase**)&iPriv->iWapIPBearerRecord, - NULL, SWapConvTbl ); - } - - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::GetIntAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C TUint32 - CCmPluginBaseEng::GetIntAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::GetIntAttributeL" ); - - TUint32 retVal( 0 ); - - switch ( aAttribute ) - { - case ECmBearerIcon: - { - retVal = 0; // bearer doesn't provide any icon - } - break; - - case ECmBearerAvailableIcon: - { - retVal = 0; // bearer doesn't provide any icon - } - break; - - case ECmId: // if the CM has an IapId than the ECmId is the ECmId - case ECmIapId: - { - retVal = iIapId; - } - break; - case ECmWapId: - { - retVal = iPriv->iWapIPBearerRecord->iWAPAccessPointId; - } - break; - case ECmIapServiceId: - { - retVal = TUint32(iIapRecord->iService); - } - break; - case ECmBearerType: - { - retVal = iBearerType; - } - break; - - case ECmDefaultPriority: - { - retVal = KDataMobilitySelectionPolicyPriorityWildCard; - } - break; - - case ECmDefaultUiPriority: - { - retVal = KDataMobilitySelectionPolicyPriorityWildCard; - } - break; - - case ECmNamingMethod: - { - retVal = iPriv->iNamingMethod; - } - break; - - case ECmExtensionLevel: - { - retVal = KExtensionBaseLevel; - } - break; - - case ECmInvalidAttribute: - { - retVal = iInvalidAttribute; - } - break; - - case ECmCommsDBBearerType: - { - User::Leave( KErrUnknown ); - } - break; - - case ECmSeamlessnessLevel: - { - retVal = iPriv->iMetaDataRecord->iSeamlessness; - } - break; - - case ECmElementID: - { - if ( !iIapRecord ) - { - User::Leave( KErrNotReady ); - } - - retVal = (KCDMaskShowField & iIapRecord->ElementId()); - } - break; - - case ECmLoadResult: - { - retVal = iPriv->iLoadResult; - } - break; - - case ECmNetworkId: - { - retVal = iIapRecord->iNetwork; - } - break; - - default: - { - TUint32 attribute = CheckForCommonAttribute( aAttribute ); - CMDBField* field; - - FindFieldL( attribute, ECmInt, (CMDBElement*&)field ); - - retVal = *field; - } - break; - } - - return retVal; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::GetBoolAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C TBool - CCmPluginBaseEng::GetBoolAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::GetBoolAttributeL" ); - - TBool retVal; - - switch ( aAttribute ) - { - case ECmProtected: - { - retVal = IsProtected(); - } - break; - - case ECmHidden: - { - retVal = iIapRecord->Attributes() & ECDHidden; - } - break; - - case ECmDestination: - { - retVal = EFalse; - } - break; - - case ECmChargeCardUsageEnabled: - { - retVal = iChargeCardEnabled; - } - break; - - case ECmCoverage: - // In default the plugin has no network coverage - { - retVal = EFalse; - } - break; - - case ECmAddToAvailableList: - { - retVal = EFalse; - } - break; - - case ECmBearerHasUi: - { - retVal = EFalse; - } - break; - - case ECmMetaHighlight: - { - retVal = iPriv->iMetaDataRecord->iMetadata & EMetaHighlight; - } - break; - - case ECmMetaHiddenAgent: - { - retVal = iPriv->iMetaDataRecord->iMetadata & EMetaHiddenAgent; - } - break; - - case ECmIPv6Supported: - { - retVal = FeatureSupported( KFeatureIdIPv6 ); - } - break; - - case ECmConnected: - { - retVal = CheckIfAlreadyConnected(); - } - break; - - case ECmVirtual: - { - retVal = EFalse; - } - break; - - case ECmIsLinked: - { - retVal = iCmMgr.IsIapLinkedL( *this ); - } - break; - - default: - { - TUint32 attribute = CheckForCommonAttribute( aAttribute ); - CMDBField* field; - - FindFieldL( attribute, ECmBool, (CMDBElement*&)field ); - - retVal = *field; - } - } - - return retVal; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::GetStringAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C HBufC* - CCmPluginBaseEng::GetStringAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::GetStringAttributeL" ); - - HBufC* retVal = NULL; - - switch ( aAttribute ) - { - case ECmStartPage: - { - retVal = TPtrC(iPriv->iWapAPRecord->iWAPStartPage).AllocL(); - } - break; - - case ECmName: - { - retVal = TPtrC(iIapRecord->iRecordName).AllocL(); - } - break; - - default: - { - TUint32 attribute = CheckForCommonAttribute( aAttribute ); - CMDBField* field; - - FindFieldL( attribute, ECmText, (CMDBElement*&)field ); - - if ( !field->IsNull() ) - { - retVal = field->GetL().AllocL(); - } - else - { - retVal = KNullDesC().AllocL(); - } - } - } - - return retVal; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::GetString8AttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C HBufC8* - CCmPluginBaseEng::GetString8AttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::GetString8AttributeL" ); - - HBufC8* retVal = NULL; - - switch ( aAttribute ) - { - default: - { - TUint32 attribute = CheckForCommonAttribute( aAttribute ); - CMDBField* field; - - FindFieldL( attribute, ECmText8, (CMDBElement*&)field ); - - if ( !field->IsNull() ) - { - retVal = field->GetL().AllocL(); - } - else - { - retVal = KNullDesC8().AllocL(); - } - } - } - - return retVal; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::SetIntAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::SetIntAttributeL( const TUint32 aAttribute, - TUint32 aValue ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::SetIntAttributeL" ); - - switch ( aAttribute ) - { - case ECmNamingMethod: - { - iPriv->iNamingMethod = (TNamingMethod)aValue; - } - break; - - case ECmCommsDBBearerType: - case ECmElementID: - case ECmIapId: - case ECmId: - { - User::Leave( KErrNotSupported ); - } - break; - - case ECmSeamlessnessLevel: - { - if ( aValue == ESeamlessnessConfirmFirst || - aValue == ESeamlessnessShowprogress ) - { - iPriv->iMetaDataRecord->iSeamlessness = aValue; - } - else - { - User::Leave( KErrNotSupported ); - } - } - break; - - case ECmNetworkId: - { - User::Leave( KErrNotSupported ); - } - break; - - default: - { - TUint32 attribute = CheckForCommonAttribute( aAttribute ); - CMDBField* field; - - TValidationFunctionL func = - FindFieldL( attribute, ECmInt, (CMDBElement*&)field ); - - if( func ) - { - func( this, attribute, (TAny*)aValue ); - } - - *field = aValue; - } - break; - } - - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::SetBoolAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::SetBoolAttributeL( const TUint32 aAttribute, - TBool aValue ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::SetBoolAttributeL" ); - - switch ( aAttribute ) - { - case ECmProtected: - { - SetAttribute( iIapRecord, ECDProtectedWrite, aValue ); - } - break; - - case ECmHidden: - { - // Check that this is not Default Connection - TCmDefConnValue defConn; - iCmMgr.ReadDefConnL( defConn ); - if ( defConn.iType == ECmDefConnConnectionMethod && - defConn.iId == iIapRecord->RecordId() ) - { - User::Leave( KErrArgument ); - } - - SetAttribute( iIapRecord, ECDHidden, aValue ); - } - break; - - case ECmProxyUsageEnabled: - { - EnableProxyL( aValue ); - } - break; - - case ECmChargeCardUsageEnabled: - { - EnableChargeCardL( aValue ); - } - break; - - case ECmLocationUsageEnabled: - { - EnableLocationL( aValue ); - } - break; - - case ECmMetaHighlight: - { - if( aValue ) - { - iPriv->iMetaDataRecord->iMetadata = - EMetaHighlight | iPriv->iMetaDataRecord->iMetadata; - } - else - { - iPriv->iMetaDataRecord->iMetadata = - ~EMetaHighlight & iPriv->iMetaDataRecord->iMetadata; - } - } - break; - - case ECmMetaHiddenAgent: - { - if( aValue ) - { - iPriv->iMetaDataRecord->iMetadata = - EMetaHiddenAgent | iPriv->iMetaDataRecord->iMetadata; - } - else - { - iPriv->iMetaDataRecord->iMetadata = - ~EMetaHiddenAgent & iPriv->iMetaDataRecord->iMetadata; - } - } - break; - - default: - { - TUint32 attribute = CheckForCommonAttribute( aAttribute ); - CMDBField* field; - - TValidationFunctionL func = - FindFieldL( attribute, ECmBool, (CMDBElement*&)field ); - - if( func ) - { - func( this, attribute, (const TAny*)aValue ); - } - - - *field = aValue; - } - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::SetStringAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::SetStringAttributeL( const TUint32 aAttribute, - const TDesC16& aValue ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::SetStringAttributeL" ); - - TUint32 commonattribute = MappedCommonAttribute( aAttribute ); - switch ( commonattribute ) - { - case ECmStartPage: - { - iPriv->iWapAPRecord->iWAPStartPage.SetL( aValue ); - } - break; - - case ECmName: - { - SetNameL( aValue ); - } - break; - case ECmIPAddress: - { - GenericStringWriterL( commonattribute, aValue ); - if (( aValue.Compare(KUnspecifiedIPv4) == 0) || ( aValue.Compare(KNullDesC)==0 ) ) - { - SetBoolAttributeL( ECmIPAddFromServer, ETrue ); - } - else - { - SetBoolAttributeL( ECmIPAddFromServer, EFalse ); - } - } - break; - default: - { - GenericStringWriterL( commonattribute, aValue ); - } - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::SetString8AttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::SetString8AttributeL( const TUint32 aAttribute, - const TDesC8& aValue ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::SetString8AttributeL" ); - - switch ( aAttribute ) - { - default: - { - TUint32 attribute = CheckForCommonAttribute( aAttribute ); - CMDBField* field; - - TValidationFunctionL func = - FindFieldL( attribute, ECmText8, (CMDBElement*&)field ); - - if( func ) - { - func( this, attribute, (const TAny*)&aValue ); - } - - field->SetL( aValue ); - } - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::RestoreAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::RestoreAttributeL( const TUint32 aAttribute ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::RestoreAttributeL" ); - - TCmAttrConvArrayItem* item = ConversionTable( aAttribute ); - - TInt index( 0 ); - CMDBElement& field = FieldByAttributeL( item, aAttribute, index ); - - TRAPD( err, field.LoadL( Session() ) ); - if( err == KErrNotFound ) - { - switch ( field.Type() ) - { - case EText: - case EMedText: - case ELongText: - { - CMDBField* textField = static_cast*>( &field ); - - textField->SetL( KNullDesC ); - } - break; - - case EDesC8: - { - CMDBField* textField = static_cast*>( &field ); - - textField->SetL( KNullDesC8 ); - } - break; - - case EUint32: - case EInt: - case EBool: - { - CMDBField* intField = static_cast*>( &field ); - - intField->SetL( 0 ); - } - break; - - default: - { - User::Leave( KErrArgument ); - } - break; - } - } - else - { - User::LeaveIfError( err ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::Destination -// --------------------------------------------------------------------------- -// -EXPORT_C CCmDestinationImpl* CCmPluginBaseEng::Destination() const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::Destination" ); - - return NULL; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::UpdateL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::UpdateL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::UpdateL" ); - - CheckSpaceBelowCriticalLevelL(); - - OpenTransactionLC(); - - PrepareToUpdateRecordsL(); - - UpdateChargeCardRecordL(); - UpdateServiceRecordL(); - - UpdateLocationRecordL(); - UpdateNetworkRecordL(); - - UpdateIAPRecordL(); - - UpdateWapRecordL(); - UpdateProxyRecordL(); - UpdateSeamlessnessRecordL(); - UpdateConnPrefSettingL(); - - UpdateAdditionalRecordsL(); - - CommitTransactionL( 0 ); - iCmMgr.ConnMethodUpdatedL( this ); - iIdIsValid = ETrue; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::NumOfConnMethodReferencesL -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CCmPluginBaseEng::NumOfConnMethodReferencesL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::NumOfConnMethodReferencesL" ); - - return iCmMgr.NumOfConnMethodReferencesL( iIapId ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::Session -// --------------------------------------------------------------------------- -// -EXPORT_C CMDBSession& CCmPluginBaseEng::Session()const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::Session" ); - - return iCmMgr.Session(); - } - -// --------------------------------------------------------------------------- -// Delete this connection methond. -// Record ids are checked to be sure that we delete only records -// that were loaded before. -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CCmPluginBaseEng::DeleteL( TBool aForced, - TBool aOneRefAllowed ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::DeleteL" ); - - if ( CheckIfAlreadyConnected() ) - { - User::Leave( KErrInUse ); - } - - if( iPriv->iLoadResult ) - // previous load failed -> do NOT delete this partially loaded cm. - { - User::Leave( KErrNotReady ); - } - - if( GetBoolAttributeL( ECmIsLinked ) ) - { - User::Leave( KErrLocked ); - } - - // If there is no parent destination, we can delete - TBool retVal(ETrue); - - if( !aForced ) - { - TInt refs = NumOfConnMethodReferencesL(); - - switch ( refs ) - { - case 0: - // no referencies to this cm - { - CLOG_WRITE( "No ref -> do delete it" ); - } - break; - - case 1: - // one reference - { - if ( !aOneRefAllowed ) - // this is not a legacy cm -> cannot be deleted. - { - retVal = EFalse; - } - } - break; - - default: - // connection method is multiple referenced from - // destinations -> no delete - { - retVal = EFalse; - } - break; - } - } - - if ( retVal ) - { - TCmDefConnValue deletedItem; - deletedItem.iType = ECmDefConnConnectionMethod; - deletedItem.iId = iIapId; - iCmMgr.HandleDefConnDeletedL( deletedItem ); - - if( aForced ) - { - iCmMgr.RemoveAllReferencesWoTransL( *this ); - } - - OpenTransactionLC(); - // And now we have everything from CommsDat, - // so we delete only those records. - PrepareToDeleteRecordsL(); - - if ( iIapRecord && iIapRecord->RecordId() ) - { - iIapRecord->DeleteL( Session() ); - } - - if ( iProxyRecord && iProxyRecord->RecordId() ) - { - iProxyRecord->DeleteL( Session() ); - } - - if ( iServiceRecord && iServiceRecord->RecordId() ) - { - iServiceRecord->DeleteL( Session() ); - } - - if ( iChargeCardRecord && iChargeCardRecord->RecordId() ) - { - iChargeCardRecord->DeleteL( Session() ); - } - - if ( iNetworkRecord && iNetworkRecord->RecordId() ) - { - iNetworkRecord->DeleteL( Session() ); - } - - if ( iLocationRecord && iLocationRecord->RecordId() ) - { - iLocationRecord->DeleteL( Session() ); - } - - if ( iPriv->iWapAPRecord && - iPriv->iWapAPRecord->RecordId() ) - { - iPriv->iWapAPRecord->DeleteL( Session() ); - } - - if ( iPriv->iWapIPBearerRecord && - iPriv->iWapIPBearerRecord->RecordId() ) - { - iPriv->iWapIPBearerRecord->DeleteL( Session() ); - } - - if ( iPriv->iMetaDataRecord && - iPriv->iMetaDataRecord->RecordId() ) - { - iPriv->iMetaDataRecord->DeleteL( Session() ); - } - - DeleteAdditionalRecordsL(); - - CommitTransactionL( KErrNone ); - } - - return retVal; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::LoadL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::LoadL( TUint32 aIapId ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::LoadL" ); - CLOG_NAME_2( _L("plugin_0x%x_%d"), this, aIapId ); - - OpenTransactionLC(); - - // trap it to set iPriv->iLoadResult - TRAP( iPriv->iLoadResult, DoLoadL( aIapId ) ); - - User::LeaveIfError( iPriv->iLoadResult ); - - RollbackTransaction(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::CreateNewL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::CreateNewL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::CreateNewL" ); - - CheckSpaceBelowCriticalLevelL(); - - if ( iIapId ) - // we already have IAP id -> - { - User::Leave( KErrAlreadyExists ); - } - - iPreDefIapId = 0; - - // optional record are disable in default - iChargeCardEnabled = EFalse; - iLocationEnabled = EFalse; - - // create mandatory records - iIapRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord)); - iNetworkRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdNetworkRecord)); - iProxyRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdProxiesRecord)); - NewWapRecordL(); - iPriv->iWapIPBearerRecord->iWAPGatewayAddress.SetL( - KDefWapGatewayIpAddress ); - - iPriv->iMetaDataRecord = NewSeamlessnessRecordL( ETrue ); - - // call plugin to create its own records - CreateNewServiceRecordL(); - CreateAdditionalRecordsL(); - - EnableProxyL( EFalse ); - - // Load default CM name from resource - HBufC* defApName = AllocReadL( R_CMMANAGERENG_DEFAULT_AP_NAME ); - CleanupStack::PushL( defApName ); - - SetNameL( *defApName ); - - CleanupStack::PopAndDestroy( defApName ); - - iIapRecord->iNetworkWeighting = 0; // it's always 0. - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::CreateCopyL -// --------------------------------------------------------------------------- -// -EXPORT_C CCmPluginBaseEng* CCmPluginBaseEng::CreateCopyL() const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::CreateCopyL" ); - CheckSpaceBelowCriticalLevelL(); - - TCmPluginInitParam params( iCmMgr ); - - CCmPluginBaseEng* copyInst = CreateInstanceL( params ); - CleanupStack::PushL( copyInst ); - - copyInst->CreateNewL(); - - TInt err( KErrNone ); - TRAP( err, copyInst->SetBoolAttributeL( ECmChargeCardUsageEnabled, iChargeCardEnabled ) ); - if( err != KErrNotSupported ) - { - User::LeaveIfError( err ); - } - TRAP( err, copyInst->SetBoolAttributeL( ECmLocationUsageEnabled, iLocationEnabled ) ); - if( err != KErrNotSupported ) - { - User::LeaveIfError( err ); - } - copyInst->SetIntAttributeL( ECmNamingMethod, iPriv->iNamingMethod ); - copyInst->SetStringAttributeL( ECmName, TPtrC( iIapRecord->iRecordName ) ); - copyInst->SetStringAttributeL( ECmStartPage, TPtrC( iPriv->iWapAPRecord->iWAPStartPage ) ); - - - PrepareToCopyDataL( *copyInst ); - - for ( TInt tblInd = 0; tblInd < iPriv->iConvTblArray->Count(); ++tblInd ) - { - const TCmAttrConvArrayItem* item = (*iPriv->iConvTblArray)[tblInd]; - - if ( item->iEnabled && !(*item->iEnabled) ) - // Enabled flag is set to 'disabled' state - { - continue; - } - - if( !item->iRecord || - (item->iRecord && !(*item->iRecord)) ) - // no record - { - continue; - } - - for ( TInt attrInd = 1; item->iConvTable[attrInd].iAttribId; ++attrInd ) - { - if( item->iConvTable[attrInd].iAttribFlags & EConvReadOnly ) - // Read-only flags are not copied. - { - continue; - } - - TInt commsdatid( item->iConvTable[attrInd].iCommsDatId ); - - if ( !commsdatid ) - { // not connected to the DB, calculated field, no copy - continue; - } - - CMDBElement* field = (*item->iRecord)->GetFieldByIdL( commsdatid ); - - if( field->IsNull() ) - { - continue; - } - - switch ( field->Type() ) - { - case EText: - case EMedText: - case ELongText: - { - CMDBField* textField = (CMDBField*)field; - - TRAP( err, copyInst->SetStringAttributeL( - item->iConvTable[attrInd].iAttribId, - *textField ) ); - if( err != KErrNotSupported ) - { - User::LeaveIfError( err ); - } - } - break; - - case EDesC8: - { - CMDBField* textField = (CMDBField*)field; - - TRAP( err, copyInst->SetString8AttributeL( - item->iConvTable[attrInd].iAttribId, - *textField ) ); - if( err != KErrNotSupported ) - { - User::LeaveIfError( err ); - } - } - break; - - case EUint32: - case EInt: - { - CMDBField* intField = (CMDBField*)field; - - TRAP( err, copyInst->SetIntAttributeL( - item->iConvTable[attrInd].iAttribId, - *intField ) ); - if ( !(( err == KErrNotSupported ) || ( err == KErrArgument )) ) - { - User::LeaveIfError( err ); - } - } - break; - - case EBool: - { - CMDBField* intField = (CMDBField*)field; - - TRAP( err, copyInst->SetBoolAttributeL( - item->iConvTable[attrInd].iAttribId, - *intField ) ); - if( err != KErrNotSupported ) - { - User::LeaveIfError( err ); - } - } - break; - - case ELink: // links are not copied! - default: - { - } - break; - } - } - } - - CopyAdditionalDataL( *copyInst ); - - CleanupStack::Pop( copyInst ); - - return copyInst; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::AddResourceFileL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::AddResourceFileL( const TDesC& aName ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::AddResourceFileL" ); - - CLOG_WRITE_1( "[%S]", &aName ); - - TParse fp; - TInt err = fp.Set( aName, - &KDC_RESOURCE_FILES_DIR, - NULL ); - if ( err != KErrNone) - { - User::Leave( err ); - } - - TFileName fName; - - fName.Copy( fp.FullName() ); - - iCmMgr.AddResourceFileL( fName ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::RemoveResourceFile -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::RemoveResourceFile( const TDesC& aName ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::RemoveResourceFileL" ); - - TParse fp; - TInt err = fp.Set( aName, - &KDC_RESOURCE_FILES_DIR, - NULL ); - CLOG_WRITE_1( "Set: [%d]", err ); - - TFileName fName; - - fName.Copy( fp.FullName() ); - - iCmMgr.RemoveResourceFile( fName ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::AllocReadL -// --------------------------------------------------------------------------- -// -EXPORT_C HBufC* CCmPluginBaseEng::AllocReadL( TInt aResourceId ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::AllocReadL" ); - - return iCmMgr.AllocReadL( aResourceId ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::OpenTransactionLC -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::OpenTransactionLC() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::OpenTransactionL" ); - - iCmMgr.OpenTransactionLC( ETrue ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::CommitTransactionL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::CommitTransactionL( TInt aError ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::CommitTransactionL" ); - - iCmMgr.CommitTransactionL( aError ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::RollbackTransaction -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::RollbackTransaction() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::RollbackTransaction" ); - - iCmMgr.RollbackTransaction(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::PrepareToLoadRecordsL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::DoLoadL( TUint32 aIapId ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::DoLoadL" ); - - PrepareToLoadRecordsL(); - - LoadIAPRecordL( aIapId ); - LoadWapRecordL(); - LoadSeamlessnessRecordL(); - LoadNetworkSettingL(); - LoadLocationSettingL(); - - // This is a connectionmethodinfo instance, that has no - // service and proxy setting. - if( KDummyBearerType != iBearerType ) - { - LoadServiceSettingL(); - LoadProxySettingL(); - } - - LoadAdditionalRecordsL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::PrepareToLoadRecordsL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::PrepareToLoadRecordsL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::PrepareToLoadRecordsL" ); - - iChargeCardEnabled = EFalse; - iLocationEnabled = EFalse; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::LoadIAPRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::LoadIAPRecordL( TUint32 aIapId ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::LoadIAPRecordL" ); - - iIapId = aIapId; - - // Load IAP record - CCDIAPRecord *iapRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord)); - - CleanupStack::PushL( iapRecord ); - - iapRecord->SetRecordId( iIapId ); - - iapRecord->LoadL( Session() ); - - CleanupStack::Pop( iapRecord ); - - iIapRecord = iapRecord; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::LoadProxySettingL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::LoadProxySettingL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::LoadProxySettingL" ); - - // Load Proxy record - CMDBRecordSet* proxieRS = - new(ELeave) CMDBRecordSet(KCDTIdProxiesRecord); - CleanupStack::PushL(proxieRS); - - // Now try to find the linked proxy record - // create new record - CCDProxiesRecord* proxyRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdProxiesRecord)); - - CleanupStack::PushL( proxyRecord ); - - // Prime record - TPtrC serviceType( iIapRecord->iServiceType ); - - proxyRecord->iServiceType.SetL( serviceType ); - - proxieRS->iRecords.AppendL( proxyRecord ); - - CleanupStack::Pop( proxyRecord ); - - proxyRecord = NULL; - - CLOG_WRITE_1( "Looking for proxy: [%d]", TUint32(iIapRecord->iService) ); - - if ( proxieRS->FindL(Session()) ) - { - TInt i(0); - while( iiRecords.Count() ) - // Now that we have a list of services with the proper service type - // search for our proxy record and remove it from the array, - // then destroy the array. - { - CCDProxiesRecord* proxyRecord = (*proxieRS)[i]; - - // Compare the record id of these 2 services - if ( TUint32(proxyRecord->iService) == - TUint32(iIapRecord->iService) ) - { - iProxyRecord = proxyRecord; - // take ownership of this record - proxieRS->iRecords.Remove( i ); - break; - } - ++i; - } - } - - proxieRS->iRecords.ResetAndDestroy(); - - if( !iProxyRecord ) - { - // This creates a proxy record, where usage is disabled. - EnableProxyL( EFalse ); - } - - CleanupStack::PopAndDestroy( proxieRS ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::LoadServiceSettingL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::LoadServiceSettingL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::LoadServiceSettingL" ); - - if ( iServiceRecord ) - { - iServiceRecord->SetRecordId( iIapRecord->iService ); - TRAPD( err, iServiceRecord->LoadL( Session() ) ); - if( err == KErrNotFound ) - // record not found -> create a default one - { - CreateNewServiceRecordL(); - } - else - { - User::LeaveIfError( err ); - } - } - else - { - CLOG_WRITE( "CCmPluginBaseEng::LoadServiceSettingL: No service rec" ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::LoadChargeCardSettingL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::LoadChargeCardSettingL( TUint32 aRecordId ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::LoadChargeCardSettingL" ); - - if ( !aRecordId ) - // No charge card is link to this IAP - { - iChargeCardEnabled = EFalse; - - CLOG_WRITE( "CCmPluginBaseEng::LoadChargeCardSettingL: No charge card" ); - return; - } - - iChargeCardRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdChargecardRecord)); - iChargeCardRecord->SetRecordId( aRecordId ); - TRAPD( err, iChargeCardRecord->LoadL( Session() ) ); - if( err == KErrNotFound ) - // referenced but doesn't exist. Try to fix it. - { - iChargeCardRecord->SetRecordId( KCDNewRecordRequest ); - - // if it fails we can't do anything to solve this problem - iChargeCardRecord->StoreL( Session() ); - } - else - { - User::LeaveIfError( err ); - } - - iChargeCardEnabled = ETrue; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::LoadNetworkSettingL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::LoadNetworkSettingL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::LoadNetworkSettingL" ); - - CCDNetworkRecord* networkRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdNetworkRecord)); - CleanupStack::PushL( networkRecord ); - - networkRecord->SetRecordId( iIapRecord->iNetwork ); - TRAPD( err, networkRecord->LoadL( Session() ) ); - if( err == KErrNotFound ) - { - CleanupStack::PopAndDestroy( networkRecord ); - - networkRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdNetworkRecord)); - } - else - // KErrNotFound -> doesn't matter. We will do it UpdateL() - { - User::LeaveIfError( err ); - - CleanupStack::Pop( networkRecord ); - } - - iNetworkRecord = networkRecord; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::LoadLocationSettingL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::LoadLocationSettingL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::LoadLocationSettingL" ); - - CCDLocationRecord* locationRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdLocationRecord)); - - CleanupStack::PushL( locationRecord ); - - locationRecord->SetRecordId( iIapRecord->iLocation ); - if ( locationRecord->FindL(Session()) ) - { - iLocationEnabled = ETrue; - - iLocationRecord = locationRecord; - - CleanupStack::Pop( locationRecord ); - } - else - { - iLocationEnabled = EFalse; - - CleanupStack::PopAndDestroy( locationRecord ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::PrepareToUpdateRecordsL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::PrepareToUpdateRecordsL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::PrepareToUpdateRecordsL" ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::UpdateIAPRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::UpdateIAPRecordL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::UpdateIAPRecordL" ); - - if ( !iIapId ) - { - if ( iPreDefIapId ) - { - iIapRecord->SetRecordId( iPreDefIapId ); - iPreDefIapId = 0; - } - else - { - iIapRecord->SetRecordId( KCDNewRecordRequest ); - } - - TUint32 id; - HBufC* name; - - ServiceRecordIdLC( name, id ); - iIapRecord->iService = id; - iIapRecord->iServiceType.SetL( *name ); - CleanupStack::PopAndDestroy( name ); - - BearerRecordIdLC( name, id ); - iIapRecord->iBearer = id; - iIapRecord->iBearerType.SetL( *name ); - CleanupStack::PopAndDestroy( name ); - - iIapRecord->iNetwork = iNetworkRecord->RecordId(); - - if ( iLocationRecord ) - { - iIapRecord->iLocation = iLocationRecord->RecordId(); - } - - iIapRecord->iLocation = GetLocationIdL(); - - iIapRecord->StoreL( Session() ); - iIapId = iIapRecord->RecordId(); - - CLOG_NAME_2( _L("plugin_0x%x_%d"), this, iIapId ); - CLOG_WRITE_1( "New IapId: [%d]", iIapId ); - } - else - { - iIapRecord->ModifyL( Session() ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::UpdateProxyRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::UpdateProxyRecordL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::UpdateProxyRecordL" ); - - CopyAttributes( iIapRecord, iProxyRecord ); - CheckIfNameModifiedL( iProxyRecord ); - - if ( iProxyRecord->iUseProxyServer ) - { - if ( !iProxyRecord->RecordId() ) - // new proxy setting -> create new record - { - iProxyRecord->iService = iServiceRecord->RecordId(); - iProxyRecord->iServiceType.SetL( iIapRecord->iServiceType ); - - // By default protocol is set to "http" - if ( TPtrC(iProxyRecord->iProtocolName).Length() == 0 ) - { - iProxyRecord->iProtocolName.SetL(KDefProxyProtocolName); - } - - iProxyRecord->SetRecordId( KCDNewRecordRequest ); - - iProxyRecord->StoreL( Session() ); - } - else - // already existing record -> update only - { - iProxyRecord->ModifyL( Session() ); - } - } - else - { - if ( iProxyRecord->RecordId() ) - { - iProxyRecord->DeleteL( Session() ); - } - } - } - - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::UpdateSeamlessnessRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::UpdateSeamlessnessRecordL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::UpdateSeamlessnessRecordL" ); - - CopyAttributes( iIapRecord, iPriv->iMetaDataRecord ); - CheckIfNameModifiedL( iPriv->iMetaDataRecord ); - - if ( !iPriv->iMetaDataRecord->RecordId() ) - { - iPriv->iMetaDataRecord->iIAP = IAPRecordElementId(); - iPriv->iMetaDataRecord->SetRecordId( KCDNewRecordRequest ); - iPriv->iMetaDataRecord->StoreL( Session() ); - } - else - { - iPriv->iMetaDataRecord->ModifyL( Session() ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::UpdateChargeCardRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::UpdateChargeCardRecordL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::UpdateChargeCardRecordL" ); - if ( iChargeCardEnabled ) - { - CopyAttributes( iIapRecord, iChargeCardRecord ); - CheckIfNameModifiedL( iChargeCardRecord ); - - if ( !iChargeCardRecord->RecordId() ) - { - iChargeCardRecord->SetRecordId( KCDNewRecordRequest ); - iChargeCardRecord->StoreL( Session() ); - } - else - { - iChargeCardRecord->ModifyL( Session() ); - } - } - else - { - if ( iChargeCardRecord ) - { - iChargeCardRecord->DeleteL( Session() ); - } - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::UpdateServiceRecordL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::UpdateServiceRecordL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::UpdateServiceRecordL" ); - - if ( iServiceRecord ) - { - CopyAttributes( iIapRecord, iServiceRecord ); - CheckIfNameModifiedL( iServiceRecord ); - - if ( !iServiceRecord->RecordId() ) - { - iServiceRecord->SetRecordId( KCDNewRecordRequest ); - iServiceRecord->StoreL( Session() ); - } - else - { - iServiceRecord->ModifyL( Session() ); - } - } - else - { - CLOG_WRITE( "No service record" ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::UpdateNetworkRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::UpdateNetworkRecordL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::UpdateNetworkRecordL" ); - - CopyAttributes( iIapRecord, iNetworkRecord ); - if ( !iNetworkRecord->RecordId() ) - { - CheckIfNameModifiedL( iNetworkRecord ); - - iNetworkRecord->SetRecordId( KCDNewRecordRequest ); - iNetworkRecord->StoreL( Session() ); - } - else - { - iNetworkRecord->ModifyL( Session() ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::UpdateLocationRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::UpdateLocationRecordL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::UpdateLocationRecordL" ); - if ( iLocationEnabled ) - { - CopyAttributes( iIapRecord, iLocationRecord ); - CheckIfNameModifiedL( iLocationRecord ); - - if ( !iLocationRecord->RecordId() ) - { - iLocationRecord->SetRecordId( KCDNewRecordRequest ); - iLocationRecord->StoreL( Session() ); - } - else - { - iLocationRecord->ModifyL( Session() ); - } - } - else - { - if ( iLocationRecord ) - { - iLocationRecord->DeleteL( Session() ); - } - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::UpdateConnPrefSettingL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::UpdateConnPrefSettingL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::UpdateConnPrefSettingL" ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::EnableProxyL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::EnableProxyL( TBool aEnable ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::EnableProxyL" ); - - if ( !iServiceRecord ) - { - CLOG_WRITE( "No service record -> no proxy" ); - User::Leave( KErrNotSupported ); - } - - if( !iProxyRecord ) - { - iProxyRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdProxiesRecord)); - } - - iProxyRecord->iUseProxyServer = aEnable; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::EnableChargeCardL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::EnableChargeCardL( TBool aEnable ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::EnableChargeCardL" ); - - if ( aEnable ) - { - if ( !iChargeCardRecord ) - { - iChargeCardRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdChargecardRecord)); - } - } - else - // charge card is disabled. To be deleted in UpdateL - // Nothing to do here - { - } - - iChargeCardEnabled = aEnable; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::EnableLocationL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::EnableLocationL( TBool aEnable ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::EnableLocationL" ); - - if ( aEnable ) - { - if ( !iLocationRecord ) - { - iLocationRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdLocationRecord)); - } - } - else - // location is disabled. To be deleted in UpdateL. - // Nothing to do here - { - } - - iLocationEnabled = aEnable; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::LoadWapRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::LoadWapRecordL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::LoadWapRecordL" ); - - iPriv->iWapIPBearerRecord = FindWAPRecordL(); - if ( iPriv->iWapIPBearerRecord ) - { - CCDWAPAccessPointRecord *wapApRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdWAPAccessPointRecord)); - - CleanupStack::PushL( wapApRecord ); - - wapApRecord->SetRecordId( - iPriv->iWapIPBearerRecord->iWAPAccessPointId ); - TRAPD( err, wapApRecord->LoadL( Session() ) ); - if( err == KErrNotFound ) - { - CleanupStack::PopAndDestroy( wapApRecord ); - - wapApRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdWAPAccessPointRecord)); - } - else - { - CLOG_WRITE( "WAP bearer record found, WAP AP Not??" ); - - User::LeaveIfError( err ); - - CleanupStack::Pop( wapApRecord ); - } - - iPriv->iWapAPRecord = wapApRecord; - } - else - // No WAP record found -> create a new one - { - NewWapRecordL(); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::LoadSeamlessnessRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::LoadSeamlessnessRecordL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::LoadSeamlessnessRecordL" ); - - iPriv->iMetaDataRecord = FindSeamlessnessRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::UpdateWapRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::UpdateWapRecordL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::UpdateWapRecordL" ); - - if ( !iPriv->iWapIPBearerRecord ) - // nothing to update - { - return; - } - - // we have the bearer but to make sure that we have WAP_AP, too. - NewWapRecordL(); - - CopyAttributes( iIapRecord, iPriv->iWapAPRecord ); - CopyAttributes( iIapRecord, iPriv->iWapIPBearerRecord ); - - CheckIfNameModifiedL( iPriv->iWapAPRecord ); - CheckIfNameModifiedL( iPriv->iWapIPBearerRecord ); - - if ( !iPriv->iWapAPRecord->RecordId() ) - { - iPriv->iWapAPRecord->SetRecordId( KCDNewRecordRequest ); - iPriv->iWapAPRecord->StoreL( Session() ); - } - else - { - iPriv->iWapAPRecord->ModifyL( Session() ); - } - - if ( !iPriv->iWapIPBearerRecord->RecordId() ) - { - iPriv->iWapIPBearerRecord->iWAPAccessPointId = iPriv->iWapAPRecord->RecordId(); - iPriv->iWapIPBearerRecord->iWAPIAP = iIapId; - - iPriv->iWapIPBearerRecord->SetRecordId( KCDNewRecordRequest ); - iPriv->iWapIPBearerRecord->StoreL( Session() ); - } - else - { - iPriv->iWapIPBearerRecord->ModifyL( Session() ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::NewWapRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::NewWapRecordL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::NewWapBearerRecordL" ); - - if ( !iPriv->iWapIPBearerRecord ) - { - iPriv->iWapIPBearerRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdWAPIPBearerRecord)); - iPriv->iWapIPBearerRecord->iWAPProxyPort = 0; - iPriv->iWapIPBearerRecord->iWAPWSPOption = ECmWapWspOptionConnectionOriented; - iPriv->iWapIPBearerRecord->iWAPSecurity = EFalse; - } - - if ( !iPriv->iWapAPRecord ) - { - iPriv->iWapAPRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdWAPAccessPointRecord)); - // SMS bearer is not supported by this version - iPriv->iWapAPRecord->iWAPCurrentBearer.SetL( - TPtrC(KCDTypeNameWAPIPBearer) ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::NewSeamlessnessRecordL -// --------------------------------------------------------------------------- -// -CCDIAPMetadataRecord* CCmPluginBaseEng::NewSeamlessnessRecordL( TBool aSetDef ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::NewSeamlessnessRecordL" ); - - CCDIAPMetadataRecord* record = new (ELeave) CCDIAPMetadataRecord( - iCmMgr.SeamlessnessTableId() ); - - if( aSetDef ) - { - record->iSeamlessness = ESeamlessnessConfirmFirst; - } - - return record; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::SetAttribute -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::SetAttribute( CCDRecordBase* aRecord, - TUint32 aAttribute, - TBool aSet ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::SetAttribute" ); - - if ( aSet ) - { - aRecord->SetAttributes( aAttribute ); - } - else - { - aRecord->ClearAttributes( aAttribute ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::CopyAttributes -// --------------------------------------------------------------------------- -// -void CCmPluginBaseEng::CopyAttributes( CCDRecordBase* aSrcRecord, - CCDRecordBase* aDstRecord ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::CopyAttributes" ); - - TMDBAttributeFlags attr( aSrcRecord->Attributes() ); - - aDstRecord->SetAttributes( attr ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::FindWAPRecordL -// --------------------------------------------------------------------------- -// -CCDWAPIPBearerRecord* CCmPluginBaseEng::FindWAPRecordL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::FindWAPRecordL" ); - - CMDBRecordSet* wapRS = - new(ELeave) - CMDBRecordSet(KCDTIdWAPIPBearerRecord); - CleanupStack::PushL( wapRS ); - - CCDWAPIPBearerRecord* wapBearerRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdWAPIPBearerRecord)); - - CleanupStack::PushL( wapBearerRecord ); - - wapBearerRecord->iWAPIAP = iIapId; - wapRS->iRecords.AppendL( wapBearerRecord ); - - CleanupStack::Pop( wapBearerRecord ); - wapBearerRecord = NULL; - - if ( wapRS->FindL(Session()) ) - { - CLOG_WRITE( "WAP bearer record found" ); - - wapBearerRecord = - static_cast(wapRS->iRecords[0]); - - // we take over the ownership of this record - wapRS->iRecords.Remove( 0 ); - } - - CleanupStack::PopAndDestroy( wapRS ); - - return wapBearerRecord; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::FindSeamlessnessRecordL -// --------------------------------------------------------------------------- -// -CCDIAPMetadataRecord* CCmPluginBaseEng::FindSeamlessnessRecordL() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::FindSeamlessnessRecordL" ); - - CMDBRecordSet* slnRS = - new(ELeave) CMDBRecordSet(iCmMgr.SeamlessnessTableId()); - CleanupStack::PushL( slnRS ); - - CCDIAPMetadataRecord* slnRecord = - new (ELeave) CCDIAPMetadataRecord( iCmMgr.SeamlessnessTableId() ); - - slnRecord->iIAP = IAPRecordElementId(); - slnRS->iRecords.AppendL( slnRecord ); - - slnRecord = NULL; - - if ( slnRS->FindL(Session()) ) - { - CMDBRecordBase* record = slnRS->iRecords[0]; - - slnRecord = NewSeamlessnessRecordL( EFalse ); - slnRecord->SetRecordId( record->RecordId() ); - - // This can leave only in case of OOM. - slnRecord->LoadL( Session() ); - } - else - { - slnRecord = NewSeamlessnessRecordL( ETrue ); - } - - CleanupStack::PopAndDestroy( slnRS ); - - return slnRecord; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::DoMakeValidNameL -// --------------------------------------------------------------------------- -// -HBufC* CCmPluginBaseEng::DoMakeValidNameL( const TDesC& aName ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::DoMakeValidNameL" ); - - TBool changed( EFalse ); - HBufC* temp = HBufC::NewLC( KApMaxConnNameLength ); - HBufC* temp2 = HBufC::NewLC( KApMaxConnNameLength ); - - HBufC* corrname = EnsureMaxLengthLC( aName, changed ); - *temp = *corrname; - TInt postfix( 0 ); - TInt pf( 0 ); - TInt i( 0 ); - TBool valid ( EFalse ); - - TPtrC prefix = GetPrefix( *corrname ); - - postfix = GetPostfix( *temp, prefix ); - postfix = -1; - do - { - valid = IsValidNameL( *temp ); - if ( !valid ) - { - changed = ETrue; - postfix++; - // check the length of postfix, check text length accordingly - pf = postfix; - for (i=1; i<10; i++) - { - pf /= 10; - if ( !pf ) - break; - } - TPtr sgdptr( temp->Des() ); - TPtr sgdptr2( temp2->Des() ); - if ( postfix ) - { - if ( postfix < 10 ) - { - sgdptr2 = prefix.Left( KApMaxConnNameLength - i - 3 ); - } - else - { - sgdptr2 = prefix.Left( KApMaxConnNameLength - i - 2 ); - } - } - else - { - sgdptr2 = prefix.Left( KApMaxConnNameLength ); - } - if ( postfix ) - { - TBuf< KMaxPostfixLength > postfixString; - if ( postfix > 9 ) - { - postfixString.Format( KFormatLargePostfix, postfix ); - AknTextUtils::LanguageSpecificNumberConversion( postfixString ); - } - else - { - postfixString.Format( KFormatPostfix, postfix ); - AknTextUtils::LanguageSpecificNumberConversion( postfixString ); - } - sgdptr.Format( KFormatNameWithPostfix, &sgdptr2, - &postfixString ); - } - else - { - sgdptr.Format( KFormatNoPostfix, &sgdptr2 ); - } - } - } while ( !valid ); - - CleanupStack::PopAndDestroy( corrname ); - CleanupStack::PopAndDestroy( temp2 ); - - if ( changed ) - { - CLOG_WRITE_1( "New name: [%S]", temp ); - CleanupStack::Pop( temp ); - } - else - { - CleanupStack::PopAndDestroy( temp ); - temp = NULL; - } - - return temp; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::EnsureMaxLengthLC -// --------------------------------------------------------------------------- -// -HBufC* CCmPluginBaseEng::EnsureMaxLengthLC( const TDesC& aName, - TBool& aChanged ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::EnsureMaxLengthLC" ); - - TInt length = aName.Length(); - - aChanged = EFalse; - - if ( !length ) - { - // Name is required. - User::Leave( KErrArgument ); - } - - HBufC* corrname; - if ( KApMaxConnNameLength < length ) - { // name too long, truncate. - corrname = aName.Left( KApMaxConnNameLength ).AllocLC(); - aChanged = ETrue; - } - else - { - corrname = aName.AllocLC(); - corrname->Des().Trim(); - if ( corrname->Length() == 0 ) - { - User::Leave( KErrArgument ); - } - // comes here only if name is valid - if ( corrname->Length() != aName.Length() ) - { - aChanged = ETrue; - } - } - - return corrname; - } - -// --------------------------------------------------------------------------- -// Given aName in the format or , -// return a pointer to the leading part. -// That is, if there is trailing , -// then that is excluded; if there is no trailing part, then the original -// decriptor is returned. -// Examples: -// - "Foo" returns "Foo"; -// - "Foo 12" returns "Foo 12"; -// - "Foo(12)" returns "Foo"; -// - "Foo 12 (34)" returns "Foo 12 "; -// - "Foo bar" returns "Foo bar"; -// - "Foo " returns "Foo ". -// --------------------------------------------------------------------------- -TPtrC CCmPluginBaseEng::GetPrefix( const TDesC& aName ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::GetPrefix" ); - - TPtrC prefix = aName; - TInt lastBrace = aName.LocateReverse('('); - if ( lastBrace != KErrNotFound ) - { - // aName looks like "". - // See if is an integer number. - TPtrC num = aName.Right( aName.Length() - lastBrace - 1 ); - TInt val; - TLex lex( num ); - if ( lex.Val( val ) == KErrNone ) - { - // Yes, the trailer is an integer. - prefix.Set( aName.Left( lastBrace ) ); - } - } - return prefix; - } - - -// --------------------------------------------------------------------------- -// If aName is constructed from aPrefix with a postfix, get the numeric -// value of the postfix, e.g: -// - GetPostfix( "Foo (3)", "Foo" ) == 3 -// - GetPostfix( "Foo 23 (45)", "Foo 23" ) == 45 -// If aName is the same as aPrefix, return 0, e.g.: -// - GetPostfix( "Foo", "Foo" ) == 0 -// If aName is not constructed from aPrefix, return -1, e.g.: -// - GetPostfix( "Foobar", "Foo" ) == -1 -// - GetPostfix( "Fo 23 45", "Foo" ) == -1 -// --------------------------------------------------------------------------- -TInt CCmPluginBaseEng::GetPostfix( const TDesC& aName, const TDesC& aPrefix ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::GetPostfix" ); - TInt postfix( KErrNotFound ); - TInt nameLength = aName.Length(); - TInt prefixLength = aPrefix.Length(); - if ( nameLength >= prefixLength && aName.FindF( aPrefix ) == 0 ) - { - // aName is longer or equal length, and - // aPrefix can be found in the beginning of aName. - if ( nameLength == prefixLength ) - { - // They have the same length; they equal. - postfix = 0; - } - else - { - if ( prefixLength > 0 ) - { - if ( aName[ prefixLength ] == '(' ) - { - // (Now we know that aName is longer than aPrefix.) - // aName looks like "aPrefix". - // See if is an integer number. - TPtrC num = aName.Right( nameLength - prefixLength - 1 ); - TBuf< KApMaxConnNameLength > pf; - pf = num; - AknTextUtils::ConvertDigitsTo( pf, EDigitTypeWestern ); - TInt val; - TLex lex( pf ); - if ( lex.Val( val ) == KErrNone ) - { - // Yes, the trailer is an integer. - if ( val > 0 ) - { - postfix = val; - } - else - { - // signal that it is invalid... - postfix = -1; - } - } - } - } - else - { - postfix = -1; - } - } - } - return postfix; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::IsValidNameL -// --------------------------------------------------------------------------- -// -TBool CCmPluginBaseEng::IsValidNameL( const TDesC& aNameText ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::IsValidNameL" ); - - TBool retVal( ETrue ); - - OpenTransactionLC(); - - CMDBRecordSet* iapRS = - new(ELeave) CMDBRecordSet(KCDTIdIAPRecord); - CleanupStack::PushL(iapRS); - - CCDIAPRecord* iapRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord)); - - CleanupStack::PushL( iapRecord ); - - // Prime record - iapRecord->iRecordName.SetL( aNameText ); - - iapRS->iRecords.AppendL( iapRecord ); - - CleanupStack::Pop( iapRecord ); - - iapRecord = NULL; - - if ( iapRS->FindL(Session()) ) - { - if ( iIapId ) - // this is not a new CM - { - for ( TInt i = 0; i < iapRS->iRecords.Count(); ++i ) - { - if ( iapRS->iRecords[i]->RecordId() != iIapId ) - // duplication because it's not our name - { - retVal = EFalse; - break; - } - } - } - else - // new CM -> any occurence is a duplication - { - retVal = EFalse; - } - } - - CleanupStack::PopAndDestroy( iapRS ); - - RollbackTransaction(); - - return retVal; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::EscapeTextLC -// --------------------------------------------------------------------------- -// -HBufC* CCmPluginBaseEng::EscapeTextLC( const TDesC& aLiteral ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::EscapeTextLC" ); - - TInt l( aLiteral.Length() ); - //> 2*, to ensure correct esc. even if ALL chars are quotes... - HBufC* retbuf = HBufC::NewLC( 2*l ); - TPtr ret = retbuf->Des(); - TUint quote( '\'' ); // TChar gives warnings in THUMB & ARMI - TInt i( 0 ); - - for ( i=0; iiNamingMethod == ENamingNothing ) - { - iIapRecord->iRecordName.SetL( aName ); - } - else if ( iPriv->iNamingMethod == ENamingUnique ) - { - HBufC* newName = DoMakeValidNameL( aName ); - - if ( newName ) - // name converted to unique - { - CleanupStack::PushL( newName ); - iIapRecord->iRecordName.SetL( *newName ); - CleanupStack::PopAndDestroy( newName ); - } - else - { - iIapRecord->iRecordName.SetL( aName ); - } - } - else if ( iPriv->iNamingMethod == ENamingNotAccept ) - { - if ( IsValidNameL( aName ) ) - { - iIapRecord->iRecordName.SetL( aName ); - } - else - { - User::Leave( KErrArgument ); - } - } - else - { - User::Leave( KErrCorrupt ); - } - - CLOG_WRITE_1( "Finale name: [%S]", &FIELD_TO_TDESC(iIapRecord->iRecordName) ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::AddConverstionTableL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::AddConverstionTableL( CCDRecordBase* *aRecord, - TBool* aEnabled, - const TCmAttribConvTable* aConvTable ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::AddConverstionTableL" ); - TCmAttrConvArrayItem* item = new (ELeave) TCmAttrConvArrayItem; - - item->iRecord = aRecord; - item->iEnabled = aEnabled; - item->iConvTable = aConvTable; - - iPriv->iConvTblArray->AppendL( item ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::AddConverstionTableL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::AddCommonConversionTableL( - const TCmCommonAttrConvArrayItem* aConvTable ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::AddCommonConversionTableL" ); - - User::LeaveIfError( iPriv->iCommonConvTblArray.Append( aConvTable ) ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::RemoveConversionTable -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::RemoveConversionTable( - const TCmAttribConvTable* aConvTable ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::RemoveConversionTable" ); - - for ( TInt i = 0; i < iPriv->iConvTblArray->Count(); ++i ) - { - if ( (*iPriv->iConvTblArray)[i]->iConvTable == aConvTable ) - { - delete (*iPriv->iConvTblArray)[i]; - iPriv->iConvTblArray->Delete( i ); - } - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::RemoveCommonConversionTable -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::RemoveCommonConversionTable( - const TCmCommonAttrConvArrayItem* aConvTable ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::RemoveCommonConversionTable" ); - - for ( TInt i = 0; i < iPriv->iCommonConvTblArray.Count(); ++i ) - { - if ( iPriv->iCommonConvTblArray[i] == aConvTable ) - { - iPriv->iCommonConvTblArray.Remove( i ); - } - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::FindFieldL -// --------------------------------------------------------------------------- -// -TValidationFunctionL CCmPluginBaseEng::FindFieldL( TUint32 aAttribute, - TCMFieldTypes aType, - CMDBElement* &aElement ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::FindFieldL" ); - - TValidationFunctionL func = NULL; - const TCmAttrConvArrayItem* foundItem = ConversionTable( aAttribute ); - - aElement = NULL; - - if( !foundItem ) - { - User::Leave( KErrNotSupported ); - } - - if ( foundItem->iEnabled ) - { - if ( !(*foundItem->iEnabled) ) - { - User::Leave( KErrNotSupported ); - } - } - - if ( !(*foundItem->iRecord) ) - { - User::Leave( KErrNotSupported ); - } - - TInt index( 0 ); - CMDBElement& field = FieldByAttributeL( foundItem, aAttribute, index ); - switch ( field.Type() ) - { - case EText: - case EMedText: - case ELongText: - { - if ( aType == ECmText ) - { - aElement = &field; - } - else - { - User::Leave( KErrNotSupported ); - } - } - break; - - case EDesC8: - { - if ( aType == ECmText8 ) - { - aElement = &field; - } - else - { - User::Leave( KErrNotSupported ); - } - } - break; - - case EUint32: - case EInt: - case EBool: - { - if ( aType == ECmInt || - aType == ECmBool ) - { - aElement = &field; - } - else - { - User::Leave( KErrNotSupported ); - } - } - break; - - default: - { - User::Leave( KErrArgument ); - } - break; - } - - if( aElement ) - { - func = foundItem->iConvTable[index].iValidFuncL; - } - else - { - User::Leave( KErrNotSupported ); - } - - return func; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::Reset -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::Reset() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::Reset" ); - - iIapId = 0; - - delete iIapRecord; iIapRecord = NULL; - delete iProxyRecord; iProxyRecord = NULL; - delete iServiceRecord; iServiceRecord = NULL; - delete iChargeCardRecord; iChargeCardRecord = NULL; - delete iNetworkRecord; iNetworkRecord = NULL; - delete iLocationRecord; iLocationRecord = NULL; - if ( iPriv ) - { - iPriv->iLoadResult = KErrNone; - delete iPriv->iWapAPRecord; iPriv->iWapAPRecord = NULL; - delete iPriv->iWapIPBearerRecord; iPriv->iWapIPBearerRecord = NULL; - delete iPriv->iMetaDataRecord; iPriv->iMetaDataRecord = NULL; - } - - iChargeCardEnabled = EFalse; - iLocationEnabled = EFalse; - } - - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::CheckIfAlreadyConnected -// --------------------------------------------------------------------------- -EXPORT_C TBool CCmPluginBaseEng::CheckIfAlreadyConnected() const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::CheckIfAlreadyConnected" ); - - TBool retVal( EFalse ); - RSocketServ serv; - RConnection connection; - TUint count; - - if ( serv.Connect() == KErrNone ) - { - if ( connection.Open( serv, KAfInet ) == KErrNone ) - { - if ( connection.EnumerateConnections( count ) == KErrNone ) - { - TPckgBuf connInfo; - - for ( TUint32 i = 1; i <= count; ++i ) - { - connection.GetConnectionInfo( i, connInfo ); - - if ( connInfo().iIapId == iIapId ) - { - CLOG_WRITE( "Found connection" ); - retVal = ETrue; - break; - } - } - } - - connection.Close(); - } - - serv.Close(); - } - - return retVal; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::CheckIfNameModifiedL -// --------------------------------------------------------------------------- -EXPORT_C void - CCmPluginBaseEng::CheckIfNameModifiedL( CCDRecordBase* aRecord ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::CheckIfNameModifiedL" ); - - if ( !TPtrC(iIapRecord->iRecordName).CompareF( TPtrC(aRecord->iRecordName)) ) - // names matche - { - return; - } - - aRecord->iRecordName.SetL( TPtrC(iIapRecord->iRecordName) ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::IAPRecordElementId -// --------------------------------------------------------------------------- -TMDBElementId CCmPluginBaseEng::IAPRecordElementId() const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::IAPRecordElementId" ); - - return ( KCDMaskShowField & iIapRecord->ElementId() ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::IsProtected -// --------------------------------------------------------------------------- -TBool CCmPluginBaseEng::IsProtected() const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::IsProtected" ); - - return ( iIapRecord->Attributes() & ECDProtectedWrite ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::GetLocationIdL -// --------------------------------------------------------------------------- -TUint32 CCmPluginBaseEng::GetLocationIdL() const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::GetLocationIdL" ); - - TUint32 locId( 0 ); - CMDBRecordSet* locRS = - new(ELeave) CMDBRecordSet(KCDTIdLocationRecord); - CleanupStack::PushL( locRS ); - - CCDLocationRecord* locRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdLocationRecord)); - - CleanupStack::PushL( locRecord ); - locRecord->iRecordName.SetL( KLocationName ); - locRS->iRecords.AppendL( locRecord ); - CleanupStack::Pop( locRecord ); - - if ( locRS->FindL(Session()) ) - { - locRecord = static_cast(locRS->iRecords[0]); - - locId = locRecord->RecordId(); - } - else - { - CLOG_WRITE( "Loc id not found" ); - User::Leave( KErrNotFound ); - } - - CleanupStack::PopAndDestroy( locRS ); - - return locId; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::CheckForCommonAttribute -// --------------------------------------------------------------------------- -TUint32 - CCmPluginBaseEng::CheckForCommonAttribute( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::CheckForCommonAttribute" ); - - TUint32 convAttr( aAttribute ); - - if ( iPriv->iCommonConvTblArray.Count() && - aAttribute > ECmCommonAttributesStart && - aAttribute < ECmCommonAttributesEnd ) - { - for ( TInt i = 0; i < iPriv->iCommonConvTblArray.Count(); ++i ) - { - const TCmCommonAttrConvArrayItem* convArray = - iPriv->iCommonConvTblArray[i]; - for ( TInt item = 0; convArray[item].iCommonAttribId; ++item ) - { - if ( convArray[item].iCommonAttribId == aAttribute ) - { - return convArray[item].iAttribId; - } - } - } - } - - return convAttr; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::CommonAttribute -// --------------------------------------------------------------------------- -/*TUint32 CCmPluginBaseEng::CommonAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::CommonAttribute" ); - - if ( iPriv->iCommonConvTblArray.Count() ) - { - for ( TInt i = 0; i < iPriv->iCommonConvTblArray.Count(); ++i ) - { - const TCmCommonAttrConvArrayItem* convArray = - iPriv->iCommonConvTblArray[i]; - for ( TInt item = 0; convArray[item].iCommonAttribId; ++item ) - { - if ( convArray[item].iAttribId == aAttribute ) - { - return convArray[item].iCommonAttribId; - } - } - } - } - - User::Leave( KErrArgument ); - - return 0; - }*/ - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::FeatureSupported -// --------------------------------------------------------------------------- -EXPORT_C TBool CCmPluginBaseEng::FeatureSupported( TInt aFeature ) - { -#ifdef _IPV6_DISABLED - if( aFeature == KFeatureIdIPv6 ) - { - return EFalse; - } -#endif - return CCmManagerImpl::FeatureSupported( aFeature ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::GlobalBearerPriority -// --------------------------------------------------------------------------- -EXPORT_C TInt - CCmPluginBaseEng::GlobalBearerPriority( const TDesC& aServiceType ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::GlobalBearerPriority" ); - - return iCmMgr.GlobalBearerPriority( EFalse, aServiceType ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::GlobalUiBearerPriority -// --------------------------------------------------------------------------- -EXPORT_C TInt - CCmPluginBaseEng::GlobalUiBearerPriority( const TDesC& aServiceType ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::GlobalUiBearerPriority" ); - - return iCmMgr.GlobalBearerPriority( ETrue, aServiceType ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::SetProxyServerNameL -// --------------------------------------------------------------------------- -TBool CCmPluginBaseEng::SetProxyServerNameL( const TDesC& aProxyServer ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::SetProxyServerNameL" ); - - iProxyRecord->iServerName.SetL( aProxyServer ); - if( !aProxyServer.Length() ) - { - iProxyRecord->iPortNumber = 0; - iProxyRecord->iUseProxyServer = EFalse; - } - else - { - iProxyRecord->iUseProxyServer = ETrue; - } - - return ETrue; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::ConvTableItemL -// --------------------------------------------------------------------------- -EXPORT_C const TCmAttribConvTable* - CCmPluginBaseEng::ConvTableItem( TUint32 aAttribute ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::ConvTableItem" ); - - TInt i; - TCmAttrConvArrayItem* foundItem = ConversionTable( aAttribute ); - - if( foundItem ) - { - // From 2nd item, because the first one is for the range. - for ( i = 1; foundItem->iConvTable[i].iAttribId; ++i ) - { - if ( foundItem->iConvTable[i].iAttribId == aAttribute ) - { - return &foundItem->iConvTable[i]; - } - } - } - else - { - // I know that this is a not nice solution, but - // I couldn't find any more inteligent way of adding - // ECmBearerSettingName to the array. - const TCmAttribConvTable* item = SUiTable; - - // This is a where use - for ( i = 0; item[i].iAttribId; ++i ) - { - if( item[i].iAttribId == aAttribute ) - { - return &item[i]; - } - } - } - - return NULL; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::ConversionTable -// --------------------------------------------------------------------------- -TCmAttrConvArrayItem* - CCmPluginBaseEng::ConversionTable( TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::ConversionTable" ); - - TCmAttrConvArrayItem* foundItem = NULL; - TInt i; - - for ( i = 0; i < iPriv->iConvTblArray->Count(); ++i ) - { - TCmAttrConvArrayItem* item = (*iPriv->iConvTblArray)[i]; - - if ( item->iConvTable[0].iAttribId <= aAttribute && - item->iConvTable[0].iCommsDatId >= aAttribute ) - { - foundItem = item; - break; - } - } - - return foundItem; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::FieldByAttributeL -// --------------------------------------------------------------------------- -CMDBElement& CCmPluginBaseEng::FieldByAttributeL( - const TCmAttrConvArrayItem* aItem, - const TUint32 aAttribute, - TInt& aIndex ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::FieldByAttributeL" ); - - // From 2nd item, because the first one is for the range. - for ( aIndex = 1; aItem->iConvTable[aIndex].iAttribId; ++aIndex ) - { - if ( aItem->iConvTable[aIndex].iAttribId == aAttribute ) - { - return *(*aItem->iRecord)->GetFieldByIdL( - aItem->iConvTable[aIndex].iCommsDatId ); - } - } - - User::Leave( KErrNotFound ); - // Dead code - return *(CMDBElement*)1; - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::SetDNSServerAddressL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::SetDNSServerAddressL( TUint32 aSrv1Attr, - const TDesC& aSrv1, - TUint32 aSrv2Attr, - const TDesC& aSrv2, - TUint32 aAddrFromSrvAttr, - TBool aIPv6 ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::SetDNSServerAddressL" ); - - TBool undef1; - TBool undef2; - TPtrC dynamic; - - if( aIPv6 ) - // IPv6 - { - undef1 = ClassifyIPv6Address( aSrv1 ) == EIPv6Unspecified; - undef2 = ClassifyIPv6Address( aSrv2 ) == EIPv6Unspecified; - - dynamic.Set( KDynamicIpv6Address ); - } - else - { - undef1 = IsUnspecifiedIPv4Address( aSrv1 ); - undef2 = IsUnspecifiedIPv4Address( aSrv2 ); - - dynamic.Set( KUnspecifiedIPv4 ); - } - - if( undef1 ) - { - SetStringAttributeL( aSrv1Attr, aSrv2 ); - SetStringAttributeL( aSrv2Attr, dynamic ); - - SetBoolAttributeL( aAddrFromSrvAttr, undef2 ); - } - else - { - SetStringAttributeL( aSrv1Attr, aSrv1 ); - SetStringAttributeL( aSrv2Attr, aSrv2 ); - - SetBoolAttributeL( aAddrFromSrvAttr, EFalse ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::CheckDNSServerAddressL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBaseEng::CheckDNSServerAddressL( TBool aIPv6, - CMDBField& aDNS1, - CMDBField& aDNS2, - CMDBField& /*aDNSFromServer*/ ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::CheckDNSServerAddressL" ); - - // aDNSFromServer is commented out because the API must not set this - // field any more. It is only set from the UI - if( !(aDNS1.ElementId() & KCDChangedFlag) && - !(aDNS2.ElementId() & KCDChangedFlag) ) - // No change - { - return; - } - - if( aIPv6 ) - { - if( ClassifyIPv6Address( aDNS1 ) == EIPv6Unspecified ) - { - if( ClassifyIPv6Address( aDNS2 ) != EIPv6Unspecified ) - { - aDNS1.SetL( aDNS2 ); - aDNS2.SetL( KDynamicIpv6Address ); - } - } - } - else // IPv4 - { - if( IsUnspecifiedIPv4Address( aDNS1 ) ) - { - if( !IsUnspecifiedIPv4Address( aDNS2 ) ) - { - aDNS1.SetL( aDNS2 ); - aDNS2.SetL( KUnspecifiedIPv4 ); - } - } - } - } - - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::CheckSpaceBelowCriticalLevelL -// --------------------------------------------------------------------------- -// -TBool CCmPluginBaseEng::CheckSpaceBelowCriticalLevelL() const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::CheckSpaceBelowCriticalLevelL" ); - - // OOD handling. If disk space is low user is notified. - RFs fs; - User::LeaveIfError( fs.Connect() ); - CleanupClosePushL( fs ); - - // Checks the FFS space "after" addition - TBool belowCL = SysUtil::FFSSpaceBelowCriticalLevelL - ( &fs, KEstimatedOverhead ); - - CleanupStack::PopAndDestroy(); // fs - - if( belowCL ) - { - // Raise a dialog to notify the user. - TCmCommonUi::ShowMemoryFullConfirmationQueryL(); - // It must leave because it is the only way to notify the caller about - // the operation failed. (Its caller does not return indicator.) - // KLeaveWithoutAlert means no more dialog will raise - User::Leave( KLeaveWithoutAlert ); - } - - // Return value keept to have a suitable API - return belowCL; - - } - -// ----------------------------------------------------------------------------- -// CCmPluginBaseEng::IncrementRefCounter -// ----------------------------------------------------------------------------- -void CCmPluginBaseEng::IncrementRefCounter() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::IncrementRefCounter" ); - - iRefCounter++; - } -// ----------------------------------------------------------------------------- -// CCmPluginBaseEng::DecrementRefCounter -// ----------------------------------------------------------------------------- -void CCmPluginBaseEng::DecrementRefCounter() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::DecrementRefCounter" ); - - iRefCounter--; - } -// ----------------------------------------------------------------------------- -// CCmPluginBaseEng::GetRefCounter -// ----------------------------------------------------------------------------- -TInt CCmPluginBaseEng::GetRefCounter() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::GetRefCounter" ); - - return iRefCounter; - } - -// ----------------------------------------------------------------------------- -// CCmPluginBaseEng::IdIsValid -// ----------------------------------------------------------------------------- -TBool CCmPluginBaseEng::IdIsValid() - { - LOGGER_ENTERFN( "CCmPluginBaseEng::IdIsValid" ); - - return iIdIsValid; - } - - -// ----------------------------------------------------------------------------- -// CCmPluginBaseEng::IdIsValid -// ----------------------------------------------------------------------------- -void CCmPluginBaseEng::SetIdValidity(TBool validity) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::SetIdValidity" ); - - iIdIsValid = validity; - } - - -// ----------------------------------------------------------------------------- -// CCmPluginBaseEng::GetRefCounter -// ----------------------------------------------------------------------------- -void CCmPluginBaseEng::GenericStringWriterL( const TUint32 aAttribute, - const TDesC16& aValue ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::GenericStringWriterL" ); - - TUint32 attribute = CheckForCommonAttribute( aAttribute ); - CMDBField* field; - - TValidationFunctionL func = - FindFieldL( attribute, ECmText, (CMDBElement*&)field ); - - if( func ) - { - func( this, attribute, (const TAny*)&aValue ); - } - - field->SetL( aValue ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBaseEng::MappedCommonAttribute -// --------------------------------------------------------------------------- -TUint32 - CCmPluginBaseEng::MappedCommonAttribute( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::MappedCommonAttribute" ); - - TUint32 convAttr( aAttribute ); - - if ( iPriv->iCommonConvTblArray.Count() ) - { - for ( TInt i = 0; i < iPriv->iCommonConvTblArray.Count(); ++i ) - { - const TCmCommonAttrConvArrayItem* convArray = - iPriv->iCommonConvTblArray[i]; - for ( TInt item = 0; convArray[item].iCommonAttribId; ++item ) - { - if ( convArray[item].iAttribId == aAttribute ) - { - return convArray[item].iCommonAttribId; - } - } - } - } - - return convAttr; - } -//----------------------------------------------------------------------------- -// CCmPluginBaseEng::ParentDestination -// ----------------------------------------------------------------------------- -EXPORT_C CCmDestinationImpl* CCmPluginBaseEng::ParentDestination() const - { - LOGGER_ENTERFN( "CCmPluginBaseEng::ParentDestination" ); - - if (iParentDest) - { - CCmDestinationImpl* parentDest = NULL; - TRAPD( err, parentDest = iCmMgr.DestinationL( iParentDest ) ); - if ( !err ) - { - return parentDest; - } - } - - return NULL; - } - -//----------------------------------------------------------------------------- -// CCmPluginBaseEng::GetAdditionalUids -// ----------------------------------------------------------------------------- -EXPORT_C void CCmPluginBaseEng::GetAdditionalUids( RArray& /*aIapIds*/ ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::GetAdditionalUids" ); - } - -//----------------------------------------------------------------------------- -// CCmPluginBaseEng::SetPreDefinedId -// ----------------------------------------------------------------------------- -EXPORT_C void CCmPluginBaseEng::SetPreDefinedId( const TUint32 aPreDefId ) - { - LOGGER_ENTERFN( "CCmPluginBaseEng::SetPreDefinedId" ); - - iPreDefIapId = aPreDefId; - } - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmapplicationsettingsui.cpp --- a/cmmanager/cmmgr/Framework/Src/cmapplicationsettingsui.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Application Setting UI -* -*/ - -#include "cmapplicationsettingsui.h" -#include -#include "cmconnsettingsuiimpl.h" -#include "cmmanager.hrh" - -using namespace CMManager; -//----------------------------------------------------------------------------- -// CCmApplicationSettingsUi::NewL() -//----------------------------------------------------------------------------- -// -EXPORT_C CCmApplicationSettingsUi* CCmApplicationSettingsUi::NewL() - { - CCmApplicationSettingsUi* self = new (ELeave) CCmApplicationSettingsUi(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); // self - return self; - } - -//----------------------------------------------------------------------------- -// CCmApplicationSettingsUi::NewLC() -//----------------------------------------------------------------------------- -// -EXPORT_C CCmApplicationSettingsUi* CCmApplicationSettingsUi::NewLC() - { - CCmApplicationSettingsUi* self = new (ELeave) CCmApplicationSettingsUi(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -//----------------------------------------------------------------------------- -// CCmApplicationSettingsUi::CCmApplicationSettingsUi() -//----------------------------------------------------------------------------- -// -CCmApplicationSettingsUi::CCmApplicationSettingsUi() - { - } - -//----------------------------------------------------------------------------- -// CCmApplicationSettingsUi::~CCmApplicationSettingsUi() -//----------------------------------------------------------------------------- -// -EXPORT_C CCmApplicationSettingsUi::~CCmApplicationSettingsUi() - { - delete iImpl; - } - -//----------------------------------------------------------------------------- -// CCmApplicationSettingsUi::ConstructL() -//----------------------------------------------------------------------------- -// -void CCmApplicationSettingsUi::ConstructL() - { - iImpl = CCmConnSettingsUiImpl::NewWithoutTablesL(); - } - -//----------------------------------------------------------------------------- -// CCmApplicationSettingsUi::RunSettingsL() -//----------------------------------------------------------------------------- -// -EXPORT_C TBool CCmApplicationSettingsUi::RunApplicationSettingsL( - TCmSettingSelection& aSelection ) - { - TBearerFilterArray aFilterArray; - return iImpl->RunApplicationSettingsL( aSelection, - EShowDefaultConnection | - EShowDestinations | - EShowConnectionMethods, - aFilterArray ); - } - -//----------------------------------------------------------------------------- -// CCmApplicationSettingsUi::RunSettingsL() -//----------------------------------------------------------------------------- -// -EXPORT_C TBool CCmApplicationSettingsUi::RunApplicationSettingsL( - TCmSettingSelection& aSelection, - TUint aListItems, - TBearerFilterArray& aFilterArray) - { - return iImpl->RunApplicationSettingsL( aSelection, - aListItems, - aFilterArray ); - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmapplicationsettingsuiimpl.cpp --- a/cmmanager/cmmgr/Framework/Src/cmapplicationsettingsuiimpl.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of application setting UI. -* -*/ - -#include -#include -#include -#include - -#include "cmapplicationsettingsui.h" -#include -#include "cmmanagerimpl.h" -#include -#include "cmapplicationsettingsuiimpl.h" - -using namespace CMManager; - -typedef struct - { - TInt iCmIapId; - TInt iCmDefaultPriority; - }TCmListItem; - -//--------------------------------------------------------------------------- -// CCmApplicationSettingsUiImpl::NewL -//--------------------------------------------------------------------------- -// -EXPORT_C CCmApplicationSettingsUiImpl* CCmApplicationSettingsUiImpl::NewL() - { - return NULL; - } - - -//--------------------------------------------------------------------------- -// CCmApplicationSettingsUiImpl::RunSettingsL() -//--------------------------------------------------------------------------- -// -EXPORT_C TBool CCmApplicationSettingsUiImpl::RunApplicationSettingsL( - TCmSettingSelection& /*aSelection*/ ) - { - return EFalse; - } - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmcommonui.cpp --- a/cmmanager/cmmgr/Framework/Src/cmcommonui.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,687 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Defines common UI methods. -* -*/ - -#include // CAknDoubleLargeGraphicPopupMenuStyleListBox -#include // CAknPopupList -#include -#include -#include // CDesCArray -#include -#include -#include // CEikFormattedCellListBox -#include // ELbmDoesNotOwnItemArray -#include -#include -#include - -#include -#include -#include "cmlogger.h" -#include "cmmanagerimpl.h" -#include "cmmanager.hrh" -#include - -using namespace CMManager; - -const TInt KDefaultListBoxFlags = 0; - - -// --------------------------------------------------------------------------- -// TCmCommonUi::CCmDesCArray::CCmDesCArray -// --------------------------------------------------------------------------- -// -TCmCommonUi::CCmDesCArray::CCmDesCArray() - : CDesCArrayFlat( KCmArraySmallGranularity ) - , iUids( KCmArraySmallGranularity ) - { - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::CCmDesCArray::~CCmDesCArray -// --------------------------------------------------------------------------- -// -TCmCommonUi::CCmDesCArray::~CCmDesCArray() - { - iUids.Close(); - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::CCmDesCArray::AppendL -// --------------------------------------------------------------------------- -// -void TCmCommonUi::CCmDesCArray::AppendL( TUint aUid, const TDesC& aItem ) - { - iUids.AppendL( aUid ); - CDesCArray::AppendL( aItem ); - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::CCmDesCArray::Uid -// --------------------------------------------------------------------------- -// -TUint TCmCommonUi::CCmDesCArray::Uid( TInt aIndex ) const - { - return iUids[ aIndex ]; - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::ShowConfirmationQueryWithInputL -// --------------------------------------------------------------------------- -// -EXPORT_C TInt TCmCommonUi::ShowConfirmationQueryWithInputL( TInt aResId, - TDes& aInput ) - { - CLOG_ENTERFN_PTR( "ShowConfirmationQueryWithInputL" ); - HBufC* prompt = CEikonEnv::Static()->AllocReadResourceAsDes16LC( aResId ); - - CAknTextQueryDialog* dlg = - CAknTextQueryDialog::NewL( aInput, CAknQueryDialog::ENoTone ); - - // Handle the allowable enterable length of the text - CLOG_WRITE_1_PTR( NULL, "max length input: [%d ]", aInput.MaxLength() ); - dlg->SetMaxLength( aInput.MaxLength() ); - - TInt retval = dlg->ExecuteLD( R_TEXT_QUERY, *prompt ); - - CleanupStack::PopAndDestroy( prompt ); - - return retval; - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::ShowConfirmationQueryL -// --------------------------------------------------------------------------- -// -EXPORT_C TInt TCmCommonUi::ShowConfirmationQueryL( TInt aResId ) - { - CLOG_ENTERFN_PTR( "ShowConfirmationQueryL" ); - HBufC* prompt = CEikonEnv::Static()->AllocReadResourceL( aResId ); - - // Ownership (of 'prompt') is handed over to callee. That's why we don't - // bother with cleanup stack either - let it be the callee's problem. - return ShowConfirmationQueryL( prompt ); - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::ShowConfirmationQueryL -// --------------------------------------------------------------------------- -// -EXPORT_C TInt TCmCommonUi::ShowConfirmationQueryL( TInt aResId, - const TDesC& aString ) - { - CLOG_ENTERFN_PTR( "ShowConfirmationQueryL" ); - HBufC* prompt = StringLoader::LoadL( aResId, aString ); - - // Ownership (of 'prompt') is handed over to callee. - return ShowConfirmationQueryL( prompt ); - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::ShowAvailableMethodsL -// --------------------------------------------------------------------------- -// -TUint32 TCmCommonUi::ShowAvailableMethodsL( - const RArray& aAvailableBearers, - const CCmManagerImpl& aCmManager ) - { - CLOG_ENTERFN_PTR( "ShowAvailableMethodsL" ); - - TUint32 retval = 0; - - // Create listbox and popup list and perform some initialization on them. - CEikFormattedCellListBox* listBox = - new (ELeave) CAknDoubleLargeGraphicPopupMenuStyleListBox(); - CleanupStack::PushL( listBox ); - - CAknPopupList* popupList = - CAknPopupList::NewL( listBox, - R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, - AknPopupLayouts::EMenuDoubleLargeGraphicWindow ); - CleanupStack::PushL( popupList ); - - listBox->ConstructL( popupList, KDefaultListBoxFlags ); - listBox->CreateScrollBarFrameL( ETrue ); - listBox->ScrollBarFrame()->SetScrollBarVisibilityL( - CEikScrollBarFrame::EOff, - CEikScrollBarFrame::EAuto ); - - // Create the icon and item text arrays. - CArrayPtr* icons = - new(ELeave) CArrayPtrFlat( KCmArraySmallGranularity ); - CleanupStack::PushL( icons ); - - CCmDesCArray* itemArray = new (ELeave) CCmDesCArray(); - listBox->Model()->SetItemTextArray( itemArray ); - // just to be on the safe side: next line is not mandatory, but advisable - listBox->Model()->SetOwnershipType( ELbmOwnsItemArray ); - - // Note: we don't have to put 'itemArray' on to the cleanup stack, as the - // model has already taken this object over. - - // Fill up the arrays - for ( TInt i = 0; i < aAvailableBearers.Count(); i++ ) - { - TUint32 bearerUid = aAvailableBearers[i]; - - // Add icons to the icon array - CGulIcon* icon = (CGulIcon*)(aCmManager.GetBearerInfoIntL( - bearerUid, - ECmBearerAvailableIcon ) ); - - if( !icon ) - { - continue; - } - - CleanupStack::PushL( icon ); - icons->AppendL( icon ); - CleanupStack::Pop( icon ); // icon array took over ownership - - // Add item text to the array. - // Query the name of the bearer first. - HBufC* firstLine = aCmManager.GetBearerInfoStringL( - bearerUid, - ECmBearerAvailableName ); - CleanupStack::PushL( firstLine ); - - // Query the availability string of the bearer second. - HBufC* secondLine = aCmManager.GetBearerInfoStringL( - bearerUid, - ECmBearerAvailableText ); - CleanupStack::PushL( secondLine ); - - // Third, combine these two strings along with an icon index. - HBufC* listBoxLine = FormattedTextForListBoxLC( i, - *firstLine, - *secondLine ); - - // Finally add the resulting string to the item array. - itemArray->AppendL( bearerUid, *listBoxLine ); - - CLOG_WRITE_1_PTR( NULL, - "ShowAvailableMethodsL new listbox item: [%S]", - listBoxLine ); - - // Clean-up: firstLine, secondLine, listBoxLine. - CleanupStack::PopAndDestroy( 3, firstLine ); - } - - // Handing over the ownership of the icon array to the listbox - listBox->ItemDrawer()->FormattedCellData()->SetIconArrayL( icons ); - - CleanupStack::Pop( icons ); // ownership already handed over - - // Set title - HBufC* title = StringLoader::LoadLC( R_CMWIZARD_AVAILABLE_METHODS ); - popupList->SetTitleL( *title ); - CleanupStack::PopAndDestroy( title ); - - if ( popupList->ExecuteLD() ) - { - retval = itemArray->Uid( listBox->CurrentItemIndex() ); - } - - CleanupStack::Pop( popupList ); // ExecuteLD has already destroyed it - CleanupStack::PopAndDestroy( listBox ); - - CLOG_WRITE_1_PTR( NULL, "ShowAvailableMethodsL exit, retval: [%d]", retval ); - - return retval; - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::SelectBearerL -// --------------------------------------------------------------------------- -// -TUint32 TCmCommonUi::SelectBearerL( const CCmManagerImpl& aCmManager ) - { - CLOG_ENTERFN_PTR( "SelectBearerL" ); - TUint32 retval = 0; - - CEikFormattedCellListBox* listBox = - new (ELeave) CAknSingleGraphicPopupMenuStyleListBox(); - CleanupStack::PushL( listBox ); - - CAknPopupList* popupList = - CAknPopupList::NewL( listBox, - R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, - AknPopupLayouts::EMenuGraphicWindow ); - CleanupStack::PushL( popupList ); - - listBox->ConstructL( popupList, KDefaultListBoxFlags ); - listBox->CreateScrollBarFrameL( ETrue ); - listBox->ScrollBarFrame()->SetScrollBarVisibilityL( - CEikScrollBarFrame::EOff, - CEikScrollBarFrame::EAuto ); - - RArray bearers( KCmArrayMediumGranularity ); - CleanupClosePushL( bearers ); - aCmManager.SupportedBearersL( bearers ); - - TInt i; - - for ( i = 0; i < bearers.Count(); ++i ) - { - if( !aCmManager.GetBearerInfoBoolL( bearers[i], - ECmBearerHasUi ) ) - { - bearers.Remove( i ); - --i; - } - - } - - CArrayPtr* icons = - new(ELeave) CArrayPtrFlat( KCmArrayMediumGranularity ); - CleanupStack::PushL( icons ); - - // Note: it's interesting that we, in fact, set up an *ordered* list of - // icons. Ordering of the icon array is based on the order of supported - // bearers. - for ( i = 0; i < bearers.Count(); ++i ) - { - CGulIcon* icon = (CGulIcon*)(aCmManager.GetBearerInfoIntL( - bearers[i], - ECmBearerIcon ) ); - - if( !icon ) - { - bearers.Remove( i ); - --i; - continue; - } - - CleanupStack::PushL( icon ); - - icons->AppendL( icon ); - - CleanupStack::Pop( icon ); // icon array took over ownership - } - - // Handing over the ownership of the icon array to the listbox - listBox->ItemDrawer()->FormattedCellData()->SetIconArrayL( icons ); - - CleanupStack::Pop( icons ); // ownership already handed over - - CCmDesCArray* itemArray = new (ELeave) CCmDesCArray(); - listBox->Model()->SetItemTextArray( itemArray ); - // just to be on the safe side: next line is not mandatory, but advisable - listBox->Model()->SetOwnershipType( ELbmOwnsItemArray ); - - // Note: we don't have to put 'itemArray' on to the cleanup stack, as the - // model has already taken this object over. - - for ( TInt i = 0; i < bearers.Count(); i++ ) - { - // Here we take advantage of the fact that our icon array is ordered. - // That is, the indices of the icons in the array will always be - // in sync with those in the item text array (i.e. each bearer will - // have the right icon associated with it). - HBufC* bearerName = aCmManager.GetBearerInfoStringL( bearers[i], - ECmBearerSupportedName ); - CleanupStack::PushL( bearerName ); - - HBufC* lineText = FormattedTextForListBoxLC( i, *bearerName ); - - itemArray->AppendL( bearers[i], *lineText ); - - CLOG_WRITE_1_PTR( NULL, "SelectBearerL new listbox item: [%S]", - lineText ); - - CleanupStack::PopAndDestroy( 2, bearerName ); // lineText, bearerName - } - - CleanupStack::PopAndDestroy( &bearers ); - - // Set title - HBufC* title = StringLoader::LoadLC( R_CMWIZARD_SELECT_CONN_METHOD ); - popupList->SetTitleL( *title ); - CleanupStack::PopAndDestroy( title ); - - if ( popupList->ExecuteLD() ) - { - retval = itemArray->Uid( listBox->CurrentItemIndex() ); - } - - CleanupStack::Pop( popupList ); // ExecuteLD has already destroyed it - CleanupStack::PopAndDestroy( listBox ); - - CLOG_WRITE_1_PTR( NULL, "SelectBearerL exit, retval: [%d]", retval ); - - return retval; - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::ShowConfirmationQueryL -// --------------------------------------------------------------------------- -// -TInt TCmCommonUi::ShowConfirmationQueryL( HBufC* aPrompt ) - { - CLOG_ENTERFN_PTR( "ShowConfirmationQueryL" ); - - CleanupStack::PushL( aPrompt ); - - CAknQueryDialog* dlg = - CAknQueryDialog::NewL( CAknQueryDialog::EConfirmationTone ); - TInt retval = dlg->ExecuteLD( R_CONFIRMATION_QUERY, *aPrompt ); - - CleanupStack::PopAndDestroy( aPrompt ); - - return retval; - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::ShowMemoryFullConfirmationQueryL -// --------------------------------------------------------------------------- -// -TInt TCmCommonUi::ShowMemoryFullConfirmationQueryL() - { - CLOG_ENTERFN_PTR( "ShowMemoryFullConfirmationQueryL" ); - - // need to check if EikonEnv exists in this context - CEikonEnv* eikPtr = CEikonEnv::Static(); - TInt retval( KErrNone ); - if( eikPtr ) - { - HBufC* prompt = eikPtr->AllocReadResourceL( R_QTN_MEMLO_MEMORY_FULL ); - CleanupStack::PushL( prompt ); - CAknQueryDialog* dlg = - CAknQueryDialog::NewL( CAknQueryDialog::EConfirmationTone ); - retval = dlg->ExecuteLD( R_MEMORY_FULL_CONFIRMATION_QUERY, *prompt ); - CleanupStack::PopAndDestroy( prompt ); - } - - return retval; - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::ShowNoteL -// --------------------------------------------------------------------------- -// -EXPORT_C TInt TCmCommonUi::ShowNoteL( TInt aResId, TCmNoteType aNoteType ) - { - CLOG_ENTERFN_PTR( "ShowNoteL" ); - HBufC* prompt = CEikonEnv::Static()->AllocReadResourceLC( aResId ); - - TInt result = ShowNoteL( *prompt, aNoteType ); - - CleanupStack::PopAndDestroy( prompt ); - - return result; - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::ShowNoteL -// --------------------------------------------------------------------------- -// -EXPORT_C TInt TCmCommonUi::ShowNoteL( TInt aResId, const TDesC& aString, - TCmNoteType aNoteType ) - { - CLOG_ENTERFN_PTR( "ShowNoteL" ); - HBufC* prompt = StringLoader::LoadLC( aResId, aString ); - - TInt result = ShowNoteL( *prompt, aNoteType ); - - CleanupStack::PopAndDestroy( prompt ); - - return result; - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::ShowNoteL -// --------------------------------------------------------------------------- -// -EXPORT_C TInt TCmCommonUi::ShowNoteL( const TDesC& aPrompt, TCmNoteType aNoteType ) - { - CLOG_ENTERFN_PTR( "ShowNoteL" ); - - CAknNoteDialog* dlg = new (ELeave) CAknNoteDialog( - CAknNoteDialog::ENoTone, - CAknNoteDialog::ELongTimeout ); - - TInt resId; - switch ( aNoteType ) - { - case ECmOkNote: - { - resId = R_OK_NOTE; - break; - } - case ECmWarningNote: - { - resId = R_WARNING_NOTE; - break; - } - case ECmErrorNote: - { - resId = R_ERROR_NOTE; - break; - } - default: - { - resId = R_INFO_NOTE; - } - } - - // no need to worry about LC (PrepareLC), RunLD takes care of it - dlg->PrepareLC( resId ); - dlg->SetTextL( aPrompt ); - - return dlg->RunLD(); - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::FormattedTextForListBoxLC -// --------------------------------------------------------------------------- -// -HBufC* TCmCommonUi::FormattedTextForListBoxLC( TInt aIconIndex, - const TDesC& aLineText ) - { - HBufC* formattedString = - HBufC::NewL( KNumberOfStaticCharsIn1LineFormattedString + - aLineText.Length() ); - - TPtr des = formattedString->Des(); - des.AppendFormat( KSingleNumberAsString, aIconIndex ); - des.Append( TChar( KSettingsListBoxItemPrefix ) ); - des.Append( aLineText ); - - CleanupStack::PushL( formattedString ); - - return formattedString; - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::FormattedTextForListBoxLC -// --------------------------------------------------------------------------- -// -HBufC* TCmCommonUi::FormattedTextForListBoxLC( TInt aIconIndex, - const TDesC& aFirstLine, - const TDesC& aSecondLine ) - { - HBufC* formattedString = - HBufC::NewL( KNumberOfStaticCharsIn2LineFormattedString + - aFirstLine.Length() + - aSecondLine.Length() ); - - TPtr des = formattedString->Des(); - des.AppendFormat( KSingleNumberAsString, aIconIndex ); - des.Append( TChar( KSettingsListBoxItemPrefix ) ); - des.Append( aFirstLine ); - des.Append( TChar( KSettingsListBoxItemPrefix ) ); - des.Append( aSecondLine ); - - CleanupStack::PushL( formattedString ); - - return formattedString; - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::FormattedTextForListBoxLC -// --------------------------------------------------------------------------- -// -HBufC* TCmCommonUi::FormattedTextForListBoxLC( TInt aIconIndex, - TInt aFirstLineResId, - TInt aSecondLineResId ) - { - HBufC* secondLine = StringLoader::LoadLC( aSecondLineResId ); - - HBufC* formattedString = FormattedTextForListBoxL( aIconIndex, - aFirstLineResId, - *secondLine ); - - CleanupStack::PopAndDestroy( secondLine ); - - CleanupStack::PushL( formattedString ); - - return formattedString; - } - - -// --------------------------------------------------------------------------- -// TCmCommonUi::FormattedTextForListBoxLC -// --------------------------------------------------------------------------- -// -HBufC* TCmCommonUi::FormattedTextForListBoxLC( TInt aIconIndex, - TInt aFirstLineResId, - TInt aSecondLineResId, - TInt aReplacementInSecondLine ) - { - HBufC* secondLine = StringLoader::LoadLC( aSecondLineResId, - aReplacementInSecondLine ); - - HBufC* formattedString = FormattedTextForListBoxL( aIconIndex, - aFirstLineResId, - *secondLine ); - - CleanupStack::PopAndDestroy( secondLine ); - - CleanupStack::PushL( formattedString ); - - return formattedString; - } - - -// --------------------------------------------------------------------------- -// TCmCommonUi::FormattedTextForListBoxL -// --------------------------------------------------------------------------- -// -HBufC* TCmCommonUi::FormattedTextForListBoxL( TInt aIconIndex, - TInt aFirstLineResId, - const TDesC& aSecondLine ) - { - HBufC* firstLine = StringLoader::LoadLC( aFirstLineResId ); - - HBufC* formattedString = - HBufC::NewL( KNumberOfStaticCharsIn2LineFormattedString + - firstLine->Length() + - aSecondLine.Length() ); - - TPtr des = formattedString->Des(); - des.AppendFormat( KSingleNumberAsString, aIconIndex ); - des.Append( TChar( KSettingsListBoxItemPrefix ) ); - des.Append( *firstLine ); - des.Append( TChar( KSettingsListBoxItemPrefix ) ); - des.Append( aSecondLine ); - - CleanupStack::PopAndDestroy( firstLine ); - - return formattedString; - } - - -// -------------------------------------------------------------------------- -// TCmCommonUi::ShowPopupListL -// -------------------------------------------------------------------------- -// -EXPORT_C TBool TCmCommonUi::ShowPopupListL( const TDesC& aTitle, - CDesCArrayFlat* aTextItems, - CArrayPtr* aIconArray, - const TUint aSoftKeys, - TInt& aSelection ) - { - TBool retVal ( EFalse ); - - // Prepare the dialog - CEikFormattedCellListBox* list = NULL; - if ( aIconArray ) - { - list = new ( ELeave ) CAknSingleGraphicPopupMenuStyleListBox; - } - else - { - list = new ( ELeave ) CAknSinglePopupMenuStyleListBox; - } - - CleanupStack::PushL( list ); - - CAknPopupList* popupList = CAknPopupList::NewL( - list, aSoftKeys, - AknPopupLayouts::EMenuWindow ); - CleanupStack::PushL( popupList ); - - // initialise listbox. - list->ConstructL( popupList, CEikListBox::ELeftDownInViewRect ); - list->CreateScrollBarFrameL( ETrue ); - list->ScrollBarFrame()->SetScrollBarVisibilityL( - CEikScrollBarFrame::EOff, - CEikScrollBarFrame::EAuto ); - - // Handing over the ownership of the icon array to the listbox - if ( aIconArray ) - { - list->ItemDrawer()->FormattedCellData()->SetIconArrayL( aIconArray ); - } - - // Items - list->Model()->SetItemTextArray( aTextItems ); - - // Title - popupList->SetTitleL( aTitle ); - - // Show the dialog - if ( popupList->ExecuteLD() ) - { - aSelection = list->CurrentItemIndex(); - retVal = ETrue; - } - - CleanupStack::Pop( popupList ); - CleanupStack::PopAndDestroy( list ); - - return retVal; - } - -// --------------------------------------------------------------------------- -// TCmCommonUi::ShowAlwaysAskNoteL -// --------------------------------------------------------------------------- -// -TBool TCmCommonUi::ShowAlwaysAskNoteL( TCmDefConnValue aOldDefConn, - CCmManagerImpl& aCmManagerImpl ) - { - TCmDefConnValue newConn; - aCmManagerImpl.ReadDefConnL( newConn ); - if ( newConn != aOldDefConn ) - { - ShowNoteL( R_CMMANAGERUI_CONF_DEFAULT_ALWAYS_ASK, - TCmCommonUi::ECmOkNote ); - return ETrue; - } - return EFalse; - } - - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmcommsdatnotifier.cpp --- a/cmmanager/cmmgr/Framework/Src/cmcommsdatnotifier.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ -/* -* Copyright (c) 2009- Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Listens for changes in one CommsDat table through CenRep. -* -*/ - -#include -#include -#include - -#include "cmcommsdatnotifier.h" -#include "cmmanagerimpl.h" - -// Repository for CommsDat -const TUid KCDCommsRepositoryId = { 0xCCCCCC00 }; - -CCmCommsDatNotifier* CCmCommsDatNotifier::NewL( TUint32 aTableId ) - { - CCmCommsDatNotifier* self = CCmCommsDatNotifier::NewLC( aTableId ); - CleanupStack::Pop( self ); - return self; - } - -CCmCommsDatNotifier* CCmCommsDatNotifier::NewLC( TUint32 aTableId ) - { - CCmCommsDatNotifier* self = new( ELeave ) CCmCommsDatNotifier( aTableId ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -CCmCommsDatNotifier::~CCmCommsDatNotifier() - { - // Cancel outstanding request, if exists - if( iWatcher ) - { - Cancel(); - } - delete iRepository; - - DeleteCallBackArray(); - - iWatcher = NULL; - } - -void CCmCommsDatNotifier::DeleteCallBackArray() - { - TInt count = iCallBackArray->Count(); - TInt index( 0 ); - while( count > 0 ) - { - iCallBackArray->Delete( index ); - iCallBackArray->Compress(); - - count = iCallBackArray->Count(); - } - - delete iCallBackArray; - iCallBackArray = NULL; - } - -CCmCommsDatNotifier::CCmCommsDatNotifier( TUint32 aTableId ) - : - CActive( EPriorityStandard ), - iTableId( aTableId ), - iWatcher( NULL ) - { - iRepository = NULL; - } - -void CCmCommsDatNotifier::ConstructL() - { - iCallBackArray = new (ELeave) CCmCallBackArray( KCmArrayBigGranularity ); - - iRepository = CRepository::NewL( KCDCommsRepositoryId ); - CActiveScheduler::Add( this ); - } - -void CCmCommsDatNotifier::WatcherRegisterL( MCmCommsDatWatcher* aWatcher ) - { - if( !aWatcher ) - { - return; - } - - if( !iWatcher ) - { - TInt err( RequestNotifications() ); - User::LeaveIfError( err ); - } - - iCallBackArray->AppendL( aWatcher ); - - iWatcher = aWatcher; - } - -void CCmCommsDatNotifier::WatcherUnRegister( ) - { - TInt index = iCallBackArray->Count(); - index --; - - if (index >= 0) - { - iCallBackArray->Delete( index ); - iCallBackArray->Compress(); - } - - index = iCallBackArray->Count(); - index --; - if (index >= 0) - { - iWatcher = (*iCallBackArray)[index]; - } - else - { - iWatcher = NULL; - } - - if( !iWatcher ) - { - Cancel(); - } - } - -TInt CCmCommsDatNotifier::RequestNotifications() - { - TInt err = iRepository->NotifyRequest( iTableId, KCDMaskShowRecordType, iStatus ); - - if ( KErrNone == err ) - { - SetActive(); - } - - return err; - } - -void CCmCommsDatNotifier::DoCancel() - { - iRepository->NotifyCancel( iTableId, KCDMaskShowRecordType ); - } - -void CCmCommsDatNotifier::RunL() - { - if ( iStatus.Int() < KErrNone ) - { - return; - } - - if ( iWatcher ) - { - iWatcher->CommsDatChangesL(); - - RequestNotifications(); - } - } - -// End-of-file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmconnectionmethod.cpp --- a/cmmanager/cmmgr/Framework/Src/cmconnectionmethod.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,433 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of RCmConnectionMethod -* -*/ - -// INCLUDES -#include "cmmanagerimpl.h" -#include -#include -#include -#include -#include "cmdestinationimpl.h" - -using namespace CMManager; -// ======== MEMBER FUNCTIONS ======== - - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::RCmConnectionMethod() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethod::RCmConnectionMethod( - const RCmConnectionMethod& aItem) - : iImplementation( aItem.iImplementation ) - { - iImplementation->IncrementRefCounter(); - } - - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::Close() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmConnectionMethod::Close() - { - if( !iImplementation ) - { - return; - } - - TRAP_IGNORE( iImplementation->CmMgr().RemoveCMFromPoolL(iImplementation) ); - iImplementation = NULL; - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::~RCmConnectionMethod() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethod::~RCmConnectionMethod() - { - Close(); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::GetIntAttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint32 - RCmConnectionMethod::GetIntAttributeL( TUint32 aAttribute ) const - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - return iImplementation->GetIntAttributeL( aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::GetBoolAttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool - RCmConnectionMethod::GetBoolAttributeL( TUint32 aAttribute ) const - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - return iImplementation->GetBoolAttributeL( aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::GetStringAttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC* - RCmConnectionMethod::GetStringAttributeL( TUint32 aAttribute ) const - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - return iImplementation->GetStringAttributeL( aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::GetString8AttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC8* RCmConnectionMethod::GetString8AttributeL( TUint32 aAttribute ) const - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - return iImplementation->GetString8AttributeL( aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::SetIntAttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmConnectionMethod::SetIntAttributeL( TUint32 aAttribute, - TUint32 aValue ) - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - if( iImplementation->GetBoolAttributeL( ECmProtected ) ) - { - // Only clients with NetworkControl capability can modify - // protection setting! - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - iImplementation->SetIntAttributeL( aAttribute, aValue ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::SetBoolAttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmConnectionMethod::SetBoolAttributeL( TUint32 aAttribute, - TBool aValue ) - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - if( iImplementation->GetBoolAttributeL( ECmProtected ) ) - { - // Only clients with NetworkControl capability can modify - // protection setting! - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - iImplementation->SetBoolAttributeL( aAttribute, aValue ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::SetStringAttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmConnectionMethod::SetStringAttributeL( TUint32 aAttribute, - const TDesC16& aValue ) - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - if( iImplementation->GetBoolAttributeL( ECmProtected ) ) - { - // Only clients with NetworkControl capability can modify - // protection setting! - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - iImplementation->SetStringAttributeL( aAttribute, aValue ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::SetString8AttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmConnectionMethod::SetString8AttributeL( TUint32 aAttribute, - const TDesC8& aValue ) - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - if( iImplementation->GetBoolAttributeL( ECmProtected ) ) - { - // Only clients with NetworkControl capability can modify - // protection setting! - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - iImplementation->SetString8AttributeL( aAttribute, aValue ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::UpdateL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmConnectionMethod::UpdateL() - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - iImplementation->UpdateL(); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::DeleteL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmConnectionMethod::DeleteL() - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - if( iImplementation->GetBoolAttributeL( ECmProtected ) ) - { - // Only clients with NetworkControl capability can delete - // this destination - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - // Check it's not connected - if ( iImplementation->GetBoolAttributeL( ECmConnected ) ) - { - User::Leave( KErrInUse ); - } - - // Check it's not referenced by Virtual CM - if( iImplementation->GetBoolAttributeL( ECmIsLinked ) ) - { - User::Leave( KErrLocked ); - } - - // Check that it's not the last CM in a destination which is - // referenced by Virtual CM - CCmDestinationImpl* destImpl = iImplementation->ParentDestination(); - TUint32 destId ( 0 ); - TUint32 count( 0 ); - - if ( destImpl ) - { - destId = destImpl->Id(); - count = destImpl->ConnectionMethodCount(); - } - delete destImpl; - destImpl = NULL; - - if ( count == 1 ) - { - // The IAP is in destination and it's the last one - // for each IAP in CM manager - // 1. check if it is virtual - // if not => goto 1. - // if yes: - // 2. check if it links to the destination of this CM - // if yes => carryOn = EFalse, ERROR - // if not: carryOn = ETrue - TBool carryOn = ETrue; - - CommsDat::CMDBRecordSet* iaps = iImplementation->CmMgr().AllIapsL(); - CleanupStack::PushL( iaps ); - - // for each IAP in CM manager - for ( TInt i = KCmInitIndex; carryOn && i < iaps->iRecords.Count(); ++i ) - { - CommsDat::CCDIAPRecord* rec = (*iaps)[i]; - TUint32 bearerType = 0; - - TRAP_IGNORE( bearerType = iImplementation->CmMgr().BearerTypeFromIapRecordL( rec ) ); - if ( !bearerType ) - { - continue; - } - - // check if it is virtual - if ( iImplementation->CmMgr().GetBearerInfoBoolL( bearerType, ECmVirtual ) ) - { - // check if it links to the current destination - CCmPluginBase* plugin = NULL; - TRAP_IGNORE( plugin = iImplementation->CmMgr().GetConnectionMethodL( rec->RecordId() ) ); - - if ( !plugin ) - { - continue; - } - - if ( plugin->IsLinkedToSnap( destId ) ) - { - // the CM links to this destination, deletion not allowed - carryOn = EFalse; - } - - delete plugin; - } - } - - CleanupStack::PopAndDestroy( iaps ); - - if ( !carryOn ) - { - User::Leave( KErrLocked ); - } - } - - // ETrue = delete it. It doesn't matter how many referencies there are. - TBool deleteRes = iImplementation->DeleteL( ETrue ); - if( deleteRes ) - { - CCmDestinationImpl* dest = iImplementation->ParentDestination(); - if( dest ) - { - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(iImplementation); - CleanupStack::PushL( connMethod ); - dest->ConnectionMethodDeletedL( *connMethod ); - CleanupStack::PopAndDestroy(connMethod);//deletes iImplementation - iImplementation = NULL; - } - delete dest; - } - - return deleteRes; - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::Destination() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmDestination RCmConnectionMethod::DestinationL() const - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - if (!iImplementation->Destination()) - { - User::Leave(KErrNotSupported); - } - - RCmDestination dest; - dest.iDestinatonData = - iImplementation->Destination()->GetData(); - dest.iDestinatonData->IncrementRefCounter(); - return dest; - } -// -------------------------------------------------------------------------- -// RCmConnectionMethod::RCmConnectionMethod -// -------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethod::RCmConnectionMethod() - : iImplementation( NULL ) - { - } - - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::operator=() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethod& RCmConnectionMethod::operator=( - const RCmConnectionMethod& aConnMethod) - { - if (this != &aConnMethod) - { - Close(); - iImplementation = aConnMethod.iImplementation; - iImplementation->IncrementRefCounter(); - } - return *this; - } - -// -------------------------------------------------------------------------- -// RCmConnectionMethod::operator== -// -------------------------------------------------------------------------- -// -EXPORT_C TBool RCmConnectionMethod::operator==( - RCmConnectionMethod& aConnMethod ) const - { - return ( iImplementation == aConnMethod.iImplementation ); - }; - - -// -------------------------------------------------------------------------- -// RCmConnectionMethod::operator!= -// -------------------------------------------------------------------------- -// -EXPORT_C TBool RCmConnectionMethod::operator!=( - RCmConnectionMethod& aConnMethod ) const - { - return !( iImplementation == aConnMethod.iImplementation ); - }; - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::CreateCopyL() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethod RCmConnectionMethod::CreateCopyL() - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - RCmConnectionMethod cm; - - cm.iImplementation = iImplementation->CreateCopyL(); - cm.iImplementation->CmMgr().InsertConnectionMethodL(cm.iImplementation); - - return cm; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmconnectionmethodext.cpp --- a/cmmanager/cmmgr/Framework/Src/cmconnectionmethodext.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,438 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of RCmConnectionMethodExt -* -*/ - -// INCLUDES -#include "cmmanagerimpl.h" -#include -#include -#include -#include "cmdestinationimpl.h" - -using namespace CMManager; -// ======== MEMBER FUNCTIONS ======== - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::RCmConnectionMethodExt() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethodExt::RCmConnectionMethodExt( - const RCmConnectionMethodExt& aItem) - : iImplementation( aItem.iImplementation ) - { - iImplementation->IncrementRefCounter(); - } - - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::Close() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmConnectionMethodExt::Close() - { - if( !iImplementation ) - { - return; - } - - TRAP_IGNORE( iImplementation->CmMgr().RemoveCMFromPoolL(iImplementation) ); - iImplementation = NULL; - } - - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::CreateCopyL() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethodExt RCmConnectionMethodExt::CreateCopyL() - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - RCmConnectionMethodExt cm; - - cm.iImplementation = iImplementation->CreateCopyL(); - - cm.iImplementation->CmMgr().InsertConnectionMethodL(cm.iImplementation); - - return cm; - } - - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::GetIntAttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint32 - RCmConnectionMethodExt::GetIntAttributeL( TUint32 aAttribute ) const - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - return iImplementation->GetIntAttributeL( aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::GetBoolAttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool - RCmConnectionMethodExt::GetBoolAttributeL( TUint32 aAttribute ) const - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - - return iImplementation->GetBoolAttributeL( aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::GetStringAttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC* - RCmConnectionMethodExt::GetStringAttributeL( TUint32 aAttribute ) const - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - - return iImplementation->GetStringAttributeL( aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::GetString8AttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC8* - RCmConnectionMethodExt::GetString8AttributeL( TUint32 aAttribute ) const - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - return iImplementation->GetString8AttributeL( aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::SetIntAttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmConnectionMethodExt::SetIntAttributeL( TUint32 aAttribute, - TUint32 aValue ) - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - if( iImplementation->GetBoolAttributeL( ECmProtected ) ) - { - // Only clients with NetworkControl capability can modify - // protection setting! - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - iImplementation->SetIntAttributeL( aAttribute, aValue ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::SetBoolAttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmConnectionMethodExt::SetBoolAttributeL( TUint32 aAttribute, - TBool aValue ) - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - if( iImplementation->GetBoolAttributeL( ECmProtected ) ) - { - // Only clients with NetworkControl capability can modify - // protection setting! - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - iImplementation->SetBoolAttributeL( aAttribute, aValue ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::SetStringAttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void - RCmConnectionMethodExt::SetStringAttributeL( TUint32 aAttribute, - const TDesC16& aValue ) - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - if( iImplementation->GetBoolAttributeL( ECmProtected ) ) - { - // Only clients with NetworkControl capability can modify - // protection setting! - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - iImplementation->SetStringAttributeL( aAttribute, aValue ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::SetString8AttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void - RCmConnectionMethodExt::SetString8AttributeL( TUint32 aAttribute, - const TDesC8& aValue ) - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - if( iImplementation->GetBoolAttributeL( ECmProtected ) ) - { - // Only clients with NetworkControl capability can modify - // protection setting! - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - iImplementation->SetString8AttributeL( aAttribute, aValue ); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::UpdateL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmConnectionMethodExt::UpdateL() - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - iImplementation->UpdateL(); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::DeleteL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmConnectionMethodExt::DeleteL() - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - - if( iImplementation->GetBoolAttributeL( ECmProtected ) ) - { - // Only clients with NetworkControl capability can delete - // this destination - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - // Check it's not connected - if ( iImplementation->GetBoolAttributeL( ECmConnected ) ) - { - User::Leave( KErrInUse ); - } - - // Check it's not referenced by Virtual CM - if( iImplementation->GetBoolAttributeL( ECmIsLinked ) ) - { - User::Leave( KErrLocked ); - } - - // Check that it's not the last CM in a destination which is - // referenced by Virtual CM - CCmDestinationImpl* destImpl = iImplementation->ParentDestination(); - TUint32 destId ( 0 ); - TUint32 count( 0 ); - - if ( destImpl ) - { - destId = destImpl->Id(); - count = destImpl->ConnectionMethodCount(); - } - delete destImpl; - destImpl = NULL; - - if ( count == 1 ) - { - // The IAP is in destination and it's the last one - // for each IAP in CM manager - // 1. check if it is virtual - // if not => goto 1. - // if yes: - // 2. check if it links to the destination of this CM - // if yes => carryOn = EFalse, ERROR - // if not: carryOn = ETrue - TBool carryOn = ETrue; - - CommsDat::CMDBRecordSet* iaps = iImplementation->CmMgr().AllIapsL(); - CleanupStack::PushL( iaps ); - - // for each IAP in CM manager - for ( TInt i = KCmInitIndex; carryOn && i < iaps->iRecords.Count(); ++i ) - { - CommsDat::CCDIAPRecord* rec = (*iaps)[i]; - TUint32 bearerType = 0; - - TRAP_IGNORE( bearerType = iImplementation->CmMgr().BearerTypeFromIapRecordL( rec ) ); - if ( !bearerType ) - { - continue; - } - - // check if it is virtual - if ( iImplementation->CmMgr().GetBearerInfoBoolL( bearerType, ECmVirtual ) ) - { - // check if it links to the current destination - CCmPluginBase* plugin = NULL; - TRAP_IGNORE( plugin = iImplementation->CmMgr().GetConnectionMethodL( rec->RecordId() ) ); - - if ( !plugin ) - { - continue; - } - - if ( plugin->IsLinkedToSnap( destId ) ) - { - // the CM links to this destination, deletion not allowed - carryOn = EFalse; - } - - delete plugin; - } - } - - CleanupStack::PopAndDestroy( iaps ); - - if ( !carryOn ) - { - User::Leave( KErrLocked ); - } - } - - // ETrue = delete it. It doesn't matter how many referencies there are. - TBool deleteRes = iImplementation->DeleteL( ETrue ); - if( deleteRes ) - { - CCmDestinationImpl* dest = iImplementation->ParentDestination(); - if( dest ) - { - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(iImplementation); - CleanupStack::PushL( connMethod ); - dest->ConnectionMethodDeletedL( *connMethod ); - CleanupStack::PopAndDestroy(connMethod);//deletes iImplementation - iImplementation = NULL; - } - delete dest; - } - - return deleteRes; - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::Destination() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmDestinationExt RCmConnectionMethodExt::DestinationL() const - { - if (!iImplementation) - { - User::Leave(KErrBadHandle); - } - if (!iImplementation->Destination()) - { - User::Leave(KErrNotSupported); - } - - RCmDestinationExt dest; - dest.iDestinatonData = - iImplementation->Destination()->GetData(); - dest.iDestinatonData->IncrementRefCounter(); - return dest; - } -// -------------------------------------------------------------------------- -// RCmConnectionMethod::RCmConnectionMethod -// -------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethodExt::RCmConnectionMethodExt() - : iImplementation( NULL ) - { - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethodExt::~RCmConnectionMethodExt() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethodExt::~RCmConnectionMethodExt() - { - Close(); - } - -// ----------------------------------------------------------------------------- -// RCmConnectionMethod::operator=() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethodExt& RCmConnectionMethodExt::operator=( - const RCmConnectionMethodExt& aConnMethod) - { - if (this != &aConnMethod) - { - Close(); - iImplementation = aConnMethod.iImplementation; - iImplementation->IncrementRefCounter(); - } - return *this; - } - -// -------------------------------------------------------------------------- -// RCmConnectionMethod::operator== -// -------------------------------------------------------------------------- -// -EXPORT_C TBool RCmConnectionMethodExt::operator==( - RCmConnectionMethodExt& aConnMethod ) const - { - return ( iImplementation == aConnMethod.iImplementation ); - }; - - -// -------------------------------------------------------------------------- -// RCmConnectionMethod::operator!= -// -------------------------------------------------------------------------- -// -EXPORT_C TBool RCmConnectionMethodExt::operator!=( - RCmConnectionMethodExt& aConnMethod ) const - { - return !( iImplementation == aConnMethod.iImplementation ); - }; diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmconnectionmethodinfo.cpp --- a/cmmanager/cmmgr/Framework/Src/cmconnectionmethodinfo.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,315 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmConnectionMethodInfo -* -*/ -#include -#include "cmmanagerimpl.h" -#include "cmlogger.h" -#include "cmconnectionmethodinfo.h" - -using namespace CommsDat; - -// ======== LOCAL FUNCTIONS ======== - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::CCmConnectionMethodInfo -// --------------------------------------------------------------------------- -// -CCmConnectionMethodInfo::CCmConnectionMethodInfo( - TCmPluginInitParam *aInitParam ) - : CCmPluginBaseEng( aInitParam ) - { - CLOG_CREATE; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::ConstructL -// --------------------------------------------------------------------------- -// -void CCmConnectionMethodInfo::ConstructL() - { - // Dummy bearer type - iBearerType = KDummyBearerType; - - CCmPluginBaseEng::ConstructL(); - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::NewL -// --------------------------------------------------------------------------- -// -CCmConnectionMethodInfo* - CCmConnectionMethodInfo::NewL( TCmPluginInitParam *aInitParam ) - { - CCmConnectionMethodInfo* self = CCmConnectionMethodInfo::NewLC( aInitParam ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::NewLC -// --------------------------------------------------------------------------- -// -CCmConnectionMethodInfo* - CCmConnectionMethodInfo::NewLC( TCmPluginInitParam *aInitParam ) - { - CCmConnectionMethodInfo* self = - new( ELeave ) CCmConnectionMethodInfo( aInitParam ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::~CCmConnectionMethodInfo -// --------------------------------------------------------------------------- -// -CCmConnectionMethodInfo::~CCmConnectionMethodInfo() - { - CLOG_CLOSE; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::GetConnectionInfoIntL -// --------------------------------------------------------------------------- -// -TUint32 CCmConnectionMethodInfo::GetConnectionInfoIntL( const TUint32 aIapId, - const TUint32 aAttribute ) - { - CCmPluginBase* plugin = CmMgr().GetConnectionMethodL( aIapId ); - CleanupStack::PushL( plugin ); - - if ( !plugin ) - { - User::Leave( KErrNotFound ); - } - - ResetAndLoadL( aIapId ); - - TUint32 info = plugin->GetIntAttributeL( aAttribute ); - CleanupStack::PopAndDestroy( plugin ); - - return info; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::GetConnectionInfoBoolL -// --------------------------------------------------------------------------- -// -TBool CCmConnectionMethodInfo::GetConnectionInfoBoolL( const TUint32 aIapId, - const TUint32 aAttribute ) - { - CCmPluginBase* plugin = CmMgr().GetConnectionMethodL( aIapId ); - CleanupStack::PushL( plugin ); - - if ( !plugin ) - { - User::Leave( KErrNotFound ); - } - - ResetAndLoadL( aIapId ); - - TBool info = plugin->GetBoolAttributeL( aAttribute ); - CleanupStack::PopAndDestroy( plugin ); - - return info; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::GetConnectionInfoStringL -// --------------------------------------------------------------------------- -// -HBufC* - CCmConnectionMethodInfo::GetConnectionInfoStringL( const TUint32 aIapId, - const TUint32 aAttribute ) - { - CCmPluginBase* plugin = CmMgr().GetConnectionMethodL( aIapId ); - CleanupStack::PushL( plugin ); - - if ( !plugin ) - { - User::Leave( KErrNotFound ); - } - - ResetAndLoadL( aIapId ); - - HBufC* info = plugin->GetStringAttributeL( aAttribute ); - CleanupStack::PopAndDestroy( plugin ); - - return info; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::GetConnectionInfoStringL -// --------------------------------------------------------------------------- -// -HBufC8* CCmConnectionMethodInfo::GetConnectionInfoString8L( - const TUint32 aIapId, - const TUint32 aAttribute ) - { - CCmPluginBase* plugin = CmMgr().GetConnectionMethodL( aIapId ); - CleanupStack::PushL( plugin ); - - if ( !plugin ) - { - User::Leave( KErrNotFound ); - } - - ResetAndLoadL( aIapId ); - - HBufC8* info = plugin->GetString8AttributeL( aAttribute ); - CleanupStack::PopAndDestroy( plugin ); - - return info; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::RunSettingsL -// --------------------------------------------------------------------------- -// -TInt CCmConnectionMethodInfo::RunSettingsL() - { - User::Leave( KErrNotSupported ); - return KErrNotSupported; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::InitializeWithUiL -// --------------------------------------------------------------------------- -// -TBool CCmConnectionMethodInfo::InitializeWithUiL( TBool /*aManuallyConfigure*/ ) - { - User::Leave( KErrNotSupported ); - - return ETrue; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::CanHandleIapIdL -// --------------------------------------------------------------------------- -// -TBool CCmConnectionMethodInfo::CanHandleIapIdL( TUint32 /*aIapId*/ ) const - { - User::Leave( KErrNotSupported ); - - return EFalse; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::CanHandleIapIdL -// --------------------------------------------------------------------------- -// -TBool CCmConnectionMethodInfo::CanHandleIapIdL( - CCDIAPRecord* /*aIapRecord*/ ) const - { - User::Leave( KErrNotSupported ); - - return EFalse; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::ServiceRecordIdLC -// --------------------------------------------------------------------------- -// -void CCmConnectionMethodInfo::ServiceRecordIdLC( HBufC* &/*aBearerName*/, - TUint32& /*aRecordId*/ ) - { - User::Leave( KErrNotSupported ); - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::BearerRecordIdLC -// --------------------------------------------------------------------------- -// -void CCmConnectionMethodInfo::BearerRecordIdLC( HBufC* &/*aBearerName*/, - TUint32& /*aRecordId*/ ) - { - User::Leave( KErrNotSupported ); - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::CreateNewServiceRecordL -// --------------------------------------------------------------------------- -// -void CCmConnectionMethodInfo::CreateNewServiceRecordL() - { - User::Leave( KErrNotSupported ); - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::ResetAndLoadL -// --------------------------------------------------------------------------- -// -void CCmConnectionMethodInfo::ResetAndLoadL( TUint32 aIapId ) - { - if( iIapId != aIapId ) - { - Reset(); - LoadL( aIapId ); - } - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::CopyAdditionalDataL -// --------------------------------------------------------------------------- -// -void CCmConnectionMethodInfo::CopyAdditionalDataL( CCmPluginBaseEng* /*aDestInst*/ ) - { - User::Leave( KErrNotSupported ); - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::CreateInstanceL -// --------------------------------------------------------------------------- -// -CCmPluginBaseEng* CCmConnectionMethodInfo:: - CreateInstanceL( TCmPluginInitParam& /*aInitParam*/ ) const - { - User::Leave( KErrNotSupported ); - - return NULL; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::CreateCopyL -// --------------------------------------------------------------------------- -// -CCmPluginBaseEng* CCmConnectionMethodInfo::CreateCopyL() const - { - User::Leave( KErrNotSupported ); - - return NULL; - } - -// --------------------------------------------------------------------------- -// CCmConnectionMethodInfo::ResetIfInMemory -// --------------------------------------------------------------------------- -// -void CCmConnectionMethodInfo::ResetIfInMemory( CCmPluginBaseEng* aCM ) - { - TUint32 cmId = 0; - TRAPD( err, cmId = aCM->GetIntAttributeL( CMManager::ECmId ) ); - if ( KErrNone == err ) - { - if( cmId > 0 && iIapId == cmId ) - { - Reset(); - TRAP_IGNORE( LoadL( cmId ) ); - } - } - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmconnselectrbpage.cpp --- a/cmmanager/cmmgr/Framework/Src/cmconnselectrbpage.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,404 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of plugin base class -* -*/ - - -#include -#include - -#include "cmconnselectrbpage.h" -#include "cmmanager.hrh" -#include "cmconnsettingsuiimpl.h" -#include "cmlogger.h" - -using namespace CMManager; - -// --------------------------------------------------------------------------- -// CCMConnSelectRBPage::CCMConnSelectRBPage -// --------------------------------------------------------------------------- -// -CCMConnSelectRBPage::CCMConnSelectRBPage( TInt aDialogResourceId, - TInt& aCurrentSelectionIndex, - const MDesCArray* aItemArray, - CCmManagerImpl& aCmManagerImpl, - TCmDCSettingSelectionMode& aSelectionMode, - RArray& aDestinations, - TBool areDestinations, - TBool aOpenDestination, - TCoeContextName& aContext ) - : CAknRadioButtonSettingPage( aDialogResourceId, - aCurrentSelectionIndex, - aItemArray ) - , iDialogResourceId (aDialogResourceId) - , iCmManagerImpl( aCmManagerImpl ) - , iSelectionMode( aSelectionMode ) - , iDestinations( aDestinations ) - , iAreDestinations( areDestinations ) - , iOpenDestination( aOpenDestination ) - , iHelpContext ( aContext ) - { - CLOG_CREATE; - iPrevItem = iDestinations[aCurrentSelectionIndex]; - } - -// --------------------------------------------------------------------------- -// CCMConnSelectRBPage::~CCMConnSelectRBPage -// --------------------------------------------------------------------------- -// -CCMConnSelectRBPage::~CCMConnSelectRBPage() - { - CLOG_CLOSE; - } - -// --------------------------------------------------------------------------- -// CCMConnSelectRBPage::OkToExitL -// Good to know : EAknSoftkeyCancel is never called, because -// EEikDialogFlagNotifyEsc flag is not set in the resource. -// --------------------------------------------------------------------------- -// -TBool CCMConnSelectRBPage::OkToExitL( TInt aButtonId ) - { - LOGGER_ENTERFN("CCMConnSelectRBPage::OkToExitL"); - - // Convert the button presses into commands for the appui & current - // view to handle - TBool retval( EFalse ); - if ( aButtonId == EAknSoftkeyOk ) - { - ProcessCommandL( ECmManagerUiCmdDestSelect ); - retval = ETrue; - } - else - { - if ( aButtonId == EAknSoftkeyOptions ) - { - //*iSelected = iListbox->CurrentItemUid(); - //retval = ETrue; - DisplayMenuL(); - retval = EFalse; - } - else - { - retval = ETrue; - } - } - - return retval; - } - -// --------------------------------------------------------------------------- -// CCMConnSelectRBPage::ProcessCommandL -// --------------------------------------------------------------------------- -// -void CCMConnSelectRBPage::ProcessCommandL( TInt aCommandId ) - { - LOGGER_ENTERFN("CCMConnSelectRBPage::ProcessCommandL"); - - if ( MenuShowing() ) - { - HideMenu(); - } - - switch ( aCommandId ) - { - case EAknSoftkeyOptions: - { - DisplayMenuL(); - break; - } - - case EAknSoftkeyCancel: - { - AttemptExitL(EFalse); - break; - } - - case EAknSoftkeyOk: - case EAknSoftkeySelect: - case ECmManagerUiCmdDestSelect: - { - TUint selectedItem = - iDestinations[ ListBoxControl()->CurrentItemIndex() ]; - if ( selectedItem == KDestItemAlwaysAsk ) - { - iSelectionMode = EDCAlwaysAsk; - } - else if ( selectedItem == KDestItemAskOnce ) - { - iSelectionMode = EDCAskOnce; - } - else if ( selectedItem == KDestItemDefaultConnection ) - { - iSelectionMode = EDCDefaultConnection; - } - else if ( selectedItem == KDestItemUncategorized ) - { - iSelectionMode = EDCConnectionMethod; - } - else - { - if (iAreDestinations) - { - iSelectionMode = EDCDestination; - } - else - { - iSelectionMode = EDCConnectionMethod; - } - } - //iId is to be defined in the caller class - SelectCurrentItemL(); - AttemptExitL(ETrue); - break; - } - - case ECmManagerUiCmdCMSelect: - { - iSelectionMode = EDCConnectionMethod; - SelectCurrentItemL(); - AttemptExitL( ETrue ); - break; - } - case EAknCmdHelp: - { - HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), - iEikonEnv->EikAppUi()->AppHelpContextL() ); - } - break; - default: - { - break; - } - } - } - -// --------------------------------------------------------------------------- -// CCMConnSelectRBPage::DynInitMenuPaneL -// --------------------------------------------------------------------------- -// -void CCMConnSelectRBPage::DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - LOGGER_ENTERFN("CCMConnSelectRBPage::DynInitMenuPaneL"); - - CAknSettingPage::DynInitMenuPaneL( aResourceId, aMenuPane ); - if ( aResourceId == R_SELECT_NETW_CONN_MENU ) - { - if (!iCmManagerImpl.IsHelpOn()) - { - aMenuPane->DeleteMenuItem( EAknCmdHelp ); - } - TUint32 currentItem = - iDestinations[ ListBoxControl()->CurrentItemIndex() ]; - - // Always Ask ( always the first item ) - if ( (currentItem == KDestItemAlwaysAsk) || - (currentItem == KDestItemAskOnce) || - (currentItem == KDestItemDefaultConnection) || - !iOpenDestination ) - { - aMenuPane->SetItemDimmed( ECmManagerUiCmdCMSelect, ETrue ); - } - else if ( ( currentItem != KDestItemAlwaysAsk ) && - ( currentItem != KDestItemAskOnce ) && - ( currentItem != KDestItemDefaultConnection ) && - ( currentItem != KDestItemUncategorized )) - { - CCmDestinationImpl* destImpl = iCmManagerImpl.DestinationL( currentItem ); - - if ( !destImpl->ConnectionMethodCount() ) - { - aMenuPane->SetItemDimmed( ECmManagerUiCmdCMSelect, ETrue ); - } - - delete destImpl; - } - else - { - RArray uncatArray( KCmArraySmallGranularity ); - CleanupClosePushL( uncatArray ); - iCmManagerImpl.ConnectionMethodL( uncatArray ); - - // Uncategorised - cannot be selected - if ( currentItem == KDestItemUncategorized ) - { - aMenuPane->SetItemDimmed( ECmManagerUiCmdDestSelect, ETrue ); - } - CleanupStack::PopAndDestroy( &uncatArray ); - } - } - } - - -// --------------------------------------------------------------------------- -// CCMConnSelectRBPage::OfferKeyEventL -// --------------------------------------------------------------------------- -// -TKeyResponse CCMConnSelectRBPage::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - LOGGER_ENTERFN("CCMConnSelectRBPage::OfferKeyEventL"); - - TKeyResponse retVal ( EKeyWasNotConsumed ); - // save for the future use - iPrevItem = iDestinations[ListBoxControl()->CurrentItemIndex()]; - - switch ( aKeyEvent.iScanCode ) - { - case EStdKeyDownArrow: - case EStdKeyUpArrow: - { - if ( iOpenDestination ) //only if we are on 'destination level' and we are able to - //open destinations - { - // If focus is on the 'uncategorised' destination, - // change the soft key to 'Open' - if ( iDestinations[ ListBoxControl()->CurrentItemIndex() ] == - KDestItemUncategorized ) - { - HBufC* text = StringLoader::LoadLC( R_QTN_MSK_OPEN ); - Cba()->SetCommandL( EAknSoftkeySelect, *text ); - Cba()->DrawNow(); - CleanupStack::PopAndDestroy( text ); - } - else - { - HBufC* text = StringLoader::LoadLC( R_QTN_MSK_SELECT ); - Cba()->SetCommandL( EAknSoftkeySelect, *text ); - Cba()->DrawNow(); - CleanupStack::PopAndDestroy( text ); - } - } - break; - } - default: - { - break; - } - } - retVal = CAknRadioButtonSettingPage::OfferKeyEventL( aKeyEvent, aType ); - - return retVal; - } - -// -------------------------------------------------------------------------- -// CCMConnSelectRBPage::GetHelpContext -// -------------------------------------------------------------------------- -// -void CCMConnSelectRBPage::GetHelpContext( TCoeHelpContext& aContext ) const - { - LOGGER_ENTERFN("CCMConnSelectRBPage::GetHelpContext"); - - aContext.iMajor = KHelpUidPlugin; - aContext.iContext = iHelpContext; - } - -// --------------------------------------------------------------------------- -// CCMConnSelectRBPage::HandleListBoxEventL -// --------------------------------------------------------------------------- -// -void CCMConnSelectRBPage::HandleListBoxEventL(CEikListBox* aListBox, - MEikListBoxObserver::TListBoxEvent aEventType) - { - LOGGER_ENTERFN("CCMConnSelectRBPage::HandleListBoxEventL"); - - if ( AknLayoutUtils::PenEnabled() ) - { - - if (iDialogResourceId == R_RADIO_BUTTON_SETTING_PAGE_OK_CANCEL) - { - // Call base class implementation and return if no options menu - CAknRadioButtonSettingPage::HandleListBoxEventL(aListBox, aEventType); - - switch ( aEventType ) - { - case EEventEnterKeyPressed: - case EEventItemDoubleClicked: - case EEventItemSingleClicked: - case EEventItemClicked: - { - ProcessCommandL(ECmManagerUiCmdDestSelect); - break; - } - - default: - { - break; - } - } - return; - } - - switch ( aEventType ) - { - // All these actions are activating the listbox item - case MEikListBoxObserver::EEventEnterKeyPressed: - case MEikListBoxObserver::EEventItemActioned: - CAknRadioButtonSettingPage::HandleListBoxEventL(aListBox, aEventType); - break; - - case MEikListBoxObserver::EEventItemClicked: - case MEikListBoxObserver::EEventItemSingleClicked: - if (iPrevItem == iDestinations[ListBoxControl()->CurrentItemIndex()]) - { - ProcessCommandL(ECmManagerUiCmdDestSelect); - } - else - { - // save for the later use - iPrevItem = iDestinations[ListBoxControl()->CurrentItemIndex()]; - - if ( iOpenDestination ) //only if we are on 'destination level' and we are able to - //open destinations - { - // If focus is on the 'uncategorised' destination, - // change the soft key to 'Open' - if ( iDestinations[ ListBoxControl()->CurrentItemIndex() ] == - KDestItemUncategorized ) - { - HBufC* text = StringLoader::LoadLC( R_QTN_MSK_OPEN ); - Cba()->SetCommandL( EAknSoftkeySelect, *text ); - Cba()->DrawNow(); - CleanupStack::PopAndDestroy( text ); - } - else - { - HBufC* text = StringLoader::LoadLC( R_QTN_MSK_SELECT ); - Cba()->SetCommandL( EAknSoftkeySelect, *text ); - Cba()->DrawNow(); - CleanupStack::PopAndDestroy( text ); - } - CAknRadioButtonSettingPage::SelectCurrentItemL(); - } - } - break; - - case MEikListBoxObserver::EEventItemDoubleClicked: - ProcessCommandL(ECmManagerUiCmdDestSelect); - break; - - default: - CAknRadioButtonSettingPage::HandleListBoxEventL(aListBox, aEventType); - break; - } - } - else - { - CAknRadioButtonSettingPage::HandleListBoxEventL(aListBox, aEventType); - } - } - - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmconnsettingsuiimpl.cpp --- a/cmmanager/cmmgr/Framework/Src/cmconnsettingsuiimpl.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1163 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of application setting UI. -* -*/ - -#include -#include -#include -#include -#include -#include -#include - - -#include -#include "cmapplicationsettingsui.h" -#include -#include "cmmanagerimpl.h" -#include "cmdestinationimpl.h" -#include "cmmanagerimpl.h" -#include -#include -#include "cmconnsettingsuiimpl.h" -#include "cmconnselectrbpage.h" - -using namespace CMManager; - -typedef struct - { - TInt iCmIapId; - TInt iCmDefaultPriority; - }TCmListItem; - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::NewL -//--------------------------------------------------------------------------- -// -EXPORT_C CCmConnSettingsUiImpl* CCmConnSettingsUiImpl::NewL( CCmManagerImpl* aCCmManagerImpl ) - { - CCmConnSettingsUiImpl* self = - new (ELeave) CCmConnSettingsUiImpl(); - CleanupStack::PushL( self ); - self->ConstructL( aCCmManagerImpl ); - CleanupStack::Pop( self ); // self - return self; - } - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::NewL -//--------------------------------------------------------------------------- -// -CCmConnSettingsUiImpl* CCmConnSettingsUiImpl::NewWithoutTablesL() - { - CCmConnSettingsUiImpl* self = - new (ELeave) CCmConnSettingsUiImpl(); - CleanupStack::PushL( self ); - self->iCreateTables = EFalse; - self->ConstructL( NULL ); - CleanupStack::Pop( self ); // self - return self; - } - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::TCmDCSettingSelection -//--------------------------------------------------------------------------- -// -CCmConnSettingsUiImpl::CCmConnSettingsUiImpl() - : iResourceReader( *CCoeEnv::Static() ) - , iAreDestinations ( ETrue ) - , iShowAlwaysAsk( EFalse ) - , iShowEasyWlan( EFalse ) - , iShowVirtualCMs( ETrue ) - , iShowEmptyDestinations( EFalse ) - , iShowAskOnce( EFalse ) - , iShowUncat( EFalse ) - , iShowDefConn( EFalse ) - , iUsePassedDestinationArray( EFalse ) - , iHelpContext ( KSET_HLP_APP_DEST_ASSOC_VIEW ) - , iCreateTables( ETrue ) - { - } - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::~TCmDCSettingSelection -//--------------------------------------------------------------------------- -// -CCmConnSettingsUiImpl::~CCmConnSettingsUiImpl() - { - if ( iOwnCmManager ) - { - delete iCmManagerImpl; - } - iResourceReader.Close(); - iItems.Close(); - iPassedDestinations.Close(); - } - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::LoadResourceL -// Load the resource for the dll module -//--------------------------------------------------------------------------- -// -TInt CCmConnSettingsUiImpl::LoadResourceL () - { - // Add resource file. - TParse* fp = new(ELeave) TParse(); - TInt err = fp->Set( KACMManagerResDirAndFileName, - &KDC_RESOURCE_FILES_DIR, - NULL ); - if ( err != KErrNone) - { - User::Leave( err ); - } - - TFileName resourceFileNameBuf = fp->FullName(); - delete fp; - - iResourceReader.OpenL( resourceFileNameBuf ); - return err; - } - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::ConstructL() -//--------------------------------------------------------------------------- -// -void CCmConnSettingsUiImpl::ConstructL( CCmManagerImpl* aCCmManagerImpl ) - { - iOwnCmManager = !(aCCmManagerImpl); - if ( iOwnCmManager ) - { - if (iCreateTables) - { - iCmManagerImpl = CCmManagerImpl::NewL(); - } - else - { - iCmManagerImpl = CCmManagerImpl::NewL(EFalse); - } - } - else - { - iCmManagerImpl = aCCmManagerImpl; - } - LoadResourceL(); - AknsUtils::SetAvkonSkinEnabledL( ETrue ); - } - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::ShowConnSelectRadioPageL -//--------------------------------------------------------------------------- -// -TBool CCmConnSettingsUiImpl::ShowConnSelectRadioPageL( - TCmDCSettingSelection& aSelection, - const TInt aTitleStringResource, - TBearerFilterArray& aFilterArray ) - { - TBool retVal( EFalse ); -// aSelection.iResult = EDCAlwaysAsk; - - CDesCArrayFlat* items = - new ( ELeave ) CDesCArrayFlat( KCmArrayBigGranularity ); - CleanupStack::PushL( items ); - - if (iAreDestinations) - { - BuildDestinationArrayL( items, aFilterArray ); - } - else - { - BuildCMArrayL( items, aFilterArray ); - - } - // Uncategorized connection methods - RPointerArray uncatArray( KCmArraySmallGranularity ); - CCmManagerImpl::CleanupResetAndDestroyPushL< RPointerArray >( uncatArray ); - if ( iShowUncat ) - { - BuildUncatArrayL( uncatArray, items, - aFilterArray); - } - //appending items in reverse order of priority - // Check if Ask Once should be shown - if ( iShowAskOnce ) - { - HBufC* buf = StringLoader::LoadLC( R_CMMANAGERUI_SETT_ASK_ONCE ); - items->InsertL( 0, *buf ); - iItems.InsertL( KDestItemAskOnce, 0 ); - CleanupStack::PopAndDestroy( buf ); - } - - // Check if Always Ask should be shown - if ( iShowAlwaysAsk ) - { - HBufC* buf = StringLoader::LoadLC( R_CMMANAGERUI_SETT_ALWAYS_ASK ); - items->InsertL( 0, *buf ); - iItems.InsertL( KDestItemAlwaysAsk, 0 ); - CleanupStack::PopAndDestroy( buf ); - } - // Check if Default Connection should be shown - //feautre flag - if ( iCmManagerImpl->IsDefConnSupported() ) - { - //client's selection - if ( iShowDefConn ) - { - HBufC* buf = StringLoader::LoadLC( R_CMMANAGERUI_SETT_DEFAULT_CONNECTION ); - items->InsertL( 0, *buf ); - iItems.InsertL( KDestItemDefaultConnection, 0 ); - CleanupStack::PopAndDestroy( buf ); - } - } - if (!items->Count()) - { - User::Leave(KErrConnectionNotFound); - } - - TInt listIndex(0); - - if (iAreDestinations) - { - switch ( aSelection.iResult ) - { - case EDCDestination: - { - TInt newIndex = iItems.Find(aSelection.iId); - if (newIndex >=0) - { - listIndex = newIndex; - } - break; - } - case EDCConnectionMethod: - { - TInt err(KErrNotFound); - CCmPluginBase* cm = NULL; - TRAP( err, cm = iCmManagerImpl->GetConnectionMethodL(aSelection.iId)); - if ( err == KErrNone ) - { - // connection method is valid - CleanupStack::PushL( cm ); - TUint32 parentId = 0; - CCmDestinationImpl* parent = cm->ParentDestination(); - if (parent) - { - // it has a parent, get it's id - parentId = parent->Id(); - delete parent; - } - else - { - // no parent means Uncategorised - parentId = KDestItemUncategorized; - } - // get the index based on id - TInt tempIndex = iItems.Find( parentId ); - if ( tempIndex != KErrNotFound ) - { - // found destination id in list - listIndex = tempIndex; - } - CleanupStack::PopAndDestroy( cm ); - } - break; - } - case EDCDefaultConnection: - { - TInt newIndex = iItems.Find(KDestItemDefaultConnection); - if (newIndex >=0) - { - listIndex = newIndex; - } - break; - } - case EDCAlwaysAsk: - { - TInt newIndex = iItems.Find(KDestItemAlwaysAsk); - if (newIndex >=0) - { - listIndex = newIndex; - } - break; - } - case EDCAskOnce: - { - TInt newIndex = iItems.Find(KDestItemAskOnce); - if (newIndex >=0) - { - listIndex = newIndex; - } - break; - } - default: // use default value (0) - { - break; - } - } - } - else - { - if (aSelection.iResult == EDCConnectionMethod) - { - TInt newIndex = iItems.Find(aSelection.iId); - if (newIndex >=0) - { - listIndex = newIndex; - } - } - } - - if ( aTitleStringResource == R_CMMANAGERUI_DEFAULT_CONNECTION_TITLE ) - { - // It is not allowed to choose Connection Methods - // in Default connection -dialog. - // - iOpenDestination = EFalse; - } - - if ( UserSelectionDlgL( listIndex, items, aSelection, - aTitleStringResource, - iOpenDestination) ) - { - // Handle selection - - switch ( aSelection.iResult ) - { - case EDCConnectionMethod: - { - // from the first list? - if (!iAreDestinations) - { - aSelection.iId = iItems[listIndex]; - retVal = ETrue; - } - else - { - // Uncategorised? - TUint32 destId = iItems[ listIndex ]; - if ( destId == KDestItemUncategorized ) - { - TBearerFilterArray emptyFilter; - retVal = ShowConnectionMethodsL( uncatArray, - aSelection, aTitleStringResource, emptyFilter ); - } - else - { - RPointerArray cmArray ( KCmArrayMediumGranularity ); - if ( iShowVirtualCMs ) //create a flat list to show cms in embedded destinations - { - iCmManagerImpl->CreateFlatCMListLC( destId, cmArray); - } - else - { - //append only the cms in the destination - iCmManagerImpl->AppendCmListLC( destId, cmArray ); - } - retVal = ShowConnectionMethodsL( cmArray, - aSelection, aTitleStringResource, - aFilterArray ); - CleanupStack::PopAndDestroy( &cmArray ); - } - } - break; - } - case EDCDestination: - { - // Store the destination Id - aSelection.iId = iItems[listIndex]; - retVal = ETrue; - break; - } - case EDCAlwaysAsk: - { - // nothing more to do - retVal = ETrue; - break; - } - case EDCDefaultConnection: - { - // nothing more to do - retVal = ETrue; - break; - } - case EDCAskOnce: - { - // nothing more to do - retVal = ETrue; - break; - } - default: - { - break; - } - } - } - - CleanupStack::PopAndDestroy( &uncatArray ); - CleanupStack::PopAndDestroy( items ); - - return retVal; - } - - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::RunSettingsL() -//--------------------------------------------------------------------------- -// -EXPORT_C TBool CCmConnSettingsUiImpl::RunApplicationSettingsL( - TCmSettingSelection& aSelection, - TUint aListItems, - TBearerFilterArray& aFilterArray) - { - iItems.Close(); - iAreDestinations = ETrue; - if (!aListItems) - { - User::Leave(KErrArgument); - } - if ( !iCmManagerImpl->IsDefConnSupported() && - !(aListItems & EShowAlwaysAsk) && - !(aListItems & EShowConnectionMethods) && - !(aListItems & EShowDestinations) - ) - { - // default conn would be the only one but not supported - User::Leave(KErrNotSupported); - } - - if ( aListItems & EShowDefaultConnection ) - { - EnableDefConn( ETrue ); - } - else - { - EnableDefConn( EFalse ); - } - if (aListItems & EShowAlwaysAsk) - { - EnableAlwaysAsk( ETrue ); - } - else - { - EnableAlwaysAsk( EFalse ); - } - if ( (aListItems & EShowConnectionMethods) && (aListItems & EShowDestinations) ) - { - iOpenDestination = ETrue; - iShowUncat = ETrue; - } - else - { - iOpenDestination = EFalse; - } - if ( (aListItems & EShowConnectionMethods) && !(aListItems & EShowDestinations) ) - { - iAreDestinations = EFalse; - GetCMArrayL( ); - } - else if ( aListItems & EShowDestinations ) - { - if (iUsePassedDestinationArray) - { - // now fill up iItems - for( TInt i=0; iAllDestinationsL( iItems ); - TInt i( 0 ); - TInt count = iItems.Count(); - for ( i=0; i < count; i++ ) - { - if ( iItems[i] > 0 && iItems[i] < 255 ) - { - CCmDestinationImpl* dest = - iCmManagerImpl->DestinationL( iItems[i] ); - CleanupStack::PushL( dest ); - if ( dest->IsHidden() ) - { - iItems.Remove(i); - i--; - count = count-1; - } - CleanupStack::PopAndDestroy(); - } - } - iItems.Compress(); - } - } - - TBool ret = EFalse; - TCmDCSettingSelection userDefSelection; - - // convert selection - switch ( aSelection.iResult ) - { - case EDestination: - { - userDefSelection.iResult = EDCDestination; - userDefSelection.iId = aSelection.iId; - break; - } - - case EConnectionMethod: - { - userDefSelection.iResult = EDCConnectionMethod; - userDefSelection.iId = aSelection.iId; - break; - } - - case EDefaultConnection: - { - userDefSelection.iResult = EDCDefaultConnection; - userDefSelection.iId = 0; - break; - } - - case EAlwaysAsk: - { - userDefSelection.iResult = EDCAlwaysAsk; - userDefSelection.iId = 0; - break; - } - - default: - { - // do not leave, perhaps there was no default selection - } - } - - - - if ( ShowConnSelectRadioPageL( userDefSelection, - R_CMMANAGERUI_SETT_DESTINATION , aFilterArray)) - { - switch ( userDefSelection.iResult ) - { - case EDCDestination: - { - aSelection.iResult = EDestination; - aSelection.iId = userDefSelection.iId; - break; - } - case EDCConnectionMethod: - { - aSelection.iResult = EConnectionMethod; - aSelection.iId = userDefSelection.iId; - break; - } - case EDCDefaultConnection: - { - aSelection.iResult = EDefaultConnection; - aSelection.iId = 0; - break; - } - case EDCAlwaysAsk: - { - aSelection.iResult = EAlwaysAsk; - aSelection.iId = 0; - break; - } - default: //should not ever get here, unhandled branch - { - User::Leave( KErrGeneral ); - break; - } - } - ret = ETrue; - } - else - { - ret = EFalse; - } - return ret; - } - - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::RunDefaultConnecitonRBPageL() -//--------------------------------------------------------------------------- -// -TBool CCmConnSettingsUiImpl::RunDefaultConnecitonRBPageL( - TCmDCSettingSelection& aSelection ) - { - iHelpContext = KSET_HLP_DEFAULT_CONN; - iItems.Close(); - iOpenDestination = ETrue; - iCmManagerImpl->AllDestinationsL( iItems ); - EnableAlwaysAsk( EFalse ); - EnableAskOnce( EFalse ); - EnableUncat( EFalse ); - TBearerFilterArray aFilterArray; - iAreDestinations = ETrue; - iShowEmptyDestinations = ETrue; - return ShowConnSelectRadioPageL( aSelection , - R_CMMANAGERUI_DEFAULT_CONNECTION_TITLE, aFilterArray ); - } -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::GetCMArrayL() -//--------------------------------------------------------------------------- -// -void CCmConnSettingsUiImpl::GetCMArrayL( ) - { - iCmManagerImpl->ConnectionMethodL( iItems, ETrue, EFalse,EFalse, ETrue ); - TInt count = iItems.Count(); - - if ( !iShowVirtualCMs ) - { - // Don't show virtual CMs - for ( TInt i = 0; i < count; i++ ) - { - if ( IsCmVirtualL( iItems[i] ) ) - { - iItems.Remove( i ); - count--; - i--; - } - } - } - } - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::BuildCMArrayL() -//--------------------------------------------------------------------------- -// -void CCmConnSettingsUiImpl::BuildCMArrayL( CDesCArrayFlat* aItems, - TBearerFilterArray& aFilterArray ) - { - // Add the New Connection Item - for ( TInt i = 0; i < iItems.Count(); i++ ) - { - CCmPluginBase* cm = NULL; - TInt err(KErrNone); - TRAP( err, cm = iCmManagerImpl->GetConnectionMethodL(iItems[i])); - if (err == KErrNoMemory) - { - User::Leave(KErrNoMemory); - } - else if (err != KErrNone) - { - continue; - } - CleanupStack::PushL( cm ); - if (aFilterArray.Count()) - { - TUint cmBearerType = cm->GetIntAttributeL( ECmBearerType ); - if ( aFilterArray.Find( cmBearerType ) == KErrNotFound ) - { - CleanupStack::PopAndDestroy( cm ); - iItems.Remove(i); - i--; - continue; - } - } - // CM Iap Id - TUint32 cmId = cm->GetIntAttributeL( ECmId ); - - // Should virtual bearer types be shown? - if ( iShowVirtualCMs || !IsCmVirtualL( cmId ) ) - { - // CM name - HBufC* cmName = cm->GetStringAttributeL( ECmName ); - CleanupStack::PushL( cmName ); - // embedded destination has a special text format - aItems->AppendL( *cmName ); - CleanupStack::PopAndDestroy( cmName ); - } - CleanupStack::PopAndDestroy( cm ); - } - } - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::BuildDestinationArray() -//--------------------------------------------------------------------------- -// -void CCmConnSettingsUiImpl::BuildDestinationArrayL( CDesCArrayFlat* aItems, - TBearerFilterArray& aFilterArray ) - { - /* - * The behavior of this function is as follow. - * 1. If aFilterArray.Count() == 0 (This just means no filter provided by user) then the function will - * show all of available destinations (if iShowVirtualCMs == ETrue; Otherwise, destination with only - * virtualCMs will be filted out) (default). - * 2. If aFilterArray.Count() != 0 then destination with only unavailable bearer-type IAPs will be - * filted out. - */ - TInt count = iItems.Count(); - // Add the New Connection Item - for ( TInt i = 0; i < count; i++ ) - { - // Get the destinations from their IDs - CCmDestinationImpl* dest = - iCmManagerImpl->DestinationL( iItems[i] ); - CleanupStack::PushL( dest ); - - TInt cmCount = dest->ConnectionMethodCount(); - TInt validCmCount = cmCount; - - if ( !iUsePassedDestinationArray ) - { - // Check if empty destinations should be displayed - if ( !iShowVirtualCMs || aFilterArray.Count()) - { - for ( TInt j = 0; j < cmCount; j++ ) - { - CCmPluginBase& cm = *dest->GetConnectionMethodL(j); - // check if this destination only contains virtual CMs - if (!iShowVirtualCMs)// See if the virtual CM (Default in case no filter provided by user) - { - // CM Iap Id - TUint32 cmIapId = cm.GetIntAttributeL( ECmId ); - // real CMs were found - if ( IsCmVirtualL( cmIapId ) ) - { - validCmCount--; - continue; - } - // We can not break the loop with else case here - // for cm might be filted out by aFilterArray - } - - if (aFilterArray.Count()) // See if the CM is filtered out - { - TUint cmBearerType = cm.GetIntAttributeL( ECmBearerType ); - if ( aFilterArray.Find( cmBearerType ) == KErrNotFound ) - { - validCmCount--; - } - else - { - break;//there is at least one CM in this dest - } - } - } - } - } - - // check if the destination should be omitted - // check if empty destinations should be displayed - - // We can use a destination to make a connection only - // if it contains something else than an empty embedded - // destination. Otherwise, consider it empty. - TBool canUseDestToConnect = dest->CanUseToConnectL(); - - if ( iDestinationToOmit != iItems[i] && - ( ( validCmCount && canUseDestToConnect ) - || iShowEmptyDestinations ) ) - { - // Check whether the MMS SNAP is in question. - // It should not be shown on the UI in the destinations list - TInt snapMetadata = 0; - TRAPD( metaErr, snapMetadata = dest->MetadataL( CMManager::ESnapMetadataPurpose )); - if ( metaErr == KErrNone && snapMetadata == CMManager::ESnapPurposeMMS ) - { - iItems.Remove(i); - count--; - i--; - } - else - { - HBufC* destName = dest->NameLC(); - - aItems->AppendL( *destName ); - CleanupStack::PopAndDestroy( destName ); - } - } - else - { - iItems.Remove(i); - count--; - i--; - } - - CleanupStack::PopAndDestroy( dest ); - } - } - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::BuildUncatArrayL() -//--------------------------------------------------------------------------- -// -void CCmConnSettingsUiImpl::BuildUncatArrayL( RPointerArray& aUncatArray, - CDesCArrayFlat* aItems, - TBearerFilterArray& aFilterArray ) - { - if ( iShowEasyWlan ) - { - // Get the uncategorised CMs including EasyWLAN - iCmManagerImpl->AppendUncatCmListL( aUncatArray, ETrue, ETrue, ETrue ); - } - else - { - iCmManagerImpl->AppendUncatCmListL( aUncatArray ); - } - - // Remove hidden Connection Methods - for ( TInt i = 0; i < aUncatArray.Count(); i++ ) - { - if ( aUncatArray[i]->GetBoolAttributeL( ECmHidden ) ) - { - delete aUncatArray[i]; - aUncatArray.Remove(i); - i--; - } - } - - if (aFilterArray.Count()) - { - for ( TInt i = 0; i < aUncatArray.Count(); i++ ) - { - CCmPluginBase* cm = aUncatArray[i]; - TUint cmBearerType = cm->GetIntAttributeL( ECmBearerType ); - if ( aFilterArray.Find( cmBearerType ) == KErrNotFound ) - { - delete aUncatArray[i]; - aUncatArray.Remove(i); - i--; - } - } - } - TInt count = aUncatArray.Count(); - - if ( !iShowVirtualCMs ) - { - // Don't show virtual CMs - for ( TInt i = 0; i < count; i++ ) - { - if ( IsCmVirtualL( aUncatArray[i]->GetIntAttributeL( ECmId ) ) ) - { - delete aUncatArray[i]; - aUncatArray.Remove( i ); - count--; - i--; - } - } - } - // Show the 'Uncategorised' destination - if ( count ) - { - HBufC* buf = StringLoader::LoadLC( R_CMMANAGERUI_DEST_UNCATEGORIZED ); - aItems->AppendL( *buf ); - CleanupStack::PopAndDestroy( buf ); - iItems.AppendL( KDestItemUncategorized ); - } - } - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::UserSelectionDlgL() -//--------------------------------------------------------------------------- -// -TBool CCmConnSettingsUiImpl::UserSelectionDlgL( - TInt& aDestSelected, - CDesCArrayFlat* aItems, - TCmDCSettingSelection& aSelection, - const TInt aTitleStringResource, - TBool aOpenDestination) - { - // Should an item be highlighted? - if ( aSelection.iResult == EDCDestination ) - { - for ( TInt i = 0; i < iItems.Count(); i++ ) - { - if ( iItems[i] == aSelection.iId ) - { - aDestSelected = i; - } - } - } - - HBufC* buf = StringLoader::LoadLC( aTitleStringResource ); - TInt dialogResourceId = R_RADIO_BUTTON_SETTING_PAGE_OK_CANCEL; - if ( aOpenDestination ) // OPTIONS/CANCEL is available only if we can open - //destinations - { - dialogResourceId = R_RADIO_BUTTON_SETTING_PAGE; - } - CCMConnSelectRBPage* page = - new ( ELeave ) CCMConnSelectRBPage( dialogResourceId, - aDestSelected, - aItems, - *iCmManagerImpl, - aSelection.iResult, - iItems, - iAreDestinations, - aOpenDestination , - iHelpContext ); - CleanupStack::PushL( page ); - page->SetSettingTextL( *buf ); - CleanupStack::Pop( page ); - - CleanupStack::PopAndDestroy( buf ); - buf = NULL; - - return page->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); - } - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::UserSelectedUncatItemL() -//--------------------------------------------------------------------------- -// -TBool CCmConnSettingsUiImpl::UserSelectedUncatItemL( - RPointerArray& aUncatArray, - TCmDCSettingSelection& aSelection, - const TInt aTitleStringResource ) - { - TBool retVal( EFalse ); - CDesCArrayFlat* items = - new ( ELeave ) CDesCArrayFlat( KCmArrayBigGranularity ); - CleanupStack::PushL( items ); - - TInt cmSelected( 0 ); - - TInt count = aUncatArray.Count(); - for ( TInt i = 0; i < count; ++i ) - { - CCmPluginBase* cm = NULL; - TRAPD( err, - cm = iCmManagerImpl->GetConnectionMethodL( aUncatArray[i]->GetIntAttributeL( ECmId) ) - ); - - if ( !err ) - { - CleanupStack::PushL( cm ); - HBufC* cmName = cm->GetStringAttributeL( ECmName ); - CleanupStack::PushL( cmName ); - items->AppendL( *cmName ); - - // Virtual CMs have underlying CMs, highlight - if ( cm->GetBoolAttributeL( ECmVirtual ) ) - { - TUint32 iapId (0); - iapId = cm->GetIntAttributeL( ECmNextLayerIapId ); - if ( iapId && iapId == aSelection.iId ) - { - cmSelected = i; - } - } - CleanupStack::PopAndDestroy( 2, cm ); - } - else - { - //not handled iap, remove from list - aUncatArray.Remove( i ); - count--; - i--; - } - } - - - CAknRadioButtonSettingPage* rbPage = - new ( ELeave ) CAknRadioButtonSettingPage( - R_RADIO_BUTTON_SETTING_PAGE_OK_CANCEL, - cmSelected, - items ); - CleanupStack::PushL( rbPage ); - - HBufC* buf = StringLoader::LoadLC( aTitleStringResource ); - rbPage->SetSettingTextL( *buf ); - CleanupStack::PopAndDestroy( buf ); - - if ( rbPage->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) - { - CCmPluginBase* cm = - iCmManagerImpl->GetConnectionMethodL( aUncatArray[cmSelected]->GetIntAttributeL( ECmId) ); - - // ECmIapId can be surely queried here. It won't leave, but PushL to be - // on the safe side - CleanupStack::PushL( cm ); - aSelection.iId = cm->GetIntAttributeL( ECmId ); - CleanupStack::PopAndDestroy( cm ); - - aSelection.iResult = EDCConnectionMethod; - - retVal = ETrue; - } - CleanupStack::Pop( rbPage ); - CleanupStack::PopAndDestroy( items ); - - return retVal; - } - - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::ShowConnectionMethodsL() -//--------------------------------------------------------------------------- -// -TBool CCmConnSettingsUiImpl::ShowConnectionMethodsL( - RPointerArray& aCmArray, TCmDCSettingSelection& aSelection, - const TInt aTitleStringResource, - TBearerFilterArray& aFilterArray ) - { - TInt retVal ( EFalse ); - - // List texts - CDesCArrayFlat* items = - new ( ELeave ) CDesCArrayFlat( KCmArrayMediumGranularity ); - CleanupStack::PushL( items ); - - // keeps track of the CMs in the list - - // idArray is used to put valid IAP ID. - // aFilterArray might filt some of IAPs (e.g., virtual IAPs) out. In this case, - // aCmArray can not be used to select IAP. So, idArray may be used for IAP selection - // for it only stores valid IAPs (i.e., not filted-out IAPs). - RArray idArray; - TInt cmSelected( 0 ); - TInt j( 0 ); - - // Collect item texts - TInt cmCount = aCmArray.Count(); - for ( TInt i = 0; i < cmCount; i++ ) - { - // CM info - if (aFilterArray.Count()) - { - TUint cmBearerType = aCmArray[i]->GetIntAttributeL( ECmBearerType ); - if ( aFilterArray.Find( cmBearerType ) == KErrNotFound ) - { - continue; - } - } - - // CM Iap Id - TUint32 cmIapId = aCmArray[i]->GetIntAttributeL( ECmId ); - - // Should virtual bearer types be shown? - if ( iShowVirtualCMs || !IsCmVirtualL( cmIapId ) ) - { - // CM name - HBufC* name = aCmArray[i]->GetStringAttributeL( ECmName ); - CleanupStack::PushL( name ); - - items->AppendL( *name ); - idArray.Append( cmIapId ); - - // Virtual CMs have underlying CMs, highlight - if ( cmIapId == aSelection.iId ) - { - cmSelected = j; - j++; - } - - CleanupStack::PopAndDestroy( name ); - } - } - - // create the dialog - CAknRadioButtonSettingPage* dlg = - new ( ELeave ) CAknRadioButtonSettingPage( - R_RADIO_BUTTON_SETTING_PAGE_OK_CANCEL, - cmSelected, - items ); - CleanupStack::PushL( dlg ); - - // Title - HBufC* title = StringLoader::LoadLC ( aTitleStringResource ); - dlg->SetSettingTextL( *title ); - - // Show the dialog - if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) - { - aSelection.iId = idArray[cmSelected]; - aSelection.iResult = EDCConnectionMethod; - retVal = ETrue; - } - idArray.Close(); - - CleanupStack::PopAndDestroy( title ); - CleanupStack::Pop( dlg ); - CleanupStack::PopAndDestroy( items ); - - return retVal; - } - - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::IsCmVirtualL -//--------------------------------------------------------------------------- -// -TBool CCmConnSettingsUiImpl::IsCmVirtualL( TUint32 aIapId ) - { - // check if bearer is virtual - TInt bearerType = iCmManagerImpl->GetConnectionMethodInfoIntL( - aIapId, ECmBearerType ); - return iCmManagerImpl->GetBearerInfoBoolL( bearerType, ECmVirtual ); - } - - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::CreateDefaultConnectionNameL -//--------------------------------------------------------------------------- -// -HBufC* CCmConnSettingsUiImpl::CreateDefaultConnectionNameL( - TCmDefConnValue aSelection ) - { - HBufC* ret = NULL; - switch ( aSelection.iType ) - { - case ECmDefConnDestination: - { - CCmDestinationImpl* dest = - iCmManagerImpl->DestinationL( aSelection.iId ); - CleanupStack::PushL( dest ); - ret = dest->NameLC(); - CleanupStack::Pop( ret ); - CleanupStack::PopAndDestroy( dest ); - break; - } - case ECmDefConnConnectionMethod: - { - ret = iCmManagerImpl->GetConnectionMethodInfoStringL( - aSelection.iId, ECmName ); - break; - } - } - return ret; - } - - - -//--------------------------------------------------------------------------- -// CCmConnSettingsUiImpl::SetDestinationArrayToUseL -//--------------------------------------------------------------------------- -// -EXPORT_C void CCmConnSettingsUiImpl::SetDestinationArrayToUseL( - RArray aDestinationArray ) - { - iPassedDestinations.Close(); - for (TInt i=0; i -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include "cmmanager.hrh" -#include "cmdesticondialog.h" -#include "cmdesticonmap.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ---------------------------------------------------------------------------- -// CCmDestinationIconDialog class -// CCmDestinationIconDialog() - constructor -// ---------------------------------------------------------------------------- -// -CCmDestinationIconDialog::CCmDestinationIconDialog( TInt& aIconIndex ) - : iIconIndex(&aIconIndex) - { - CEikDialog::SetBorder( AknBorderId::EAknBorderNotePopup ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconDialog::~CCmDestinationIconDialog() -// ----------------------------------------------------------------------------- -// -CCmDestinationIconDialog::~CCmDestinationIconDialog() - { - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconDialog::HandleResourceChange() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconDialog::HandleResourceChange(TInt aType) - { - CAknDialog::HandleResourceChange(aType); - - if (aType==KEikDynamicLayoutVariantSwitch) - { - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconDialog::OkToExitL() -// ----------------------------------------------------------------------------- -// -TBool CCmDestinationIconDialog::OkToExitL(TInt aButtonId) - { - CCmDestinationIconMap* iconmapControl = - STATIC_CAST(CCmDestinationIconMap*, Control(ECmDestIconMapContentId)); - // Selection key / select softkey adds a iconacter only if 5-key was not - // used to select multiple icons before. - if ( aButtonId == EAknSoftkeyOk || aButtonId == EAknSoftkeySelect ) - { - TKeyEvent key; - key.iCode=EKeyOK; - key.iModifiers=0; - iconmapControl->OfferKeyEventL(key, EEventKey); - } - return(ETrue); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconDialog::PreLayoutDynInitL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconDialog::PreLayoutDynInitL() - { - CCmDestinationIconMap* iconmapControl = - STATIC_CAST( CCmDestinationIconMap*, Control( ECmDestIconMapContentId )); - CAknPopupHeadingPane* headingPane = - STATIC_CAST( CAknPopupHeadingPane*, Control( EAknSCTQueryHeadingId )); - - iconmapControl->SetIndex(*iIconIndex); - - SetLineNonFocusing(EAknSCTQueryHeadingId); - - // add title - CEikonEnv* env = CEikonEnv::Static(); - HBufC* title = env->AllocReadResourceL( R_CMMANAGERUI_PRMPT_SELECT_ICON ); - CleanupStack::PushL( title ); - headingPane->SetTextL( *title ); - CleanupStack::PopAndDestroy( title ); - title = NULL; - -#ifdef RD_SCALABLE_UI_V2 - - iconmapControl->SetObserver(this); - -#endif // RD_SCALABLE_UI_V2 - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconDialog::SetSizeAndPosition() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconDialog::SetSizeAndPosition( const TSize& aSize ) - { - SetBorder( TGulBorder::ENone ); // No Dialog borders in SCT. - CAknDialog::SetSizeAndPosition( aSize ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconDialog::OfferKeyEventL() -// ----------------------------------------------------------------------------- -// -TKeyResponse CCmDestinationIconDialog::OfferKeyEventL( - const TKeyEvent& aKeyEvent, TEventCode aModifiers ) - { - if ( aModifiers == EEventKey ) - { - TUint code=aKeyEvent.iCode; - CCmDestinationIconMap* iconmapControl = - STATIC_CAST( CCmDestinationIconMap*, - Control( ECmDestIconMapContentId )); - - switch ( code ) - { - case EKeyLeftArrow: - case EKeyRightArrow: - case EKeyUpArrow: - case EKeyDownArrow: - { - TKeyResponse res( - iconmapControl->OfferKeyEventL( aKeyEvent, aModifiers )); - return res; - } - - case EKeyEnter: - // change fro EKeyEnter to EKeyOK - { - TKeyEvent keyEvent; - keyEvent.iCode = EKeyOK; - keyEvent.iScanCode = aKeyEvent.iScanCode; - keyEvent.iModifiers = aKeyEvent.iModifiers; - keyEvent.iRepeats = aKeyEvent.iRepeats; - return CEikDialog::OfferKeyEventL( keyEvent, aModifiers ); - } - - default: - break; - } - } - - return CEikDialog::OfferKeyEventL( aKeyEvent, aModifiers ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconDialog::ExecuteLD() -// ----------------------------------------------------------------------------- -// -TInt CCmDestinationIconDialog::ExecuteLD() - { - // Prepare real icon map - CEikDialog::PrepareLC( R_ICONSEL_DIALOG ); - return(RunLD()); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconDialog::CEikDialog_Reserved_1() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconDialog::CEikDialog_Reserved_1() - { - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconDialog::CEikDialog_Reserved_2() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconDialog::CEikDialog_Reserved_2() - { - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconDialog::CCmDestinationIconDialog_Reserved() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconDialog::CAknIconMapDialog_Reserved() - { - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconDialog::CreateCustomControlL() -// Virtual function override from the base class to implement the custom control -// ----------------------------------------------------------------------------- -// -SEikControlInfo CCmDestinationIconDialog::CreateCustomControlL( - TInt aControlType) - { - CCmDestinationIconMap *control= NULL; - if ( aControlType == KCmDestIconMapType ) - { - control = CCmDestinationIconMap::NewL(); - } - SEikControlInfo info; - info.iControl = control; - info.iFlags = 0; - info.iTrailerTextId = 0; - return info; - } - -#ifdef RD_SCALABLE_UI_V2 - -// ----------------------------------------------------------------------------- -// CCmDestinationIconDialog::HandleControlEventL -// Handles the event. -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconDialog::HandleControlEventL( - CCoeControl* /*aControl*/, - TCoeEvent aEventType ) - { - if( aEventType == EEventStateChanged) - { - iConSelected = ETrue; - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconDialog::HandleDialogPageEventL -// Handles the event. -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconDialog::HandleDialogPageEventL(TInt aEventID) - { - if ( AknLayoutUtils::PenEnabled() && ( aEventID == - MEikDialogPageObserver::EDialogPageTapped && iConSelected ) ) - { - TryExitL( EAknSoftkeyOk ); - } - } - -#endif //RD_SCALABLE_UI_V2 - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmdesticonmap.cpp --- a/cmmanager/cmmgr/Framework/Src/cmdesticonmap.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2058 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmDestinationIconMap -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // TEikScrollBarModelType -#include -#include -#include -#include -#include -#include -#include "cmdesticonmap.h" -#include "cmmanagerimpl.h" - -// The offset because of CEikDialogPage -const TInt KHorizontalDialogMargin = 0; -const TInt KVerticalDialogMargin = 0; -const TInt KAknSctCBaButtonDirections = 3; // bottom, right and left - -/** - * Extension class to CCmDestinationIconMap - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CCmDestinationIconMapExtension ) : public CBase, - public MObjectProvider - { - public: - - CCmDestinationIconMapExtension(); - ~CCmDestinationIconMapExtension(); - - protected: - - TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); - MObjectProvider* MopNext(); - - public: // data - - MCoeControlObserver *iObserver; - - TUint iFlags; - MObjectProvider* iIconMap; - TInt iMaxVisibleRows; - CAknsFrameBackgroundControlContext* iBgContext; - }; - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMapExtension::CCmDestinationIconMapExtension -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CCmDestinationIconMapExtension::CCmDestinationIconMapExtension() - : iMaxVisibleRows( 0 ) - { - iObserver = NULL; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMapExtension::MopSupplyObject() -// ----------------------------------------------------------------------------- -// -TTypeUid::Ptr CCmDestinationIconMapExtension::MopSupplyObject( TTypeUid aId ) - { - return MAknsControlContext::SupplyMopObject( aId, iBgContext ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMapExtension::MopNext() -// ----------------------------------------------------------------------------- -// -MObjectProvider* CCmDestinationIconMapExtension::MopNext() - { - return iIconMap; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMapExtension::~CCmDestinationIconMapExtension() -// ----------------------------------------------------------------------------- -// -CCmDestinationIconMapExtension::~CCmDestinationIconMapExtension() - { - delete iBgContext; - iBgContext = NULL; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::CCmDestinationIconMap -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CCmDestinationIconMap::CCmDestinationIconMap() - : iCursorPos( TPoint( 0,0 ) ) - , iOldCursorPos( TPoint( 0,0 ) ) - , iMaxColumns( -1 ) - , iDragAlreadyActive( EFalse ) - { - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCmDestinationIconMap* CCmDestinationIconMap::NewL() - { - CCmDestinationIconMap* self = new( ELeave ) CCmDestinationIconMap(); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); //self - return self; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::ConstructL() - { - // Must be created here to get the member variables available - iExtension = new ( ELeave ) CCmDestinationIconMapExtension; - iExtension->iIconMap = this; - - iConsArray = new( ELeave ) CAknIconArray( KNumOfIcons ); - - iExtension->iFlags = 0x00; - - DoLayout(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::~CCmDestinationIconMap() -// ----------------------------------------------------------------------------- -// -CCmDestinationIconMap::~CCmDestinationIconMap() - { - delete iSBFrame; iSBFrame = NULL; - - delete iOffscreenBg; - delete iBitmapDevice; - delete iBitmapGc; - - delete iExtension; - iExtension = ( CCmDestinationIconMapExtension* )NULL; - - if ( iConsArray ) - { - iConsArray->ResetAndDestroy(); - delete iConsArray; - iConsArray = NULL; - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::DoLayout() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::DoLayout() - { - TRAPD( err,LoadIconL() ); - if ( err ) - { - return; - } - - iIsMirrored = AknLayoutUtils::LayoutMirrored(); - iDrawnBefore = EFalse; - CountMaxColumnsAndCellSizes(); - SizeChanged(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::ConstructFromResourceL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::ConstructFromResourceL( - TResourceReader& /*aReader*/ ) - { - LoadIconL(); - CreateScrollBarAndIconRowL(); - - iExtension->iBgContext = CAknsFrameBackgroundControlContext::NewL( - KAknsIIDQsnFrPopup, - TRect( 0, 0, 1, 1 ), - TRect( 0, 0, 1, 1 ), - EFalse ); - - if ( DrawableWindow() && AknLayoutUtils::PenEnabled() ) - { - EnableDragEvents(); - SetGloballyCapturing( ETrue ); - SetPointerCapture( ETrue ); - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::LoadIcons() -// This actually load the all icons to be shown on dialog from icon file -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::LoadIconL() - { - iConsArray->ResetAndDestroy(); - // Draw all the Icons. - TParse mbmFile; - User::LeaveIfError( mbmFile.Set( KManagerIconFilename, - &KDC_APP_BITMAP_DIR, NULL ) ); - - // Create icon bitmap and mask. - for ( TInt i( 0 ); i < ( KNumOfIcons * 2 ); i++ ) - { - CFbsBitmap* bitmap = NULL; - CFbsBitmap* bitmapMask = NULL; - AknIconUtils::CreateIconLC( - bitmap, - bitmapMask, mbmFile.FullName(), - EMbmCmmanagerQgn_prop_set_conn_dest_internet_small + i, - EMbmCmmanagerQgn_prop_set_conn_dest_internet_small + i + 1 ); - i++; - AknIconUtils::SetSize( bitmap, - TSize( iGridItemWidth, iGridItemHeight ) ); - AknIconUtils::SetSize( bitmapMask, - TSize( iGridItemWidth, iGridItemHeight ) ); - CGulIcon* icon = CGulIcon::NewL( bitmap, bitmapMask ); - CleanupStack::PushL( icon ); - iConsArray->AppendL( icon ); - CleanupStack::Pop( 3, bitmap ); - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::HeightInRows() -// This actually returns the no of rows to be shown on a page -// Depends upon the Layout size -// ----------------------------------------------------------------------------- -// -TInt CCmDestinationIconMap::HeightInRows() - { - return ( iRows ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::CreateScrollBarAndIconRowL() -// This actually creates the scroll bar sets the number of -// pages and rows on a page to be shown -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::CreateScrollBarAndIconRowL() - { - iRows = ( ( iConsArray->Count() - 1 ) / iMaxColumns ) + 1 ; - iFirstVisibleRow = 0; - iAnimated = EFalse; - iCursorPos = TPoint( 0, 0 ); - iNumPages = ( iRows / iExtension->iMaxVisibleRows ) + - ( iRows % iExtension->iMaxVisibleRows ? 1 : 0 ); - iCurrentPage = 1; - - // Create and set the scb visible even though there is nothing to scroll - delete iSBFrame; iSBFrame=NULL; - - if ( AknLayoutUtils::PenEnabled() ) - { - iSBFrame=new( ELeave ) CEikScrollBarFrame( this, this, ETrue ); - } - else - { - iSBFrame=new( ELeave ) CEikScrollBarFrame( this, NULL, ETrue ); - } - // Decide which type of scrollbar is shown - CAknAppUi* appUi = iAvkonAppUi; - if ( AknLayoutUtils::DefaultScrollBarType( appUi ) == - CEikScrollBarFrame::EDoubleSpan ) - { - // For EDoubleSpan type scrollbar - if ( AknLayoutUtils::PenEnabled() ) - { - // window owning scrollbar - iSBFrame->CreateDoubleSpanScrollBarsL( ETrue, - EFalse, - ETrue, - EFalse ); - } - else - { - // non-window owning scrollbar - iSBFrame->CreateDoubleSpanScrollBarsL( EFalse, - EFalse, - ETrue, - EFalse ); - } - iSBFrame->SetTypeOfVScrollBar( CEikScrollBarFrame::EDoubleSpan ); - } - else - { - // For EArrowHead type scrollbar - iSBFrame->SetTypeOfVScrollBar( CEikScrollBarFrame::EArrowHead ); - } - - iSBFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, - CEikScrollBarFrame::EAuto ); - iSBFrame->VerticalScrollBar()->SetMopParent( iExtension ); - UpdateScrollIndicatorL(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::SetIndex -// set the reference of the selected icon index from the table -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::SetIndex( TInt& aIconIndex ) - { - iIconIndex = &aIconIndex; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::MinimumSize -// -// ----------------------------------------------------------------------------- -// -TSize CCmDestinationIconMap::MinimumSize() - { - iIsMirrored = AknLayoutUtils::LayoutMirrored(); - CountMaxColumnsAndCellSizes(); - - TRect rect; - // Used the set rect, but resolution changes cannot be handled when it is used - - TAknLayoutRect dialogLayRect; - - // Main pane without softkeys - TRect mainPaneRect; - if ( !AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect ) ) - { - mainPaneRect = iAvkonAppUi->ClientRect(); - } - - // Dialog layout, check variety first - TAknLayoutScalableParameterLimits iconMapDialogVariety = - AknLayoutScalable_Avkon::popup_grid_graphic_window_ParamLimits(); - - // Calc the variety - TInt maxVariety = iconMapDialogVariety.LastVariety(); - - // Check the CBA, if the orientation is not landscape - // there is not so much varieties - AknLayoutUtils::TAknCbaLocation location = AknLayoutUtils::CbaLocation(); - // the offset for the certain cba location variety - TInt maxVarietyOffset = 0; - // the number of varieties - TInt varietyOffset = maxVariety + 1; - - // landscape variety number must be calculated offset == number of varieties - // same applies to the variety number for the biggest sized layout for the - // variety - if ( Layout_Meta_Data::IsLandscapeOrientation() ) - { - // the offset for one variety - varietyOffset = ( maxVariety + 1 ) / KAknSctCBaButtonDirections; - } - - // for right and left cba buttons the max variety is not zero - // the varities are ordered by the location of the cba and the descending order - // e.g the biggest sized layout first, the smallest last - if ( location == AknLayoutUtils::EAknCbaLocationRight ) - { - maxVarietyOffset = varietyOffset; - } - else if ( location == AknLayoutUtils::EAknCbaLocationLeft ) - { - maxVarietyOffset = varietyOffset + varietyOffset; // 2* - } - - TInt varietyNumber = varietyOffset - iRows - 1; - - // if more lines than possible to show, use the default - // ( the biggest grid ) variety - if ( varietyNumber < 0 ) - varietyNumber = 0; - // if zero rows, use the minimum - else if ( iRows<=0 ) - varietyNumber -= 1; - - //add the varietyoffset - varietyNumber += maxVarietyOffset; - - if ( Layout_Meta_Data::IsLandscapeOrientation() && - location == AknLayoutUtils::EAknCbaLocationRight ) - { - varietyNumber = 10; - } - else - { - if( iRows == 0 ) - { - varietyNumber = 5; - } - else - { - varietyNumber = 3; - } - } - // Layout the dialog size - dialogLayRect.LayoutRect( mainPaneRect, - AknLayoutScalable_Avkon::popup_grid_graphic_window( varietyNumber ) ); - - // Layout the grid - TAknLayoutRect gridWithScrollLayRect; - gridWithScrollLayRect.LayoutRect( dialogLayRect.Rect(), - AknLayoutScalable_Avkon::listscroll_popup_graphic_pane() ); - - return TSize( dialogLayRect.Rect().Width(), - gridWithScrollLayRect.Rect().Height() ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::ActivateL() -// This method is needed to set correct initial value to scroll indicator. -// ----------------------------------------------------------------------------- -// - void CCmDestinationIconMap::ActivateL() - { - CCoeControl::ActivateL(); - if ( iRows > iExtension->iMaxVisibleRows ) - { - UpdateScrollIndicatorL(); - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::OfferKeyEventL -// Handles all the Keypad events -// ----------------------------------------------------------------------------- -// -TKeyResponse CCmDestinationIconMap::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode /*aModifiers*/ ) - { - TUint code=aKeyEvent.iCode; - - switch ( code ) - { - case EKeyLeftArrow: - case '4': - MoveCursorL( -1,0 ); - break; - case EKeyRightArrow: - case '6': - MoveCursorL( 1,0 ); - break; - case EKeyUpArrow: - case '2': - MoveCursorL( 0,-1 ); - break; - case EKeyDownArrow: - case '8': - MoveCursorL( 0,1 ); - break; - case EKeyOK: - case '5': - case EKeySpace: - { - if ( iConsArray ) - { - TInt ret = iMaxColumns * - ( iFirstVisibleRow + iCursorPos.iY ) + - iCursorPos.iX; - if ( ret <= iConsArray->Count() ) - { - *iIconIndex = ret; - } - else - { - *iIconIndex = -1; - } - } - - } - break; - default: - return EKeyWasNotConsumed; - - } - return EKeyWasConsumed; - } - -#ifdef RD_SCALABLE_UI_V2 - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::HandlePointerEventL -// Handles all the Keypad events -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::HandlePointerEventL( - const TPointerEvent& aPointerEvent ) - { - if ( AknLayoutUtils::PenEnabled() ) - { - TInt newGridX; // For the whole - TInt newGridY; // For the whole grid. - TInt yInPixels = aPointerEvent.iPosition.iY - iGridTopLeft.iY; - newGridY = yInPixels / iGridItemHeight; - if ( ( aPointerEvent.iPosition.iX - iGridTopLeft.iX ) < 0 ) - { - newGridX = -1; - } - else - { - newGridX = ( aPointerEvent.iPosition.iX - iGridTopLeft.iX ) - / iGridItemWidth; - } - - // The pointer has been set down or dragged into the area of the grid. - // (it might be in the "white space" at the end of the grid) - if ( ( yInPixels >= 0 && yInPixels < iGridItemHeight - * iExtension->iMaxVisibleRows) && - // When the pointer is in rows except the recent icon row - ( ( ( ( newGridY + iFirstVisibleRow ) != 0 ) && - newGridX < iMaxColumns && newGridX >= 0 ) || - // When the pointer is in the recent icon row - ( ( newGridY + iFirstVisibleRow == 0 ) && - ( newGridX < iMaxColumns ) ) ) ) - { - TUint globalY = newGridY + iFirstVisibleRow; - // For any action to be taken, the pointer event must either be a - // Button1Down or a drag event which has originated from a - // Button1Down in to the grid. - if ( aPointerEvent.iType == TPointerEvent::EButton1Down || - aPointerEvent.iType == TPointerEvent::EDrag ) - { - if ( aPointerEvent.iType == TPointerEvent::EDrag ) - { - iDragAlreadyActive = ETrue; - } - - // The user tapps a cell which has no icon. it is ignored. - if ( iConsArray->Count() > globalY * iMaxColumns + newGridX ) - { - // If icon is already selected then on single tap it - // should select the icon. - if( iCursorPos.iY == newGridY && - iCursorPos.iX == newGridX && - aPointerEvent.iType != TPointerEvent::EDrag ) - { - if ( iExtension->iObserver ) - { - iExtension->iObserver->HandleControlEventL( - this, - MCoeControlObserver::EEventStateChanged ); - } - } - else if ( iCursorPos.iX + ( iCursorPos.iY + - iFirstVisibleRow ) * iMaxColumns < - iConsArray->Count() ) - { - iOldCursorPos = iCursorPos; - iCursorPos.iY = newGridY; - iCursorPos.iX = newGridX; - DrawCursor(); - } - else - { - iOldCursorPos.iX = 0; - iOldCursorPos.iY = 0; - } - } - } - else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) - { - // The pointer has been set and dragged into the area of - // the grid. - if ( yInPixels >= 0 && yInPixels < iGridItemHeight * - iExtension->iMaxVisibleRows && - iDragAlreadyActive && - iOldCursorPos == iCursorPos && - (iConsArray->Count() > (globalY * iMaxColumns + newGridX))) - { - if ( iExtension->iObserver ) - { - iExtension->iObserver->HandleControlEventL( - this, - MCoeControlObserver::EEventStateChanged ); - } - iDragAlreadyActive = EFalse; - } - } - - MTouchFeedback* feedback = MTouchFeedback::Instance(); - - if ( feedback ) - { - if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - feedback->InstantFeedback( this, ETouchFeedbackBasic ); - } - else if ( aPointerEvent.iType == TPointerEvent::EDrag && iCursorPos != iOldCursorPos ) - { - feedback->InstantFeedback( this, ETouchFeedbackSensitive ); - } - } - } - else // For a non window owning scrollbar. - { - if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) - { - iDragAlreadyActive = EFalse; - } - } - - CCoeControl::HandlePointerEventL( aPointerEvent ); - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::SetObserver -// Sets the observer. -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::SetObserver( MCoeControlObserver* aObserver ) - { - if ( iExtension ) - { - iExtension->iObserver = aObserver; - } - } - -#endif //RD_SCALABLE_UI_V2 - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::InputCapabilities() -// -// ----------------------------------------------------------------------------- -// -TCoeInputCapabilities CCmDestinationIconMap::InputCapabilities() const - { - return TCoeInputCapabilities( TCoeInputCapabilities::EAllText ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::SizeChanged() -// Control position of this control is registered for skin library when -// necessary in CEikDialogPage::SetDataPosition, so we do not do that in this -// method. -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::SizeChanged() - { - // Get the layout - - // Main pane without softkeys - TRect mainPaneRect; - - if ( !AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, - mainPaneRect ) ) - { - mainPaneRect = iAvkonAppUi->ClientRect(); - } - - // Dialog layout, check variety first - TAknLayoutScalableParameterLimits iconMapDialogVariety = - AknLayoutScalable_Avkon::popup_grid_graphic_window_ParamLimits(); - - TInt maxVariety = iconMapDialogVariety.LastVariety(); - - // Check the CBA, if the orientation is not landscape - // there is not so much varieties - AknLayoutUtils::TAknCbaLocation location = AknLayoutUtils::CbaLocation(); - // the offset for the certain cba location variety - TInt maxVarietyOffset = 0; - TInt varietyOffset = maxVariety + 1; - - // landscape variety number must be calculated offset == number of varieties - // same applies to the variety number for the biggest sized layout for the - // variety - if ( Layout_Meta_Data::IsLandscapeOrientation() ) - { - // the offset for one variety - varietyOffset = ( maxVariety + 1 ) / KAknSctCBaButtonDirections; - } - - // for right and left cba buttons the max variety is not zero - // the varities are ordered by the location of the cba and the descending - // order e.g the biggest sized layout first, the smallest last - if ( location == AknLayoutUtils::EAknCbaLocationRight ) - { - maxVarietyOffset = varietyOffset; - } - else if ( location == AknLayoutUtils::EAknCbaLocationLeft ) - { - maxVarietyOffset = varietyOffset + varietyOffset; // 2* - } - - TInt varietyNumber = varietyOffset - iRows - 1; - - // if more lines than possible to show, use the default - // ( the biggest grid ) variety - if ( varietyNumber < 0 ) - varietyNumber = 0; - // if zero rows, use the minimum - else if ( iRows<=0 ) - varietyNumber -= 1; - - //add the varietyoffset - varietyNumber += maxVarietyOffset; - - if ( Layout_Meta_Data::IsLandscapeOrientation() && - location == AknLayoutUtils::EAknCbaLocationRight ) - { - varietyNumber = 10; - } - else - { - if ( iRows == 0 ) - { - varietyNumber = 5; - } - else - { - varietyNumber = 3; - } - - } - - TAknLayoutRect popupGridLayRect; - popupGridLayRect.LayoutRect( mainPaneRect, - AknLayoutScalable_Avkon::popup_grid_graphic_window( varietyNumber ) ); - - // Calculate the size relatively - TRect relativeDialog( TPoint( 0,0 ),popupGridLayRect.Rect().Size() ); - - // Get the layout of the actual icon grid with scrollbar - TAknLayoutRect gridWithScrollLayRect; - gridWithScrollLayRect.LayoutRect( relativeDialog, - AknLayoutScalable_Avkon::listscroll_popup_graphic_pane() ); - - // Then the grid area without scrollbar - // NOTE: The grid with scroll bar is used as reference - TAknLayoutRect gridLayRect; - gridLayRect.LayoutRect( gridWithScrollLayRect.Rect(), - AknLayoutScalable_Avkon::grid_graphic_popup_pane( 0 ) ); - - // Different parent if SCT inside editing menu. - TRect contentRect = gridLayRect.Rect(); - - // The x coordinate is 3 pixels to right and y coordinate 3 pixels up - // so substract from x coordinate and add to y coordinate - if ( iIsMirrored ) - { - iOffset = TPoint( - contentRect.iBr.iX - KHorizontalDialogMargin - iGridItemWidth + 1, - contentRect.iTl.iY - KVerticalDialogMargin + 1 ); - - iGridTopLeft.iX = contentRect.iBr.iX - - KHorizontalDialogMargin - - ( iMaxColumns * iGridItemWidth ); - iGridTopLeft.iY = contentRect.iTl.iY - KVerticalDialogMargin; - } - else // not mirrored - { - iOffset = TPoint( contentRect.iTl.iX - KHorizontalDialogMargin + 1, - contentRect.iTl.iY - KVerticalDialogMargin + 1 ); - iGridTopLeft.iX = contentRect.iTl.iX - KHorizontalDialogMargin; - iGridTopLeft.iY = contentRect.iTl.iY - KVerticalDialogMargin; - } - - - // The last, update background context - if ( iExtension->iBgContext ) - { - TInt bgVariety = 0; - if ( Layout_Meta_Data::IsLandscapeOrientation() ) - { - bgVariety = 1; - } - - TAknLayoutRect innerRect; - innerRect.LayoutRect( - relativeDialog, - AknLayoutScalable_Avkon::bg_popup_window_pane_g1( bgVariety ) ); - - iExtension->iBgContext->SetFrameRects( relativeDialog, - innerRect.Rect() ); - } - - TRAPD( err,UpdateScrollIndicatorL() ); - if ( err ) - { - return; - } - } - - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::HandleResourceChange() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::HandleResourceChange( TInt aType ) - { - if ( aType == KEikDynamicLayoutVariantSwitch ) - { - // save the old info for the magnitudes of the SCT grid - TInt oldMaxColumns = iMaxColumns; - //TInt oldMaxRows = 0; - //oldMaxRows = iRows; - // calculate the new magnitudes - DoLayout(); - - // then calculate the index position of the cursor in the icon table - // and update the x and y positions for the new grid with it - - TInt oldCursorPosition = ( iFirstVisibleRow + iOldCursorPos.iY ) * - oldMaxColumns + - iOldCursorPos.iX; - - TInt currentCursorPosition = ( iFirstVisibleRow + iCursorPos.iY ) * - oldMaxColumns + - iCursorPos.iX; - - // the new first row is the top row on the page where the new focus is - iFirstVisibleRow = iExtension->iMaxVisibleRows * - ( currentCursorPosition / - ( iMaxColumns * iExtension->iMaxVisibleRows ) ); - - // the cursor positions are relative to current page - iCursorPos.iY = ( currentCursorPosition - - ( iMaxColumns * iFirstVisibleRow ) ) / - iMaxColumns; - iCursorPos.iX = currentCursorPosition - - ( iMaxColumns * iFirstVisibleRow ) - - ( iMaxColumns * iCursorPos.iY ); - - iOldCursorPos.iY = ( oldCursorPosition - - ( iMaxColumns * iFirstVisibleRow ) ) / - iMaxColumns; - iOldCursorPos.iX = oldCursorPosition - - ( iMaxColumns * iFirstVisibleRow ) - - ( iMaxColumns * iOldCursorPos.iY ); - } - - if ( aType == KAknsMessageSkinChange ) - { - iOffscreenBgDrawn = EFalse; - } - - CCoeControl::HandleResourceChange( aType ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::Draw() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::Draw( const TRect& /*aRect*/ ) const - { - TInt cursorPos = 0; - CWindowGc& gc=SystemGc(); - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); - - TRect rect = Rect(); - - // Main pane without softkeys - TRect mainPaneRect; - if ( !AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, - mainPaneRect ) ) - { - mainPaneRect = iAvkonAppUi->ClientRect(); - } - - // Dialog layout, check variety first - TAknLayoutScalableParameterLimits iconMapDialogVariety = - AknLayoutScalable_Avkon::popup_grid_graphic_window_ParamLimits(); - - // The variety starts from 0 so add +1 - TInt maxVariety = iconMapDialogVariety.LastVariety(); - - // Check the CBA, if the orientation is not landscape - // there is not so much varieties - AknLayoutUtils::TAknCbaLocation location = AknLayoutUtils::CbaLocation(); - // the offset for the certain cba location variety - TInt maxVarietyOffset = 0; - TInt varietyOffset = maxVariety + 1; - - // landscape variety number must be calculated offset == number of varieties - // same applies to the variety number for the biggest sized layout for the - // variety - if ( Layout_Meta_Data::IsLandscapeOrientation() ) - { - // the offset for one variety - varietyOffset = ( maxVariety + 1 )/KAknSctCBaButtonDirections; - } - - // for right and left cba buttons the max variety is not zero - // the varities are ordered by the location of the cba and the descending - // order e.g the biggest sized layout first, the smallest last - if ( location == AknLayoutUtils::EAknCbaLocationRight ) - { - maxVarietyOffset = varietyOffset; - } - else if ( location == AknLayoutUtils::EAknCbaLocationLeft ) - { - maxVarietyOffset = varietyOffset + varietyOffset; // 2* - } - - TInt varietyNumber = varietyOffset - iRows - 1; - - // if more lines than possible to show, use the default - // ( the biggest grid ) variety - if ( varietyNumber < 0 ) - { - varietyNumber = 0; - } - // if zero rows, use the minimum - else if ( iRows<=0 ) - { - varietyNumber -= 1; - } - - //add the varietyoffset - varietyNumber += maxVarietyOffset; - - if ( Layout_Meta_Data::IsLandscapeOrientation() && - location == AknLayoutUtils::EAknCbaLocationRight ) - { - varietyNumber = 10; - } - else - { - varietyNumber = 3; - } - // Layout the dialog size - TAknLayoutRect dialogLayRect; - dialogLayRect.LayoutRect( - mainPaneRect, - AknLayoutScalable_Avkon::popup_grid_graphic_window( varietyNumber ) ); - - // Get the missing height for the background - TInt backgroundHeightOffset = dialogLayRect.Rect().Height() - rect.iBr.iY; - - rect.iBr.iY += backgroundHeightOffset; - - // Check if we got an offscreen bitmap allocated for skin background and - // there is bitmap background in the current skin. - if ( iOffscreenBg && iHasBitmapBackground ) - { - DrawOffscreenBackgroundIfRequired(); - gc.BitBlt( rect.iTl, iOffscreenBg ); - } - else - { - AknsDrawUtils::Background( skin, cc, this, gc, rect ); - } - - TInt numberOfIconsToBeDrawn = iConsArray->Count(); - numberOfIconsToBeDrawn -= ( iFirstVisibleRow * iMaxColumns ); - if ( numberOfIconsToBeDrawn > 0 ) - { - if ( numberOfIconsToBeDrawn > - ( iExtension->iMaxVisibleRows * iMaxColumns ) ) - { - numberOfIconsToBeDrawn = iExtension->iMaxVisibleRows * iMaxColumns; - } - - gc.SetPenStyle( CGraphicsContext::ESolidPen ); - gc.SetBrushStyle( CGraphicsContext::ENullBrush ); - gc.SetPenSize( TSize( 1,1 ) ); - - // 2 ) Draw the grid - const TSize gridItemRectSize( iGridItemWidth + 1, iGridItemHeight + 1 ); - - TInt numberOfGridCellsToBeDrawn = numberOfIconsToBeDrawn; - - TRgb colorLine = AKN_LAF_COLOR( 219 ); - AknsUtils::GetCachedColor( skin, - colorLine, - KAknsIIDQsnLineColors, - EAknsCIQsnLineColorsCG5 ); - TRgb colorRecentLine = AKN_LAF_COLOR( 215 ); - AknsUtils::GetCachedColor( skin, - colorRecentLine, - KAknsIIDQsnLineColors, - EAknsCIQsnLineColorsCG7 ); - - // default pen color - gc.SetPenColor( colorLine ); - - TInt fullRows = numberOfGridCellsToBeDrawn / iMaxColumns; - - // how many left after the full rows - numberOfGridCellsToBeDrawn -= fullRows * iMaxColumns; - - TPoint pos = iGridTopLeft; - - TInt endX = pos.iX + iGridItemWidth * iMaxColumns + 1; - TInt endY = pos.iY + iGridItemHeight * fullRows; - - TInt ii = 0; - - if ( fullRows ) - { - // Draw full vertical lines - for ( ii = 0 ; ii <= iMaxColumns ; ii++ ) - { - gc.SetPenColor( colorLine ); - gc.SetPenSize( TSize( 1,1 ) ); - gc.DrawLine( pos, TPoint( pos.iX, endY ) ); - pos.iX += iGridItemWidth; - } - - pos = iGridTopLeft; - - // Draw full horizontal lines - for ( ii = 0 ; ii <= fullRows ; ii++ ) - { - gc.SetPenSize( TSize( 1,1 ) ); - gc.SetPenColor( colorLine ); - gc.DrawLine( pos, TPoint( endX, pos.iY ) ); - pos.iY += iGridItemHeight; - } - gc.SetPenColor( colorLine ); - gc.SetPenSize( TSize( 1,1 ) ); - } - - if ( numberOfGridCellsToBeDrawn ) - { - // Remaining cells in the last, non-full row - pos = iOffset; - // iOffset is cell area topLeft, grid is not included in it - pos.iX--; - pos.iY--; - - pos.iY += iGridItemHeight * fullRows; - - for ( ii = 0 ; ii < numberOfGridCellsToBeDrawn ; ii++ ) - { - gc.DrawRect( TRect( pos, gridItemRectSize ) ); - - if ( iIsMirrored ) - pos.iX -= iGridItemWidth; - else // not mirrored - pos.iX += iGridItemWidth; - } - } - - TInt iconIndex = ( iCurrentPage - 1 ) * - ( iMaxColumns * iExtension->iMaxVisibleRows ); - TInt lCnt = iConsArray->Count(); - cursorPos = iCursorPos.iX + iCursorPos.iY * iMaxColumns; - if ( lCnt > 0 ) - { - TRect cellRect( TPoint( 0,0 ), - TSize( iGridItemWidth - 1, iGridItemHeight - 1 ) ); - for ( TInt j = iconIndex, i = 0; - j < lCnt && i < numberOfIconsToBeDrawn; - j++, i++ ) - { - DrawItem( gc, CursorRect( i ), j, cursorPos == i, EFalse ); - } - } - - } - iDrawnBefore = ETrue; - gc.DiscardFont(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::DrawItem() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::DrawItem( - CWindowGc& aGc, - const TRect& aSctPosition, - TInt aIconIndex, - TBool aHighlighted, - TBool aDrawBackground ) const - { - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); - - TBool skins = AknsDrawUtils::Background( skin,cc,aGc, aSctPosition ); - TRgb color; - if ( !skins ) - aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); - if ( aHighlighted ) - { - TRgb colorHightLightRect = AKN_LAF_COLOR( 215 ); - AknsUtils::GetCachedColor( skin, - colorHightLightRect, - KAknsIIDQsnLineColors, - EAknsCIQsnLineColorsCG7 ); - aGc.SetPenColor( colorHightLightRect ); - aGc.DrawRect( aSctPosition ); - - // Shrink by one pixel in all directions. - TRect innerRect = aSctPosition; - innerRect.Shrink( 1,1 ); - - color = AKN_LAF_COLOR( 210 ); - AknsUtils::GetCachedColor( skin, - color, - KAknsIIDQsnHighlightColors, - EAknsCIQsnHighlightColorsCG1 ); - aGc.SetBrushColor( color ); - aGc.Clear( innerRect ); - } - else if ( aDrawBackground ) - { - TRect innerRect = aSctPosition; - aGc.SetBrushColor( AKN_LAF_COLOR( 0 ) ); - if ( !skins ) - { - aGc.Clear( innerRect ); - } - else - { - AknsDrawUtils::Background( skin, cc, this, aGc, innerRect ); - } - } - - if ( iConsArray ) - { - TInt lCnt = iConsArray->Count(); - if ( lCnt > 0 && aIconIndex < lCnt && aIconIndex >= 0 ) - { - TRect cellRect( TPoint( 0,0 ), - TSize( iGridItemWidth - 1, iGridItemHeight - 1 ) ); - - CGulIcon* bitmap = NULL; - bitmap = iConsArray->At( aIconIndex ); - TInt numIconsInaPage = iExtension->iMaxVisibleRows * iMaxColumns; - TInt cellIndex = aIconIndex; - if ( aIconIndex >= numIconsInaPage ) - { - cellIndex = aIconIndex % numIconsInaPage; - } - aGc.BitBltMasked( CursorPoint( cellIndex ), - bitmap->Bitmap(), - cellRect, - bitmap->Mask(), - EFalse ); - } - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::DrawCursor() -// Optimizes drawing. Only cursor is drawn. -// ----------------------------------------------------------------------------- -void CCmDestinationIconMap::DrawCursor() const - { - // Whole Icon Map has to be drawn at least once. - // If the user presses arrow key before Icon Map has been drawn, - // only cursor position is drawn without this check. - if ( !iDrawnBefore ) - { - DrawNow(); - } - // Only redraw old and new cursor position cells - ActivateGc(); - CWindowGc& gc = SystemGc(); - - TInt cursorPos = iOldCursorPos.iX + iOldCursorPos.iY * iMaxColumns; - DrawCell( cursorPos, EFalse ); - - cursorPos = iCursorPos.iX + iCursorPos.iY * iMaxColumns; - DrawCell( cursorPos, ETrue ); - - gc.DiscardFont(); - DeactivateGc(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::DrawCell -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::DrawCell( - TInt aCursorPos, - TBool aHighlighted ) const - { - // calculate icon index - TInt iconIndex = aCursorPos + iFirstVisibleRow * iMaxColumns; - - // If we are only redrawing for animations, no need to draw non-animated - // items. - TRect rect = CursorRect( aCursorPos ); - - Window().Invalidate( rect ); - Window().BeginRedraw( rect ); - DrawItem( SystemGc(), rect, iconIndex, aHighlighted, ETrue ); - Window().EndRedraw(); - SystemGc().DiscardFont(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::CursorRect -// ----------------------------------------------------------------------------- -// -TRect CCmDestinationIconMap::CursorRect( TInt aCursorPos ) const - { - TPoint pos = iOffset; - - if ( iIsMirrored ) - { - pos.iX -= ( aCursorPos % iMaxColumns ) * iGridItemWidth; - } - else // Not mirrored - { - pos.iX += ( aCursorPos % iMaxColumns ) * iGridItemWidth; - } - - pos.iY += ( aCursorPos / iMaxColumns ) * iGridItemHeight; - return TRect( pos, TSize( iGridItemWidth - 1, iGridItemHeight - 1 ) ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::CursorPoint -// ----------------------------------------------------------------------------- -// -TPoint CCmDestinationIconMap::CursorPoint( TInt aCursorPos ) const - { - TPoint pos = iOffset; - - if ( iIsMirrored ) - { - pos.iX -= ( aCursorPos % iMaxColumns ) * iGridItemWidth; - } - else // Not mirrored - { - pos.iX += ( aCursorPos % iMaxColumns ) * iGridItemWidth; - } - - pos.iY += ( aCursorPos / iMaxColumns ) * iGridItemHeight; - return pos; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::MoveCursorL -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::MoveCursorL( TInt aDeltaX, TInt aDeltaY ) - { - if ( iIsMirrored ) - aDeltaX = -aDeltaX; - - if ( ( iConsArray->Count() < 8 ) ) - return; - - iOldCursorPos = iCursorPos; - TInt oldFirstVisibleRow = iFirstVisibleRow; - - TInt globalYPos = iCursorPos.iY + iFirstVisibleRow; - TInt lastColumnOnLastRow = ( ( iConsArray->Count() - 1 ) % iMaxColumns ); - - TInt skipicon = aDeltaX != 0 ? 1: 0; - - if ( aDeltaX < 0 ) - { - // Cursor was moved to left. - if ( iCursorPos.iX > skipicon - 1 ) - { - iCursorPos.iX -= skipicon; - } - else - { - if ( skipicon > iMaxColumns ) - { - globalYPos--; - iCursorPos.iX = iMaxColumns; - } - // Go to previous line - globalYPos--; - if ( globalYPos < 0 ) - { - // Cursor was on the first line - go to last line. - globalYPos = iRows - 1; - // x - position to the last item on the last row. - iCursorPos.iX = lastColumnOnLastRow; - } - else - { - // x - position to last column. - iCursorPos.iX = iMaxColumns - skipicon; - } - } - } - - if ( aDeltaX > 0 ) - { - // Cursor was moved to right. - if ( globalYPos < iRows - 1 ) - { - // Not in the last row. - if ( iCursorPos.iX < iMaxColumns - skipicon ) - { - // If not on the last columns, move cursor to next column. - iCursorPos.iX += skipicon; - } - else - { - // Cursor was on last column, - // move to first column of the next line. - iCursorPos.iX = 0; - globalYPos++; - } - } - else - { - // Currently on the last row. - if ( iCursorPos.iX < lastColumnOnLastRow ) - { - // If there are more items on this row, move cursor to next item. - iCursorPos.iX++; - } - else - { - // No more item on the current row. - // Move to first item on the first row. - iCursorPos.iX = 0; - globalYPos = 0; - } - } - } - - if ( aDeltaY < 0 ) - { - iCursorPos.iX -= skipicon; - if ( iCursorPos.iX < 0 ) - { - iCursorPos.iX += ( iMaxColumns - 1 ); - globalYPos--; - } - // Cursor was moved to up. - if ( globalYPos > 0 ) - { - // Cursor was not on the first line - move it to previous row. - globalYPos--; - } - else - { - // Move cursot to last to row. - globalYPos = iRows - 1; - if ( iCursorPos.iX > lastColumnOnLastRow ) - { - // No items in the current column on the last row - - // move cursor to last item on the row. - iCursorPos.iX = lastColumnOnLastRow; - } - } - } - - if ( aDeltaY > 0 ) - { - iCursorPos.iX = ( iCursorPos.iX + skipicon ) % iMaxColumns; - globalYPos += ( iCursorPos.iX + skipicon ) / iMaxColumns; - // Cursor was moved to down. - if ( globalYPos < iRows - 1 ) - { - // Cursor is not on the last row. Move cursor to next row. - globalYPos++; - if ( globalYPos == iRows - 1 && - iCursorPos.iX > lastColumnOnLastRow ) - { - // No items in the current column on the last row - - // move cursor to last item on the row. - iCursorPos.iX = lastColumnOnLastRow; - } - } - else - { - // Cursor was at the last row - move it to the first row. - globalYPos = 0; - } - } - iCursorPos.iY = globalYPos - iFirstVisibleRow; - - if ( globalYPos < iFirstVisibleRow ) - { - // Cursor was moved from the top row. - if ( globalYPos <= 0 ) - { - iFirstVisibleRow = 0; - iCursorPos = TPoint( iCursorPos.iX, 0 ); - } - else - { - // If cursor was moved up out of the visible area - show it again. - iFirstVisibleRow -= iExtension->iMaxVisibleRows; - iCursorPos = TPoint( iCursorPos.iX, - iExtension->iMaxVisibleRows - 1 ); - } - } - - if ( globalYPos > iFirstVisibleRow + iExtension->iMaxVisibleRows - 1 ) - { - if ( globalYPos == iRows - 1 ) - { - // When cursor has moved from the top line, - // it is adjusted to a page boundary. - iCursorPos = TPoint( - iCursorPos.iX, - ( iRows - 1 ) % iExtension->iMaxVisibleRows - ); - iFirstVisibleRow = ( ( iRows - 1 ) / iExtension->iMaxVisibleRows ) * - iExtension->iMaxVisibleRows; - } - else - { - // If cursor was moved down out of the visible area - show it again. - iFirstVisibleRow += iExtension->iMaxVisibleRows; - iCursorPos = TPoint( iCursorPos.iX, 0 ); - } - } - - //TInt increment( 1 ); - //if ( aDeltaY < 0 || aDeltaX < 0 ) - // { - //// increment = -1; - // } - if ( iRows > iExtension->iMaxVisibleRows && - ( iOldCursorPos.iY + oldFirstVisibleRow != - iCursorPos.iY + iFirstVisibleRow ) ) - { - UpdateScrollIndicatorL(); - } - - if ( oldFirstVisibleRow == iFirstVisibleRow ) - { - // Draw only cursor if the view to the content was not scrolled. - DrawCursor(); - } - else - { - DrawNow(); - } - - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::UpdateScrollIndicatorL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::UpdateScrollIndicatorL() - { - if ( !iSBFrame ) - { - return; - } - TEikScrollBarModel hSbarModel; - TEikScrollBarModel vSbarModel; - - TEikScrollBarFrameLayout layout; - - // Main pane without softkeys - TRect mainPaneRect; - if ( !AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, - mainPaneRect ) ) - { - mainPaneRect = iAvkonAppUi->ClientRect(); - } - - // Dialog layout, check variety first - TAknLayoutScalableParameterLimits iconMapDialogVariety = - AknLayoutScalable_Avkon::popup_grid_graphic_window_ParamLimits(); - - TInt maxVariety = iconMapDialogVariety.LastVariety(); - - // Check the CBA, if the orientation is not landscape - // there is not so much varieties - AknLayoutUtils::TAknCbaLocation location = AknLayoutUtils::CbaLocation(); - // the offset for the certain cba location variety - TInt maxVarietyOffset = 0; - TInt varietyOffset = maxVariety + 1; - - // landscape variety number must be calculated offset == number of varieties - // same applies to the variety number for the biggest sized layout for the - // variety - if ( Layout_Meta_Data::IsLandscapeOrientation() ) - { - // the offset for one variety - varietyOffset = ( maxVariety + 1 )/KAknSctCBaButtonDirections; - } - - // for right and left cba buttons the max variety is not zero - // the varities are ordered by the location of the cba and the descending - // order e.g the biggest sized layout first, the smallest last - if ( location == AknLayoutUtils::EAknCbaLocationRight ) - { - maxVarietyOffset = varietyOffset; - } - else if ( location == AknLayoutUtils::EAknCbaLocationLeft ) - { - maxVarietyOffset = varietyOffset + varietyOffset; // 2* - } - - TInt varietyNumber = varietyOffset - iRows - 1; - - // if more lines than possible to show, use the default - // ( the biggest grid ) variety - if ( varietyNumber < 0 ) - { - varietyNumber = 0; - } - // if zero rows, use the minimum - else if ( iRows <= 0 ) - { - varietyNumber -= 1; - } - - //add the varietyoffset - varietyNumber += maxVarietyOffset; - - if ( Layout_Meta_Data::IsLandscapeOrientation() && - location == AknLayoutUtils::EAknCbaLocationRight ) - { - varietyNumber = 10; - } - else - { - varietyNumber = 3; - } - // Layout the dialog size - TAknLayoutRect dialogLayRect; - dialogLayRect.LayoutRect( mainPaneRect, - AknLayoutScalable_Avkon::popup_grid_graphic_window( varietyNumber ) ); - - TRect dialogRect = dialogLayRect.Rect(); - - // Get the layout of the actual icon grid with scrollbar - TAknLayoutRect gridWithScrollLayRect; - - gridWithScrollLayRect.LayoutRect( - TRect( TPoint( 0,0 ), - TSize( dialogRect.Size() ) ), - AknLayoutScalable_Avkon::listscroll_popup_graphic_pane() ); - - // Calculate the relative rect for the grid - TRect parent = gridWithScrollLayRect.Rect(); - - TAknWindowComponentLayout scrollbarLayout = - AknLayoutScalable_Avkon::scroll_pane_cp5(); - - iCurrentPage = ( iFirstVisibleRow / iExtension->iMaxVisibleRows ) + 1; - - vSbarModel.iScrollSpan = iNumPages * iExtension->iMaxVisibleRows; - vSbarModel.iThumbSpan = iExtension->iMaxVisibleRows; - - if ( iSBFrame && iSBFrame->TypeOfVScrollBar() == - CEikScrollBarFrame::EDoubleSpan ) - { - // For EDoubleSpan type scrollbar - vSbarModel.iThumbPosition = ( iCurrentPage - 1 ) * - iExtension->iMaxVisibleRows; - TAknDoubleSpanScrollBarModel hDsSbarModel( hSbarModel ); - TAknDoubleSpanScrollBarModel vDsSbarModel( vSbarModel ); - - // The y coordinate must be sifted 3 pixels up and x 3 to left - parent.iTl.iY -= KVerticalDialogMargin; - parent.iBr.iY -= KVerticalDialogMargin; - parent.iTl.iX -= KHorizontalDialogMargin; - parent.iBr.iX -= KHorizontalDialogMargin; - - layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant; - iSBFrame->Tile( &vDsSbarModel ); - AknLayoutUtils::LayoutVerticalScrollBar( iSBFrame, - parent, - scrollbarLayout ); - iSBFrame->SetVFocusPosToThumbPos( vDsSbarModel.FocusPosition() ); - } - else - { - // For EArrowHead type scrollbar - vSbarModel.iThumbPosition = iCursorPos.iY + iFirstVisibleRow; - iSBFrame->TileL( &hSbarModel,&vSbarModel,parent,parent,layout ); - iSBFrame->SetVFocusPosToThumbPos( vSbarModel.iThumbPosition ); - } - } - - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::Reserved_1() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::Reserved_1() - { - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::Reserved_2() -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::Reserved_2() - { - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::DrawOffscreenBackgroundIfRequired -// -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::DrawOffscreenBackgroundIfRequired() const - { - if ( iOffscreenBg && iHasBitmapBackground ) - { - if ( !iOffscreenBgDrawn ) - { - TRect mainPaneRect; - if ( !AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, - mainPaneRect ) ) - { - mainPaneRect = iAvkonAppUi->ClientRect(); - } - - // Dialog layout, check variety first - TAknLayoutScalableParameterLimits iconMapDialogVariety = - AknLayoutScalable_Avkon::popup_grid_graphic_window_ParamLimits(); - - TInt maxVariety = iconMapDialogVariety.LastVariety(); - - // Check the CBA, if the orientation is not landscape - // there is not so much varieties - AknLayoutUtils::TAknCbaLocation location = - AknLayoutUtils::CbaLocation(); - // the offset for the certain cba location variety - TInt maxVarietyOffset = 0; - TInt varietyOffset = maxVariety + 1; - - // landscape variety number must be calculated offset == number of - // varieties same applies to the variety number for the biggest - // sized layout for the variety - if ( Layout_Meta_Data::IsLandscapeOrientation() ) - { - // the offset for one variety - varietyOffset = ( maxVariety + 1 )/KAknSctCBaButtonDirections; - } - - // for right and left cba buttons the max variety is not zero - // the varities are ordered by the location of the cba and the - // descending order e.g the biggest sized layout first, the smallest last - if ( location == AknLayoutUtils::EAknCbaLocationRight ) - { - maxVarietyOffset = varietyOffset; - } - else if ( location == AknLayoutUtils::EAknCbaLocationLeft ) - { - maxVarietyOffset = varietyOffset + varietyOffset; // 2* - } - TInt varietyNumber = varietyOffset - iRows - 1; - - // if more lines than possible to show, use the default - // ( the biggest grid ) variety - if ( varietyNumber < 0 ) - { - varietyNumber = 0; - } - // if zero rows, use the minimum - else if ( iRows<=0 ) - { - varietyNumber -= 1; - } - - //add the varietyoffset - varietyNumber += maxVarietyOffset; - - TAknLayoutRect popupGridLayRect; - popupGridLayRect.LayoutRect( mainPaneRect, - AknLayoutScalable_Avkon::popup_grid_graphic_window( 5 ) ); - - TRect popupGridRect = popupGridLayRect.Rect(); - - // set the top left height as the control starting point - popupGridRect.iTl.iY = Rect().iTl.iY; - - //if ( popupGridRect.iBr.iY < mainPaneRect.iBr.iY ) - // popupGridRect.iBr.iY = mainPaneRect.iBr.iY - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); - - // draw to upper left corner, and normalize the retangle to - // fact that the dialog starts from coordinates ( 0,0 ), - // so the y-coordinate is correct ( heading pane ) - // but x must be set to zero - TPoint point = TPoint( 0, 0 ); - popupGridRect.Move( -popupGridRect.iTl.iX,0 ); - - AknsDrawUtils::DrawBackground( skin, - cc, - this, - *iBitmapGc, - point, - popupGridRect, - KAknsDrawParamDefault ); - - iOffscreenBgDrawn = ETrue; - } - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::ComponentControl( TInt aIndex ) const -// Return the controll pointer -// ----------------------------------------------------------------------------- -// -CCoeControl* CCmDestinationIconMap::ComponentControl( TInt aIndex ) const - { - if ( aIndex == 0 && - iSBFrame && - iSBFrame->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan ) - { - return iSBFrame->VerticalScrollBar(); - } - else - { - return NULL; - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::CountComponentControls() -// Return no of controll to be placed on the container control -// ----------------------------------------------------------------------------- -// -TInt CCmDestinationIconMap::CountComponentControls() const - { - if ( iSBFrame && - iSBFrame->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan ) - { - return 1; - } - else - { - return 0; - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::CountMaxColumnsAndCellSizes -// Counts no of columns and the cell size will be displayed in the icon table -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::CountMaxColumnsAndCellSizes() - { - TRect cellRect; // retangle of one item in grid - TRect gridRect; // retangle of the grid contaning the items - - // 1. Get the layout - - // Get the parent rect - TRect mainPaneRect; - if ( !AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, - mainPaneRect ) ) - { - mainPaneRect = iAvkonAppUi->ClientRect(); - } - - // Calculate the layout of the whole popup with the biggest possible -> 0 - // Dialog layout, check variety first - - // Get the layout rect of the dialog - - // Check variety first - TAknLayoutScalableParameterLimits iconMapDialogVariety = - AknLayoutScalable_Avkon::popup_grid_graphic_window_ParamLimits(); - - TInt maxVariety = iconMapDialogVariety.LastVariety(); - - // Check the CBA, if the orientation is not landscape - // there is not so much varieties - AknLayoutUtils::TAknCbaLocation location = AknLayoutUtils::CbaLocation(); - // the offset for the certain cba location variety - TInt maxVarietyOffset = 0; - TInt varietyOffset = maxVariety + 1; // the number of varieties - - // landscape variety number must be calculated offset == number of varieties - // same applies to the variety number for the biggest sized layout for the - // variety - if ( Layout_Meta_Data::IsLandscapeOrientation() ) - { - // the offset for one variety - varietyOffset = ( maxVariety + 1 ) / KAknSctCBaButtonDirections; - } - - if ( location == AknLayoutUtils::EAknCbaLocationRight ) - { - maxVarietyOffset = varietyOffset; - } - else if ( location == AknLayoutUtils::EAknCbaLocationLeft ) - { - maxVarietyOffset = varietyOffset + varietyOffset; // 2* - } - - TAknLayoutRect popupGridLayRect; - popupGridLayRect.LayoutRect( mainPaneRect, - AknLayoutScalable_Avkon::popup_grid_graphic_window( maxVarietyOffset ) ); - - // Get the layout of the actual icon grid with scrollbar - TAknLayoutRect gridWithScrollLayRect; - gridWithScrollLayRect.LayoutRect( popupGridLayRect.Rect(), - AknLayoutScalable_Avkon::listscroll_popup_graphic_pane() ); - - // Then the grid area without scrollbar - // NOTE: The grid with scroll bar is used as reference - TAknLayoutRect gridLayRect; - gridLayRect.LayoutRect( gridWithScrollLayRect.Rect(), - AknLayoutScalable_Avkon::grid_graphic_popup_pane( 0 ) ); - - // Different parent if SCT inside editing menu. - TRect rect = Rect(); - gridRect = gridLayRect.Rect(); - // cell size, AGAIN 7 item - TAknLayoutRect cellLayRect; - cellLayRect.LayoutRect( - gridRect, - AknLayoutScalable_Avkon::cell_graphic_popup_pane( 0,0,0 ) ); - - cellRect = cellLayRect.Rect(); - - // 2. Calculate width related - // - item width - // - max number of columns - - // Width of the items area - TInt gridWidth = gridRect.Width(); - - // Width of one item - TInt cellWidth = cellRect.Width(); - - // ensure the item width and store it - TAknLayoutRect secondCellLayRect; - secondCellLayRect.LayoutRect( gridRect, - AknLayoutScalable_Avkon::cell_graphic_popup_pane( 0,1,0 ) ); - - iGridItemWidth = secondCellLayRect.Rect().iTl.iX - - cellLayRect.Rect().iTl.iX; - - if ( iGridItemWidth < 0 ) - { - // The result is negative with lay file data if the layout is mirrored. - iGridItemWidth = -iGridItemWidth; - } - - // Calculate the amount of columns - iMaxColumns = gridWidth / cellWidth; - - - // 2. Calculate height related - // - item height - // - max number of rows - - // Get the grid height - // NOTE: in landscape the LAF is wrong so use the main panes height - TInt gridHeight = gridRect.Height(); - - // get the item height - TInt cellHeight = cellRect.Height(); - - // calculate the number of items fitting to grid - iExtension->iMaxVisibleRows = 3;//gridHeight / cellHeight; - - // Store the item height - TAknLayoutRect secondRowLayRect; - secondRowLayRect.LayoutRect( gridLayRect.Rect(), - AknLayoutScalable_Avkon::cell_graphic_popup_pane( 0,0,1 ) ); - - iGridItemHeight = secondRowLayRect.Rect().iTl.iY - - cellLayRect.Rect().iTl.iY; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::HandleScrollEventL -// Handles the different scroll events so that the map reacts accordingly. -// ----------------------------------------------------------------------------- -// -void CCmDestinationIconMap::HandleScrollEventL( CEikScrollBar* aScrollBar, - TEikScrollEvent aEventType ) - { - TBool update = EFalse; - - switch ( aEventType ) - { - case EEikScrollUp: - case EEikScrollPageUp: - { - // nothing done if we are already on the first page. - if ( iFirstVisibleRow != 0 ) - { - iFirstVisibleRow -= iExtension->iMaxVisibleRows; - update = ETrue; - } - UpdateScrollIndicatorL(); - } - break; - - case EEikScrollDown: - case EEikScrollPageDown: - { - // nothing done if we are already on the last page. - if ( iFirstVisibleRow != iRows/iExtension->iMaxVisibleRows * - iExtension->iMaxVisibleRows ) - { - iFirstVisibleRow += iExtension->iMaxVisibleRows; - update = ETrue; - } - UpdateScrollIndicatorL(); - } - break; - - case EEikScrollThumbDragVert: - { - TInt thumbPosition; - TInt halfPage = iExtension->iMaxVisibleRows/2; - // Ask which type of scrollbar is shown - //CAknAppUi* appUi = iAvkonAppUi; - TBool isDoubleSpan = - CEikScrollBarFrame::EDoubleSpan == iSBFrame->TypeOfVScrollBar(); - if ( isDoubleSpan ) - { - thumbPosition = static_cast ( - aScrollBar->Model() )->FocusPosition(); - } - else - { - thumbPosition = aScrollBar->Model()->iThumbPosition; - } - - // If the slider is in the range of less then a half page from a - // possible correct thumb position. thus 0 <= iFirstVisibleRow - - // thumbPosition < halfPage. Or in the other direction: - // 0 <= thumbPosition - iFirstVisibleRow < halfPage - if ( !( ( 0 <= iFirstVisibleRow - thumbPosition && - iFirstVisibleRow - thumbPosition < halfPage )|| - ( 0 <= thumbPosition - iFirstVisibleRow && - thumbPosition - iFirstVisibleRow < halfPage ) ) ) - { - TReal toRound = thumbPosition / - ( TReal )iExtension->iMaxVisibleRows; - if ( toRound * 2 > ( TInt )toRound * 2 + 1 ) - { - toRound++; - } - iFirstVisibleRow = ( TInt )toRound * - iExtension->iMaxVisibleRows; - update = ETrue; - } - } - break; - - case EEikScrollThumbReleaseVert: - { - UpdateScrollIndicatorL(); - } - break; - - case EEikScrollLeft: // flow through - case EEikScrollRight: // flow through - case EEikScrollPageLeft: // flow through - case EEikScrollPageRight: // flow through - case EEikScrollThumbDragHoriz: // flow through - case EEikScrollThumbReleaseHoriz: // flow through - // do nothing - break; - - default: - // do nothing - break; - } - - // If we have moved down to the last page we check that the cursor is in - // a place where it can be drawn. - if ( iFirstVisibleRow == - iRows/iExtension->iMaxVisibleRows * iExtension->iMaxVisibleRows ) - { - // the old cursor is set to a "safe" position where it at least can be. - iOldCursorPos.iX = 0; - iOldCursorPos.iY = 0; - // if the last page has only one line which isn't filled complitely. - if ( ( iConsArray->Count() % iMaxColumns - 1 < iCursorPos.iX ) && - ( iRows % iExtension->iMaxVisibleRows ) == 1 ) - { - iCursorPos.iX = iConsArray->Count()%iMaxColumns - 1; - } - // If the cursor is in a position where it would go unto a spot without - // a icon when scrolled. - if ( iCursorPos.iY + iFirstVisibleRow >= iRows ) - { - if ( iConsArray->Count() % iMaxColumns > iCursorPos.iX ) - { - iCursorPos.iY = iRows - 1 - iFirstVisibleRow; - } - else - { - iCursorPos.iY = iRows - 2 - iFirstVisibleRow; - } - } - // If the cursor is actually on the last row, but is still in the - // area where there is now icons. ( the rest of the last row ) - if ( ( iConsArray->Count() <= ( iFirstVisibleRow + iCursorPos.iY ) - * iMaxColumns + iCursorPos.iX ) && - ( iCursorPos.iY + iFirstVisibleRow + 1 == iRows ) ) - { - iCursorPos.iY--; - } - // if the corrections did not help and the cursor is in the area - // where there is a valid row, but no icons anymore - } - - // to avoid flicker we draw only if there really was something new to draw. - if ( update ) - { - if ( iExtension->iObserver ) - { - iExtension->iObserver->HandleControlEventL( - this, - MCoeControlObserver::EEventRequestFocus ); - } - DrawDeferred(); - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationIconMap::Extension -// ----------------------------------------------------------------------------- -// -CCmDestinationIconMapExtension* CCmDestinationIconMap::Extension() const - { - return iExtension; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmdestination.cpp --- a/cmmanager/cmmgr/Framework/Src/cmdestination.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,662 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of RCmDestination -* -*/ - -#include -#include "cmdestinationimpl.h" -#include "cmmanagerimpl.h" -#include -#include - -using namespace CMManager; - -// ----------------------------------------------------------------------------- -// RCmDestination::Close() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestination::Close() - { - if( !iDestinatonData ) - { - return; - } - - iDestinatonData->Cmmgr()->RemoveDestFromPool(iDestinatonData); - iDestinatonData = NULL; - } - - -// ----------------------------------------------------------------------------- -// RCmDestination::~RCmDestination() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmDestination::~RCmDestination() - { - Close(); - } - - -// ----------------------------------------------------------------------------- -// RCmDestination::RCmDestination( RCmDestination& ) -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmDestination::RCmDestination( - const RCmDestination& aCmDestination) - : iDestinatonData( aCmDestination.iDestinatonData ) - { - iDestinatonData->IncrementRefCounter(); - } - - - -// ----------------------------------------------------------------------------- -// RCmDestination::RCmDestination::operator=() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmDestination& RCmDestination::operator=( - const RCmDestination& aCmDestination) - { - if (this != &aCmDestination) - { - delete iDestinatonData; - iDestinatonData = aCmDestination.iDestinatonData; - iDestinatonData->IncrementRefCounter(); - } - return *this; - } - -// ----------------------------------------------------------------------------- -// RCmDestination::ConnectionMethodCount() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt RCmDestination::ConnectionMethodCount() const - { - __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), KErrBadHandle ) ); - - return iDestinatonData->ConnectionMethodCount(); - }; - -// ----------------------------------------------------------------------------- -// RCmDestination::ConnectionMethodL -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethod - RCmDestination::ConnectionMethodL( TInt anIndex ) const - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - RCmConnectionMethod cm; - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - cm.iImplementation = - aImplementation->GetConnectionMethodL( anIndex )->Plugin(); - //CCmDestinationImpl::GetConnectionMethodL doesn't give ownership - cm.iImplementation->IncrementRefCounter(); - CleanupStack::PopAndDestroy(aImplementation); - - return cm; - } - -// ----------------------------------------------------------------------------- -// RCmDestination::ConnectionMethodByIDL -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethod - RCmDestination::ConnectionMethodByIDL( TInt aIapId ) const - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - RCmConnectionMethod cm; - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - cm.iImplementation = - aImplementation->ConnectionMethodByIDL( aIapId )->Plugin(); - //CCmDestinationImpl::ConnectionMethodByIDL doesn't give ownership - cm.iImplementation->IncrementRefCounter(); - CleanupStack::PopAndDestroy(aImplementation); - - return cm; - } - -// ----------------------------------------------------------------------------- -// RCmDestination::PriorityL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint RCmDestination::PriorityL(const RCmConnectionMethod& aCCMItem ) const - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - TUint retValue = aImplementation->PriorityL( *aCCMItem.iImplementation ); - CleanupStack::PopAndDestroy(aImplementation); - return retValue; - } - -// ----------------------------------------------------------------------------- -// RCmDestination::NameLC() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC* RCmDestination::NameLC ( ) const - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - HBufC* retValue = aImplementation->NameLC(); - CleanupStack::Pop(retValue); - CleanupStack::PopAndDestroy(aImplementation); - CleanupStack::PushL(retValue); - return retValue; - }; - -// ----------------------------------------------------------------------------- -// RCmDestination::Id() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint32 RCmDestination::Id() const - { - __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), - KErrBadHandle ) ); - - return iDestinatonData->Id(); - } - -// ----------------------------------------------------------------------------- -// RCmDestination::ElementId() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint32 RCmDestination::ElementId() const - { - __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), - KErrBadHandle ) ); - - return iDestinatonData->ElementId(); - } - -// ----------------------------------------------------------------------------- -// RCmDestination::IconL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CGulIcon* RCmDestination::IconL() const - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - CGulIcon* retValue = aImplementation->IconL(); - CleanupStack::PopAndDestroy(aImplementation); - return retValue; - } - - -// ----------------------------------------------------------------------------- -// RCmDestination::MetadataL() -// ----------------------------------------------------------------------------- -// -EXPORT_C - TUint32 RCmDestination::MetadataL( TSnapMetadataField aMetaField ) const - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - return iDestinatonData->MetadataL( aMetaField ); - } - -// ----------------------------------------------------------------------------- -// RCmDestination::ProtectionLevel() -// ----------------------------------------------------------------------------- -// -EXPORT_C TProtectionLevel RCmDestination::ProtectionLevel() const - { - __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), - KErrBadHandle ) ); - - return iDestinatonData->ProtectionLevel(); - } - -// ----------------------------------------------------------------------------- -// RCmDestination::IsHidden() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmDestination::IsHidden() const - { - __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), - KErrBadHandle ) ); - - TBool hidden( EFalse ); - TRAPD( err, hidden = iDestinatonData->IsHiddenL() ); - __ASSERT_ALWAYS( err == KErrNone, User::Panic(_L( "CMManager" ), - KErrArgument ) ); - - return hidden; - } - -// ----------------------------------------------------------------------------- -// RCmDestination::CreateConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethod RCmDestination::CreateConnectionMethodL - ( TUint32 aImplementationUid ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - RCmConnectionMethod cm; - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - CCmPluginBase* imp = aImplementation->CreateConnectionMethodL( - aImplementationUid ); - imp->IncrementRefCounter(); - CleanupStack::PushL(imp); - cm.iImplementation = imp->Plugin(); - CleanupStack::PopAndDestroy(imp); - - CleanupStack::PopAndDestroy(aImplementation); - return cm; - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::CreateConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethod RCmDestination::CreateConnectionMethodL( - TUint32 aImplementationUid, - TUint32 aConnMethId ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - RCmConnectionMethod cm; - CCmDestinationImpl* implementation = - CCmDestinationImpl::NewLC( iDestinatonData ); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - CCmPluginBase* imp = implementation->CreateConnectionMethodL( - aImplementationUid, - aConnMethId ); - imp->IncrementRefCounter(); - CleanupStack::PushL(imp); - cm.iImplementation = imp->Plugin(); - CleanupStack::PopAndDestroy(imp); - - CleanupStack::PopAndDestroy(implementation); - return cm; - } - -// ----------------------------------------------------------------------------- -// RCmDestination::AddConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt RCmDestination::AddConnectionMethodL( - RCmConnectionMethod aConnectionMethod ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* implementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(aConnectionMethod.iImplementation); - connMethod->IncrementRefCounter(); - CleanupStack::PushL( connMethod ); - - // Check if the given connection method exists already in this destination - if ( aConnectionMethod.iImplementation->IdIsValid() && - implementation->CheckIfCMExistsL( *connMethod ) ) - { - CleanupStack::PopAndDestroy( connMethod ); - CleanupStack::PopAndDestroy( implementation ); - User::Leave( KErrAlreadyExists ); - } - - TInt retValue = implementation->AddConnectionMethodL( *connMethod ); - CleanupStack::PopAndDestroy( connMethod ); - CleanupStack::PopAndDestroy( implementation ); - return retValue; - } - -// ----------------------------------------------------------------------------- -// RCmDestination::AddEmbeddedDestinationL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt RCmDestination::AddEmbeddedDestinationL( - const RCmDestination& aDestination ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - if ( this == &aDestination ) - { - User::Leave( KErrArgument ); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting will decrement the ref counter - aImplementation->IncrementRefCounter(); - CCmDestinationImpl* aDestToAdd = - CCmDestinationImpl::NewLC(aDestination.iDestinatonData); - // Deleting will decrement the ref counter - aDestToAdd->IncrementRefCounter(); - - TInt retValue = aImplementation->AddEmbeddedDestinationL( - *aDestToAdd ); - CleanupStack::PopAndDestroy(aDestToAdd); - CleanupStack::PopAndDestroy(aImplementation); - return retValue; - } - -// ----------------------------------------------------------------------------- -// RCmDestination::DeleteConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestination::DeleteConnectionMethodL( - RCmConnectionMethod& aConnectionMethod ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(aConnectionMethod.iImplementation); - connMethod->IncrementRefCounter(); - CleanupStack::PushL( connMethod ); - aImplementation->DeleteConnectionMethodL( - *connMethod ); - CleanupStack::PopAndDestroy(connMethod); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestination::RemoveConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestination::RemoveConnectionMethodL( - RCmConnectionMethod aConnectionMethod ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->RemoveConnectionMethodL( - *aConnectionMethod.iImplementation ); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestination::ModifyPriorityL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestination::ModifyPriorityL( - RCmConnectionMethod& aCCmItem, - TUint aIndex ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(aCCmItem.iImplementation); - connMethod->IncrementRefCounter(); - CleanupStack::PushL( connMethod ); - aImplementation->ModifyPriorityL( *connMethod, aIndex ); - CleanupStack::PopAndDestroy(connMethod); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestination::SetNameL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestination::SetNameL( const TDesC& aName ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->SetNameL( aName ); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestination::SetIconL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestination::SetIconL( TUint32 anIndex ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - if ( anIndex > KNumOfIcons ) - { - User::Leave( KErrArgument ); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->SetIconL( anIndex ); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestination::SetMetadataL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestination::SetMetadataL( TSnapMetadataField aMetaField, - TUint32 aValue ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->SetMetadataL( aMetaField, aValue ); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestination::SetProtectionL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestination::SetProtectionL( TProtectionLevel aProtLevel ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->SetProtectionL( aProtLevel ); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestination::SetHiddenL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestination::SetHiddenL( TBool aHidden ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->SetHiddenL( aHidden ); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestination::UpdateL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestination::UpdateL() - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->UpdateL(); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestination::DeleteLD() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestination::DeleteLD() - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - iDestinatonData->IncrementRefCounter(); - aImplementation->DeleteLD(); - CleanupStack::Pop(aImplementation); - iDestinatonData = NULL; - } - -// ----------------------------------------------------------------------------- -// RCmDestination::IsConnectedL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmDestination::IsConnectedL() const - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - TBool retValue = aImplementation->IsConnectedL(); - CleanupStack::PopAndDestroy(aImplementation); - return retValue; - } - -// ----------------------------------------------------------------------------- -// RCmDestination::RCmDestination -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmDestination::RCmDestination() - : iDestinatonData( NULL ) - { - } - -// ----------------------------------------------------------------------------- -// RCmDestination::operator== -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmDestination::operator==(const RCmDestination& aDestination ) const - { - return ( iDestinatonData == aDestination.iDestinatonData ); - }; - -// ----------------------------------------------------------------------------- -// RCmDestination::operator!= -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmDestination::operator!=(const RCmDestination& aDestination ) const - { - return !( iDestinatonData == aDestination.iDestinatonData ); - }; - -// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmdestinationext.cpp --- a/cmmanager/cmmgr/Framework/Src/cmdestinationext.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,665 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of RCmDestinationExt -* -*/ - -#include -#include "cmdestinationimpl.h" -#include -#include -#include -#include "cmmanagerimpl.h" - -using namespace CMManager; - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::Close() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestinationExt::Close() - { - if( !iDestinatonData ) - { - return; - } - - iDestinatonData->Cmmgr()->RemoveDestFromPool(iDestinatonData); - iDestinatonData = NULL; - } - - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::~RCmDestinationExt() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmDestinationExt::~RCmDestinationExt() - { - Close(); - } - - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::RCmDestinationExt( RCmDestinationExt& ) -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmDestinationExt::RCmDestinationExt( - const RCmDestinationExt& aCmDestination) - : iDestinatonData( aCmDestination.iDestinatonData ) - { - iDestinatonData->IncrementRefCounter(); - } - - - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::RCmDestinationExt::operator=() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmDestinationExt& RCmDestinationExt::operator=( - const RCmDestinationExt& aCmDestination) - { - if (this != &aCmDestination) - { - Close(); - iDestinatonData = aCmDestination.iDestinatonData; - iDestinatonData->IncrementRefCounter(); - } - return *this; - } - - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::ConnectionMethodCount() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt RCmDestinationExt::ConnectionMethodCount() - { - __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), - KErrBadHandle ) ); - - return iDestinatonData->ConnectionMethodCount(); - }; - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::ConnectionMethodL -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethodExt - RCmDestinationExt::ConnectionMethodL( TInt anIndex ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - RCmConnectionMethodExt cm; - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - cm.iImplementation = - aImplementation->GetConnectionMethodL( anIndex )->Plugin(); - //CCmDestinationImpl::GetConnectionMethodL doesn't give ownership - cm.iImplementation->IncrementRefCounter(); - CleanupStack::PopAndDestroy(aImplementation); - return cm; - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::ConnectionMethodByIDL -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethodExt - RCmDestinationExt::ConnectionMethodByIDL( TInt aIapId ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - RCmConnectionMethodExt cm; - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - cm.iImplementation = - aImplementation->ConnectionMethodByIDL( aIapId )->Plugin(); - //CCmDestinationImpl::ConnectionMethodByIDL doesn't give ownership - cm.iImplementation->IncrementRefCounter(); - CleanupStack::PopAndDestroy(aImplementation); - - return cm; - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::PriorityL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint RCmDestinationExt::PriorityL(const RCmConnectionMethodExt& aCCMItem ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - TUint retValue = aImplementation->PriorityL( *aCCMItem.iImplementation ); - CleanupStack::PopAndDestroy(aImplementation); - return retValue; - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::NameLC() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC* RCmDestinationExt::NameLC ( ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - HBufC* retValue = aImplementation->NameLC(); - CleanupStack::Pop(retValue); - CleanupStack::PopAndDestroy(aImplementation); - CleanupStack::PushL(retValue); - return retValue; - }; - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::Id() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint32 RCmDestinationExt::Id() - { - __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), - KErrBadHandle ) ); - - return iDestinatonData->Id(); - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::ElementId() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint32 RCmDestinationExt::ElementId() - { - __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), - KErrBadHandle ) ); - - return iDestinatonData->ElementId(); - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::IconL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CGulIcon* RCmDestinationExt::IconL() - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - CGulIcon* retValue = aImplementation->IconL(); - CleanupStack::PopAndDestroy(aImplementation); - return retValue; - } - - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::MetadataL() -// ----------------------------------------------------------------------------- -// -EXPORT_C - TUint32 RCmDestinationExt::MetadataL( TSnapMetadataField aMetaField ) const - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - return iDestinatonData->MetadataL( aMetaField ); - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::ProtectionLevel() -// ----------------------------------------------------------------------------- -// -EXPORT_C TProtectionLevel RCmDestinationExt::ProtectionLevel() - { - __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), - KErrBadHandle ) ); - - return iDestinatonData->ProtectionLevel(); - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::IsHidden() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmDestinationExt::IsHidden() - { - __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), - KErrBadHandle ) ); - - TBool hidden( EFalse ); - TRAPD( err, hidden = iDestinatonData->IsHiddenL() ); - __ASSERT_ALWAYS( err == KErrNone, User::Panic(_L( "CMManager" ), - KErrArgument ) ); - - return hidden; - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::CreateConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethodExt - RCmDestinationExt::CreateConnectionMethodL( TUint32 aImplementationUid ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - RCmConnectionMethodExt cm; - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - CCmPluginBase* imp = aImplementation->CreateConnectionMethodL( - aImplementationUid ); - imp->IncrementRefCounter(); - CleanupStack::PushL(imp); - cm.iImplementation = imp->Plugin(); - CleanupStack::PopAndDestroy(imp); - - CleanupStack::PopAndDestroy(aImplementation); - return cm; - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::CreateConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethodExt RCmDestinationExt::CreateConnectionMethodL( - TUint32 aImplementationUid, - TUint32 aConnMethId ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - RCmConnectionMethodExt cm; - CCmDestinationImpl* implementation = - CCmDestinationImpl::NewLC( iDestinatonData ); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - CCmPluginBase* imp = implementation->CreateConnectionMethodL( - aImplementationUid, - aConnMethId ); - imp->IncrementRefCounter(); - CleanupStack::PushL(imp); - cm.iImplementation = imp->Plugin(); - CleanupStack::PopAndDestroy(imp); - - CleanupStack::PopAndDestroy(implementation); - return cm; - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::AddConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt RCmDestinationExt::AddConnectionMethodL( - RCmConnectionMethodExt aConnectionMethod ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* implementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(aConnectionMethod.iImplementation); - connMethod->IncrementRefCounter(); - CleanupStack::PushL( connMethod ); - - // Check if the given connection method exists already in this destination - if ( aConnectionMethod.iImplementation->IdIsValid() && - implementation->CheckIfCMExistsL( *connMethod ) ) - { - CleanupStack::PopAndDestroy( connMethod ); - CleanupStack::PopAndDestroy( implementation ); - User::Leave( KErrAlreadyExists ); - } - - TInt retValue = implementation->AddConnectionMethodL( *connMethod ); - CleanupStack::PopAndDestroy( connMethod ); - CleanupStack::PopAndDestroy( implementation ); - return retValue; - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::AddEmbeddedDestinationL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt RCmDestinationExt::AddEmbeddedDestinationL( - const RCmDestinationExt& aDestination ) - { - if ( !iDestinatonData ) - { - User::Leave(KErrBadHandle); - } - - if ( this == &aDestination ) - { - User::Leave( KErrArgument ); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting will decrement the ref counter - aImplementation->IncrementRefCounter(); - CCmDestinationImpl* aDestToAdd = - CCmDestinationImpl::NewLC(aDestination.iDestinatonData); - // Deleting will decrement the ref counter - aDestToAdd->IncrementRefCounter(); - - TInt retValue = aImplementation->AddEmbeddedDestinationL( - *aDestToAdd ); - CleanupStack::PopAndDestroy(aDestToAdd); - CleanupStack::PopAndDestroy(aImplementation); - return retValue; - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::DeleteConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestinationExt::DeleteConnectionMethodL( - RCmConnectionMethodExt& aConnectionMethod ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(aConnectionMethod.iImplementation); - connMethod->IncrementRefCounter(); - CleanupStack::PushL( connMethod ); - aImplementation->DeleteConnectionMethodL( - *connMethod ); - CleanupStack::PopAndDestroy(connMethod); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::RemoveConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestinationExt::RemoveConnectionMethodL( - RCmConnectionMethodExt aConnectionMethod ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->RemoveConnectionMethodL( - *aConnectionMethod.iImplementation ); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::ModifyPriorityL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestinationExt::ModifyPriorityL( - RCmConnectionMethodExt& aCCmItem, - TUint aIndex ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(aCCmItem.iImplementation); - connMethod->IncrementRefCounter(); - CleanupStack::PushL( connMethod ); - aImplementation->ModifyPriorityL( *connMethod, aIndex ); - CleanupStack::PopAndDestroy(connMethod); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::SetNameL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestinationExt::SetNameL( const TDesC& aName ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->SetNameL( aName ); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::SetIconL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestinationExt::SetIconL( TUint32 anIndex ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - if ( anIndex > KNumOfIcons ) - { - User::Leave( KErrArgument ); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->SetIconL( anIndex ); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::SetMetadataL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestinationExt::SetMetadataL( TSnapMetadataField aMetaField, - TUint32 aValue ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->SetMetadataL( aMetaField, aValue ); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::SetProtectionL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestinationExt::SetProtectionL( TProtectionLevel aProtLevel ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->SetProtectionL( aProtLevel ); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::SetHiddenL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestinationExt::SetHiddenL( TBool aHidden ) - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->SetHiddenL( aHidden ); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::UpdateL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestinationExt::UpdateL() - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - aImplementation->UpdateL(); - CleanupStack::PopAndDestroy(aImplementation); - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::DeleteLD() -// ----------------------------------------------------------------------------- -// -EXPORT_C void RCmDestinationExt::DeleteLD() - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - iDestinatonData->IncrementRefCounter(); - aImplementation->DeleteLD(); - CleanupStack::Pop(aImplementation); - iDestinatonData = NULL; - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::IsConnectedL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmDestinationExt::IsConnectedL() const - { - if (!iDestinatonData) - { - User::Leave(KErrBadHandle); - } - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(iDestinatonData); - // Deleting aImplementation will decrement the ref counter - iDestinatonData->IncrementRefCounter(); - TBool retValue = aImplementation->IsConnectedL(); - CleanupStack::PopAndDestroy(aImplementation); - return retValue; - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::RCmDestinationExt -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmDestinationExt::RCmDestinationExt() - : iDestinatonData( NULL ) - { - } - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::operator== -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmDestinationExt::operator==(const RCmDestinationExt& aDestination ) const - { - return ( iDestinatonData == aDestination.iDestinatonData ); - }; - -// ----------------------------------------------------------------------------- -// RCmDestinationExt::operator!= -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmDestinationExt::operator!=(const RCmDestinationExt& aDestination ) const - { - return !( iDestinatonData == aDestination.iDestinatonData ); - }; - -// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmdestinationimpl.cpp --- a/cmmanager/cmmgr/Framework/Src/cmdestinationimpl.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3500 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmDestinationImpl -* -*/ - -#include "cmdestinationimpl.h" -#include "cmmanagerimpl.h" -#include -#include -#include -#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#include -#endif -#include "cmlogger.h" -#include "cmmanager.hrh" -#include -#include "datamobilitycommsdattypes.h" -#include -#include -#include -#include -#include // icons -#include -#include - -// System includes -#include // For REComSession -#include - -#include - -using namespace CMManager; -using namespace CommsDat; - -const TUint KDefaultTierManagerTagId = KAfInet; - -const TInt KDestinationIconConvTable[][4] = { - { EAknsMajorGeneric, - EAknsMinorGenericQgnIndiSettProtectedAdd, - EMbmCmmanagerQgn_prop_set_conn_dest_internet, - EMbmCmmanagerQgn_prop_set_conn_dest_internet_mask }, - - { EAknsMajorGeneric, - EAknsMinorGenericQgnPropWmlGprs, - EMbmCmmanagerQgn_prop_set_conn_dest_wap, - EMbmCmmanagerQgn_prop_set_conn_dest_wap_mask }, - - { EAknsMajorGeneric, - EAknsMinorGenericQgnPropWmlGprs, - EMbmCmmanagerQgn_prop_set_conn_dest_mms, - EMbmCmmanagerQgn_prop_set_conn_dest_mms_mask }, - - { EAknsMajorGeneric, - EAknsMinorGenericQgnPropWmlGprs, - EMbmCmmanagerQgn_prop_set_conn_dest_intranet, - EMbmCmmanagerQgn_prop_set_conn_dest_intranet_mask }, - - { EAknsMajorGeneric, - EAknsMinorGenericQgnPropWmlGprs, - EMbmCmmanagerQgn_prop_set_conn_dest_operator, - EMbmCmmanagerQgn_prop_set_conn_dest_operator_mask }, - - { EAknsMajorGeneric, - EAknsMinorGenericQgnPropWmlGprs, - EMbmCmmanagerQgn_prop_set_conn_dest_icon1, - EMbmCmmanagerQgn_prop_set_conn_dest_icon1_mask }, - - { EAknsMajorGeneric, - EAknsMinorGenericQgnPropWmlGprs, - EMbmCmmanagerQgn_prop_set_conn_dest_icon2, - EMbmCmmanagerQgn_prop_set_conn_dest_icon2_mask }, - - { EAknsMajorGeneric, - EAknsMinorGenericQgnPropWmlGprs, - EMbmCmmanagerQgn_prop_set_conn_dest_icon3, - EMbmCmmanagerQgn_prop_set_conn_dest_icon3_mask }, - - { EAknsMajorGeneric, - EAknsMinorGenericQgnPropWmlGprs, - EMbmCmmanagerQgn_prop_set_conn_dest_icon4, - EMbmCmmanagerQgn_prop_set_conn_dest_icon4_mask }, - - { EAknsMajorGeneric, - EAknsMinorGenericQgnPropWmlGprs, - EMbmCmmanagerQgn_prop_set_conn_dest_icon5, - EMbmCmmanagerQgn_prop_set_conn_dest_icon5_mask }, - - { EAknsMajorGeneric, - EAknsMinorGenericQgnPropWmlGprs, - EMbmCmmanagerQgn_prop_set_conn_dest_icon6, - EMbmCmmanagerQgn_prop_set_conn_dest_icon6_mask }, - - { EAknsMajorGeneric, - EAknsMinorGenericQgnPropWmlGprs, - EMbmCmmanagerQgn_prop_set_conn_dest_default, - EMbmCmmanagerQgn_prop_set_conn_dest_default_mask }, - {0, 0, 0, 0} - }; - -// ================= MEMBER FUNCTIONS ======================= - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CCmDestinationImpl* - CCmDestinationImpl::NewL( CCmManagerImpl& aCmMgr, - const TDesC& aName ) - { - CCmDestinationImpl* dest = - new (ELeave) CCmDestinationImpl( aCmMgr ); - CleanupStack::PushL( dest ); - - dest->ConstructL( aName ); - - CleanupStack::Pop( dest ); - return dest; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CCmDestinationImpl* - CCmDestinationImpl::NewL( CCmManagerImpl& aCmMgr, - TUint aDestinationId ) - { - CCmDestinationImpl* dest = - new (ELeave) CCmDestinationImpl( aCmMgr ); - CleanupStack::PushL( dest ); - - dest->ConstructL( aDestinationId ); - - CleanupStack::Pop( dest ); - return dest; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::NewL() -// ----------------------------------------------------------------------------- -// -CCmDestinationImpl* CCmDestinationImpl::NewL( CCmManagerImpl& aCmMgr, - CCmDestinationData* aData ) - { - CCmDestinationImpl* dest = - new (ELeave) CCmDestinationImpl( aCmMgr ); - dest->iData = aData; - return dest; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::NewL() -// ----------------------------------------------------------------------------- -// -CCmDestinationImpl* CCmDestinationImpl::NewL( CCmManagerImpl& aCmMgr, - const TDesC& aName, - TUint32 aDestId) - { - CCmDestinationImpl* dest = - new (ELeave) CCmDestinationImpl( aCmMgr ); - CleanupStack::PushL( dest ); - - dest->ConstructL( aName, aDestId ); - - CleanupStack::Pop( dest ); - return dest; - } - - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::NewLC() -// ----------------------------------------------------------------------------- -// -CCmDestinationImpl* CCmDestinationImpl::NewLC( CCmDestinationData* aData ) - { - CCmDestinationImpl* dest = - new (ELeave) CCmDestinationImpl( aData->iCmMgr ); - CleanupStack::PushL( dest ); - dest->iData = aData; - return dest; - } - - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CCmDestinationImpl() -// ----------------------------------------------------------------------------- -// -CCmDestinationImpl::CCmDestinationImpl( CCmManagerImpl& aCmMgr ) - : iCmMgr( aCmMgr ) - { - } - -// ----------------------------------------------------------------------------- -// CCmDestinationData::CCmDestinationData() -// ----------------------------------------------------------------------------- -// -CCmDestinationData::CCmDestinationData( CCmManagerImpl& aCmMgr ) - : iCmMgr( aCmMgr ), - iNewWithId ( EFalse ) - { - } - -// ----------------------------------------------------------------------------- -// CCmDestinationData::~CCmDestinationData() -// ----------------------------------------------------------------------------- -// -CCmDestinationData::~CCmDestinationData() - { - delete iMetaDataRec; - delete iNetworkRecord; - delete iDestAPRecord; - - if (iConnMethodArray) - { - ResetAndDestroyArray( iConnMethodArray, ETrue ); - } - if (iDeleteCmArray) - { - ResetAndDestroyArray( iDeleteCmArray, ETrue ); - } - - CLOG_CLOSE; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::~CCmDestinationImpl() -// ----------------------------------------------------------------------------- -// -CCmDestinationImpl::~CCmDestinationImpl() - { - if (iData) - { - if (GetRefCounter()) - { - iCmMgr.RemoveDestFromPool(this); - } - else //if leaves during construction refcounter is 0 - { - delete iData; - } - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ConstructL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::ConstructL( const TDesC& aName ) - { - CLOG_CREATE; - CLOG_NAME_2( _L("Destination_0x%x_%S"), this, &aName ); - - iData = new (ELeave) CCmDestinationData(iCmMgr); - iData->iNetworkRecord = static_cast( - CCDRecordBase::RecordFactoryL( KCDTIdNetworkRecord ) ); - - iData->iConnMethodArray = new (ELeave) CCmArray( KCmArrayBigGranularity ); - iData->iDeleteCmArray = new (ELeave) CCmArray( KCmArrayBigGranularity ); - - iData->iMetaDataRec = new (ELeave) CCDSNAPMetadataRecord( - iCmMgr.IconTableId() ); - - iData->iDestAPRecord = static_cast( - CCDRecordBase::RecordFactoryL( KCDTIdAccessPointRecord ) ); - - SetNameL( aName ); - - InitializeDestAPRecordL(); - - CPluginItem* item = new (ELeave) CPluginItem; - CleanupStack::PushL( item ); - - // create the new record - item->iDNRecord = iCmMgr.SNAPRecordL( 0 ); - CleanupStack::PushL( item->iDNRecord ); - - AddToArrayL( item ); - - CleanupStack::Pop( 2, item ); // iDNRecord, item - iData->iIdIsValid = EFalse;// the Id is still zero here - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ConstructL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::ConstructL( const TDesC& aName, TUint32 aDestId ) - { - CLOG_CREATE; - CLOG_NAME_2( _L("Destination_0x%x_%S"), this, &aName ); - - iData = new (ELeave) CCmDestinationData(iCmMgr); - iData->iNetworkRecord = static_cast( - CCDRecordBase::RecordFactoryL( KCDTIdNetworkRecord ) ); - - iData->iConnMethodArray = new (ELeave) CCmArray( KCmArrayBigGranularity ); - iData->iDeleteCmArray = new (ELeave) CCmArray( KCmArrayBigGranularity ); - - iData->iMetaDataRec = new (ELeave) CCDSNAPMetadataRecord( iCmMgr.IconTableId() ); - - iData->iDestAPRecord = static_cast( - CCDRecordBase::RecordFactoryL( KCDTIdAccessPointRecord ) ); - - SetNameL( aName ); - - TInt correctAPId = aDestId; - TInt correctNetworkId = aDestId; - - if ( aDestId > 0 && aDestId < 255 ) - { - correctAPId = aDestId + KCmDefaultDestinationAPTagId; - } - else if ( aDestId > KCmDefaultDestinationAPTagId - && ( aDestId < ( KCmDefaultDestinationAPTagId+255 ) ) ) - { - correctNetworkId = aDestId - KCmDefaultDestinationAPTagId; - } - else - { - User::Leave( KErrArgument ); - } - - SetIdL( correctAPId ); - - InitializeDestAPRecordL(); - - CPluginItem* item = new (ELeave) CPluginItem; - CleanupStack::PushL( item ); - - // create the new record - iData->iNetworkRecord->SetRecordId( correctNetworkId ); - iData->iNewWithId = ETrue; - item->iDNRecord = iCmMgr.SNAPRecordL( 0 ); - CleanupStack::PushL( item->iDNRecord ); - - AddToArrayL( item ); - - CleanupStack::Pop( 2, item ); // iDNRecord, item - iData->iIdIsValid = EFalse;// the Id is still zero here - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::SetIdL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::SetIdL( TInt aDestId ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::SetIdL" ); - - TInt correctAPId( aDestId ); - if ( aDestId > 0 && aDestId < 255 ) - { - correctAPId = aDestId + KCmDefaultDestinationAPTagId; - } - else if ( aDestId < KCmDefaultDestinationAPTagId + 1 - || aDestId > KCmDefaultDestinationAPTagId + 255 ) - { - User::Leave( KErrArgument ); - } - - CheckIfDestinationIdExistsL( correctAPId ); - - iData->iDestAPRecord->iRecordTag = correctAPId; - }; - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CheckIfDestinationIdExistsL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::CheckIfDestinationIdExistsL( TUint32 aDestId ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::CheckIfDestinationNameExistL" ); - - CMDBRecordSet* ptrRecordSet = - new (ELeave) CMDBRecordSet( KCDTIdAccessPointRecord ); - CleanupStack::PushL( ptrRecordSet ); - - // Prime record - CCDAccessPointRecord* record = static_cast - ( CCDRecordBase::RecordFactoryL( KCDTIdAccessPointRecord ) ); - CleanupStack::PushL( record ); - - record->iRecordTag = ( TInt )aDestId; - - ptrRecordSet->iRecords.AppendL( record ); - - CleanupStack::Pop( record ); - record = NULL; - - if ( ptrRecordSet->FindL( Session() ) ) - { - User::Leave( KErrAlreadyExists ); - } - - ptrRecordSet->iRecords.ResetAndDestroy(); - CleanupStack::PopAndDestroy( ptrRecordSet ); - - iData->iDestAPRecord->iRecordTag = aDestId; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CheckIfDestinationNameExistL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::CheckIfDestinationNameExistL( const TDesC& aName ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::CheckIfDestinationNameExistL" ); - - CMDBRecordSet* ptrRecordSet = - new (ELeave) CMDBRecordSet( - iCmMgr.DestinationTableId() ); - CleanupStack::PushL( ptrRecordSet ); - - // Prime record - CCDSnapRecord* record = iCmMgr.SNAPRecordL( 0 ); - CleanupStack::PushL( record ); - - record->iRecordName.SetL( aName ); - - ptrRecordSet->iRecords.AppendL( record ); - - CleanupStack::Pop( record ); - record = NULL; - - if ( ptrRecordSet->FindL( Session() ) ) - { - User::Leave( KErrAlreadyExists ); - } - - ptrRecordSet->iRecords.ResetAndDestroy(); - CleanupStack::PopAndDestroy( ptrRecordSet ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ConstructL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::ConstructL( TUint aDestinationId ) - { - CLOG_CREATE; - CLOG_NAME_2( _L("Destination_0x%x_%d"), this, aDestinationId ); - iData = new (ELeave) CCmDestinationData(iCmMgr); - OpenTransactionLC(); - - iData->iNetworkRecord = static_cast( - CCDRecordBase::RecordFactoryL( KCDTIdNetworkRecord ) ); - - iData->iDestAPRecord = static_cast( - CCDRecordBase::RecordFactoryL( KCDTIdAccessPointRecord ) ); - - iData->iConnMethodArray = new (ELeave) CCmArray( KCmArrayBigGranularity ); - iData->iDeleteCmArray = new (ELeave) CCmArray( KCmArrayBigGranularity ); - - TInt correctAPId = aDestinationId; - TInt correctNetworkId = aDestinationId; - - if ( aDestinationId > 0 && aDestinationId < 255 ) - { - correctAPId = aDestinationId + KCmDefaultDestinationAPTagId; - } - else if ( aDestinationId > KCmDefaultDestinationAPTagId - && ( aDestinationId < ( KCmDefaultDestinationAPTagId+255 ) ) ) - { - correctNetworkId = aDestinationId - KCmDefaultDestinationAPTagId; - } - else - { - User::Leave( KErrArgument ); - } - - LoadDestAPRecordL( correctAPId ); - - LoadNetworkRecordL( correctNetworkId ); - - LoadConnectionMethodsL(); - LoadSNAPMetadataTableL(); - - RollbackTransaction(); - - iData->iIdIsValid = ETrue; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::Session() -// ----------------------------------------------------------------------------- -// -CMDBSession& CCmDestinationImpl::Session()const - { - return iCmMgr.Session(); - } - -// --------------------------------------------------------------------------- -// CCmDestinationImpl::OpenTransactionLC -// --------------------------------------------------------------------------- -// -void CCmDestinationImpl::OpenTransactionLC() - { - LOGGER_ENTERFN( "CCmDestinationImpl::OpenTransactionL" ); - // Do NOT call OpenTransactionLC() more then once! - iCmMgr.OpenTransactionLC( ETrue ); - } - -// --------------------------------------------------------------------------- -// CCmDestinationImpl::CommitTransactionL -// --------------------------------------------------------------------------- -// -void CCmDestinationImpl::CommitTransactionL( TInt aError ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::CommitTransactionL" ); - - iCmMgr.CommitTransactionL( aError ); - } - -// --------------------------------------------------------------------------- -// CCmDestinationImpl::RollbackTransaction -// --------------------------------------------------------------------------- -// -void CCmDestinationImpl::RollbackTransaction() - { - LOGGER_ENTERFN( "CCmDestinationImpl::RollbackTransaction" ); - - iCmMgr.RollbackTransaction(); - } - - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::NameLC() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC* CCmDestinationImpl::NameLC( ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::NameLC" ); - - HBufC* name = NULL; - const TUint32 KSnapMetadataNameMask = 0x0000000F; - - TUint32 val = TUint32(iData->iMetaDataRec->iMetadata) & KSnapMetadataNameMask; - TUint32 val2 = (TUint32(iData->iMetaDataRec->iMetadata) & ESnapMetadataDestinationIsLocalised) - >> 4; - - if( (val == ESnapMetadataInternet) || - (val2 == ELocalisedDestInternet) ) - { - name = iCmMgr.AllocReadL( R_CMMANAGERUI_DEST_INTERNET ); - } - else if ( val2 == ELocalisedDestWap ) - { - name = iCmMgr.AllocReadL( R_CMMANAGERUI_DEST_WAP ); - } - else if ( val2 == ELocalisedDestMMS ) - { - name = iCmMgr.AllocReadL( R_CMMANAGERUI_DEST_MMS ); - } - else if ( val2 == ELocalisedDestIntranet ) - { - name = iCmMgr.AllocReadL( R_CMMANAGERUI_DEST_INTRANET ); - } - else - { - name = TPtrC(iData->iNetworkRecord->iRecordName).AllocL(); - } - - CleanupStack::PushL( name ); - - return name; - }; - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::SetNameL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CCmDestinationImpl::SetNameL( const TDesC& aName ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::SetNameL" ); - - // Destination cannot be renamed if it's - // - protected - // - Internet - if ( ProtectionLevel() == EProtLevel1 || - ProtectionLevel() == EProtLevel2 || - MetadataL( ESnapMetadataInternet ) ) - { - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - OpenTransactionLC(); - CheckIfDestinationNameExistL( aName ); - CommitTransactionL( KErrNone ); - - iData->iNetworkRecord->iRecordName.SetL( aName ); - iData->iDestAPRecord->iRecordName.SetL( aName ); - }; - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ConnectionMethodCount() -// ----------------------------------------------------------------------------- -// -TInt CCmDestinationData::ConnectionMethodCount() - { - LOGGER_ENTERFN( "CCmDestinationImpl::ConnectionMethodCount" ); - - return iConnMethodArray->Count() - KCmInitIndex; - }; - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ConnectionMethodCount() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CCmDestinationImpl::ConnectionMethodCount() - { - LOGGER_ENTERFN( "CCmDestinationImpl::ConnectionMethodCount" ); - - return iData->ConnectionMethodCount(); - }; - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ConnectionMethodL -// ----------------------------------------------------------------------------- -// -EXPORT_C CCmPluginBaseEng* CCmDestinationImpl::ConnectionMethodL( TInt /*aIndex*/ ) - { - LOGGER_ENTERFN( "Error: Obsolete function CCmDestinationImpl::ConnectionMethodL used" ); - User::Panic( _L("CMManager"), KErrNotSupported ); - return NULL; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ConnectionMethodL -// ----------------------------------------------------------------------------- -// -EXPORT_C CCmPluginBase* CCmDestinationImpl::GetConnectionMethodL( TInt aIndex ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::ConnectionMethodL" ); - // Initial entry! - - CCmPluginBase* retVal = NULL; - TInt index = KCmInitIndex + aIndex; - CPluginItem* item = (*(iData->iConnMethodArray))[index]; - - LoadPluginL( *item ); - retVal = item->iPlugin; - - return retVal; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ConnectionMethodByIDL -// ----------------------------------------------------------------------------- -// -CCmPluginBase* CCmDestinationImpl::ConnectionMethodByIDL( TUint32 aCmId ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::ConnectionMethodByIDL" ); - - TInt found = ConnectionMethodIndex( aCmId ); - - if( found == KErrNotFound ) - { - User::Leave( KErrNotFound ); - } - - CPluginItem* item = (*(iData->iConnMethodArray))[found]; - - LoadPluginL( *item ); - - return item->iPlugin; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ConnectMethodIdArrayL -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::ConnectMethodIdArrayL( RArray& aCmIds ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::ConnectMethodIdArrayL" ); - - TInt count = iData->iConnMethodArray->Count(); - - for( TInt i = KCmInitIndex; i < count; ++i ) - { - CPluginItem* item = (*(iData->iConnMethodArray))[i]; - - TUint32 elementId = item->iDNRecord->iIAP ? - RECORD_FROM_ELEMENT_ID( TUint32(item->iDNRecord->iIAP) ) : - TUint32( item->iDNRecord->iEmbeddedSNAP ); - - User::LeaveIfError( aCmIds.Append( elementId ) ); - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::AddToArrayL -// ----------------------------------------------------------------------------- -// -TInt CCmDestinationImpl::AddToArrayL( CPluginItem* aItem ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::AddToArrayL" ); - - TInt count = iData->iConnMethodArray->Count(); - if ( 0 == count ) - { - iData->iConnMethodArray->AppendL( aItem ); - CLOG_WRITE_1( "inserted: [%d]", count ); - return count; - } - - // Fill in SNAP record with IAP/EmbSNAP/SNAP values - TMDBElementId iapElemetid( 0 ); - TInt embDestId( 0 ); - - // No plugin means this is the template record. - TBool isDestination = aItem->iPlugin->GetBoolAttributeL( ECmDestination ); - if ( isDestination ) - { - embDestId = aItem->iPlugin->Destination()->Id(); - } - else - { - iapElemetid = aItem->iPlugin->IAPRecordElementId(); - } - - aItem->iDNRecord->iIAP = iapElemetid; - aItem->iDNRecord->iEmbeddedSNAP = embDestId; - - TUint32 prio = 0; - TUint32 bearerType = 0; - TUint32 extLevel = 0; - - TBool isVirtual( EFalse ); - - if ( count == KCmInitIndex ) - { - if( !aItem->iDNRecord->iIAP && !aItem->iDNRecord->iEmbeddedSNAP ) - { - iData->iConnMethodArray->AppendL( aItem ); - } - else - { - isVirtual = PrioDataL( aItem, prio, bearerType, extLevel ); - aItem->iDNRecord->iPriority = prio; - iData->iConnMethodArray->AppendL( aItem ); - } - return count; - } - - TInt insertedAt( -1 ); - - if ( !isDestination ) - { - // This function returns the info necessary for determining the priority - // It is the cm data in none VPN case - // It is the data of the underlying cm in case of VPN over cm - // It is wildcard prio in case of VPN over destination - isVirtual = PrioDataL( aItem, prio, bearerType, extLevel ); - - CLOG_WRITE_3( "inserted item prio: [%d], bearer: [%x] ext: [%d]", - prio, bearerType, extLevel ); - - // wildcard priority goes to back - if ( KDataMobilitySelectionPolicyPriorityWildCard == prio ) - { - // Set the default priority of a wildcard bearer - aItem->iDNRecord->iPriority = prio; - } - else - { - insertedAt = InsertSameMethodL( bearerType, isVirtual ); - if( insertedAt == -1 ) - { - insertedAt = InsertPriorityMethodL( prio, extLevel ); - } - - } // if wildcard - } // if !destination - - if( insertedAt == -1 ) - { - //Add to the end of the list - iData->iConnMethodArray->AppendL( aItem ); - insertedAt = iData->iConnMethodArray->Count()-1; - CLOG_WRITE_1( "inserted as last: [%d]", insertedAt ); - } - else - { - iData->iConnMethodArray->InsertL( insertedAt, aItem ); - } - - CLOG_WRITE_1( "inserted at: [%d]", insertedAt ); - - return insertedAt; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::PrioDataL -// ----------------------------------------------------------------------------- -// -TBool CCmDestinationImpl::PrioDataL( CPluginItem* aItem, TUint32& aRetPrio, - TUint32& aRetBearer, TUint32& aRetExtLevel ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::PrioDataL" ); - - // Gets the data affecting the priority of the plugin in the list. - // It means the VPN priory based on the barer priority of the underlying cm - // or "wildcard" if VPN points to a destination - aRetPrio = aItem->iPlugin->GetIntAttributeL( ECmDefaultPriority ); - aRetBearer = aItem->iPlugin->GetIntAttributeL( ECmBearerType ); - aRetExtLevel = aItem->iPlugin->GetIntAttributeL( ECmExtensionLevel ); - - TBool isVirtual = aItem->iPlugin->GetBoolAttributeL( ECmVirtual ); - if( isVirtual ) - { - // Embeded destination is also virtual but further checking should - // not be done. - TBool isDestination = aItem->iPlugin->GetBoolAttributeL( ECmDestination ); - if( !isDestination ) - { - TUint32 underlying = aItem->iPlugin->GetIntAttributeL( - ECmNextLayerIapId ); - if ( underlying != 0 ) - { - // Gets the bearer of the underlying cm - aRetBearer = iCmMgr.BearerTypeFromCmIdL( underlying ); - // Gets the prio of the bearer - aRetPrio = - iCmMgr.GetBearerInfoIntL( aRetBearer, ECmDefaultPriority ); - aRetExtLevel = - iCmMgr.GetBearerInfoIntL( aRetBearer, ECmExtensionLevel ); - } - else - { - // VPN points to a destination so its priority is "wildcard" - aRetPrio = KDataMobilitySelectionPolicyPriorityWildCard; - } - } - } - - return isVirtual; - } - - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::InsertSameMethodL -// ----------------------------------------------------------------------------- -// -TInt CCmDestinationImpl::InsertSameMethodL( TUint32 aBearerType, TBool aIsVirtual ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::InsertSameMethodL" ); - - TInt insertedAt( -1 ); - TUint32 bearerInList( 0 ); - TUint32 prioInList( 0 ); - TUint32 extLevelInList( 0 ); - TBool isVirtualInList( EFalse ); - - TInt count = iData->iConnMethodArray->Count(); - // Loops throught the items in the list - for ( TInt i = count-1; ( i >= KCmInitIndex ) && ( insertedAt == -1) ; i-- ) - { - // Loads the plugin - CPluginItem* item = (*(iData->iConnMethodArray))[i]; - LoadPluginL( *item ); - - // Gets the data of the list item - isVirtualInList = PrioDataL( item, - prioInList, bearerInList, extLevelInList ); - - CLOG_WRITE_4( "actual item [%d] prio: [%d], bearer: [%x] ext: [%d]", - i, prioInList, bearerInList, extLevelInList ); - - // Bearer type the same - if( aBearerType == bearerInList ) - { - // puts Virt/Virt or !Virt/!Virt or !Virt/Virt - if( ( aIsVirtual == isVirtualInList ) || ( aIsVirtual && !isVirtualInList )) - { - insertedAt = i+1; - CLOG_WRITE_1( "inserted same bearer: [%d]", insertedAt ); - } - } // if bearer - } // for - return insertedAt; - } - - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::InsertPriorityMethodL -// ----------------------------------------------------------------------------- -// -TInt CCmDestinationImpl::InsertPriorityMethodL( TUint32 aPrio, TUint32 aExtLevel ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::InsertPriorityMethodL" ); - - TInt insertedAt = -1; - TUint32 bearerInList( 0 ); - TUint32 prioInList( 0 ); - TUint32 extLevelInList( 0 ); - - TInt count = iData->iConnMethodArray->Count(); - // Loops throught the items in the list - ////for ( TInt i = KCmInitIndex; ( i < count ) && ( insertedAt == -1) ; i++ ) - TInt i ( count-1 ); - for ( ; ( i >= KCmInitIndex ) && ( insertedAt == -1) ; i-- ) - { - // Loads the plugin - CPluginItem* item = (*(iData->iConnMethodArray))[i]; - LoadPluginL( *item ); - - // Gets the data of the list item - PrioDataL( item, prioInList, bearerInList, extLevelInList ); - - CLOG_WRITE_4( "actual item [%d] prio: [%d], bearer: [%x] ext: [%d]", - i, prioInList, bearerInList, extLevelInList ); - - // If the priority is the same then it should be inserted near here - if ( aPrio == prioInList ) - { - if( aExtLevel <= extLevelInList ) - { - insertedAt = i+1; - CLOG_WRITE_1( "inserted same bearer non virtual: [%d]", insertedAt ); - } - } - // Insert in front of the higher priority (prio 1 is the highest ...) - else if ( aPrio > prioInList ) - { - insertedAt = i+1; - CLOG_WRITE_1( "inserted higher prio: [%d]", insertedAt ); - } // if same prio - - } // for - - // This is the highest priority one. It should be inserted at the first pos. - if( -1 == insertedAt ) - { - insertedAt = KCmInitIndex; - CLOG_WRITE_1( "inserted first position: [%d]", insertedAt ); - } // if same prio - - return insertedAt; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationData::ProtectionLevel() -// ----------------------------------------------------------------------------- -// -TProtectionLevel CCmDestinationData::ProtectionLevel() - { - TInt protection = TUint32(iMetaDataRec->iMetadata) & - KSnapMetadataProtecionLevelMask; - return TProtectionLevel(protection >> 28); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ProtectionLevel() -// ----------------------------------------------------------------------------- -// -EXPORT_C - TProtectionLevel CCmDestinationImpl::ProtectionLevel() - { - return iData->ProtectionLevel(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::SetAttributeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CCmDestinationImpl::SetProtectionL( TProtectionLevel aProtectionLevel ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::SetProtectionL" ); - - CLOG_WRITE_1( "Level: [%d]", aProtectionLevel ); - - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - - // Make a destination protected. - TUint32 mask = ~KSnapMetadataProtecionLevelMask; - TUint32 temp = TUint32(iData->iMetaDataRec->iMetadata) & mask; - iData->iMetaDataRec->iMetadata = aProtectionLevel << 28; - iData->iMetaDataRec->iMetadata = temp | TUint32(iData->iMetaDataRec->iMetadata); - - iData->iProtectionChanged = ETrue; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CreateConnectionMethodL() -// ----------------------------------------------------------------------------- -// -CCmPluginBase* CCmDestinationImpl::CreateConnectionMethodL( - TUint32 aImplementationUid ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::CreateConnectionMethodL" ); - - CCmPluginBase* retval = NULL; - if( ProtectionLevel() == EProtLevel1 ) - { - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - retval = iCmMgr.CreateConnectionMethodL(aImplementationUid, this); - CleanupStack::PushL(retval); - AddConnectionMethodL(*retval); - CleanupStack::Pop(retval); - return retval; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CreateConnectionMethodL() -// ----------------------------------------------------------------------------- -// -CCmPluginBase* CCmDestinationImpl::CreateConnectionMethodL( - TUint32 aImplementationUid, - TUint32 aConnMthId ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::CreateConnectionMethodL" ); - - CCmPluginBase* retval = NULL; - if( ProtectionLevel() == EProtLevel1 ) - { - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - retval = iCmMgr.CreateConnectionMethodL( aImplementationUid, - aConnMthId, - this ); - CleanupStack::PushL(retval); - AddConnectionMethodL(*retval); - CleanupStack::Pop(retval); - return retval; - } - - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::AddConnectionMethodL() -// ----------------------------------------------------------------------------- -// -TInt CCmDestinationImpl::AddConnectionMethodL( - CCmPluginBase& aConnectionMethod ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::AddConnectionMethodL" ); - - if( ProtectionLevel() == EProtLevel1 ) - { - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - TUint cmId = aConnectionMethod.GetIntAttributeL( ECmId ); - - CPluginItem* item = new (ELeave) CPluginItem; - CleanupStack::PushL( item ); // 1 - - // get the plugin - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(aConnectionMethod.Plugin()); - CleanupStack::PushL( connMethod );// 2 - connMethod->IncrementRefCounter(); - item->iPlugin = connMethod; - - CleanupStack::PushL( item->iPlugin ); // 3 - // create the new record - item->iDNRecord = iCmMgr.SNAPRecordL( 0 ); - - CleanupStack::PushL( item->iDNRecord ); // 4 - - // if the destination is protection level 1, the connection method must be protected - if ( ProtectionLevel() == EProtLevel1 ) - { - item->iPlugin->SetBoolAttributeL( ECmProtected, ETrue ); - } - - TInt index = AddToArrayL( item ); - index = index - KCmInitIndex; //the array contains one initial item, so subtract KCmInitIndex from the index to get cm index! - - CleanupStack::Pop( 4, item ); // item, connMethod, iDNRecord, iPlugin - - return index; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::AddEmbeddedDestinationL() -// ----------------------------------------------------------------------------- -// -TInt CCmDestinationImpl::AddEmbeddedDestinationL( - CCmDestinationImpl& aDestination ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::AddEmbeddedDestinationL" ); - - if( ProtectionLevel() == EProtLevel1 ) - { - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - //Check to avoid multiple levels of embedding - CheckIfEmbeddedL( Id() ); - - //Check to avoid multiple levels of embedding - if ( aDestination.HasEmbeddedL() ) - { - User::Leave( KErrNotSupported ); - } - - // Only one embedded destination per destination is allowed - if ( HasEmbeddedL() ) - { - User::Leave( KErrNotSupported ); - } - - CPluginItem* item = new (ELeave) CPluginItem; - CleanupStack::PushL( item ); // 1 - - CreateEmbeddedDestinationPluginL( *item, aDestination.Id() ); - // create the new record - item->iDNRecord = iCmMgr.SNAPRecordL( 0 ); - item->iDNRecord->iPriority = KDataMobilitySelectionPolicyPriorityWildCard; - - CleanupStack::PushL( item->iDNRecord ); // 2 - TInt index = AddToArrayL( item ); - index = index - KCmInitIndex; //the array contains one initial item, so subtract KCmInitIndex from the index to get cm index! - - CleanupStack::Pop( 2, item ); // item, iDNRecord - - return index; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::DeleteConnectionMethodL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::DeleteConnectionMethodL( - CCmPluginBase& aConnectionMethod ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::DeleteConnectionMethodL" ); - - if( ProtectionLevel() == EProtLevel1 || - ProtectionLevel() == EProtLevel3 ) - { - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - if ( aConnectionMethod.GetBoolAttributeL( ECmConnected ) ) - { - User::Leave( KErrInUse ); - } - - TInt index = FindConnectionMethodL( aConnectionMethod ); - - // move this method to the 'to be deleted' array - CPluginItem* item = (*(iData->iConnMethodArray))[index]; - - LoadPluginL( *item ); - - if( item->iPlugin->GetBoolAttributeL( ECmIsLinked ) ) - { - User::Leave( KErrLocked ); - } - - if ( ConnectionMethodCount() == 1 ) - { - // Check if this destination is referenced by Virtual CM - CheckIfReferencedByVirtualCML(); - } - - iData->iDeleteCmArray->AppendL( item ); - iData->iConnMethodArray->Delete( index ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::RemoveConnectionMethodL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::RemoveConnectionMethodL( - const CCmPluginBase& aConnectionMethod ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::DeleteConnectionMethodL" ); - - if( ProtectionLevel() == EProtLevel1 || - ProtectionLevel() == EProtLevel3 ) - { - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - if ( ConnectionMethodCount() == 1 ) - { - // Check if this destination is referenced by Virtual CM - CheckIfReferencedByVirtualCML(); - } - - TInt index = FindConnectionMethodL( aConnectionMethod ); - - // move this method to the 'to be deleted' array, but - // set remove only from, not to delete it on update. - CPluginItem* item = (*(iData->iConnMethodArray))[index]; - - item->iFlags |= CPluginItem::ERemoveCm; - - iData->iDeleteCmArray->AppendL( item ); - iData->iConnMethodArray->Delete( index ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CheckIfReferencedByVirtualCML() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::CheckIfReferencedByVirtualCML() - { - // for each IAP in CM manager - // 1. check if it is virtual - // if not => goto 1. - // if yes: - // 2. check if it links to the destination of this CM - // if yes => carryOn = EFalse, ERROR - // if not: carryOn = ETrue - CommsDat::CMDBRecordSet* iaps = iCmMgr.AllIapsL(); - CleanupStack::PushL( iaps ); - - TBool carryOn = ETrue; - TUint32 destId = Id(); - - // for each IAP in CM manager - for ( TInt i = KCmInitIndex; carryOn && i < iaps->iRecords.Count(); ++i ) - { - CommsDat::CCDIAPRecord* rec = (*iaps)[i]; - TUint32 bearerType = 0; - - TRAP_IGNORE( bearerType = iCmMgr.BearerTypeFromIapRecordL( rec ) ); - if ( !bearerType ) - { - continue; - } - - // check if it is virtual - if ( iCmMgr.GetBearerInfoBoolL( bearerType, ECmVirtual ) ) - { - // check if it links to the current destination - CCmPluginBase* plugin = NULL; - TRAP_IGNORE( plugin = iCmMgr.GetConnectionMethodL( rec->RecordId() ) ); - - if ( !plugin ) - { - continue; - } - - if ( plugin->IsLinkedToSnap( destId ) ) - { - // the CM links to this destination, deletion not allowed - carryOn = EFalse; - } - - delete plugin; - } - } - - CleanupStack::PopAndDestroy( iaps ); - - if ( !carryOn ) - { - User::Leave( KErrLocked ); - } - } -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::RemoveConnectionMethodL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::RemoveConnectionMethodL( - const CCmPluginBaseEng& aConnectionMethod ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::DeleteConnectionMethodL" ); - - if( ProtectionLevel() == EProtLevel1 || - ProtectionLevel() == EProtLevel3 ) - { - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - TInt index = FindConnectionMethodL( aConnectionMethod ); - - // move this method to the 'to be deleted' array, but - // set remove only from, not to delete it on update. - CPluginItem* item = (*(iData->iConnMethodArray))[index]; - - item->iFlags |= CPluginItem::ERemoveCm; - - iData->iDeleteCmArray->AppendL( item ); - iData->iConnMethodArray->Delete( index ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ConnectionMethodDeletedL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::ConnectionMethodDeletedL( - const CCmPluginBase& aConnectionMethod ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::ConnectionMethodDeletedL" ); - - TInt found( KErrNotFound ); - TUint32 aCmId = aConnectionMethod.GetIntAttributeL( ECmId ); - - found = ConnectionMethodIndex( aCmId ); - - if( found != KErrNotFound ) - { - CPluginItem* item = (*(iData->iConnMethodArray))[found]; - - (*(iData->iConnMethodArray))[found] = NULL; - iData->iConnMethodArray->Delete( found ); - iData->iConnMethodArray->Compress(); - - // The iPlugin is deleted in plugin interface function - // that called this function. - delete item->iDNRecord; - delete item; - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::FindConnectionMethodL() -// ----------------------------------------------------------------------------- -// -TInt CCmDestinationImpl::FindConnectionMethodL( - const CCmPluginBase& aConnectionMethod ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::FindConnectionMethodL" ); - - TInt cmId = aConnectionMethod.GetIntAttributeL( ECmId ); - TBool embeded = aConnectionMethod.GetBoolAttributeL( ECmDestination ) ? - ETrue : - EFalse; - - CLOG_WRITE_2( "ID: [%d], embDest: [%d]", - cmId, - aConnectionMethod.GetBoolAttributeL( ECmDestination ) ); - - for ( TInt i = KCmInitIndex; i < iData->iConnMethodArray->Count(); ++i ) - { - CPluginItem* item = (*(iData->iConnMethodArray))[i]; - if( embeded ) - { - if( item->iDNRecord->iEmbeddedSNAP == cmId ) - { - return i; - } - } - else - { - if( RECORD_FROM_ELEMENT_ID(item->iDNRecord->iIAP) == cmId ) - { - return i; - } - } - } - - CLOG_WRITE( "Not found" ); - User::Leave( KErrNotFound ); - - // dummy return value. never used. - return -1; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::FindConnectionMethodL() -// ----------------------------------------------------------------------------- -// -TInt CCmDestinationImpl::FindConnectionMethodL( - const CCmPluginBaseEng& aConnectionMethod ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::FindConnectionMethodL" ); - - TInt cmId = aConnectionMethod.GetIntAttributeL( ECmId ); - TBool embeded = aConnectionMethod.GetBoolAttributeL( ECmDestination ) ? - ETrue : - EFalse; - - CLOG_WRITE_2( "ID: [%d], embDest: [%d]", - cmId, - aConnectionMethod.GetBoolAttributeL( ECmDestination ) ); - - for ( TInt i = KCmInitIndex; i < iData->iConnMethodArray->Count(); ++i ) - { - CPluginItem* item = (*(iData->iConnMethodArray))[i]; - if( embeded ) - { - if( item->iDNRecord->iEmbeddedSNAP == cmId ) - { - return i; - } - } - else - { - if( RECORD_FROM_ELEMENT_ID(item->iDNRecord->iIAP) == cmId ) - { - return i; - } - } - } - - CLOG_WRITE( "Not found" ); - User::Leave( KErrNotFound ); - - // dummy return value. never used. - return -1; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ModifyPriorityL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::ModifyPriorityL( CCmPluginBase& aCCMItem, - TUint aIndex ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::ModifyPriorityL" ); - - if (aCCMItem.GetBoolAttributeL(ECmDestination) || - (aCCMItem.GetBoolAttributeL(ECmVirtual) && - aCCMItem.GetIntAttributeL(ECmNextLayerSNAPId))) - { - // Priority can not be changed for this cm - return; - } - - if( ProtectionLevel() == EProtLevel1 || - ProtectionLevel() == EProtLevel3 ) - { - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - TBool found( EFalse ); - TInt cm2 = aCCMItem.GetIntAttributeL( ECmId ); - - if ( aIndex >= ( iData->iConnMethodArray->Count() - KCmInitIndex ) ) - { - User::Leave( KErrArgument ); - } - - for ( TInt i = KCmInitIndex; i < iData->iConnMethodArray->Count(); i++ ) - { - LoadPluginL( *(*(iData->iConnMethodArray))[i] ); - - // Compare the IAP IDs - TInt cm1 = (*(iData->iConnMethodArray))[i]->iPlugin->GetIntAttributeL( ECmId ); - - if ( cm1 == cm2 ) - { - CPluginItem* item = (*(iData->iConnMethodArray))[i]; - - TInt pri = (*(iData->iConnMethodArray))[i]->iDNRecord->iPriority; - if ( pri == KDataMobilitySelectionPolicyPriorityWildCard ) - { - TUint32 prio = 0; - TUint32 bearerType = 0; - TUint32 extLevel = 0; - - TBool isVirtual = PrioDataL( item, prio, bearerType, extLevel ); - if (prio != KDataMobilitySelectionPolicyPriorityWildCard) - { - // The priority will be changed later when UpdateL is called - // So, the priority will simply be chnaged from - // KDataMobilitySelectionPolicyPriorityWildCard to value i - (*(iData->iConnMethodArray))[i]->iDNRecord->iPriority = i; - } - } - - (*(iData->iConnMethodArray))[i] = NULL; - - // remove from array - iData->iConnMethodArray->Delete( i ); - iData->iConnMethodArray->Compress(); - iData->iConnMethodArray->InsertL( KCmInitIndex + aIndex, item ); - - found = ETrue; - break; - } - } - - if ( !found ) - { - User::Leave( KErrArgument ); - } - - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::PriorityL() -// ----------------------------------------------------------------------------- -// -TUint CCmDestinationImpl::PriorityL( CCmPluginBaseEng& aCCMItem ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::PriorityL" ); - - TInt index = FindConnectionMethodL( aCCMItem ); - - return (*(iData->iConnMethodArray))[index]->iDNRecord->iPriority; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::PriorityL() -// ----------------------------------------------------------------------------- -// -TUint CCmDestinationImpl::PriorityL( CCmPluginBase& aCCMItem ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::PriorityL" ); - - TInt index = FindConnectionMethodL( aCCMItem ); - - return (*(iData->iConnMethodArray))[index]->iDNRecord->iPriority; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::UpdateL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CCmDestinationImpl::UpdateL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::UpdateL" ); - - // Connection methods and destination records are updated in - // one transaction. - OpenTransactionLC(); - - DeleteConnectionMethodsL(); - - // Update protection level of connection methods if it's changed in - // the destination - UpdateProtectionL(); - // Updates all modified connection methods. - UpdateConnectionMethodsL(); - UpdateNetworkRecordL(); - UpdateDestAPRecordL(); - UpdateSNAPTableL(); - UpdateSNAPMetadataTableL(); - - CommitTransactionL( KErrNone ); - - // set the last updated protection level of the destination - iData->iLastProtectionLevel = ProtectionLevel(); - - // Clear the modified flag - iData->iProtectionChanged = EFalse; - - // empty the array, but do not delete it - iData->ResetAndDestroyArray( iData->iDeleteCmArray, EFalse ); - - iCmMgr.DestinationUpdated(this); - iData->iIdIsValid = ETrue; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::DeleteLD() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CCmDestinationImpl::DeleteLD() - { - LOGGER_ENTERFN( "CCmDestinationImpl::DeleteLD" ); - - if( ProtectionLevel() == EProtLevel1 ) - { - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - TInt count = iData->iConnMethodArray->Count(); - - if( IsConnectedL() ) - { - User::Leave( KErrInUse ); - } - - // Check first that any of the CMs in this Destination is not - // referenced by Virtual CM - TInt i( 0 ); - - for( i = KCmInitIndex; i < count; ++i ) - { - CPluginItem* item = (*(iData->iConnMethodArray))[i]; - - LoadPluginL( *item ); - - if( item->iPlugin->GetBoolAttributeL( ECmIsLinked ) ) - { - User::Leave( KErrLocked ); - } - } - // Check that this Destination is not referenced by any Virtual CM - if ( ConnectionMethodCount() > 0 ) - { - CheckIfReferencedByVirtualCML(); - } - - OpenTransactionLC(); - TRAPD( err, DeleteRelatedRecordsL( count ) ); - if ( err ) - { - RollbackTransaction(); - User::Leave( err ); - } - CommitTransactionL(KErrNone); - - delete this; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::DeleteRelatedRecordsL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::DeleteRelatedRecordsL( TInt aCount ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::DeleteRelatedRecordsL" ); - - CleanUpEmbeddedL( Id() ); - - TCmDefConnValue deletedItem; - deletedItem.iType = ECmDefConnDestination; - deletedItem.iId = Id(); - iCmMgr.HandleDefConnDeletedL( deletedItem ); - CMDBRecordBase* dnIapRecord; - TInt i; - - // Here we don't use KCmInitIndex becouse initial entry should be deleted - // too! - for ( i = 0; i < aCount; i++ ) - { - CPluginItem* item = (*(iData->iConnMethodArray))[i]; - - // Delete the plugin - if ( i >= KCmInitIndex ) - { - if ( !item->iPlugin->Plugin()->IdIsValid() ) - { - // Delete incomplete plugin - delete item->iPlugin; - item->iPlugin = NULL; - } - else - { - TRAPD( err, item->iPlugin->DeleteL( EFalse ) ); - - if( err != KErrLocked && - err != KErrNotReady ) - { - User::LeaveIfError( err ); - } - - delete item->iPlugin; - item->iPlugin = NULL; - } - } - - // Delete the DN-IAP record - dnIapRecord = item->iDNRecord; - - if ( dnIapRecord->RecordId() ) - // If we have record Id, this record is already in CommsDat - { - dnIapRecord->DeleteL( Session() ); - } - delete item->iDNRecord; - item->iDNRecord = NULL; - } - - iData->iDestAPRecord->DeleteL( Session() ); // deletes a record - iData->iNetworkRecord->DeleteL( Session() ); // deletes a record - - // Delete SNAPMetadata table - CMDBRecordSet* ptrRecordSet = - new (ELeave) CMDBRecordSet( - iCmMgr.IconTableId() ); - CleanupStack::PushL( ptrRecordSet ); - - // Prime record - CCDSNAPMetadataRecord* record = - new (ELeave) CCDSNAPMetadataRecord( iCmMgr.IconTableId() ); - CleanupStack::PushL( record ); - record->iSNAP = Id(); - ptrRecordSet->iRecords.AppendL( record ); - - CleanupStack::Pop( record ); - record = NULL; - - if ( ptrRecordSet->FindL( Session() ) ) - { - (*ptrRecordSet)[0]->DeleteL( Session() ); - } - - ptrRecordSet->iRecords.ResetAndDestroy(); - CleanupStack::PopAndDestroy( ptrRecordSet ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CheckIfEmbeddedL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::CheckIfEmbeddedL( TInt aId ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::CheckIfEmbeddedL" ); - - CMDBRecordSet* ptrRecordSet = - new (ELeave) CMDBRecordSet( - iCmMgr.DestinationTableId() ); - CleanupStack::PushL( ptrRecordSet ); - - // Prime record - CCDSnapRecord* record = iCmMgr.SNAPRecordL( 0 ); - CleanupStack::PushL( record ); - record->iEmbeddedSNAP = aId; - ptrRecordSet->iRecords.AppendL( record ); - - CleanupStack::Pop( record ); - record = NULL; - - OpenTransactionLC(); - if( ptrRecordSet->FindL( Session() ) ) - // Match found - it's embedded - { - User::Leave( KErrNotSupported ); - } - RollbackTransaction(); - - ptrRecordSet->iRecords.ResetAndDestroy(); - - CleanupStack::PopAndDestroy( ptrRecordSet ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::HasEmbeddedL -// ----------------------------------------------------------------------------- -// -TBool CCmDestinationImpl::HasEmbeddedL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::HasEmbeddedL" ); - - return ( EmbeddedL() != NULL )? ETrue : EFalse; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::EmbeddedL -// ----------------------------------------------------------------------------- -// -CCmDestinationImpl* CCmDestinationImpl::EmbeddedL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::EmbeddedL" ); - - CCmDestinationImpl* retVal = NULL; - // Check if the destination contains embedded destinations - for ( TInt i = KCmInitIndex; i < iData->iConnMethodArray->Count(); i++ ) - { - LoadPluginL( *(*(iData->iConnMethodArray))[i] ); - // It's an embedded destination ( this is also true for VPN CMs ) - retVal = (*(iData->iConnMethodArray))[i]->iPlugin->Destination(); - if ( retVal ) - { - // as there can be only one - // embedded destination, the first one is enough - break; - } - } - - return retVal; - } - - // ----------------------------------------------------------------------------- -// CCmDestinationImpl::CanUseToConnectL -// ----------------------------------------------------------------------------- -// -TBool CCmDestinationImpl::CanUseToConnectL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::CanUseToConnectL" ); - - const TInt KZeroItem = 0; - const TInt KOneItem = 1; - TInt cmCount = ConnectionMethodCount(); //without KCmInitIndex !!! - switch ( cmCount ) - { - case KZeroItem:// no items at all - { - return EFalse; - } - case KOneItem:// One item, a possible empty embedded destination! - { - CCmDestinationImpl* embeddedDest = EmbeddedL(); - if ( embeddedDest ) - { - // If embeddedDest->ConnectionMethodCount() is not zero, - // we have something in the embedded destination - // which cannot be another embedded destination, - // since multiple embedding is not allowed. - return embeddedDest->ConnectionMethodCount(); - } - else - { - return ETrue; //not an embedded destination - } - } - default: // more than one item, only one can be an empty embedded - // destination, so we surely contain a valid cm - { - return ETrue; - } - - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::UpdateNetworkRecordL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::UpdateNetworkRecordL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::UpdateNetworkRecordL" ); - - if ( !iData->iNetworkRecord->RecordId() || iData->iNewWithId ) - { - CLOG_WRITE( "New Destination, create it!" ); - //Create a network record, set the host name and add it to the database - - if ( !iData->iNewWithId ) - { - iData->iNetworkRecord->SetRecordId(KCDNewRecordRequest); - } - - SetAttribute( iData->iNetworkRecord, - ECDProtectedWrite, - ProtectionLevel() == EProtLevel1 ); - - iData->iNetworkRecord->StoreL( Session() ); //adds a new record - iData->iNewWithId = EFalse; - } - else - { - SetAttribute( iData->iNetworkRecord, - ECDProtectedWrite, - ProtectionLevel() == EProtLevel1 ); - - iData->iNetworkRecord->ModifyL( Session() ); - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::UpdateDestAPRecordL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::UpdateDestAPRecordL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::UpdateDestAPRecordL" ); - - if ( !iData->iDestAPRecord->RecordId() ) - { - CLOG_WRITE( "New Destination, create AP for it!" ); - //Create an AP record, set the selection policy(network id) - //and add it to the database - iData->iDestAPRecord->SetRecordId(KCDNewRecordRequest); - iData->iDestAPRecord->iRecordTag = CreateDestinationAPTagIdL(); - iData->iDestAPRecord->iCustomSelectionPolicy = iData->iNetworkRecord->RecordId(); - iData->iDestAPRecord->iRecordName.SetL(iData->iNetworkRecord->iRecordName); - iData->iDestAPRecord->StoreL( Session() ); //adds a new record - } - else - { - iData->iDestAPRecord->iCustomSelectionPolicy = iData->iNetworkRecord->RecordId(); - iData->iDestAPRecord->iRecordName.SetL(iData->iNetworkRecord->iRecordName); - iData->iDestAPRecord->ModifyL( Session() ); //modifies the existing - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CreateDestinationAPTagId() -// ----------------------------------------------------------------------------- -// -TUint32 CCmDestinationImpl::CreateDestinationAPTagIdL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::CreateDestinationAPTagId" ); - - return KCmDefaultDestinationAPTagId + iData->iNetworkRecord->RecordId(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::GetDestinationAPTagId() -// ----------------------------------------------------------------------------- -// -TUint32 CCmDestinationImpl::GetDestinationAPTagId( ) - { - return iData->iNetworkRecord->RecordId() + KCmDefaultDestinationAPTagId; - } - - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::UpdateProtectionL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::UpdateProtectionL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::UpdateProtectionL" ); - - if( !iData->iProtectionChanged ) - // protection level not changed -> nothing to update here - { - return; - } - - for ( TInt i = KCmInitIndex; i < iData->iConnMethodArray->Count(); i++ ) - { - CPluginItem* item = (*(iData->iConnMethodArray))[i]; - - LoadPluginL( *item ); - - switch ( ProtectionLevel() ) - { - case EProtLevel0: - case EProtLevel2: - { - // from the protection level 0 to 2 and vice versa - // the ECmProtected value of the CM is not changed - if( iData->iLastProtectionLevel == EProtLevel1 || - iData->iLastProtectionLevel == EProtLevel3 ) - { - item->iPlugin->SetBoolAttributeL( ECmProtected, EFalse ); - } - } - break; - case EProtLevel1: - case EProtLevel3: - { - item->iPlugin->SetBoolAttributeL( ECmProtected, ETrue ); - } - break; - default: - { - // - } - break; - } - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::UpdateConnectionMethodsL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::UpdateConnectionMethodsL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::UpdateConnectionMethodsL" ); - - for( TInt i = KCmInitIndex; i < iData->iConnMethodArray->Count(); ++i ) - { - CPluginItem* item = (*(iData->iConnMethodArray))[i]; - - // If the plugin is not loaded, it means that this a old one, or nothing - // modified in it -> there's no need to update it. - if( item->iPlugin ) - { - item->iPlugin->UpdateL(); - } - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::SetAttribute() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::SetAttribute( CMDBRecordBase* aRecord, - TUint32 aAttribute, TBool aSet ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::SetAttribute" ); - - if ( aSet && !aRecord->IsSetAttribute( aAttribute ) ) - { - aRecord->SetAttributes( aAttribute ); - } - else if( !aSet && aRecord->IsSetAttribute( aAttribute ) ) - { - aRecord->ClearAttributes( aAttribute ); - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::UpdateSNAPTableL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::UpdateSNAPTableL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::UpdateSNAPTableL" ); - - TInt i; - CCDSnapRecord* dnIapRecord; - - // Now we have only records of which are new or needs to be updated - for ( i = KCmInitIndex; i < iData->iConnMethodArray->Count(); ++i ) - { - TInt pri = (*(iData->iConnMethodArray))[i]->iDNRecord->iPriority; - - if ( pri != i && - pri != KDataMobilitySelectionPolicyPriorityWildCard ) - // wildcard priority CM have to be the last one in the array. - // In theory they cannot be re-prioritized. - { - (*(iData->iConnMethodArray))[i]->iDNRecord->iPriority = i; - } - } - - // Here we don't use KCmInitIndex becouse initial entry should be updated - // too! - for ( i = 0; i < iData->iConnMethodArray->Count(); ++i ) - { - dnIapRecord = (*(iData->iConnMethodArray))[i]->iDNRecord; - - if( dnIapRecord->iIAP ) - { - if( !RECORD_FROM_ELEMENT_ID( dnIapRecord->iIAP ) ) - { - dnIapRecord->iIAP = (*(iData->iConnMethodArray))[i]->iPlugin->IAPRecordElementId(); - } - } - - // Set protection on connection methods - SetAttribute( dnIapRecord, - ECDProtectedWrite, - ProtectionLevel() == EProtLevel1 ? ETrue : EFalse ); - // Metadata is used instead of ECDHidden Attribute - //SetAttribute( dnIapRecord, ECDHidden, iData->iNetworkRecord->Attributes() & ECDHidden ); - CheckIfNameModifiedL( dnIapRecord ); - - if ( dnIapRecord->RecordId() ) - { - dnIapRecord->ModifyL( Session() ); - } - else - // this is a new record - { - dnIapRecord->SetRecordId(KCDNewRecordRequest); - dnIapRecord->iSNAP = Id(); - dnIapRecord->StoreL( Session() ); - } - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::UpdateSNAPMetadataTableL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::UpdateSNAPMetadataTableL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::UpdateSNAPMetadataTableL" ); - - if( !iData->iMetaDataRec->RecordId() ) - // new record - { - iData->iMetaDataRec->iSNAP = Id(); - iData->iMetaDataRec->SetRecordId( KCDNewRecordRequest ); - iData->iMetaDataRec->StoreL( Session() ); - } - else - { - iData->iMetaDataRec->ModifyL( Session() ); - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::LoadSNAPMetadataTableL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::LoadSNAPMetadataTableL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::LoadSNAPMetadataTableL" ); - - iData->iMetaDataRec = new (ELeave) CCDSNAPMetadataRecord( - iCmMgr.IconTableId() ); - - iData->iMetaDataRec->iSNAP = Id(); - - if ( !iData->iMetaDataRec->FindL( Session() ) ) - // Not found -> fill in with default values - { - iData->iMetaDataRec->iSNAP = Id(); - iData->iMetaDataRec->iIcon = 0; - iData->iMetaDataRec->iMetadata = 0; - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::LoadNetworkRecordL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::LoadNetworkRecordL( TUint32 /*aDestinationId*/ ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::LoadNetworkRecordL" ); - - // set the record ID - iData->iNetworkRecord->SetRecordId( iData->iDestAPRecord->iCustomSelectionPolicy ); - - // load the record ID - iData->iNetworkRecord->LoadL( Session() ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::LoadDestAPRecordL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::LoadDestAPRecordL( TUint32 aDestinationId ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::LoadDestAPRecordL" ); - - if ( aDestinationId > KCmDefaultDestinationAPTagId ) - { - // set the record ID - iData->iDestAPRecord->iRecordTag = aDestinationId; - // load the record ID - if ( iData->iDestAPRecord->FindL( Session() ) ) - { - iData->iDestAPRecord->LoadL( Session() ); - } - else - { - User::Leave( KErrNotFound ); - } - } - else - { - User::Leave( KErrArgument ); - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::LoadConnectionMethodsL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::LoadConnectionMethodsL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::LoadConnectionMethodsL" ); - - CMDBRecordSet* ptrRecordSet = - new (ELeave) CMDBRecordSet( - iCmMgr.DestinationTableId() ); - CleanupStack::PushL( ptrRecordSet ); - - // Prime record - CCDSnapRecord* snapRec = iCmMgr.SNAPRecordL( 0 ); - CleanupStack::PushL( snapRec ); - snapRec->iSNAP = Id(); - ptrRecordSet->iRecords.AppendL( snapRec ); - - CleanupStack::Pop( snapRec ); - snapRec = NULL; - - OpenTransactionLC(); - if ( !ptrRecordSet->FindL(Session()) ) - // no conn method is to this destination -> it was not us who made it - { - CLOG_WRITE( "Empty destination" ); - User::Leave( KErrUnderflow ); - } - - TLinearOrder orderbyId( - CCmDestinationImpl::SortRecordsByPriority ); - ptrRecordSet->iRecords.Sort(orderbyId); - - TInt count = ptrRecordSet->iRecords.Count(); - - //Load IAP records to be used to check if the IAPs are existing - CMDBRecordSet* ptrIapSet = - new (ELeave) CMDBRecordSet( KCDTIdIAPRecord ); - CleanupStack::PushL( ptrIapSet ); - - TRAPD( err, ptrIapSet->LoadL( Session() ) ); - - if( !err ) - { - CLOG_WRITE_1_PTR( NULL, "Record num [%d]", ptrIapSet->iRecords.Count() ); - - // Here we don't use CM_INIT_INDEX because initial entry should be - // loaded too! - for ( TInt i = 0; i < count; i++ ) - { - snapRec = (*ptrRecordSet)[i]; - TBool exist( EFalse ); - - // Check if CM really exists, if not - // it should be cleared from selection policy table - TInt32 embedded = QUERY_INT_FIELD( - snapRec, - KCDTIdDataMobilitySelectionPolicyEmbeddedSNAP ); - TInt32 iap = RECORD_FROM_ELEMENT_ID( - QUERY_INT_FIELD( - snapRec, - KCDTIdDataMobilitySelectionPolicyIAP ) ); - // Item could be embedded destination or iap - if ( embedded ) - { - CCDAccessPointRecord * destAPRecord = static_cast( - CCDRecordBase::RecordFactoryL( KCDTIdAccessPointRecord ) ); - CleanupStack::PushL( destAPRecord ); - destAPRecord->iRecordTag = embedded; - if ( !destAPRecord->FindL( Session() ) ) - { - CleanUpSnapMetadataTableL( embedded ); - (*ptrRecordSet)[i]->DeleteL( Session() ); - } - else - { - exist = ETrue; - } - - CleanupStack::PopAndDestroy( destAPRecord ); - } - else if ( iap ) - // This is an AP - { - for ( TInt iapInd = 0; iapInd < ptrIapSet->iRecords.Count(); ++iapInd ) - { - CMDBRecordBase* iapRec = (*ptrIapSet)[iapInd]; - - if ( iap == iapRec->RecordId() ) - { - exist = ETrue; - delete iapRec; - // this way we can filter out duplicated CMs - ptrIapSet->iRecords.Remove( iapInd ); - break; - } - } - if ( !exist ) - { - DeleteIAPRecordsL( snapRec ); - } - } - - // The first record is a dummy one where iap and snap are zero - if ( exist || ( !embedded && !iap ) ) - { - // The item may have to be loaded at this stage so that the supported can be checked - // before it is put into iData->iConnMethodArray for the item may be unsupported. - TInt err( 0 ); - - if ( i != 0 ) - { - if ( embedded ) - { - TRAP( err, TUint32 bearerType = iCmMgr.BearerTypeFromCmIdL( embedded ) ); - } - else if ( iap ) - { - TRAP( err, TUint32 bearerType = iCmMgr.BearerTypeFromCmIdL( iap ) ); - } - } - - if ( !err ) - { - CPluginItem* item = new (ELeave) CPluginItem; - CleanupStack::PushL( item ); - - item->iDNRecord = iCmMgr.SNAPRecordL( snapRec->RecordId() ); - item->iPlugin = NULL; - - iData->iConnMethodArray->AppendL( item ); - - CleanupStack::Pop( item ); - } - } - } - } - else - // There's no connection method in the phone - { - CPluginItem* item = new (ELeave) CPluginItem; - - CleanupStack::PushL( item ); - - item->iDNRecord = iCmMgr.SNAPRecordL( (*ptrRecordSet)[0]->RecordId() ); - - iData->iConnMethodArray->AppendL( item ); - - CleanupStack::Pop( item ); - } - - CleanupStack::PopAndDestroy( ptrIapSet ); - RollbackTransaction(); - - ptrRecordSet->iRecords.ResetAndDestroy(); - CleanupStack::PopAndDestroy( ptrRecordSet ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ReLoadConnectionMethodsL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::ReLoadConnectionMethodsL() - { - TInt count = iData->iConnMethodArray->Count(); - //TInt index = KCmInitIndex; - TInt index = 0; - - while ( index < count ) - { - CPluginItem* item = (*(iData->iConnMethodArray))[index]; - item->iFlags |= CPluginItem::ERemoveCm; - - iData->iDeleteCmArray->AppendL( item ); - iData->iConnMethodArray->Delete( index ); - iData->iConnMethodArray->Compress(); - - count = iData->iConnMethodArray->Count(); - } - - // Empty the array, but do not delete it - iData->ResetAndDestroyArray( iData->iDeleteCmArray, EFalse ); - - LoadConnectionMethodsL(); - } - -// --------------------------------------------------------- -// CCmDestinationImpl::CleanUpEmbeddedL -// --------------------------------------------------------- -// -void CCmDestinationImpl::CleanUpEmbeddedL(TUint32 aDestId) - { - LOGGER_ENTERFN( "CCmDestinationImpl::CleanUpEmbeddedL" ); - - TBool found = EFalse; - CMDBRecordSet* ptrRecordSet = - new (ELeave) CMDBRecordSet( - iCmMgr.DestinationTableId() ); - CleanupStack::PushL( ptrRecordSet ); - // Prime record - CCDSnapRecord* snapRec = iCmMgr.SNAPRecordL( 0 ); - CleanupStack::PushL( snapRec ); - snapRec->iEmbeddedSNAP = aDestId; - ptrRecordSet->iRecords.AppendL( snapRec ); - CleanupStack::Pop( snapRec ); - snapRec = NULL; - - if ( ptrRecordSet->FindL(Session()) ) - { - for ( TInt i = 0; i iRecords.Count(); i++ ) - { - (*ptrRecordSet)[i]->DeleteL( Session() ); - } - found = ETrue; - } - CleanupStack::PopAndDestroy( ptrRecordSet ); - if (found) - { - CleanUpSnapMetadataTableL(aDestId); - } - } -// --------------------------------------------------------- -// CCmDestinationImpl::CleanUpSnapMetadataTableL -// --------------------------------------------------------- -// -void CCmDestinationImpl::CleanUpSnapMetadataTableL( TUint32 aSnap ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::CleanUpSnapMetadataTableL" ); - - // Just to test how many record we have - CMDBRecordSet* ptrRecordSet - = new (ELeave) CMDBRecordSet( - iCmMgr.IconTableId() ); - CleanupStack::PushL( ptrRecordSet ); - - // Prime record - CCDSNAPMetadataRecord* record = - new (ELeave) CCDSNAPMetadataRecord( iCmMgr.IconTableId() ); - CleanupStack::PushL( record ); - - record->iSNAP = aSnap; - ptrRecordSet->iRecords.AppendL( record ); - - CleanupStack::Pop( record ); - record = NULL; - - if ( ptrRecordSet->FindL( Session() ) ) - { - for ( TInt i = 0; i iRecords.Count(); i++ ) - { - (*ptrRecordSet)[i]->DeleteL( Session() ); - } - } - - CleanupStack::PopAndDestroy( ptrRecordSet ); //ptrRecordSet - } - -// --------------------------------------------------------- -// CCmDestinationImpl::CleanUpSeamlessnessTableL -// --------------------------------------------------------- -// -void CCmDestinationImpl::CleanUpSeamlessnessTableL( TUint32 aIapId ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::CleanUpSeamlessnesstableL" ); - - // Just to test how many record we have - CMDBRecordSet* ptrRecordSet - = new (ELeave) CMDBRecordSet( - iCmMgr.SeamlessnessTableId() ); - CleanupStack::PushL( ptrRecordSet ); - - // Prime record - CCDIAPMetadataRecord* record = - new (ELeave) CCDIAPMetadataRecord( iCmMgr.SeamlessnessTableId() ); - CleanupStack::PushL( record ); - - TMDBElementId elementid = iCmMgr.SeamlessnessTableId() & - KCDTIdIAPMetadataIAP & - aIapId; - record->iSeamlessness = elementid; - ptrRecordSet->iRecords.AppendL( record ); - - CleanupStack::Pop( record ); - record = NULL; - - if ( ptrRecordSet->FindL( Session() ) ) - { - for ( TInt i = 0; i iRecords.Count(); i++ ) - { - (*ptrRecordSet)[i]->DeleteL( Session() ); - } - } - - CleanupStack::PopAndDestroy( ptrRecordSet ); - } - -// --------------------------------------------------------- -// CCmDestinationImpl::SortRecordsByPriority -// --------------------------------------------------------- -// -TInt CCmDestinationImpl::SortRecordsByPriority( const CMDBRecordBase& aLeft, - const CMDBRecordBase& aRight ) - { - TUint left = QUERY_INT_FIELD( const_cast(&aLeft), - KCDTIdDataMobilitySelectionPolicyPriority ); - TUint right = QUERY_INT_FIELD( const_cast(&aRight), - KCDTIdDataMobilitySelectionPolicyPriority ); - - /* - * - negative value, if aLeft is less than aRight; - * - 0, if aLeft equals to aRight; - * - positive value, if aLeft is greater than aRight. - */ - if ( left == right ) - { - return 0; - } - - return ( left < right ) ? -1 : 1; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::IconL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CGulIcon* CCmDestinationImpl::IconL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::IconL" ); - - return IconL( iData->iMetaDataRec->iIcon ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::SetIconL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::SetIconL( TUint32 anIndex ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::SetIconL" ) - - if( ProtectionLevel() == EProtLevel1 ) - { - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - iData->iMetaDataRec->iIcon = anIndex; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationData::MetadataL() -// ----------------------------------------------------------------------------- -// -TUint32 CCmDestinationData::MetadataL( TSnapMetadataField aMetaField ) const - { - LOGGER_ENTERFN( "CCmDestinationImpl::MetadataL" ) - - TUint retVal( 0 ); - - switch( aMetaField ) - { - case ESnapMetadataInternet: - { - retVal = TUint32(iMetaDataRec->iMetadata) & - ESnapMetadataInternet; - } - break; - - case ESnapMetadataHighlight: - { - retVal = TUint32(iMetaDataRec->iMetadata) & - ESnapMetadataHighlight; - } - break; - - case ESnapMetadataHiddenAgent: - { - retVal = TUint32(iMetaDataRec->iMetadata) & - ESnapMetadataHiddenAgent; - } - break; - - case ESnapMetadataDestinationIsLocalised: - { - retVal = (TUint32(iMetaDataRec->iMetadata) & - ESnapMetadataDestinationIsLocalised) >> 4; - } - break; - - case ESnapMetadataPurpose: - { - retVal = (TUint32(iMetaDataRec->iMetadata) & - ESnapMetadataPurpose) >> 8; - } - break; - - default: - { - User::Leave( KErrArgument ); - } - } - - return retVal; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::MetadataL() -// ----------------------------------------------------------------------------- -// -TUint32 CCmDestinationImpl::MetadataL( TSnapMetadataField aMetaField ) const - { - LOGGER_ENTERFN( "CCmDestinationImpl::MetadataL" ) - return iData->MetadataL(aMetaField); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::SetMetadataL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::SetMetadataL( TSnapMetadataField aMetaField, - TUint32 aValue ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::SetMetadata" ); - - if( ProtectionLevel() == EProtLevel1 ) - { - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - - switch( aMetaField ) - { - case ESnapMetadataInternet: - { - if( aValue ) - { - CheckIfInternetExistsL(); - - iData->iMetaDataRec->iMetadata = - ESnapMetadataInternet | iData->iMetaDataRec->iMetadata; - - // Set the new way, too!!! - SetMetadataL( ESnapMetadataDestinationIsLocalised, - ELocalisedDestInternet ); - } - else - { - iData->iMetaDataRec->iMetadata = - ~ESnapMetadataInternet & iData->iMetaDataRec->iMetadata; - // Clear the new way, too!!! - SetMetadataL( ESnapMetadataDestinationIsLocalised, - ENotLocalisedDest ); - } - } - break; - - case ESnapMetadataDestinationIsLocalised: - { - // Check that aValue is within valid range. - if ( aValue > ELocalisedDestIntranet ) - { - User::Leave( KErrArgument ); - } - - TUint32 oldVal = TUint32(iData->iMetaDataRec->iMetadata) & - ESnapMetadataInternet; - if ( aValue != ENotLocalisedDest ) - { - // check if already exists... - CheckIfLocalisedDestExistL( aValue ); - // does not exists, first clear original value - // if old one was Internet, clear that, too: - if ( oldVal ) - { - // copied here to avoid recursivity!!! - // SetMetadataL(ESnapMetadataInternet, 0 ); - iData->iMetaDataRec->iMetadata = - ~ESnapMetadataInternet & iData->iMetaDataRec->iMetadata; - } - // clearing - iData->iMetaDataRec->iMetadata = - ~ESnapMetadataDestinationIsLocalised & - iData->iMetaDataRec->iMetadata; - // set new value - TUint32 mask = aValue << 4; - iData->iMetaDataRec->iMetadata = - mask | - iData->iMetaDataRec->iMetadata; - // for backward compatibility, if it is internet, - // set it the old way, too - if ( aValue == ELocalisedDestInternet ) - { - // copied here to avoid recursivity!!! - iData->iMetaDataRec->iMetadata = - ESnapMetadataInternet | iData->iMetaDataRec->iMetadata; - // SetMetadataL(ESnapMetadataInternet, 1 ); - } - } - else - { - // not localised, set to ENotLocalisedDest = 0 - // for backward compatibility, if it was internet, - // set it the old way, too - if ( oldVal ) - { - SetMetadataL(ESnapMetadataInternet, 0 ); - } - // clear the new way... - iData->iMetaDataRec->iMetadata = - ~ESnapMetadataDestinationIsLocalised & - iData->iMetaDataRec->iMetadata; - } - - break; - } - - case ESnapMetadataPurpose: - { - // Check that aValue is within valid range. - if ( aValue > ESnapPurposeIntranet ) - { - User::Leave( KErrArgument ); - } - - // Check if destination with the given purpose already - // exists - CheckIfPurposeExistL( aValue ); - - // ESnapPurposeInternet and ESnapPurposeMMS need special - // handling - switch( aValue ) - { - case ESnapPurposeUnknown: - { - // This also clears ESnapMetadataInternet - SetMetadataL( ESnapMetadataDestinationIsLocalised, ENotLocalisedDest ); - break; - } - case ESnapPurposeInternet: - { - // This sets ESnapMetadataInternet and - // ELocalisedDestInternet - SetMetadataL( ESnapMetadataInternet, 1 ); - } - break; - case ESnapPurposeOperator: - { - SetMetadataL( ESnapMetadataDestinationIsLocalised, - ELocalisedDestWap ); - } - break; - case ESnapPurposeMMS: - { - SetMetadataL( ESnapMetadataDestinationIsLocalised, - ELocalisedDestMMS ); - iData->iMetaDataRec->iMetadata = - ESnapMetadataHiddenAgent | iData->iMetaDataRec->iMetadata; - } - break; - case ESnapPurposeIntranet: - { - SetMetadataL( ESnapMetadataDestinationIsLocalised, - ELocalisedDestIntranet ); - } - break; - default: - break; - } - - TUint32 value = aValue << 8; - // reset the purpose bit - iData->iMetaDataRec->iMetadata = ~ESnapMetadataPurpose & iData->iMetaDataRec->iMetadata; - // set the purpose bit - iData->iMetaDataRec->iMetadata = value | iData->iMetaDataRec->iMetadata; - } - break; - - case ESnapMetadataHighlight: - { - if( aValue ) - { - iData->iMetaDataRec->iMetadata = - ESnapMetadataHighlight | iData->iMetaDataRec->iMetadata; - } - else - { - iData->iMetaDataRec->iMetadata = - ~ESnapMetadataHighlight & iData->iMetaDataRec->iMetadata; - } - } - break; - - case ESnapMetadataHiddenAgent: - { - TUint32 internet = iData->iMetaDataRec->iMetadata & ESnapMetadataInternet; - TUint32 internetLocal = ( iData->iMetaDataRec->iMetadata & ESnapMetadataDestinationIsLocalised ) >> 4; - TUint32 internetPurpose = ( iData->iMetaDataRec->iMetadata & ESnapMetadataPurpose ) >> 8; - if( aValue ) - { - if ( internet - || ( internetLocal == ELocalisedDestInternet ) - || ( internetPurpose == ESnapPurposeInternet ) ) - { - User::Leave( KErrArgument ); - } - - iData->iMetaDataRec->iMetadata = - ESnapMetadataHiddenAgent | iData->iMetaDataRec->iMetadata; - } - else - { - iData->iMetaDataRec->iMetadata = - ~ESnapMetadataHiddenAgent & iData->iMetaDataRec->iMetadata; - } - } - break; - - default: - { - User::Leave( KErrArgument ); - } - } - } -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CreateEmbeddedDestinationPluginL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::CreateEmbeddedDestinationPluginL( - CPluginItem& aItem, - TInt aDestinationId ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::CreateEmbeddedDestinationPluginL" ); - - aItem.iPlugin = iCmMgr.CreateConnectionMethodL(KUidEmbeddedDestination, this); - CleanupStack::PushL( aItem.iPlugin ); - // Load this destination - aItem.iPlugin->LoadL( aDestinationId ); - CleanupStack::Pop( aItem.iPlugin ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::LoadEmbeddedDestinationPluginL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::LoadEmbeddedDestinationPluginL( - CPluginItem& aItem ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::LoadEmbeddedDestinationPluginL" ); - - CreateEmbeddedDestinationPluginL(aItem, aItem.iDNRecord->ElementId()); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::LoadPluginL() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::LoadPluginL( CPluginItem& aItem ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::LoadPluginL" ); - - if( aItem.iPlugin ) - { - return; - } - - TUint32 cmId; - if ( aItem.iDNRecord->iEmbeddedSNAP ) - // This is an embedded destination - { - cmId = aItem.iDNRecord->iEmbeddedSNAP; - - } - else - // Normal IAP id - { - cmId = RECORD_FROM_ELEMENT_ID( aItem.iDNRecord->iIAP ); - } - - aItem.iPlugin = iCmMgr.DoFindConnMethodL( - cmId, - this ); - - CLOG_ATTACH( aItem.iPlugin, this ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::PluginClosed() -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::PluginClosed( CCmPluginBase* aPlugin ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::PluginClosed" ); - - if (iData->iConnMethodArray) - { - for ( TInt i = 0; i < iData->iConnMethodArray->Count(); ++i ) - { - if ( (*(iData->iConnMethodArray))[i]->iPlugin == aPlugin ) - { - // Must NOT delete it here. Simply forget that - // we had this plugin instance. - (*(iData->iConnMethodArray))[i]->iPlugin = NULL; - - break; - } - } - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationData::IsHiddenL() -// ----------------------------------------------------------------------------- -// -TBool CCmDestinationData::IsHiddenL() - { - TSnapMetadataField hiddenValue = ( TSnapMetadataField )MetadataL( ESnapMetadataHiddenAgent ); - if ( hiddenValue == ESnapMetadataHiddenAgent ) - { - return ETrue; - } - else - { - return EFalse; - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::IsHiddenL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CCmDestinationImpl::IsHidden() - { - TBool hidden( EFalse ); - TRAPD( err, hidden = iData->IsHiddenL() ); - __ASSERT_ALWAYS( err == KErrNone, User::Panic(_L( "CMManager" ), err ) ); - - return hidden; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::SetHiddenL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CCmDestinationImpl::SetHiddenL( TBool aHidden ) - { - if( ProtectionLevel() == EProtLevel1 ) - { - CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ); - } - SetMetadataL( ESnapMetadataHiddenAgent, aHidden ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::DeleteConnectionMethodsL -// -// Can be called only during opened transaction. -// Array is emptied only after transaction commited! -// -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::DeleteConnectionMethodsL() - { - LOGGER_ENTERFN( "DeleteConnectionMethodsL" ); - - TInt i; - - for ( i = 0; i < iData->iDeleteCmArray->Count(); ++i ) - { - CPluginItem* item = (*iData->iDeleteCmArray)[i]; - - LoadPluginL( *item ); - - if( !(item->iFlags & CPluginItem::ERemoveCm) ) - { - item->iPlugin->DeleteL( EFalse ); - } - - item->iDNRecord->DeleteL( Session() ); - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationData::ResetAndDestroyArray -// ----------------------------------------------------------------------------- -// -void CCmDestinationData::ResetAndDestroyArray( CCmArray* &aArray, TBool aDestroy ) - { - if( aArray ) - { - for ( TInt i = 0; i < aArray->Count(); ++i ) - { - CPluginItem* item = (*aArray)[i]; - - delete item->iPlugin; - delete item->iDNRecord; - } - - aArray->ResetAndDestroy(); - - if( aDestroy ) - { - delete aArray; aArray = NULL; - } - } - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::DeleteIAPRecordsL -// ----------------------------------------------------------------------------- -// -void CCmDestinationImpl::DeleteIAPRecordsL( CMDBRecordBase* aSnapRecord ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::DeleteIAPRecordsL" ); - - // First delete the metadata record - CCDIAPMetadataRecord* metaRec = new (ELeave) CCDIAPMetadataRecord( - iCmMgr.SeamlessnessTableId() ); - - CleanupStack::PushL( metaRec ); - - metaRec->iIAP = RECORD_FROM_ELEMENT_ID( - QUERY_INT_FIELD( - aSnapRecord, - KCDTIdDataMobilitySelectionPolicyIAP ) ); - - if( metaRec->FindL( Session() ) ) - { - metaRec->DeleteL( Session() ); - } - - CleanupStack::PopAndDestroy( metaRec ); - - // and now delete the SNAP record - aSnapRecord->DeleteL( Session() ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CheckIfNameModifiedL -// ----------------------------------------------------------------------------- -void CCmDestinationImpl::CheckIfNameModifiedL( CCDSnapRecord* aRecord ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::CheckIfNameModifiedL" ); - - if ( !TPtrC(iData->iDestAPRecord->iRecordName).CompareF( TPtrC(aRecord->iRecordName) ) ) - // names matches - { - return; - } - - aRecord->iRecordName.SetL( TPtrC(iData->iDestAPRecord->iRecordName) ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::IsConnectedL -// ----------------------------------------------------------------------------- -EXPORT_C TBool CCmDestinationImpl::IsConnectedL() const - { - LOGGER_ENTERFN( "CCmDestinationImpl::IsConnectedL" ); - - CCmDestinationImpl* myThis = const_cast( this ); - TBool retVal( EFalse ); - TInt i; - - for( i = KCmInitIndex; i < iData->iConnMethodArray->Count(); ++i ) - { - CPluginItem* item = (*(iData->iConnMethodArray))[i]; - - myThis->LoadPluginL( *item ); - - if( item->iPlugin->GetBoolAttributeL( ECmConnected ) ) - { - retVal = ETrue; - break; - } - } - - return retVal; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CheckIfInternetExistsL -// -// There can be only one SNAP with Internet metadata field set. -// ----------------------------------------------------------------------------- -void CCmDestinationImpl::CheckIfInternetExistsL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::CheckIfInternetExistsL" ); - - OpenTransactionLC(); - - CMDBRecordSet* metaSet = - new ( ELeave ) CMDBRecordSet( - iCmMgr.IconTableId() ); - CleanupStack::PushL( metaSet ); - - TRAP_IGNORE( metaSet->LoadL( Session() ) ); - - for ( TInt i = 0; i < metaSet->iRecords.Count(); ++i ) - { - TInt meta = QUERY_INT_FIELD( metaSet->iRecords[i], - KCDTIdSNAPMetadataMetadata ); - - if( meta & ESnapMetadataInternet ) - { - if( Id() != QUERY_INT_FIELD( metaSet->iRecords[i], - KCDTIdSNAPMetadataSNAP ) ) - { - User::Leave( KErrAlreadyExists ); - } - } - } - - CleanupStack::PopAndDestroy( metaSet ); - - RollbackTransaction(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ConnectionMethodIndex -// ----------------------------------------------------------------------------- -TInt CCmDestinationImpl::ConnectionMethodIndex( TUint32 aCmId ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::ConnectionMethodIndex" ); - - TInt found( KErrNotFound ); - - for ( TInt i = KCmInitIndex; i < iData->iConnMethodArray->Count(); ++i ) - { - CPluginItem* item = (*(iData->iConnMethodArray))[i]; - if ( RECORD_FROM_ELEMENT_ID(item->iDNRecord->iIAP) == aCmId || - (item->iDNRecord->iEmbeddedSNAP == aCmId && aCmId != 0) ) - { - found = i; - break; - } - } - - return found; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::IconIdL -// ----------------------------------------------------------------------------- -CGulIcon* CCmDestinationImpl::IconIdL( CCmManagerImpl& aCmMgr, - TMDBElementId aId ) - { - CGulIcon* retVal = NULL; - CCDSNAPMetadataRecord* metaDataRec = new (ELeave) CCDSNAPMetadataRecord( - aCmMgr.IconTableId() ); - CleanupStack::PushL( metaDataRec ); - metaDataRec->iSNAP = aId; - - if ( metaDataRec->FindL( aCmMgr.Session() ) ) - // Not found -> fill in with default values - { - retVal = IconL( metaDataRec->iIcon ); - } - else - { - User::Leave( KErrNotFound ); - } - - CleanupStack::PopAndDestroy( metaDataRec ); - - return retVal; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ProtectionLevelL -// ----------------------------------------------------------------------------- -TProtectionLevel CCmDestinationImpl::ProtectionLevelL( CCmManagerImpl& aCmMgr, - TMDBElementId aId ) - { - TProtectionLevel retVal( EProtLevel0 ); - CCDSNAPMetadataRecord* metaDataRec = new (ELeave) CCDSNAPMetadataRecord( - aCmMgr.IconTableId() ); - CleanupStack::PushL( metaDataRec ); - metaDataRec->iSNAP = aId; - - if ( metaDataRec->FindL( aCmMgr.Session() ) ) - // Not found -> fill in with default values - { - retVal = ProtectionLevel( metaDataRec ); - } - else - { - User::Leave( KErrNotFound ); - } - - CleanupStack::PopAndDestroy( metaDataRec ); - return retVal; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ProtectionLevel -// ----------------------------------------------------------------------------- -TProtectionLevel CCmDestinationImpl::ProtectionLevel( - CCDSNAPMetadataRecord* aMetaDataRec ) - { - TInt protection = TUint32(aMetaDataRec->iMetadata) & - KSnapMetadataProtecionLevelMask; - return TProtectionLevel(protection >> 28); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::ProtectionLevelL -// ----------------------------------------------------------------------------- -CGulIcon* CCmDestinationImpl::IconL( TInt aIconIndex ) - { - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - - TParse mbmFile; - User::LeaveIfError( mbmFile.Set( KManagerIconFilename, - &KDC_BITMAP_DIR, - NULL ) ); - - TAknsItemID aknItemID; - aknItemID.Set( KDestinationIconConvTable[aIconIndex][0], - KDestinationIconConvTable[aIconIndex][1] ); - - CGulIcon* icon = AknsUtils::CreateGulIconL( - skinInstance, - aknItemID, - mbmFile.FullName(), - KDestinationIconConvTable[aIconIndex][2], - KDestinationIconConvTable[aIconIndex][3] ); - - return icon; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::RemoveFromPool -// ----------------------------------------------------------------------------- -EXPORT_C void CCmDestinationImpl::RemoveFromPool() - { - iCmMgr.RemoveDestFromPool(this); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::IncrementRefCounter -// ----------------------------------------------------------------------------- -void CCmDestinationImpl::IncrementRefCounter() - { - iData->IncrementRefCounter(); - } -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::DecrementRefCounter -// ----------------------------------------------------------------------------- -void CCmDestinationImpl::DecrementRefCounter() - { - iData->DecrementRefCounter(); - } -// ----------------------------------------------------------------------------- -// CCmDestinationData::IncrementRefCounter -// ----------------------------------------------------------------------------- -void CCmDestinationData::IncrementRefCounter() - { - iRefCounter++; - } -// ----------------------------------------------------------------------------- -// CCmDestinationData::DecrementRefCounter -// ----------------------------------------------------------------------------- -void CCmDestinationData::DecrementRefCounter() - { - iRefCounter--; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationData::GetRefCounter -// ----------------------------------------------------------------------------- -TInt CCmDestinationData::GetRefCounter() - { - return iRefCounter; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::GetRefCounter -// ----------------------------------------------------------------------------- -TInt CCmDestinationImpl::GetRefCounter() - { - return iData->iRefCounter; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::GetData -// ----------------------------------------------------------------------------- -CCmDestinationData* CCmDestinationImpl::GetData() - { - return iData; - } -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::SetData -// ----------------------------------------------------------------------------- -void CCmDestinationImpl::SetData(CCmDestinationData* aData) - { - iData = aData; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationData::IdIsValid -// ----------------------------------------------------------------------------- -TBool CCmDestinationData::IdIsValid() - { - return iIdIsValid; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::IdIsValid -// ----------------------------------------------------------------------------- -TBool CCmDestinationImpl::IdIsValid() - { - return iData->iIdIsValid; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::Cmmgr -// ----------------------------------------------------------------------------- -CCmManagerImpl* CCmDestinationData::Cmmgr() - { - return &iCmMgr; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::Cmmgr -// ----------------------------------------------------------------------------- -CCmManagerImpl* CCmDestinationImpl::Cmmgr() - { - return &iCmMgr; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CheckIfLocalisedDestExistL -// -// There can be only one SNAP with a certain localised metadata field set. -// ----------------------------------------------------------------------------- -void CCmDestinationImpl::CheckIfLocalisedDestExistL( TUint32 aValue ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::CheckIfLocalisedDestExistL" ); - - OpenTransactionLC(); - - CMDBRecordSet* metaSet = - new ( ELeave ) CMDBRecordSet( iCmMgr.IconTableId() ); - CleanupStack::PushL( metaSet ); - - TRAP_IGNORE( metaSet->LoadL( Session() ) ); - - for ( TInt i = 0; i < metaSet->iRecords.Count(); ++i ) - { - TInt meta = QUERY_INT_FIELD( metaSet->iRecords[i], - KCDTIdSNAPMetadataMetadata ); - - if ( meta & ESnapMetadataDestinationIsLocalised ) - { - TInt locval = (meta & ESnapMetadataDestinationIsLocalised) >> 4; - if ( aValue == locval ) - { - if( Id() != QUERY_INT_FIELD( metaSet->iRecords[i], KCDTIdSNAPMetadataSNAP ) ) - { - User::Leave( KErrAlreadyExists ); - } - } - if ( aValue == ELocalisedDestInternet ) - { // internet might also be set the 'old way', check it! - if( meta & ESnapMetadataInternet ) - { - if( Id() != QUERY_INT_FIELD( metaSet->iRecords[i], KCDTIdSNAPMetadataSNAP ) ) - { - User::Leave( KErrAlreadyExists ); - } - } - } - } - } - - CleanupStack::PopAndDestroy( metaSet ); - - RollbackTransaction(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CheckIfPurposeExistL -// -// There can be only one SNAP with a certain purpose metadata field set. -// ----------------------------------------------------------------------------- -void CCmDestinationImpl::CheckIfPurposeExistL( TUint32 aValue ) - { - LOGGER_ENTERFN( "CCmDestinationImpl::CheckIfPurposeExistL" ); - - OpenTransactionLC(); - - CMDBRecordSet* metaSet = - new ( ELeave ) CMDBRecordSet( iCmMgr.IconTableId() ); - CleanupStack::PushL( metaSet ); - - TRAP_IGNORE( metaSet->LoadL( Session() ) ); - - for ( TInt i = 0; i < metaSet->iRecords.Count(); ++i ) - { - TInt meta = QUERY_INT_FIELD( metaSet->iRecords[i], - KCDTIdSNAPMetadataMetadata ); - - if ( meta & ESnapMetadataPurpose ) - { - TInt purVal = ( meta & ESnapMetadataPurpose ) >> 8; - if ( aValue == purVal ) - { - if( Id() != QUERY_INT_FIELD( metaSet->iRecords[i], - KCDTIdSNAPMetadataSNAP ) ) - { - User::Leave( KErrAlreadyExists ); - } - } - } - } - - CleanupStack::PopAndDestroy( metaSet ); - - RollbackTransaction(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::InitializeDestAPRecordL -// -// -// ----------------------------------------------------------------------------- -void CCmDestinationImpl::InitializeDestAPRecordL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::InitializeDestAPRecordL" ); - - SetDefaultTierManagerL(); - SetDefaultMCprL(); - SetDefaultCprL(); - SetDefaultSCprL(); - SetDefaultProtocolL(); - iData->iDestAPRecord->iCustomSelectionPolicy = 0; - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::SetDefaultTierManagerL -// -// -// ----------------------------------------------------------------------------- -void CCmDestinationImpl::SetDefaultTierManagerL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::SetDefaultTierManagerL" ); - - CCDTierRecord* tierRec = static_cast - ( CCDRecordBase::RecordFactoryL( KCDTIdTierRecord ) ); - CleanupStack::PushL( tierRec ); - - tierRec->iRecordTag = KDefaultTierManagerTagId; - - if ( tierRec->FindL( Session() ) ) - { - iData->iDestAPRecord->iTier = tierRec->ElementId(); - } - else - { - User::Leave( KErrNotFound ); - } - - CleanupStack::PopAndDestroy(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::SetDefaultMCprL -// -// -// ----------------------------------------------------------------------------- -void CCmDestinationImpl::SetDefaultMCprL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::SetDefaultMCprL" ); - - CCDMCprRecord* mcprRec = static_cast - ( CCDRecordBase::RecordFactoryL( KCDTIdMCprRecord ) ); - CleanupStack::PushL( mcprRec ); - - mcprRec->SetRecordId( 1 ); - - mcprRec->LoadL( Session() ); - - iData->iDestAPRecord->iMCpr = mcprRec->ElementId(); - - CleanupStack::PopAndDestroy(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::SetDefaultCprL -// -// -// ----------------------------------------------------------------------------- -void CCmDestinationImpl::SetDefaultCprL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::SetDefaultCprL" ); - - CCDCprRecord* cprRec = static_cast - ( CCDRecordBase::RecordFactoryL( KCDTIdCprRecord ) ); - CleanupStack::PushL( cprRec ); - - cprRec->SetRecordId( 1 ); - - cprRec->LoadL( Session() ); - iData->iDestAPRecord->iCpr = cprRec->ElementId(); - - CleanupStack::PopAndDestroy(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::SetDefaultSCprL -// -// -// ----------------------------------------------------------------------------- -void CCmDestinationImpl::SetDefaultSCprL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::SetDefaultSCprL" ); - - CCDSCprRecord* scprRec = static_cast - ( CCDRecordBase::RecordFactoryL( KCDTIdSCprRecord ) ); - CleanupStack::PushL( scprRec ); - - scprRec->SetRecordId( 1 ); - - scprRec->LoadL( Session() ); - iData->iDestAPRecord->iSCpr = scprRec->ElementId(); - - CleanupStack::PopAndDestroy(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::SetDefaultProtocolL -// -// -// ----------------------------------------------------------------------------- -void CCmDestinationImpl::SetDefaultProtocolL() - { - LOGGER_ENTERFN( "CCmDestinationImpl::SetDefaultProtocolL" ); - - CCDProtocolRecord* protocolRec = static_cast - ( CCDRecordBase::RecordFactoryL( KCDTIdProtocolRecord ) ); - CleanupStack::PushL( protocolRec ); - - protocolRec->SetRecordId( 1 ); - - protocolRec->LoadL( Session() ); - iData->iDestAPRecord->iProtocol = protocolRec->ElementId(); - - CleanupStack::PopAndDestroy(); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::CheckIfCMExists -// -// -// ----------------------------------------------------------------------------- -TBool CCmDestinationImpl::CheckIfCMExistsL( CCmPluginBase& aConnectionMethod ) - { - TRAPD( err, (void)FindConnectionMethodL( aConnectionMethod ) ); - if ( err ) - { - if ( err == KErrNotFound ) - { - return EFalse; - } - else - { - User::Leave( err ); - } - } - - return ETrue; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmdlg.cpp --- a/cmmanager/cmmgr/Framework/Src/cmdlg.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1974 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmDlg -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "cmdlg.h" -#include "cmmanager.hrh" -#include "cmlistitem.h" -#include "cmlistitemlist.h" -#include -#include -#include "cmdestinationimpl.h" -#include -#include -#include -#include "cmwizard.h" -#include "selectdestinationdlg.h" -#include -#include -#include "ccmdexec.h" -#include "destdlg.h" -#include "cmlogger.h" -#include "cmconnsettingsuiimpl.h" - -using namespace CMManager; -using namespace CommsDat; - -// --------------------------------------------------------------------------- -// CCmDlg::ConstructAndRunLD -// Constructs the dialog and runs it. -// --------------------------------------------------------------------------- -// -TInt CCmDlg::ConstructAndRunLD( TUint32 aHighlight, - TUint32& aSelected ) - { - CleanupStack::PushL( this ); - - iHighlight = aHighlight; - iSelected = &aSelected; - - ConstructL( R_CM_MENUBAR ); - PrepareLC( R_CM_DIALOG ); - CleanupStack::Pop( this ); - - iModel = new( ELeave )CCmListboxModel(); - - iCmDestinationImpl = iCmManager->DestinationL( iDestUid ); - - iInfoPopupNoteController = CAknInfoPopupNoteController::NewL(); - - // Trace changes in CommsDat - iCmManager->WatcherRegisterL( this ); - - return RunLD(); - } - -// --------------------------------------------------------------------------- -// CCmDlg::NewL() -// Two-phase dconstructor, second phase is ConstructAndRunLD -// --------------------------------------------------------------------------- -// -CCmDlg* CCmDlg::NewL(CCmManagerImpl* aCmManager, TUint32 aDestUid, - CDestDlg* aDestDlg) - { - CCmDlg* self = new (ELeave) CCmDlg( aCmManager, aDestUid, aDestDlg ); - return self; - } - -// --------------------------------------------------------------------------- -// CCmDlg::CCmDlg() -// --------------------------------------------------------------------------- -// -CCmDlg::CCmDlg( CCmManagerImpl* aCmManager, TUint32 aDestUid, - CDestDlg* aDestDlg ) - : iModelPassed( EFalse ) - , iCmManager( aCmManager ) - , iDestUid ( aDestUid ) - , iPrioritising ( EFalse ) - , iExitReason( KDialogUserBack ) - , iEscapeArrived( EFalse ) - , iExitduringProcessing( EFalse ) - , iBackduringProcessing( EFalse ) - , iDestDlg( aDestDlg ) - { - } - -// --------------------------------------------------------------------------- -// CCmDlg::~CCmDlg -// Destructor -// --------------------------------------------------------------------------- -// -CCmDlg::~CCmDlg() - { - // iModel is deleted by the ListBox because LB owns the model... - // of course only after we passed ownership... - if ( !iModelPassed ) - { - delete iModel; - } - - delete iNaviDecorator; - - if ( iTitlePane ) - { - // set old text back, if we have it... - if ( iOldTitleText ) - { - TRAP_IGNORE( iTitlePane->SetTextL( *iOldTitleText ) ); - delete iOldTitleText; iOldTitleText = NULL; - } - } - - delete iOldTitleText; - - if(iCmDestinationImpl) - { - delete iCmDestinationImpl; - iCmDestinationImpl = NULL; - } - - if ( iInfoPopupNoteController ) - { - delete iInfoPopupNoteController; - } - - if( iCmWizard ) - { - delete iCmWizard; - } - iItemIndex.Close(); - - delete iCmdExec; - iCmdExec = NULL; - } - -// --------------------------------------------------------------------------- -// CCmDlg::PreLayoutDynInitL(); -// called by framework before dialog is shown -// --------------------------------------------------------------------------- -// -void CCmDlg::PreLayoutDynInitL() - { - iListbox = STATIC_CAST( CCmListbox*, Control( KCmListboxId ) ); - iListbox->CreateScrollBarFrameL( ETrue ); - iListbox->ScrollBarFrame()->SetScrollBarVisibilityL - ( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); - iListbox->SetListBoxObserver( this ); - - iListbox->Model()->SetItemTextArray( iModel ); - iModelPassed = ETrue; - InitTextsL(); - HandleListboxDataChangeL(); - iListbox->HandleItemAdditionL(); - - if ( iHighlight ) - { - iListbox->ScrollToMakeItemVisible( iHighlight ); - iListbox->SetCurrentItemIndexAndDraw( iHighlight ); - } - } - -// -------------------------------------------------------------------------- -// CCmDlg::DynInitMenuPaneL -// -------------------------------------------------------------------------- -// -void CCmDlg::DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - CAknDialog::DynInitMenuPaneL( aResourceId, aMenuPane ); - if ( aResourceId == R_CM_MENU ) - { - if (aResourceId == R_CM_MENU && !iCmManager->IsHelpOn()) - { - aMenuPane->DeleteMenuItem( EAknCmdHelp ); - } - // Menu items - TBool hideEdit ( EFalse ); - TBool hideAdd ( EFalse ); - TBool hideRename ( EFalse ); - TBool hideDelete ( EFalse ); - TBool hideCopy ( EFalse ); - TBool hideMove ( EFalse ); - TBool hidePrioritise( EFalse ); - - // Edit, Rename, Delete and Organise menu items are hidden if: - // 1. CM List is empty - // 2. Embedded Destinations - if ( !( iListbox->Model()->ItemTextArray()->MdcaCount() ) ) - { - hidePrioritise = ETrue; - hideEdit = ETrue; - hideRename = ETrue; - hideDelete = ETrue; - hideCopy = ETrue; - hideMove = ETrue; - } - // Embedded destinations can be deleted but not edited - else if ( ( CurrentCML()->GetBoolAttributeL(ECmDestination) ) ) - { - hideRename = ETrue; - } - // Only one CM in the list OR highlighted CM is a virtual CM - else if ( ( iListbox->Model()->ItemTextArray()->MdcaCount() == 1 ) ) - { - hidePrioritise = ETrue; - } - // virtual CMs pointing to destinations - else if ( CurrentCML()->GetBoolAttributeL( ECmVirtual ) ) - { - if ( CurrentCML()->GetIntAttributeL( ECmNextLayerSNAPId ) ) - { - hidePrioritise = ETrue; - } - } - - // Show or hide menu items - if ( aResourceId == R_CM_MENU ) - { - aMenuPane->SetItemDimmed( ECmManagerUiCmdCmEdit, hideEdit ); - aMenuPane->SetItemDimmed( ECmManagerUiCmdCmAdd, hideAdd ); - aMenuPane->SetItemDimmed( ECmManagerUiCmdCmRename, hideRename ); - aMenuPane->SetItemDimmed( ECmManagerUiCmdCmDelete, hideDelete ); - aMenuPane->SetItemDimmed( ECmManagerUiCmdCmPrioritise, hidePrioritise ); - aMenuPane->SetItemDimmed( ECmManagerUiCmdCmMoveToOtherDestination, hideMove ); - aMenuPane->SetItemDimmed( ECmManagerUiCmdCmCopyToOtherDestination, hideCopy ); - } - } - } - -// --------------------------------------------------------------------------- -// CCmDlg::InitTextsL -// called before the dialog is shown -// to initialize localized textual data -// --------------------------------------------------------------------------- -// -void CCmDlg::InitTextsL() - { - // set pane text if neccessary... - // pane text needed if not pop-up... - HBufC* primary = - iEikonEnv->AllocReadResourceLC( R_CMMANAGERUI_EMPTY_METHOD_VIEW_PRIMARY ); - HBufC* secondary = - iEikonEnv->AllocReadResourceLC( R_CMMANAGERUI_EMPTY_METHOD_VIEW_SECONDARY ); - CDesCArrayFlat* items = new (ELeave) CDesCArrayFlat(2); - CleanupStack::PushL(items); - items->AppendL(primary->Des()); - items->AppendL(secondary->Des()); - HBufC* emptyText = - StringLoader::LoadLC( R_TWO_STRING_FOR_EMPTY_VIEW , *items); - iListbox->View()->SetListEmptyTextL( *emptyText ); - CleanupStack::PopAndDestroy( emptyText ); - CleanupStack::PopAndDestroy( items ); - CleanupStack::PopAndDestroy( secondary ); - CleanupStack::PopAndDestroy( primary ); - - iStatusPane = iEikonEnv->AppUiFactory()->StatusPane(); - iTitlePane = ( CAknTitlePane* )iStatusPane->ControlL( - TUid::Uid( EEikStatusPaneUidTitle ) ); - - iOldTitleText = iTitlePane->Text()->AllocL(); - HBufC* name = iCmDestinationImpl->NameLC(); - iTitlePane->SetTextL( *name ); - CleanupStack::PopAndDestroy( name ); - - iNaviPane = ( CAknNavigationControlContainer* ) - iStatusPane->ControlL( - TUid::Uid( EEikStatusPaneUidNavi ) ); - iNaviDecorator = iNaviPane->CreateNavigationLabelL( KNullDesC ); - iNaviPane->PushL( *iNaviDecorator ); - } - -// --------------------------------------------------------------------------- -// CCmDlg::SetNoOfCMsL -// --------------------------------------------------------------------------- -// - -void CCmDlg::SetNoOfCMsL(TInt aCount) - { - if ( iNaviDecorator ) - { - if ( iNaviDecorator->ControlType() == - CAknNavigationDecorator::ENaviLabel) - { - CAknNaviLabel* naviLabel = - (CAknNaviLabel*)iNaviDecorator->DecoratedControl(); - if (aCount) - { - HBufC* title = NULL; - - if (aCount == 1) - { - title = StringLoader::LoadLC( - R_CMMANAGERUI_NAVI_ONE_CONN_METHOD ); - } - else - { - title = StringLoader::LoadLC( - R_CMMANAGERUI_NAVI_MANY_CONN_METHODS, - aCount ); - } - - naviLabel->SetTextL(*title); - CleanupStack::PopAndDestroy( title ); - } - else - { - naviLabel->SetTextL(KNullDesC); - } - - iNaviPane->PushL( *iNaviDecorator ); - } - } - - } - -//---------------------------------------------------------- -// CCmDlg::CreateCustomControlL -//---------------------------------------------------------- -// -SEikControlInfo CCmDlg::CreateCustomControlL( TInt aControlType ) - { - SEikControlInfo controlInfo; - controlInfo.iTrailerTextId = 0; - controlInfo.iFlags = 0; - if ( aControlType == KCmListboxType ) - { - controlInfo.iControl = new ( ELeave ) CCmListbox; - } - else - { - controlInfo.iControl = NULL; - } - return controlInfo; - } - -// --------------------------------------------------------------------------- -// CCmDlg::OkToExitL -// Good to know : EAknSoftkeyCancel is never called, because -// EEikDialogFlagNotifyEsc flag is not set in the resource. -// --------------------------------------------------------------------------- -// -TBool CCmDlg::OkToExitL( TInt aButtonId ) - { - LOGGER_ENTERFN( "CCmDlg::OkToExitL" ); - - // Translate the button presses into commands for the appui & current - // view to handle - // Dialog should not exit - TBool retVal( EFalse ); - - switch ( aButtonId ) - { - case EAknSoftkeyOk: - case ECmManagerUiCmdCmEdit: - { - if ( !iProcessing ) - { - if ( CMCount() ) - { - iProcessing = ETrue; - ProcessCommandL( aButtonId ); - iProcessing = EFalse; - } - else - { - iProcessing = ETrue; - AddConnectionMethodL(); - iProcessing = EFalse; - } - } - break; - } - case EAknSoftkeyClear: - { - ProcessCommandL( aButtonId ); - break; - } - case ECmManagerUiCmdCmPrioOk: - { - if ( iPrioritising ) - { - FinishPriorizingL( ETrue ); - } - - break; - } - case ECmManagerUiCmdCmPrioCancel: - { - if ( !MenuShowing() ) - { - if ( iPrioritising ) - { - FinishPriorizingL( EFalse ); - } - } - break; - } - case ECmManagerUiCmdCmUserExit: - { - iCmManager->WatcherUnRegister(); - - iExitReason = KDialogUserExit; - break; - } - case EAknSoftkeyBack: - { - iCmManager->WatcherUnRegister(); - - if ( !iProcessing ) - { - *iSelected = 0; - TryExitL( iExitReason ); - } - else - { - iBackduringProcessing = ETrue; - } - break; - } - default: - { - if ( !iProcessing ) - { - if ( aButtonId == EAknSoftkeyOptions ) - { - DisplayMenuL(); - } - else - { - retVal = ETrue; - } - } - if ( iProcessing ) - { - iExitduringProcessing = ETrue; - if( aButtonId == KDialogUserExit ) - { - retVal = ETrue; - } - } - break; - } - } - return retVal; - } - -// --------------------------------------------------------------------------- -// CCmDlg::HandleListBoxEventL -// --------------------------------------------------------------------------- -// -void CCmDlg::HandleListBoxEventL( CEikListBox* /*aListBox*/, - TListBoxEvent aEventType ) - { - LOGGER_ENTERFN( "CCmDlg::HandleListBoxEventL" ); - - switch ( aEventType ) - { - case EEventEnterKeyPressed: - { - if ( iPrioritising ) - { - FinishPriorizingL( ETrue ); - } - else - { - if ( !iProcessing ) - { - delete iCmdExec; - iCmdExec = NULL; - iCmdExec = new (ELeave) CCmdExec(*this); - iCmdExec->Execute(); - } - } - break; - } - case EEventItemSingleClicked: - { - if ( !iProcessing ) - { - delete iCmdExec; - iCmdExec = NULL; - iCmdExec = new (ELeave) CCmdExec(*this); - iCmdExec->Execute(); - } - break; - } - case EEventEditingStarted: - { - break; - } - case EEventEditingStopped: - { - break; - } - default: - { - break; - }; - }; - } - - -// --------------------------------------------------------------------------- -// CCmDlg::ProcessCommandL -// --------------------------------------------------------------------------- -// -void CCmDlg::ProcessCommandL( TInt aCommandId ) - { - LOGGER_ENTERFN( "CCmDlg::ProcessCommandL" ); - - if ( MenuShowing() ) - { - HideMenu(); - } - - switch ( aCommandId ) - { - // Connection Method Modification Commands - case ECmManagerUiCmdCmAdd: - { - if ( !iProcessing ) - { - iProcessing = ETrue; - TRAPD( err, AddConnectionMethodL() ); - // Memory full - if (err == KLeaveWithoutAlert || err == KErrNoMemory) - { - iProcessing = EFalse; - return; - } - iProcessing = EFalse; - - if ( iBackduringProcessing ) - { - iBackduringProcessing = EFalse; - TryExitL( KDialogUserBack ); - } - } - break; - } - - case ECmManagerUiCmdCmRename: - { - RenameConnectionMethodL(); - break; - } - - case EAknSoftkeyClear: - case ECmManagerUiCmdCmDelete: - { - if ( iPrioritising ) - { - // Delete cannot be done if priorising has started. - break; - } - DeleteCurrentCmL(); - break; - } - - case ECmManagerUiCmdCmPrioritise: - { - PrioritiseConnectionMethodL(); - break; - } - - case ECmManagerUiCmdCmCopyToOtherDestination: - { - CopyConnectionMethodL(); - break; - } - - case ECmManagerUiCmdCmMoveToOtherDestination: - { - MoveConnectionMethodL(); - break; - } - - case EAknSoftkeyOk: - case ECmManagerUiCmdCmEdit: - { - EditConnectionMethodL(); - break; - } - - // Button Selection commands - case EAknSoftkeyOptions: - { - DisplayMenuL(); - break; - } - - case ECmManagerUiCmdCmUserExit: - { - iExitReason = KDialogUserExit; - } - - case EAknSoftkeyBack: - { - if (!iProcessing) - { - *iSelected = 0; - TryExitL( iExitReason ); - } - break; - } - case EAknCmdHelp: - { - HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), - iEikonEnv->EikAppUi()->AppHelpContextL() ); - } - break; - - default: - { - break; - } - } - } - -// --------------------------------------------------------------------------- -// CCmDlg::DeleteCurrentCmL -// --------------------------------------------------------------------------- -// -void CCmDlg::DeleteCurrentCmL( ) - { - LOGGER_ENTERFN( "CCmDlg::DeleteCurrentCmL" ); - - TCmDefConnValue oldConn; - if (iCmManager->IsDefConnSupported()) - { - iCmManager->ReadDefConnL( oldConn ); - } - CCmPluginBase* cm = CurrentCML(); - if ( !cm ) - { - return; - } - - if ( cm->GetBoolAttributeL( ECmProtected ) ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - - return; - } - - if ( cm->GetBoolAttributeL( ECmIsLinked ) )//same check as KErrLocked below - { - TCmCommonUi::ShowNoteL( - R_QTN_NETW_CONSET_INFO_CANNOT_DELETE_VIRTUAL_REF, - TCmCommonUi::ECmErrorNote ); - - return; - } - - if ( cm->GetBoolAttributeL( ECmConnected ) )//same check as KErrInUse below - { - TCmCommonUi::ShowNoteL( R_CMMANAGERUI_INFO_CM_IN_USE_CANNOT_DELETE, - TCmCommonUi::ECmErrorNote ); - - return; - } - - // EKOA-74KC3L: check if it is the last CM in a destination being referenced - // by a VPN - if ( iCmDestinationImpl && - iCmDestinationImpl->ConnectionMethodCount() == 1 ) - { - // it is definitely the last, but is it referenced? - - // for each IAP in CM manager - // 1. check if it is virtual - // if not => goto 1. - // if yes: - // 2. check if it links to the destination of this CM - // if yes => carryOn = EFalse, ERROR - // if not: carryOn = ETrue - - CommsDat::CMDBRecordSet* iaps = - iCmManager->AllIapsL(); - - CleanupStack::PushL( iaps ); - - TBool carryOn = ETrue; - TUint32 destId = iCmDestinationImpl->Id(); - - // for each IAP in CM manager - for ( TInt i = 0; carryOn && i < iaps->iRecords.Count(); ++i ) - { - CommsDat::CCDIAPRecord* rec = (*iaps)[i]; - TUint32 bearerType = 0; - - TRAP_IGNORE( bearerType = - iCmManager->BearerTypeFromIapRecordL( rec ) ); - if ( !bearerType ) - { - continue; - } - - // check if it is virtual - if ( iCmManager->GetBearerInfoBoolL( bearerType, ECmVirtual ) ) - { - // check if it links to the current destination - CCmPluginBase* plugin = NULL; - TRAP_IGNORE( plugin = iCmManager->GetConnectionMethodL( - rec->RecordId() ) ); - - if ( !plugin ) - { - continue; - } - - if ( plugin->IsLinkedToSnap( destId ) ) - { - // the CM links to this destination, deletion not allowed - carryOn = EFalse; - } - - delete plugin; - } - - } - - CleanupStack::PopAndDestroy( iaps ); - - if ( !carryOn ) - { - TCmCommonUi::ShowNoteL( R_QTN_NETW_CONSET_INFO_CANNOT_DELETE_VIRTUAL_REF, - TCmCommonUi::ECmErrorNote ); - return; - } - - } - - - // If it's an embedded destination, show a warning - TBool showCmDeleteQuery( ETrue ); - if ( cm->GetBoolAttributeL( ECmDestination ) ) - { - if ( TCmCommonUi::ShowConfirmationQueryL( - R_CMMANAGERUI_QUEST_EMBEDDED_DEST_DELETE ) ) - { - // user wants to delete, set flag to avoid 2nd query message - showCmDeleteQuery = EFalse; - } - else - { - return; // user cancelled delete request - } - } - - HBufC* cmName = cm->GetStringAttributeL( ECmName ); - CleanupStack::PushL( cmName ); - - // Query for CM deletion - which will be skipped in the case of embedded - // destintations - // Protected CM's cannot be deleted either - if ( !showCmDeleteQuery || iAlreadyConfirmedDelete || - TCmCommonUi::ShowConfirmationQueryL( - R_CMMANAGERUI_QUEST_CM_DELETE, - *cmName ) ) - { - TInt err = KErrNone; - if ( iCmDestinationImpl ) - { - TRAP( err, iCmDestinationImpl->DeleteConnectionMethodL( *cm ) ); - } - else - { - TRAP( err, (void)cm->DeleteL( ETrue ) ); - } - - switch ( err ) - { - case KErrInUse: //shouldn't get here, already checked above - { - TCmCommonUi::ShowNoteL - ( R_CMMANAGERUI_INFO_CM_IN_USE_CANNOT_DELETE, - TCmCommonUi::ECmErrorNote ); - } - break; - - case KErrLocked://shouldn't get here, already checked above - { - TCmCommonUi::ShowNoteL - ( R_QTN_NETW_CONSET_INFO_CANNOT_DELETE_VIRTUAL_REF, - TCmCommonUi::ECmErrorNote ); - } - break; - - case KErrNone: - { - if ( iCmDestinationImpl ) - { - iCmDestinationImpl->UpdateL(); - } - if (iCmManager->IsDefConnSupported()) - { - iDestDlg->ShowDefaultConnectionNoteL( oldConn ); - } - HandleListboxDataChangeL(); - } - break; - - default: - { - } - break; - } - } - - CleanupStack::PopAndDestroy( cmName ); - } - -// -------------------------------------------------------------------------- -// CCmDlg::RenameConnectionMethodL -// -------------------------------------------------------------------------- -// -void CCmDlg::RenameConnectionMethodL() - { - LOGGER_ENTERFN( "CCmDlg::RenameConnectionMethodL" ); - - CCmPluginBase* cm = CurrentCML(); - if ( !cm ) - { - return; - } - - if ( cm->GetBoolAttributeL( ECmProtected ) ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - return; - } - - if ( CurrentCmInUseL() ) - { - return; - } - - TBuf buf; - - HBufC* cmName = cm->GetStringAttributeL(ECmName); - CleanupStack::PushL(cmName); - buf.Copy(*cmName); - - // Saves the recent naming method and set it to "Not accept" - TUint32 savedNM = cm->GetIntAttributeL( ECmNamingMethod ); - cm->SetIntAttributeL( ECmNamingMethod, ENamingNotAccept ); - - // Asks the new name - TBool go = ETrue; - TInt ret = TCmCommonUi::ShowConfirmationQueryWithInputL( - R_CMMANAGERUI_PRMPT_CM_MAME, - buf ); - - // While the name is not unique or cancel pressed - while( ret && go ) - { - // Tries to save the nem name. If it is not unique - // then ret == KErrArgument - TRAPD( err, cm->SetStringAttributeL( ECmName, buf ) ); - - if( KErrArgument == err ) - { - // Opens a info note - HBufC* noteLine = StringLoader::LoadLC( - R_CMMANAGERUI_INFO_CM_ALREADY_IN_USE, buf ); - - TCmCommonUi::ShowNoteL( *noteLine, TCmCommonUi::ECmInfoNote ); - - CleanupStack::PopAndDestroy( noteLine ); - - // Asks the new name again - ret = TCmCommonUi::ShowConfirmationQueryWithInputL( - R_CMMANAGERUI_PRMPT_CM_MAME, - buf ); - } - else - { - // New name is unique loop can stop - go = EFalse; - } - } - - // Sets back the original naming method - cm->SetIntAttributeL( ECmNamingMethod, savedNM ); - - // If not cancel pressed the new name is set - if( ret ) - { - cm->UpdateL(); - - HandleListboxDataChangeL(); - } - - CleanupStack::PopAndDestroy( cmName ); - } - -// -------------------------------------------------------------------------- -// CCmDlg::PrioritiseConnectionMethodL -// -------------------------------------------------------------------------- -// -void CCmDlg::PrioritiseConnectionMethodL() - { - LOGGER_ENTERFN( "CCmDlg::PrioritiseConnectionMethodL" ); - - ButtonGroupContainer().SetCommandSetL( R_SOFTKEYS_PRIO_OK_CANCEL__OK ); - iListbox->View()->SelectItemL( iListbox->CurrentItemIndex() ); - iListbox->View()->DrawItem( iListbox->CurrentItemIndex() ); - ButtonGroupContainer().DrawNow(); - iPrioritising = ETrue; - iCmToPrioritise = iListbox->CurrentItemIndex(); - } - -// -------------------------------------------------------------------------- -// CCmDlg::AddConnectionMethodL -// -------------------------------------------------------------------------- -// -void CCmDlg::AddConnectionMethodL() - { - LOGGER_ENTERFN( "CCmDlg::AddConnectionMethodL" ); - - // Check first if parent destination is protected - if ( iCmDestinationImpl && - iCmDestinationImpl->ProtectionLevel() == CMManager::EProtLevel1 ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - return; - } - - // Opens a Connection method creation wizard - iCmWizard = new (ELeave) CCmWizard( *iCmManager ); - - TInt itemstemp = iListbox->Model()->NumberOfItems(); - - TInt ret( KErrNone ); - TRAPD( err, ret = iCmWizard->CreateConnectionMethodL( iCmDestinationImpl ) ); - if ( err ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - ret = KErrCancel; - } - delete iCmWizard; - iCmWizard = NULL; - - - // If application wanted to be closed before then RunAppShutter() - // should be called here - if( iEscapeArrived ) - { - ( ( CAknAppUi* )iEikonEnv->EikAppUi() )->RunAppShutter(); - } - - if( ret != KErrCancel ) - { - iHighlight = ret; - - - // Update the middle soft key if this is the first cm added - if ( CMCount() == 1 ) - { - HBufC* text = StringLoader::LoadLC( R_QTN_MSK_EDIT ); - ButtonGroupContainer().SetCommandL( ECmManagerUiCmdCmEdit, - *text ); - CleanupStack::PopAndDestroy( text ); - } - - //HandleListboxDataChangeL(); - TRAP( err, HandleListboxDataChangeL() ); - if ( err ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - return; - } - iListbox->HandleItemAdditionL(); - - if (itemstemp < iListbox->Model()->NumberOfItems()) - { - //first item cannot be deleted - iListbox->ScrollToMakeItemVisible( - iListbox->Model()->NumberOfItems() -1 ); - iListbox->SetCurrentItemIndexAndDraw( iHighlight ); - } - } - } - -// -------------------------------------------------------------------------- -// CCmDlg::CopyConnectionMethodL -// -------------------------------------------------------------------------- -// -void CCmDlg::CopyConnectionMethodL() - { - LOGGER_ENTERFN( "CCmDlg::CopyConnectionMethodL" ); - - CCmPluginBase* cm = CurrentCML(); - if ( !cm ) - { - return; - } - - if ( cm->GetBoolAttributeL( ECmProtected ) || - ( iCmDestinationImpl && - iCmDestinationImpl->ProtectionLevel() == CMManager::EProtLevel1 ) ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - return; - } - - TUint32 destId( 0 ); - - // build an array of possible parent destinations - TInt destCount=0; - TRAPD( retVal, destCount = iCmManager->DestinationCountL() ); - if( retVal != KErrNone || destCount < 1 ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_NO_DESTINATION, - TCmCommonUi::ECmErrorNote ); - return; - } - - RArray destArray( iCmManager->DestinationCountL() ); - CleanupClosePushL( destArray ); - - iCmManager->AllDestinationsL( destArray ); - - // drop current destination (don't ask why) - if ( iCmDestinationImpl ) - { - destId = iCmDestinationImpl->Id(); - - TInt index = destArray.Find( destId ); - if ( index != KErrNotFound ) - { - destArray.Remove( index ); - } - } - - - // now filter the destinations - CurrentCML()->FilterPossibleParentsL( destArray ); - - // check if there are any remaining destinations - if ( !destArray.Count() ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_NO_VPN_STACKING, - TCmCommonUi::ECmErrorNote ); - CleanupStack::PopAndDestroy( &destArray ); - return; - } - - // ok, there is at least 1, pop up the dialog - CSelectDestinationDlg* dlg = CSelectDestinationDlg::NewL( destId, - *iCmManager, - &destArray ); - - if ( dlg->ExecuteLD( R_CMMANAGER_LIST_QUERY_WITH_MSGBOX ) ) - { - CCmDestinationImpl* dest = iCmManager->DestinationL( destId ); - CleanupStack::PushL( dest ); - if ( iCmDestinationImpl ) - { - // create a copy of the current connection method - CCmPluginBase* cmCopy = cm->CreateCopyL(); - CleanupStack::PushL( cmCopy ); - // store it in commsdat - cmCopy->UpdateL(); - dest->AddConnectionMethodL( *cmCopy ); - - CleanupStack::PopAndDestroy( cmCopy ); - } - else - { - iCmManager->CopyConnectionMethodL( *dest, *( cm ) ); - } - - // Rare but UpdateL can leave that cause crash - TRAPD( err, dest->UpdateL() ); - if( err < 0 ) - { - CLOG_WRITE_1( "CCmDlg::CopyConnectionMethodL UpdateL: %d", err ); - } - - CleanupStack::PopAndDestroy( dest ); - HandleListboxDataChangeL(); - } - else - { - CleanupStack::PopAndDestroy( &destArray ); - User::Leave( KErrCancel ); - } - - CleanupStack::PopAndDestroy( &destArray ); - } - -// -------------------------------------------------------------------------- -// CCmDlg::MoveConnectionMethodL -// -------------------------------------------------------------------------- -// -void CCmDlg::MoveConnectionMethodL() - { - LOGGER_ENTERFN( "CCmDlg::MoveConnectionMethodL" ); - - CCmPluginBase* cm = CurrentCML(); - if ( !cm ) - { - return; - } - - if ( cm->GetBoolAttributeL( ECmProtected ) || - iCmDestinationImpl->ProtectionLevel() == CMManager::EProtLevel1 ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - return; - } - - if ( CurrentCmInUseL() ) - { - return; - } - - // build an array of possible parent destinations - RArray destArray( iCmManager->DestinationCountL() ); - CleanupClosePushL( destArray ); - - iCmManager->AllDestinationsL( destArray ); - - TUint32 destId( 0 ); - - // first remove the current parent (makes no sense moving a CM to its - // original destination) - if ( iCmDestinationImpl ) - { - destId = iCmDestinationImpl->Id(); - - TInt index = destArray.Find( destId ); - if ( index != KErrNotFound ) - { - destArray.Remove( index ); - } - } - - // now filter the destinations - CurrentCML()->FilterPossibleParentsL( destArray ); - - // check if there are any remaining destinations - if ( !destArray.Count() ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_NO_VPN_STACKING, - TCmCommonUi::ECmErrorNote ); - CleanupStack::PopAndDestroy( &destArray ); - return; - } - - - CSelectDestinationDlg* dlg = CSelectDestinationDlg::NewL( destId, - *iCmManager, - &destArray ); - - if ( dlg->ExecuteLD( R_CMMANAGER_LIST_QUERY_WITH_MSGBOX ) ) - { - CCmDestinationImpl* dest = iCmManager->DestinationL( destId ); - CleanupStack::PushL( dest ); - iCmManager->MoveConnectionMethodL( *iCmDestinationImpl, - *dest, - *( CurrentCML() ) ); - CleanupStack::PopAndDestroy( dest ); - iCmDestinationImpl->UpdateL(); - - HandleListboxDataChangeL(); - } - - CleanupStack::PopAndDestroy( &destArray ); - } - -// -------------------------------------------------------------------------- -// CCmDlg::EditConnectionMethodL -// -------------------------------------------------------------------------- -// -void CCmDlg::EditConnectionMethodL() - { - LOGGER_ENTERFN( "CCmDlg::EditConnectionMethodL" ); - - CCmPluginBase* cm = NULL; - - TRAPD( err, cm = CurrentCML() ); - - if( err == KErrNotSupported ) - { - return; - } - else - { - User::LeaveIfError( err ); - } - - // Must reload here in case another app changed the data (CurrentCML loads - // only if not already loaded) - cm->ReLoadL(); - - if ( cm->GetBoolAttributeL( ECmProtected ) || - cm->GetBoolAttributeL( ECmDestination ) ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - } - else if ( cm->GetBoolAttributeL( ECmBearerHasUi ) ) - { - // check if the cm is in use - if ( !CurrentCmInUseL() ) - { - TInt ret = cm->RunSettingsL(); - if ( ret == KDialogUserExit ) - { - TryExitL( KDialogUserExit ); - } - else - { - if ( ret == KDialogUserDeleteConfirmed ) - { - iAlreadyConfirmedDelete = ETrue; - DeleteCurrentCmL(); - iAlreadyConfirmedDelete = EFalse; - } - if ( ret == KDialogUserDelete ) - { - DeleteCurrentCmL(); - } - - // Reorder according to priorities, if needed - ReOrderCMsL(); - - HandleListboxDataChangeL(); - } - } - } - } - -// --------------------------------------------------------------------------- -// CCmDlg::OfferKeyEventL -// --------------------------------------------------------------------------- -// -TKeyResponse CCmDlg::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - LOGGER_ENTERFN( "CCmDlg::OfferKeyEventL" ); - CLOG_WRITE_1("Key iCode: %d", aKeyEvent.iCode ); - - TKeyResponse retVal ( EKeyWasNotConsumed ); - - if ( aKeyEvent.iCode == EKeyBackspace ) - { - // While priorising delete item is disabled - if( !iPrioritising ) - { - ProcessCommandL( ECmManagerUiCmdCmDelete ); - } - retVal = EKeyWasConsumed; - } - else if ( aKeyEvent.iCode == EKeyEscape ) - { - // Handling application close needs special care - // because of iCmWizard - if ( iCmWizard ) - { - // if wizard alives then escape should do after wizard has ended. - CLOG_WRITE( "CCmDlg::OfferKeyEventL: Wizard in long process" ); - iEscapeArrived = ETrue; - retVal = EKeyWasConsumed; - } - else - { - CLOG_WRITE( "CCmDlg::OfferKeyEventL:Escape" ); - retVal = CAknDialog::OfferKeyEventL( aKeyEvent, aType ); - } - } - else - { - retVal = iListbox->OfferKeyEventL(aKeyEvent, aType); - } - - return retVal; - } -// --------------------------------------------------------------------------- -// CCmDlg::HandleInfoPopupNoteEvent -// called before the dialog is shown to initialize listbox data -// --------------------------------------------------------------------------- -// -void CCmDlg::HandleInfoPopupNoteEvent( - CAknInfoPopupNoteController* /*aController*/, - TAknInfoPopupNoteEvent /*aEvent*/ ) - { - } - -// --------------------------------------------------------------------------- -// CCmDlg::CurrentCML -// Currently selected connection method in the list -// --------------------------------------------------------------------------- -// -CCmPluginBase* CCmDlg::CurrentCML() - { - if ( iItemIndex.Count() == 0 ) - { - return NULL; - } - return iCmDestinationImpl->GetConnectionMethodL( - iItemIndex[iListbox->CurrentItemIndex()]); - } - -// --------------------------------------------------------------------------- -// CCmDlg::CMByIndexL -// a connection method in the list -// --------------------------------------------------------------------------- -// -CCmPluginBase* CCmDlg::CMByIndexL( TInt aIndex ) - { - return iCmDestinationImpl->GetConnectionMethodL( aIndex ); - } - -// --------------------------------------------------------------------------- -// CCmDlg::CMCount -// number of cms in the list -// --------------------------------------------------------------------------- -// -TInt CCmDlg::CMCount() - { - return iCmDestinationImpl->ConnectionMethodCount(); - } - -// --------------------------------------------------------------------------- -// CCmDlg::HandleListboxDataChangeL -// called before the dialog is shown to initialize listbox data -// --------------------------------------------------------------------------- -// -void CCmDlg::HandleListboxDataChangeL() - { - TInt selected = 0; - if ( iListbox->CurrentItemIndex() ) - { - selected = iListbox->CurrentItemIndex(); - } - - LOGGER_ENTERFN( "CCmDlg::HandleListboxDataChangeL" ); - iCmManager->OpenTransactionLC(); - - RArray cmIds; - ConstructCMArrayL( cmIds ); - CleanupClosePushL( cmIds ); - - // Remove hidden Connection Methods from the array if uncat folder - if ( !iCmDestinationImpl ) - { - ClearHiddenCMsFromArrayL( cmIds ); - } - - /// Using test values for now. - CArrayPtr< CGulIcon >* icons = new( ELeave ) CAknIconArray( KCMGranularity ); - CleanupStack::PushL( icons ); - iModel->ResetAndDestroy(); - - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - TParse mbmFile; - User::LeaveIfError( mbmFile.Set( KManagerIconFilename, - &KDC_APP_BITMAP_DIR, - NULL ) ); - - - icons->AppendL( AknsUtils::CreateGulIconL( - skinInstance, - KAknsIIDQgnIndiSettProtectedAdd, - mbmFile.FullName(), - EMbmCmmanagerQgn_indi_sett_protected_add, - EMbmCmmanagerQgn_indi_sett_protected_add_mask ) ); - - //0..1 are reserved indexes! - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - AknsUtils::CreateColorIconLC( skinInstance, - KAknsIIDQgnIndiDefaultConnAdd, - KAknsIIDQsnIconColors, - EAknsCIQsnIconColorsCG13, - bitmap, - mask, - mbmFile.FullName(), - EMbmCmmanagerQgn_indi_default_conn_add, - EMbmCmmanagerQgn_indi_default_conn_add_mask, - AKN_LAF_COLOR( 215 ) ); - - CGulIcon* icon = CGulIcon::NewL( bitmap, mask ); // Ownership transferred - CleanupStack::Pop( 2 ); // bitmap, mask - - CleanupStack::PushL( icon ); - icons->AppendL( icon ); - CleanupStack::Pop( icon ); - - RArray bearerIdArray = RArray( KCmArrayBigGranularity ); - CleanupClosePushL( bearerIdArray ); - - TCmDefConnValue sel; - TInt defUid = KErrNotFound; - if ( iCmManager->IsDefConnSupported() ) - { - iCmManager->ReadDefConnL(sel); - if ( sel.iType == EDCConnectionMethod ) - { - defUid = sel.iId; - } - } - iItemIndex.Reset(); - for ( TInt i = 0; i < cmIds.Count(); i++ ) - { - TInt iconId = KErrNotFound; - CCDAccessPointRecord* destAPRecord = NULL; - CCDIAPRecord* iapRecord = NULL; - HBufC* name = NULL; - TBool isDest( cmIds[i] > KCmDefaultDestinationAPTagId ); - TUint recId( 0 ); - TBool protect; - TUint32 bearerType( 0 ); - - if( isDest ) - { - destAPRecord = static_cast( - CCDRecordBase::RecordFactoryL( KCDTIdAccessPointRecord ) ); - CleanupStack::PushL( destAPRecord ); - destAPRecord->iRecordTag = cmIds[i]; - if ( !destAPRecord->FindL( iCmManager->Session() ) ) - { - User::Leave( KErrNotFound ); - } - - name = TPtrC( destAPRecord->iRecordName ).AllocLC(); - - TProtectionLevel protLev = CCmDestinationImpl::ProtectionLevelL( *iCmManager, cmIds[i] ); - - protect = (protLev == EProtLevel1) || (protLev == EProtLevel2); - - HBufC* destName = StringLoader::LoadL( R_QTN_NETW_CONSET_EMBEDDED_DEST, - *name ); - - CleanupStack::PopAndDestroy( name ); - name = destName; - CleanupStack::PushL( name ); - - bearerType = KUidEmbeddedDestination; - } - else - { - recId = cmIds[i]; - iapRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord)); - CleanupStack::PushL( iapRecord ); - - iapRecord->SetRecordId( recId ); - iapRecord->LoadL( iCmManager->Session() ); - - TRAPD( err, bearerType = iCmManager->BearerTypeFromIapRecordL( iapRecord ) ); - - if( err == KErrNotSupported ) - // This is unsupported connection method -> don't add it to the list - { - CleanupStack::PopAndDestroy( iapRecord ); - continue; - } - else - { - User::LeaveIfError( err ); - } - name = TPtrC( iapRecord->iRecordName ).AllocLC(); - protect = iapRecord->Attributes() & ECDProtectedWrite; - - if ( bearerIdArray.Count() ) - { - for ( TInt j = 0; jGetBearerInfoIntL( bearerType, - ECmBearerIcon ); - } - - if (iconInt) - { - if ( isDest ) - { - // append zero - assuming that bearer type values differ from zero - bearerIdArray.Append( 0 ); - } - else - { - bearerIdArray.Append( bearerType ); - } - - icons->AppendL( (CGulIcon*)iconInt ); - iconId = bearerIdArray.Count()-1+KCmReservedIconIndexCount; - } - else - { - iconId = KCmReservedIconIndexCount; - } - } - TBool def = EFalse; - if ( defUid == recId ) - { - def = ETrue; - } - - TInt nextLayerSnapId = 0; - if( !isDest ) - { - // Check if it is VPN over destination - // If yes the list item should have single line - CCmPluginBase* plugin = iCmManager->GetConnectionMethodL( cmIds[i] ); - CleanupStack::PushL( plugin ); - - if( plugin->GetBoolAttributeL( ECmVirtual ) ) - { - nextLayerSnapId = plugin->GetIntAttributeL( ECmNextLayerSNAPId ); - } - - CleanupStack::PopAndDestroy( plugin ); - } - - CCmListItem* item = - CCmListItem::NewLC( - recId, - name, - i, - iconId, - protect, - (nextLayerSnapId ? ETrue : EFalse), - // reasons for single line - ( isDest || !iCmDestinationImpl), - def ); - CleanupStack::Pop( item ); - CleanupStack::Pop( name ); - CleanupStack::PopAndDestroy(); // iapRecord or nwRecord - CleanupStack::PushL( item ); - iModel->AppendL( item ); - CleanupStack::Pop( item ); - iItemIndex.Append(i); - } - - TInt cmCount = iItemIndex.Count(); - SetNoOfCMsL( cmCount ); - - if ( !cmCount && iCmDestinationImpl ) - { - HBufC* buf = 0; - // rare case probably only caused by bad configuration - if ( iCmDestinationImpl->ProtectionLevel() == EProtLevel1 ) - { - buf = StringLoader::LoadLC( R_TEXT_SOFTKEY_OPTION ); - } - else - { - buf = StringLoader::LoadLC( R_CMMANAGERUI_MSK_ADD_METHOD ); - } - ButtonGroupContainer().SetCommandL( ECmManagerUiCmdCmEdit, *buf ); - ButtonGroupContainer().DrawDeferred(); - CleanupStack::PopAndDestroy( buf ); - } - - CleanupStack::PopAndDestroy( &bearerIdArray ); - - CArrayPtr* oldIcons = - iListbox->ItemDrawer()->ColumnData()->IconArray(); - if ( oldIcons ) - { - oldIcons->ResetAndDestroy(); - delete oldIcons; - } - - iListbox->ItemDrawer()->ColumnData()->SetIconArray( icons ); - - CleanupStack::Pop( icons ); - CleanupStack::PopAndDestroy( &cmIds ); - - iCmManager->CommitTransactionL( KErrNone ); - - iListbox->DrawNow(); - iListbox->UpdateScrollBarsL(); - - TInt count = iListbox->Model()->NumberOfItems(); - if ( count ) - { - if ( count <= selected ) - { - selected = count - 1; // index, so -- - } - if ( selected >= 0 ) - { - iListbox->ScrollToMakeItemVisible( selected); - iListbox->SetCurrentItemIndexAndDraw( selected ); - } - } - } - - -// -------------------------------------------------------------------------- -// CCmDlg::CurrentCmInUseL -// -------------------------------------------------------------------------- -// -TBool CCmDlg::CurrentCmInUseL() - { - TBool retVal = CurrentCML()->GetBoolAttributeL( ECmConnected ); - if ( retVal ) - { - TCmCommonUi::ShowNoteL( R_QTN_SET_NOTE_AP_IN_USE_EDIT, - TCmCommonUi::ECmErrorNote ); - retVal = ETrue; - } - return retVal; - } - -// -------------------------------------------------------------------------- -// CCmDlg::ConstructCMArrayL -// -------------------------------------------------------------------------- -// -void CCmDlg::ConstructCMArrayL( RArray& aCmIds ) - { - iCmDestinationImpl->ReLoadConnectionMethodsL(); - iCmDestinationImpl->ConnectMethodIdArrayL( aCmIds ); - } - -// -------------------------------------------------------------------------- -// CCmDlg::ClearHiddenCMsFromArrayL -// -------------------------------------------------------------------------- -// -void CCmDlg::ClearHiddenCMsFromArrayL( RArray& aCmIds ) - { - TBool hidden( EFalse ); - TInt err( KErrNone ); - for ( TInt index = 0; index < aCmIds.Count(); index++ ) - { - TUint recId = aCmIds[index]; - TRAP( err, hidden = iCmManager->GetConnectionMethodInfoBoolL( recId, ECmHidden ) ); - if ( err || hidden ) - { - aCmIds.Remove( index ); - index--; - } - } - } - -// -------------------------------------------------------------------------- -// CCmDlg::GetHelpContext -// -------------------------------------------------------------------------- -// -void CCmDlg::GetHelpContext( TCoeHelpContext& aContext ) const - { - aContext.iMajor = KHelpUidPlugin; - aContext.iContext = KSET_HLP_CONN_METHODS_VIEW; - } - -// -------------------------------------------------------------------------- -// CCmDlg::FinishPriorizingL -// -------------------------------------------------------------------------- -// -void CCmDlg::FinishPriorizingL( TBool aOkPushed ) - { - LOGGER_ENTERFN( "CCmDlg::FinishPriorizing" ); - - iListbox->ClearSelection(); - iPrioritising = EFalse; - - if( aOkPushed ) - { - if ( CurrentCML()->GetBoolAttributeL( ECmDestination ) || - (CurrentCML()->GetBoolAttributeL( ECmVirtual ) && - CurrentCML()->GetIntAttributeL( ECmNextLayerSNAPId )) ) - { - // Priorising not possible - TCmCommonUi::ShowNoteL( R_CMMANAGERUI_INFO_PRIO_NOT_POSSIBLE, - TCmCommonUi::ECmInfoNote ); - } - else - { - CCmPluginBase* cm = CMByIndexL(iCmToPrioritise); - iCmDestinationImpl->ModifyPriorityL( - *cm, - iListbox->CurrentItemIndex()); - iCmDestinationImpl->UpdateL(); - HandleListboxDataChangeL(); - } - } - // Set the softkeys back - ButtonGroupContainer().SetCommandSetL( - R_SOFTKEYS_OPTIONS_BACK__EDIT ); - ButtonGroupContainer().DrawDeferred(); - } - - -// -------------------------------------------------------------------------- -// CCmDlg::Execute -// -------------------------------------------------------------------------- -// -void CCmDlg::Execute() - { - LOGGER_ENTERFN( "CCmDlg::Execute" ); - - iInfoPopupNoteController->HideInfoPopupNote(); - - if(iPrioritising) - { - TRAPD( err, FinishPriorizingL( ETrue ) ); - if ( err ) - { - HandleLeaveError( err ); - } - } - else - { - iProcessing = ETrue; - - TRAPD( err, ProcessCommandL(ECmManagerUiCmdCmEdit) ); - if ( err ) - { - HandleLeaveError( err ); - } - - iProcessing = EFalse; - } - } - -// -------------------------------------------------------------------------- -// CCmDlg::HandleLeaveError -// -------------------------------------------------------------------------- -// -void CCmDlg::HandleLeaveError( TInt /*aError*/ ) - { - if(iProcessing) - { - iProcessing = EFalse; - } - } - -// -------------------------------------------------------------------------- -// CCmDlg::HandleResourceChange -// -------------------------------------------------------------------------- -// -void CCmDlg::HandleResourceChange( TInt aType ) - { - CCoeControl::HandleResourceChange( aType ); - - if( aType == KEikDynamicLayoutVariantSwitch ) - { - DrawNow(); - } - - CAknDialog::HandleResourceChange(aType); - } - -// -------------------------------------------------------------------------- -// CCmDlg::GetInsertIndexL -// -------------------------------------------------------------------------- -// -TInt CCmDlg::GetInsertIndexL( TInt aCount, TUint32 aPriority ) - { - TInt ret = -1; - TUint32 priority; - - for ( TInt index = 0; index < aCount; index++ ) - { - CCmPluginBase* cm = iCmDestinationImpl->GetConnectionMethodL( iItemIndex[index] ); - - if ( cm->GetBoolAttributeL( ECmVirtual ) && - !cm->GetIntAttributeL( ECmNextLayerSNAPId ) ) - { - TUint32 underlying = cm->GetIntAttributeL( ECmNextLayerIapId ); - if ( underlying != 0 ) - { - // Find the index that this VPN Iap should be inserted - TUint32 underlyingBearer = iCmManager->BearerTypeFromCmIdL( underlying ); - priority = iCmManager->GetBearerInfoIntL( underlyingBearer, ECmDefaultPriority ); - } - else - { - priority = KDataMobilitySelectionPolicyPriorityWildCard; - } - } - else - { - priority = cm->Plugin()->GetIntAttributeL( ECmDefaultPriority ); - } - - if (priority > aPriority) - { - ret = index; - break; - } - } - - return ret; - } - -// -------------------------------------------------------------------------- -// CCmDlg::ReBuildItemIndexArrayL -// -------------------------------------------------------------------------- -// -void CCmDlg::ReBuildItemIndexArrayL() - { - iCmManager->OpenTransactionLC(); - - RArray cmIds; - ConstructCMArrayL( cmIds ); - CleanupClosePushL( cmIds ); - - // Remove hidden Connection Methods from the array if uncat folder - if ( !iCmDestinationImpl ) - { - ClearHiddenCMsFromArrayL( cmIds ); - } - - iItemIndex.Reset(); - for ( TInt i = 0; i < cmIds.Count(); i++ ) - { - iItemIndex.Append(i); - } - - CleanupStack::PopAndDestroy( &cmIds ); - - iCmManager->CommitTransactionL( KErrNone ); - } - -// -------------------------------------------------------------------------- -// CCmDlg::ReOrderCMsL -// -------------------------------------------------------------------------- -// -void CCmDlg::ReOrderCMsL() - { - ReBuildItemIndexArrayL(); - - TBool prioAllowed = ETrue; - TInt firstNotAllowedEntry = 0; - TInt index = 0; - TInt count = iItemIndex.Count(); - - if (!iCmDestinationImpl) - { - return; - } - - // This part is to move a SANP-referred VPN Iap to the end of list if the VPN Iap is changed from - // IAP-referred to SNAP-referred. - for ( index = 0; index < count; index++ ) - { - CCmPluginBase* cm = iCmDestinationImpl->GetConnectionMethodL( iItemIndex[index] ); - - if ( cm->GetBoolAttributeL( ECmDestination ) || - (cm->GetBoolAttributeL( ECmVirtual ) && - cm->GetIntAttributeL( ECmNextLayerSNAPId )) ) - { - prioAllowed = EFalse; - firstNotAllowedEntry = index; - } - else - { - if ( !prioAllowed ) - { - iCmDestinationImpl->ModifyPriorityL(*cm, firstNotAllowedEntry); - iCmDestinationImpl->UpdateL(); - // start from the beginning - index = 0; - prioAllowed = ETrue; - continue; - } - } - } - - // This part is to move a IAP-referred VPN Iap to a proper location of priority in list - // if the VAP Iap is changed from SNAP-referred to IAP-referred. - for ( index = 0; index < count; index++ ) - { - CCmPluginBase* cm = iCmDestinationImpl->GetConnectionMethodL( iItemIndex[index] ); - - if ( cm->GetBoolAttributeL( ECmVirtual ) && - !cm->GetIntAttributeL( ECmNextLayerSNAPId ) ) - { - TUint32 underlying = cm->GetIntAttributeL( ECmNextLayerIapId ); - if ( underlying != 0 ) - { - // Find the index that this VPN Iap should be inserted - TUint32 underlyingBearer = iCmManager->BearerTypeFromCmIdL( underlying ); - TUint32 underlyingPrio = iCmManager->GetBearerInfoIntL( underlyingBearer, ECmDefaultPriority ); - TInt insertAt = GetInsertIndexL( index, underlyingPrio ); - - // Modify the priority of this VPN Iap - if (insertAt != -1) - { - iCmDestinationImpl->ModifyPriorityL( *cm, insertAt ); - iCmDestinationImpl->UpdateL(); - break; - } - } - } - } - } - -// -------------------------------------------------------------------------- -// CCmDlg::CommsDatChanges -// -------------------------------------------------------------------------- -// -void CCmDlg::CommsDatChangesL() - { - if (iCmDestinationImpl) - { - // If the destination that is currently working on disappears - // with some reason then go back to parent view - if( !iCmManager->DestinationStillExistedL( iCmDestinationImpl ) ) - { - iCmManager->WatcherUnRegister(); - TryExitL( iExitReason ); - return; - } - } - - // Update list box - HandleListboxDataChangeL(); - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmlistbox.cpp --- a/cmmanager/cmmgr/Framework/Src/cmlistbox.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmListbox -* -*/ - -#include -#include -#include -#include - -#include "cmlistbox.h" -#include "cmlistboxmodel.h" -#include "cmlistitem.h" - - -// --------------------------------------------------------------------------- -// CCmListbox::NewL -// --------------------------------------------------------------------------- -// -CCmListbox* CCmListbox::NewL( const CCoeControl* aParent ) - { - CCmListbox* listbox = new ( ELeave ) CCmListbox(); - CleanupStack::PushL( listbox ); - listbox->ConstructL( aParent, EAknListBoxSelectionList ); - CleanupStack::Pop( listbox ); - return listbox; - } - -// --------------------------------------------------------------------------- -// CCmListbox::CCmListbox -// --------------------------------------------------------------------------- -// -CCmListbox::CCmListbox() - { - } - -// --------------------------------------------------------------------------- -// CCmListbox::~CCmListbox -// --------------------------------------------------------------------------- -// -CCmListbox::~CCmListbox() - { - } - -// --------------------------------------------------------------------------- -// CCmListbox::OfferKeyEventL -// --------------------------------------------------------------------------- -// -TKeyResponse CCmListbox::OfferKeyEventL -( const TKeyEvent& aKeyEvent, TEventCode aType ) - { - if ( aKeyEvent.iCode == EKeyOK && - !( aKeyEvent.iModifiers & EModifierShift ) ) - { - // Enter pressed (not Shift-Enter). This will report an - // EEnterKeyPressed event sent to the observer (the view), which may - // delete this listbox. The code which processes keypresses by - // default, will continue (on the already deleted listbox), and - // will crash. So we grab this keypress here, and generate the - // same event, but after that, quit immediately! - ReportListBoxEventL( MEikListBoxObserver::EEventEnterKeyPressed ); - // By now the listbox may have been deleted! - // Do not access it after this point! - return EKeyWasConsumed; - } - else - { - return CAknDoubleGraphicStyleListBox::OfferKeyEventL - ( aKeyEvent, aType ); - } - } - -// --------------------------------------------------------------------------- -// CCmListbox::FocusChanged -// --------------------------------------------------------------------------- -// -void CCmListbox::FocusChanged( TDrawNow aDrawNow ) - { - // Do nothing until the listbox is fully constructed - // The dialogpage sets the focus before calling ConstructL - if ( iView ) - { - CAknDoubleGraphicStyleListBox::FocusChanged( aDrawNow ); - } - } - -// --------------------------------------------------------------------------- -// CCmListbox::Uid4Item -// --------------------------------------------------------------------------- -// -TUint32 CCmListbox::Uid4Item( TInt aItem ) const - { - CCmListboxModel* lbmodel = - STATIC_CAST( CCmListboxModel*, Model()->ItemTextArray() ); - return lbmodel->At( aItem )->Uid(); - } - -// --------------------------------------------------------------------------- -// CCmListbox::CurrentItemUid -// --------------------------------------------------------------------------- -// -TUint32 CCmListbox::CurrentItemUid() const - { - CCmListboxModel* lbmodel = - STATIC_CAST( CCmListboxModel*, Model()->ItemTextArray() ); - TInt idx = CurrentItemIndex(); - TUint32 retval( 0 ); - if ( idx >= 0 ) - { - retval = lbmodel->At( idx )->Uid(); - } - return retval; - } - -// --------------------------------------------------------------------------- -// CCmListbox::CurrentItemNameL -// --------------------------------------------------------------------------- -// -const TDesC& CCmListbox::CurrentItemNameL() - { - CCmListboxModel* lbmodel = new( ELeave )CCmListboxModel; - lbmodel = STATIC_CAST( CCmListboxModel*, Model()->ItemTextArray() ); - return lbmodel->At( CurrentItemIndex() )->Name(); - } - -// --------------------------------------------------------------------------- -// CCmListbox::HandleResourceChange -// --------------------------------------------------------------------------- -// -void CCmListbox::HandleResourceChange(TInt aType) - { - if ( aType == KAknsMessageSkinChange ) - { - SizeChanged(); - } - - CAknDoubleGraphicStyleListBox::HandleResourceChange( aType ); - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmlistboxmodel.cpp --- a/cmmanager/cmmgr/Framework/Src/cmlistboxmodel.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmListboxModel -* -*/ - -#include -#include -#include -#include - -#include "cmlistboxmodel.h" -#include "cmlistitem.h" -#include -#include "cmlistitemlist.h" - -// --------------------------------------------------------------------------- -// CCmListboxModel::CCmListboxModel -// --------------------------------------------------------------------------- -// -CCmListboxModel::CCmListboxModel() - : iOffset( 0 ) - { - } - -// --------------------------------------------------------------------------- -// CCmListboxModel::~CCmListboxModel -// --------------------------------------------------------------------------- -// -CCmListboxModel::~CCmListboxModel() - { - //ResetAndCmroy(); // deletes all elements... - } - -// --------------------------------------------------------------------------- -// CCmListboxModel::MdcaCount -// --------------------------------------------------------------------------- -// -TInt CCmListboxModel::MdcaCount() const - { - return Count(); - } - -// --------------------------------------------------------------------------- -// CCmListboxModel::SetOwnIconOffset -// --------------------------------------------------------------------------- -// -void CCmListboxModel::SetOwnIconOffset( TInt aOffset ) - { - iOffset = aOffset; - } - -// --------------------------------------------------------------------------- -// CCmListboxModel::MdcaPoint -// --------------------------------------------------------------------------- -// -TPtrC CCmListboxModel::MdcaPoint( TInt aIndex ) const - { - // We need to cast away the const-ness from the buffer. - // It was definitely made for formatting! - FormatListboxText( aIndex, - MUTABLE_CAST( TBuf&, iBuf ) ); - - return iBuf; - } - -// --------------------------------------------------------------------------- -// CCmListboxModel::FormatListboxText -// --------------------------------------------------------------------------- -// -void CCmListboxModel::FormatListboxText( TInt aIndex, - TDes& aBuf ) const - { - TRAP_IGNORE( FormatListboxTextL( aIndex, aBuf ) ); - } - -// --------------------------------------------------------------------------- -// CCmListboxModel::FormatListboxTextL -// --------------------------------------------------------------------------- -// -void CCmListboxModel::FormatListboxTextL( TInt aIndex, - TDes& aBuf ) const - { - aBuf.Zero(); - TUint icon = At( aIndex )->IconIndex(); - if ( At(aIndex)->IsSingleLine() ) - { - if ( At(aIndex)->IsProtected() ) - { - aBuf.Format( KListItemFormatEmbDestProt, - icon, - &At( aIndex )->Name(), - KCmReservedIconIndexProtected ); - } - else - { - aBuf.Format( KListItemFormatEmbDest, - icon, - &At( aIndex )->Name() ); - } - } - else - { - HBufC* secondLine; - secondLine = StringLoader::LoadLC( R_CMMANAGERUI_METHOD_PRIORITY_OTHER, - At( aIndex )->Priority() + 1 ); - if ( At( aIndex )->IsDefault() ) - { - aBuf.Format( KListItemFormatCmProt, - icon, - &At( aIndex )->Name(), - secondLine, - KCmReservedIconIndexDefaultConn ); - } - else - { - if ( At(aIndex)->IsProtected() ) - { - aBuf.Format( KListItemFormatCmProt, - icon, - &At( aIndex )->Name(), - secondLine, - KCmReservedIconIndexProtected ); - } - else if ( At(aIndex)->IsVpnOverDestination() ) - { - CleanupStack::PopAndDestroy( secondLine ); - - secondLine = StringLoader::LoadLC( R_QTN_NETW_CONSET_METHOD_PRIORITY_AUTO); - - aBuf.Format( KListItemFormatCm, - icon, - &At( aIndex )->Name(), - secondLine ); - } - else - { - aBuf.Format( KListItemFormatCm, - icon, - &At( aIndex )->Name(), - secondLine ); - } - } - - CleanupStack::PopAndDestroy( secondLine ); - } - } - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmlistitem.cpp --- a/cmmanager/cmmgr/Framework/Src/cmlistitem.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmListItem -* -*/ - -#include -#include "cmlistitem.h" - -// --------------------------------------------------------- -// CCmListItem::NewLC -// --------------------------------------------------------- -// -CCmListItem* CCmListItem::NewLC( TUint32 aUid, - HBufC* aName, - TInt aPriority, - TUint aIconIndex, - TBool aIsProtected, - TBool aIsVpnOverDestination, - TBool aIsSingleLine, - TBool aIsDefault ) - { - - CCmListItem* db = new( ELeave ) CCmListItem( aName ); - CleanupStack::PushL( db ); - db->ConstructL( aUid, - aPriority, - aIconIndex, - aIsProtected, - aIsVpnOverDestination, - aIsSingleLine, - aIsDefault ); - return db; - } -// --------------------------------------------------------- -// CCmListItem::~CCmListItem -// --------------------------------------------------------- -// -CCmListItem::~CCmListItem() - { - delete iName; - } - -// --------------------------------------------------------- -// CCmListItem::CCmListItem -// --------------------------------------------------------- -// -CCmListItem::CCmListItem( HBufC* aName ) - : iName( aName ) - { - } - -// --------------------------------------------------------- -// CCmListItem::ConstructL -// --------------------------------------------------------- -// -void CCmListItem::ConstructL( TUint32 aUid, - TInt aPriority, - TUint aIconIndex, - TBool aIsProtected, - TBool aIsVpnOverDestination, - TBool aIsSingleLine, - TBool aIsDefault ) - { - iPriority = aPriority; - iIconIndex = aIconIndex; - iIsProtected = aIsProtected; - iIsSingleLine = aIsSingleLine; - iIsDefault = aIsDefault; - iIsVpnOverDestination = aIsVpnOverDestination; - - iUid = aUid; - } -// --------------------------------------------------------- -// CCmListItem::Name -// --------------------------------------------------------- -// -const TDesC& CCmListItem::Name() - { - return *iName; - } - - -// --------------------------------------------------------- -// CCmListItem::Uid -// --------------------------------------------------------- -// -TUint32 CCmListItem::Uid() - { - return iUid; - } - -// --------------------------------------------------------- -// CCmListItem::IconIndex -// --------------------------------------------------------- -// -TUint CCmListItem::IconIndex() - { - return iIconIndex; - } - -// --------------------------------------------------------- -// CCmListItem::Priority -// --------------------------------------------------------- -// -TInt CCmListItem::Priority() - { - return iPriority; - } - -// --------------------------------------------------------- -// CCmListItem::IsProtected -// --------------------------------------------------------- -// -TBool CCmListItem::IsProtected() - { - return iIsProtected; - } - -// --------------------------------------------------------- -// CCmListItem::IsSingleLine -// --------------------------------------------------------- -// -TBool CCmListItem::IsSingleLine() - { - return iIsSingleLine; - } - -// --------------------------------------------------------- -// CCmListItem::IsDefault -// --------------------------------------------------------- -// -TBool CCmListItem::IsDefault() - { - return iIsDefault; - } - -// --------------------------------------------------------- -// CCmListItem::IsVpnOverDestination -// --------------------------------------------------------- -// -TBool CCmListItem::IsVpnOverDestination() - { - return iIsVpnOverDestination; - } - - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmlistitemlist.cpp --- a/cmmanager/cmmgr/Framework/Src/cmlistitemlist.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmListItemList -* -*/ - -#include "cmlistitemlist.h" -#include "cmlistitem.h" - - -LOCAL_D const TInt KGranularity = 4; ///< Granularity of the list. - -// --------------------------------------------------------- -// CCmListItemList::CCmListItemList -// --------------------------------------------------------- -// -CCmListItemList::CCmListItemList() - : CArrayPtrFlat( KGranularity ) - { - } - -// --------------------------------------------------------- -// CCmListItemList::~CCmListItemList -// --------------------------------------------------------- -// -CCmListItemList::~CCmListItemList() - { - ResetAndDestroy(); - } - -// --------------------------------------------------------- -// CCmListItemList::ItemForUid -// --------------------------------------------------------- -// -CCmListItem* CCmListItemList::ItemForUid( TUint32 aUid ) const - { - // This method cannot return "const CCmListItem*", because all methods - // of CCmListItem are non-const -> if the returned item was const, it - // would be unusable. - TInt i; - TInt count = Count(); - for ( i = 0; i < count; i++ ) - { - if ( At( i )->Uid() == aUid ) - { - return At( i ); - } - } - - return NULL; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmlogger.cpp --- a/cmmanager/cmmgr/Framework/Src/cmlogger.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,220 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of TLogger -* -*/ - -#include "cmlogger.h" - -#ifdef __CONNECTION_METHOD_LOG__ - -_LIT( KDeclareLoggerName, "< %S >" ); -_LIT( KAttachLogger, "<%x>to<%x>" ); -_LIT( KOwnerLog, "<%x> -\t" ); -_LIT8( KOwnerLog8, "<%x> -\t" ); -_LIT( KLoggerCreated, "" ); -_LIT( KLoggerClosed, "" ); -_LIT( KLoggerName, "[CMManager]" ); -_LIT8( KLoggerName8, "[CMManager]" ); - -// --------------------------------------------------------- -// CFunctionEntryExit::CFunctionEntryExit() -// --------------------------------------------------------- -// -CFunctionEntryExit::CFunctionEntryExit( const TAny* aOwner, - TRefByValue aFunc ) - : iOwner( aOwner ) - { - iEntryTime.UniversalTime(); - - iFunc.Set( aFunc ); - - TLogger::LogIt( aOwner, _L("-> <%S>"), &iFunc ); - } - -// --------------------------------------------------------- -// CFunctionEntryExit::~CFunctionEntryExit() -// --------------------------------------------------------- -// -CFunctionEntryExit::~CFunctionEntryExit() - { - TTime exitTime; - - exitTime.UniversalTime(); - TLogger::LogIt( iOwner, _L("<- <%S><%d>"), - &iFunc, - I64LOW( exitTime.MicroSecondsFrom( iEntryTime ).Int64())); - } - -// --------------------------------------------------------- -// TLogger::CreateFlogger() -// --------------------------------------------------------- -// -void TLogger::CreateLogger( TAny* aOwner ) - { - LogIt( aOwner, KLoggerCreated ); - } - -// --------------------------------------------------------- -// TLogger::CloseLogger() -// --------------------------------------------------------- -// -void TLogger::CloseLogger( TAny* aOwner ) - { - LogIt( aOwner, KLoggerClosed ); - } - -// --------------------------------------------------------- -// TLogger::AttachFLogger() -// --------------------------------------------------------- -// -void TLogger::AttachLogger( const TAny* aOwner, - const TAny* aAttach1, - const TAny* aAttach2 ) - { - LogIt( aOwner, KAttachLogger, aAttach1, aAttach2 ); - } - -// --------------------------------------------------------- -// TLogger::NameIt() -// --------------------------------------------------------- -// -void TLogger::NameIt( const TAny* aOwner, TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - - TBuf nameBuf; - TBuf logBuf; - - nameBuf.FormatList( aFmt, list ); - logBuf.Format( KDeclareLoggerName, &nameBuf ); - - VA_END(list); - - TBuf<32> tempBuf; - -#ifdef _LOG_MICRO_TIME_ - TTime timeNull( 0 ); - TTime timeNow; - - timeNow.UniversalTime(); - - tempBuf.Format( _L(" - %Li - "), timeNow.MicroSecondsFrom(timeNull)); - - logBuf.Insert( 0, timeBuf ); -#endif - - tempBuf.Format( KOwnerLog, aOwner ); - logBuf.Insert( 0, tempBuf ); - logBuf.Insert( 0, KLoggerName ); - - RDebug::Print( logBuf ); - } - -// --------------------------------------------------------- -// TLogger::LogIt() -// --------------------------------------------------------- -// -void TLogger::LogIt( const TAny* aOwner, - TRefByValue aFmt, - VA_LIST aList ) - { - TBuf logBuf; - - logBuf.FormatList( aFmt, aList ); - - TBuf<32> tempBuf; - -#ifdef _LOG_MICRO_TIME_ - TTime timeNull( 0 ); - TTime timeNow; - - timeNow.UniversalTime(); - - tempBuf.Format( _L(" - %Li - "), timeNow.MicroSecondsFrom(timeNull)); - - logBuf.Insert( 0, timeBuf ); -#endif - - tempBuf.Format( KOwnerLog, aOwner ); - logBuf.Insert( 0, tempBuf ); - logBuf.Insert( 0, KLoggerName ); - - RDebug::Print( logBuf ); - } - -// --------------------------------------------------------- -// TLogger::LogIt() -// --------------------------------------------------------- -// -void TLogger::LogIt( const TAny* aOwner, - TRefByValue aFmt, - VA_LIST aList ) - { - TBuf8 logBuf; - - logBuf.FormatList( aFmt, aList ); - - TBuf8<32> tempBuf8; - -#ifdef _LOG_MICRO_TIME_ - TTime timeNull( 0 ); - TTime timeNow; - - timeNow.UniversalTime(); - - - tempBuf8.Format( _L8(" - %Li - "), timeNow.MicroSecondsFrom(timeNull)); - - logBuf.Insert( 0, tempBuf ); -#endif - - tempBuf8.Format( KOwnerLog8, aOwner ); - logBuf.Insert( 0, tempBuf8 ); - logBuf.Insert( 0, KLoggerName8 ); - - RDebug::RawPrint( logBuf ); - } - -// --------------------------------------------------------- -// TLogger::LogIt() -// --------------------------------------------------------- -// -void TLogger::LogIt( const TAny* aOwner, TRefByValue aFmt, ...) - - { - VA_LIST list; - VA_START(list,aFmt); - - TLogger::LogIt( aOwner, aFmt, list ); - - VA_END(list); - } - -// --------------------------------------------------------- -// TLogger::LogIt() -// --------------------------------------------------------- -// -void TLogger::LogIt( const TAny* aOwner, TRefByValue aFmt, ...) - { - VA_LIST list; - VA_START(list,aFmt); - - TLogger::LogIt( aOwner, aFmt, list ); - - VA_END(list); - } - -#endif // __CONNECTION_METHOD_LOG__ diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmmanager.cpp --- a/cmmanager/cmmgr/Framework/Src/cmmanager.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,555 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of RCmManager. -* -*/ - -#include -#include -#include -#include "cmlogger.h" -#include "cmmanagerimpl.h" -#include "cmdestinationimpl.h" -#include "cmmanager.hrh" -#include -#include -#include - -//----------------------------------------------------------------------------- -// RCmManager::Close() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::Close() - { - CLOG_WRITE( "RCmManagerExt::Close()" ); - delete iImplementation; - iImplementation = NULL; - - CLOG_CLOSE; - } - -//----------------------------------------------------------------------------- -// RCmManager::OpenL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::OpenL() - { - CLOG_CREATE; - CLOG_NAME_1( _L("Manager_0x%x"), this ); - iImplementation = CCmManagerImpl::NewL(EFalse); - CLOG_ATTACH( iImplementation, this ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::CreateTablesAndOpenL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::CreateTablesAndOpenL() - { - CLOG_CREATE; - CLOG_NAME_1( _L("Manager_0x%x"), this ); - iImplementation = CCmManagerImpl::NewL(); - CLOG_ATTACH( iImplementation, this ); - } - -//----------------------------------------------------------------------------- -// RCmManager::OpenLC() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::OpenLC() - { - CLOG_CREATE; - CLOG_NAME_1( _L("Manager_0x%x"), this ); - CleanupClosePushL(*this); - iImplementation = NULL; - iImplementation = CCmManagerImpl::NewL(); - CLOG_ATTACH( iImplementation, this ); - } - -//----------------------------------------------------------------------------- -// RCmManager::ConnectionMethodL( TUint aId ) -//----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethod RCmManager::ConnectionMethodL( - TUint32 aIapId ) const - { - RCmConnectionMethod cm; - CCmPluginBase* cM = iImplementation->GetConnectionMethodL( aIapId ); - cm.iImplementation = cM->Plugin(); - cm.iImplementation->IncrementRefCounter(); - delete cM; - - return cm; - } - -//----------------------------------------------------------------------------- -// RCmManager::GetBearerInfoIntL() -//----------------------------------------------------------------------------- -// -EXPORT_C TUint32 RCmManager::GetBearerInfoIntL( TUint32 aBearerType, - TUint32 aAttribute ) const - { - return iImplementation->GetBearerInfoIntL( aBearerType, - aAttribute ); - } - -//----------------------------------------------------------------------------- -// RCmManager::GetBearerInfoBoolL() -//----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmManager::GetBearerInfoBoolL( TUint32 aBearerType, - TUint32 aAttribute ) const - { - return iImplementation->GetBearerInfoBoolL( aBearerType, - aAttribute ); - } - -//----------------------------------------------------------------------------- -// RCmManager::GetBearerInfoStringL() -//----------------------------------------------------------------------------- -// -EXPORT_C HBufC* RCmManager::GetBearerInfoStringL( TUint32 aBearerType, - TUint32 aAttribute ) const - { - return iImplementation->GetBearerInfoStringL( aBearerType, - aAttribute ); - } - -//----------------------------------------------------------------------------- -// RCmManager::GetBearerInfoStringL() -//----------------------------------------------------------------------------- -// -EXPORT_C HBufC8* RCmManager::GetBearerInfoString8L( TUint32 aBearerType, - TUint32 aAttribute ) const - { - return iImplementation->GetBearerInfoString8L( aBearerType, - aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmManager::GetConnectionMethodInfoIntL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint32 RCmManager::GetConnectionMethodInfoIntL( - TUint32 aIapId, - TUint32 aAttribute ) const - { - return iImplementation->GetConnectionMethodInfoIntL( aIapId, aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmManager::GetConnectionMethodInfoBoolL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmManager::GetConnectionMethodInfoBoolL( - TUint32 aIapId, - TUint32 aAttribute ) const - { - return iImplementation->GetConnectionMethodInfoBoolL( aIapId, aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmManager::GetConnectionMethodInfoStringL() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC* RCmManager::GetConnectionMethodInfoStringL( - TUint32 aIapId, - TUint32 aAttribute ) const - { - return iImplementation->GetConnectionMethodInfoStringL( aIapId, aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmManager::GetConnectionMethodInfoString8L() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC8* RCmManager::GetConnectionMethodInfoString8L( - TUint32 aIapId, - TUint32 aAttribute ) const - { - return iImplementation->GetConnectionMethodInfoString8L( aIapId, aAttribute ); - } - -//============================================================================= -// CREATION / DELETION API -//============================================================================= -// - -//----------------------------------------------------------------------------- -// RCmManager::CreateDestinationL( const TDesC& aName ) -//----------------------------------------------------------------------------- -// -EXPORT_C RCmDestination RCmManager::CreateDestinationL( const TDesC& aName ) - { - LOGGER_ENTERFN( "RCmManager::CreateDestinationL" ); - - RCmDestination dest; - - CCmDestinationImpl* destImp = iImplementation->CreateDestinationL( aName ); - dest.iDestinatonData = destImp->GetData(); - dest.iDestinatonData->IncrementRefCounter(); - delete destImp; - - return dest; - } - -// ----------------------------------------------------------------------------- -// RCmManager::CreateConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethod RCmManager::CreateConnectionMethodL( - TUint32 aImplementationUid ) - { - LOGGER_ENTERFN( "RCmManager::CreateConnectionMethodL" ); - - RCmConnectionMethod cm; - - CCmPluginBase* cM = - iImplementation->CreateConnectionMethodL( aImplementationUid ); - cm.iImplementation = cM->Plugin(); - cm.iImplementation->IncrementRefCounter(); - delete cM; - - return cm; - } - -//----------------------------------------------------------------------------- -// RCmManager::CopyL() -//----------------------------------------------------------------------------- -// -EXPORT_C TInt RCmManager::CopyConnectionMethodL( - RCmDestination& aTargetDestination, - RCmConnectionMethod& aConnectionMethod ) - { - LOGGER_ENTERFN( "RCmManager::CopyConnectionMethodL" ); - - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(aTargetDestination.iDestinatonData); - // Deleting aImplementation will decrement the ref counter - aImplementation->IncrementRefCounter(); - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(aConnectionMethod.iImplementation); - connMethod->IncrementRefCounter(); - CleanupStack::PushL( connMethod ); - TInt retVal = iImplementation->CopyConnectionMethodL( - *aImplementation, - *connMethod ); - CleanupStack::PopAndDestroy(connMethod); - CleanupStack::PopAndDestroy(aImplementation); - return retVal; - } - -//----------------------------------------------------------------------------- -// RCmManager::MoveConnMethodL() -//----------------------------------------------------------------------------- -// -EXPORT_C TInt RCmManager::MoveConnectionMethodL( - RCmDestination& aSourceDestination, - RCmDestination& aTargetDestination, - RCmConnectionMethod& aConnectionMethod ) - { - LOGGER_ENTERFN( "RCmManager::MoveConnectionMethodL" ); - - CCmDestinationImpl* aSourceImpl = - CCmDestinationImpl::NewLC(aSourceDestination.iDestinatonData); - aSourceImpl->IncrementRefCounter(); - CCmDestinationImpl* aTargetImpl = - CCmDestinationImpl::NewLC(aTargetDestination.iDestinatonData); - aTargetImpl->IncrementRefCounter(); - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(aConnectionMethod.iImplementation); - connMethod->IncrementRefCounter(); - CleanupStack::PushL( connMethod ); - TInt retVal = iImplementation->MoveConnectionMethodL( - *aSourceImpl, - *aTargetImpl, - *connMethod ); - CleanupStack::PopAndDestroy(connMethod); - CleanupStack::PopAndDestroy(aTargetImpl); - CleanupStack::PopAndDestroy(aSourceImpl); - return retVal; - } - -//----------------------------------------------------------------------------- -// RCmManager::RemoveConnectionMethodL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::RemoveConnectionMethodL( - RCmDestination& aDestination, - RCmConnectionMethod& aConnectionMethod ) - { - LOGGER_ENTERFN( "RCmManager::RemoveConnectionMethodL" ); - - CCmDestinationImpl* aDestImpl = - CCmDestinationImpl::NewLC(aDestination.iDestinatonData); - aDestImpl->IncrementRefCounter(); - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(aConnectionMethod.iImplementation); - connMethod->IncrementRefCounter(); - CleanupStack::PushL( connMethod ); - - iImplementation->RemoveConnectionMethodL( *aDestImpl, *connMethod ); - - CleanupStack::PopAndDestroy(connMethod); - CleanupStack::PopAndDestroy(aDestImpl); - } - -//----------------------------------------------------------------------------- -// RCmManager::RemoveAllReferencesL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::RemoveAllReferencesL( - RCmConnectionMethod& aConnectionMethod ) - { - LOGGER_ENTERFN( "RCmManager::RemoveAllReferencesL" ); - - iImplementation->RemoveAllReferencesL( *aConnectionMethod.iImplementation ); - } - -//----------------------------------------------------------------------------- -// RCmManager::ConnectionMethodL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::ConnectionMethodL( RArray& aCMArray, - TBool aCheckBearerType, - TBool aLegacyOnly, - TBool aEasyWlan ) const - { - LOGGER_ENTERFN( "RCmManager::ConnectionMethodL" ); - - return iImplementation->ConnectionMethodL( aCMArray, - aCheckBearerType, - aLegacyOnly, - aEasyWlan ); - } - -//----------------------------------------------------------------------------- -// RCmManager::AllDestinationsL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::AllDestinationsL( RArray& aDestArray ) const - { - LOGGER_ENTERFN( "RCmManager::AllDestinationsL" ); - - return iImplementation->AllDestinationsL( aDestArray ); - } - - -//----------------------------------------------------------------------------- -// RCmManager::DestinationL() -//----------------------------------------------------------------------------- -// -EXPORT_C RCmDestination RCmManager::DestinationL( TUint32 aId ) const - { - LOGGER_ENTERFN( "RCmManager::DestinationL" ); - - RCmDestination dest; - - CCmDestinationImpl* aDestImpl = iImplementation->DestinationL( aId ); - dest.iDestinatonData = aDestImpl->GetData( ); - dest.iDestinatonData->IncrementRefCounter(); - delete aDestImpl; - - return dest; - } - -//----------------------------------------------------------------------------- -// RCmManager::BearerPriorityArrayL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::BearerPriorityArrayL( - RArray& aArray ) const - { - LOGGER_ENTERFN( "RCmManager::BearerPriorityArray" ); - - iImplementation->BearerPriorityArrayL( aArray ); - } - -//----------------------------------------------------------------------------- -// RCmManager::UpdateBearerPriorityArrayL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::UpdateBearerPriorityArrayL( - const RArray& aArray ) - { - LOGGER_ENTERFN( "RCmManager::UpdateBearerPriorityArray" ); - - iImplementation->UpdateBearerPriorityArrayL( aArray ); - } - -//----------------------------------------------------------------------------- -// RCmManager::CleanupGlobalPriorityArray() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::CleanupGlobalPriorityArray( - RArray& aArray ) const - { - LOGGER_ENTERFN( "RCmManager::CleanupGlobalPriorityArray" ); - - iImplementation->CleanupGlobalPriorityArray( aArray ); - } - -//----------------------------------------------------------------------------- -// RCmManager::SupportedBearers() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::SupportedBearersL( RArray& aArray ) const - { - LOGGER_ENTERFN( "RCmManager::SupportedBearersL" ); - - return iImplementation->SupportedBearersL( aArray ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::UncategorizedIconL() -//----------------------------------------------------------------------------- -// -EXPORT_C CGulIcon* RCmManager::UncategorizedIconL() const - { - LOGGER_ENTERFN( "RCmManager::UncategorizedIconL" ); - - return iImplementation->UncategorizedIconL(); - } - -//----------------------------------------------------------------------------- -// RCmManager::EasyWlanIdL() -//----------------------------------------------------------------------------- -// -EXPORT_C TUint32 RCmManager::EasyWlanIdL() const - { - LOGGER_ENTERFN( "RCmManager::EasyWlanIdL" ); - - return iImplementation->EasyWlanIdL(); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::ReadDefConnL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::ReadDefConnL( TCmDefConnValue& aDCSetting ) - { - LOGGER_ENTERFN( "RCmManager::ReadDefConnL" ); - - return iImplementation->ReadDefConnL( aDCSetting ); - } - -//----------------------------------------------------------------------------- -// RCmManager::WriteDefConnL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::WriteDefConnL( const TCmDefConnValue& aDCSetting ) - { - LOGGER_ENTERFN( "RCmManager::WriteDefConnL" ); - - return iImplementation->WriteDefConnL( aDCSetting ); - } - -//----------------------------------------------------------------------------- -// RCmManager::ReadGenConnSettingsL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::ReadGenConnSettingsL( TCmGenConnSettings& aGenConnSettings ) -{ - LOGGER_ENTERFN( "RCmManager::ReadGenConnSettingsL" ); - - return iImplementation->ReadGenConnSettingsL( aGenConnSettings ); -} - -//----------------------------------------------------------------------------- -// RCmManager::WriteGenConnSettingsL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManager::WriteGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings ) -{ - LOGGER_ENTERFN( "RCmManager::WriteGenConnSettingsL" ); - - return iImplementation->WriteGenConnSettingsL( aGenConnSettings ); -} - -//----------------------------------------------------------------------------- -// RCmManager::CreateDestinationL( const TDesC& aName, -// TUint32 aDestId ) -//----------------------------------------------------------------------------- -// -EXPORT_C RCmDestination RCmManager::CreateDestinationL( - const TDesC& aName, - TUint32 aDestId ) - { - LOGGER_ENTERFN( "RCmManager::CreateDestinationL" ); - - if ( aDestId == 0 ) - { - return CreateDestinationL( aName ); - } - - // Check if there already exists a destination with the same Id - RArray destIdArray = RArray( KCmArrayBigGranularity ); - iImplementation->AllDestinationsL( destIdArray ); - for ( TInt i = 0; i < destIdArray.Count(); i++ ) - { - if ( aDestId > 0 && aDestId < 255 ) - { - aDestId = aDestId + KCmDefaultDestinationAPTagId; - } - else if ( aDestId < KCmDefaultDestinationAPTagId+1 - && ( aDestId > ( KCmDefaultDestinationAPTagId+255 ) ) ) - { - User::Leave( KErrArgument ); - } - if ( aDestId == destIdArray[i] ) - { - destIdArray.Close(); - User::Leave( KErrAlreadyExists ); - } - } - destIdArray.Close(); - - RCmDestination dest; - - CCmDestinationImpl* destImp = - iImplementation->CreateDestinationL( aName, - aDestId ); - dest.iDestinatonData = destImp->GetData(); - dest.iDestinatonData->IncrementRefCounter(); - delete destImp; - - return dest; - } - -// ----------------------------------------------------------------------------- -// RCmManager::CreateConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethod RCmManager::CreateConnectionMethodL( - TUint32 aImplementationUid, - TUint32 aConnMethodId ) - { - LOGGER_ENTERFN( "RCmManager::CreateConnectionMethodL" ); - - if ( aConnMethodId == 0 ) - { - return CreateConnectionMethodL( aImplementationUid ); - } - - RCmConnectionMethod cm; - - CCmPluginBase* cM = - iImplementation->CreateConnectionMethodL( aImplementationUid, - aConnMethodId ); - cm.iImplementation = cM->Plugin(); - cm.iImplementation->IncrementRefCounter(); - delete cM; - - return cm; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmmanagerext.cpp --- a/cmmanager/cmmgr/Framework/Src/cmmanagerext.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,503 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of RCmManagerExt -* -*/ - -#include -#include -#include -#include -#include "cmlogger.h" -#include "cmmanager.hrh" -#include -#include "cmmanagerimpl.h" -#include "cmdestinationimpl.h" -#include "cmmanager.hrh" -#include - -#include -#include -#include // resource - -//----------------------------------------------------------------------------- -// RCmManagerExt::~RCmManagerExt() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::Close() - { - CLOG_WRITE( "RCmManagerExt::Close()" ); - delete iImplementation; - iImplementation = NULL; - - CLOG_CLOSE; - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::ConstructL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::OpenL() - { - CLOG_CREATE; - CLOG_NAME_1( _L("ManagerExt_0x%x"), this ); - iImplementation = CCmManagerImpl::NewL(EFalse); - CLOG_ATTACH( iImplementation, this ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::ConstructL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::CreateTablesAndOpenL() - { - CLOG_CREATE; - CLOG_NAME_1( _L("ManagerExt_0x%x"), this ); - iImplementation = CCmManagerImpl::NewL(); - CLOG_ATTACH( iImplementation, this ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::OpenLC() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::OpenLC() - { - CLOG_CREATE; - CLOG_NAME_1( _L("Manager_0x%x"), this ); - CleanupClosePushL(*this); - iImplementation = NULL; - iImplementation = CCmManagerImpl::NewL(); - CLOG_ATTACH( iImplementation, this ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::GetBearerInfoIntL() -//----------------------------------------------------------------------------- -// -EXPORT_C TUint32 RCmManagerExt::GetBearerInfoIntL( TUint32 aBearerType, - TUint32 aAttribute ) const - { - return iImplementation->GetBearerInfoIntL( aBearerType, - aAttribute ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::GetBearerInfoBoolL() -//----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmManagerExt::GetBearerInfoBoolL( TUint32 aBearerType, - TUint32 aAttribute ) const - { - return iImplementation->GetBearerInfoBoolL( aBearerType, - aAttribute ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::GetBearerInfoStringL() -//----------------------------------------------------------------------------- -// -EXPORT_C HBufC* RCmManagerExt::GetBearerInfoStringL( TUint32 aBearerType, - TUint32 aAttribute ) const - { - return iImplementation->GetBearerInfoStringL( aBearerType, - aAttribute ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::GetBearerInfoString8L() -//----------------------------------------------------------------------------- -// -EXPORT_C HBufC8* - RCmManagerExt::GetBearerInfoString8L( TUint32 aBearerType, - TUint32 aAttribute ) const - { - return iImplementation->GetBearerInfoString8L( aBearerType, - aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmManagerExt::GetConnectionMethodInfoIntL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint32 RCmManagerExt::GetConnectionMethodInfoIntL( TUint32 aIapId, - TUint32 aAttribute ) const - { - return iImplementation->GetConnectionMethodInfoIntL( aIapId, aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmManagerExt::GetConnectionMethodInfoBoolL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool RCmManagerExt::GetConnectionMethodInfoBoolL( TUint32 aIapId, - TUint32 aAttribute ) const - { - return iImplementation->GetConnectionMethodInfoBoolL( aIapId, aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmManagerExt::GetConnectionMethodInfoStringL() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC* RCmManagerExt::GetConnectionMethodInfoStringL( TUint32 aIapId, - TUint32 aAttribute ) const - { - return iImplementation->GetConnectionMethodInfoStringL( aIapId, - aAttribute ); - } - -// ----------------------------------------------------------------------------- -// RCmManagerExt::GetConnectionMethodInfoStringL() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC8* - RCmManagerExt::GetConnectionMethodInfoString8L( TUint32 aIapId, - TUint32 aAttribute ) const - { - return iImplementation->GetConnectionMethodInfoString8L( aIapId, aAttribute ); - } - -//============================================================================= -// CREATION / DELETION API -//============================================================================= -// - -//----------------------------------------------------------------------------- -// RCmManagerExt::CreateDestinationL( const TDesC& aName ) -//----------------------------------------------------------------------------- -// -EXPORT_C - RCmDestinationExt RCmManagerExt::CreateDestinationL( const TDesC& aName ) - { - RCmDestinationExt dest; - - CCmDestinationImpl* destImp = iImplementation->CreateDestinationL( aName ); - dest.iDestinatonData = destImp->GetData(); - dest.iDestinatonData->IncrementRefCounter(); - delete destImp; - - return dest; - } - -// ----------------------------------------------------------------------------- -// RCmManagerExt::CreateConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethodExt - RCmManagerExt::CreateConnectionMethodL( TUint32 aImplementationUid ) - { - RCmConnectionMethodExt cm; - - CCmPluginBase* cM = - iImplementation->CreateConnectionMethodL( aImplementationUid ); - cm.iImplementation = cM->Plugin(); - cm.iImplementation->IncrementRefCounter(); - delete cM; - - return cm; - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::CopyL() -//----------------------------------------------------------------------------- -// -EXPORT_C TInt RCmManagerExt::CopyConnectionMethodL( - RCmDestinationExt& aTargetDestination, - RCmConnectionMethodExt& aConnectionMethod ) - { - CCmDestinationImpl* aImplementation = - CCmDestinationImpl::NewLC(aTargetDestination.iDestinatonData); - // Deleting aImplementation will decrement the ref counter - aImplementation->IncrementRefCounter(); - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(aConnectionMethod.iImplementation); - connMethod->IncrementRefCounter(); - CleanupStack::PushL( connMethod ); - TInt retVal = iImplementation->CopyConnectionMethodL( - *aImplementation, - *connMethod ); - CleanupStack::PopAndDestroy(connMethod); - CleanupStack::PopAndDestroy(aImplementation); - return retVal; - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::MoveConnMethodL() -//----------------------------------------------------------------------------- -// -EXPORT_C TInt RCmManagerExt::MoveConnectionMethodL( - RCmDestinationExt& aSourceDestination, - RCmDestinationExt& aTargetDestination, - RCmConnectionMethodExt& aConnectionMethod ) - { - CCmDestinationImpl* aSourceImpl = - CCmDestinationImpl::NewLC(aSourceDestination.iDestinatonData); - aSourceImpl->IncrementRefCounter(); - CCmDestinationImpl* aTargetImpl = - CCmDestinationImpl::NewLC(aTargetDestination.iDestinatonData); - aTargetImpl->IncrementRefCounter(); - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(aConnectionMethod.iImplementation); - connMethod->IncrementRefCounter(); - CleanupStack::PushL( connMethod ); - TInt retVal = iImplementation->MoveConnectionMethodL( - *aSourceImpl, - *aTargetImpl, - *connMethod ); - CleanupStack::PopAndDestroy(connMethod); - CleanupStack::PopAndDestroy(aTargetImpl); - CleanupStack::PopAndDestroy(aSourceImpl); - return retVal; - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::RemoveConnectionMethodL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::RemoveConnectionMethodL( - RCmDestinationExt& aDestination, - RCmConnectionMethodExt& aConnectionMethod ) - { - CCmDestinationImpl* aDestImpl = - CCmDestinationImpl::NewLC(aDestination.iDestinatonData); - aDestImpl->IncrementRefCounter(); - CCmPluginBase* connMethod = new (ELeave) - CCmPluginBase(aConnectionMethod.iImplementation); - connMethod->IncrementRefCounter(); - CleanupStack::PushL( connMethod ); - iImplementation->RemoveConnectionMethodL( - *aDestImpl, - *connMethod ); - CleanupStack::PopAndDestroy(connMethod); - CleanupStack::PopAndDestroy(aDestImpl); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::RemoveAllReferencesL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::RemoveAllReferencesL( - RCmConnectionMethodExt& aConnectionMethod ) - { - iImplementation->RemoveAllReferencesL( *aConnectionMethod.iImplementation ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::ConnectionMethodExtL() -//----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethodExt - RCmManagerExt::ConnectionMethodL( TUint32 aIapId ) - { - RCmConnectionMethodExt cm; - CCmPluginBase* cM = iImplementation->GetConnectionMethodL( aIapId ); - cm.iImplementation = cM->Plugin(); - cm.iImplementation->IncrementRefCounter(); - delete cM; - - return cm; - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::ConnectionMethodL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::ConnectionMethodL( RArray& aCMArray, - TBool aCheckBearerType, - TBool aLegacyOnly, - TBool aEasyWlan ) - { - iImplementation->ConnectionMethodL( aCMArray, - aCheckBearerType, - aLegacyOnly, - aEasyWlan ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::DestinationL() -//----------------------------------------------------------------------------- -// -EXPORT_C RCmDestinationExt RCmManagerExt::DestinationL( TUint32 aId ) - { - RCmDestinationExt dest; - - CCmDestinationImpl* aDestImpl = iImplementation->DestinationL( aId ); - dest.iDestinatonData = aDestImpl->GetData( ); - dest.iDestinatonData->IncrementRefCounter(); - delete aDestImpl; - - return dest; - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::AllDestinationsL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::AllDestinationsL( RArray& aDestArray ) - { - return iImplementation->AllDestinationsL( aDestArray ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::BearerPriorityArrayL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::BearerPriorityArrayL( - RArray& aArray ) const - { - LOGGER_ENTERFN( "RCmManagerExt:BearerPriorityArray" ); - iImplementation->BearerPriorityArrayL( aArray ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::UpdateBearerPriorityArrayL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::UpdateBearerPriorityArrayL( - const RArray& aArray ) - { - LOGGER_ENTERFN( "RCmManagerExt::UpdateBearerPriorityArray" ); - iImplementation->UpdateBearerPriorityArrayL( aArray ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::CleanupGlobalPriorityArray() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::CleanupGlobalPriorityArray( - RArray& aArray ) const - { - LOGGER_ENTERFN( "RCmManagerExt:CleanupGlobalPriorityArray" ); - iImplementation->CleanupGlobalPriorityArray( aArray ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::SupportedBearers() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::SupportedBearersL( RArray& aArray ) const - { - return iImplementation->SupportedBearersL( aArray ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::UncategorizedIconL() -//----------------------------------------------------------------------------- -// -EXPORT_C CGulIcon* RCmManagerExt::UncategorizedIconL() const - { - return iImplementation->UncategorizedIconL(); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::EasyWlanIdL() -//----------------------------------------------------------------------------- -// -EXPORT_C TUint32 RCmManagerExt::EasyWlanIdL() - { - return iImplementation->EasyWlanIdL(); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::ReadDefConnL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::ReadDefConnL( TCmDefConnValue& aDCSetting ) - { - return iImplementation->ReadDefConnL( aDCSetting ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::WriteDefConnL() -//----------------------------------------------------------------------------- -// -EXPORT_C void RCmManagerExt::WriteDefConnL( const TCmDefConnValue& aDCSetting ) - { - return iImplementation->WriteDefConnL( aDCSetting ); - } - - -//----------------------------------------------------------------------------- -// RCmManagerExt::CreateDestinationL( const TDesC& aName, -// TUint32 aDestId ) -//----------------------------------------------------------------------------- -// -EXPORT_C RCmDestinationExt RCmManagerExt::CreateDestinationL( - const TDesC& aName, - TUint32 aDestId ) - { - if ( aDestId == 0 ) - { - return CreateDestinationL( aName ); - } - - // Check if there already exists a destination with the same Id - RArray destIdArray = RArray( KCmArrayBigGranularity ); - iImplementation->AllDestinationsL( destIdArray ); - for ( TInt i = 0; i < destIdArray.Count(); i++ ) - { - if ( aDestId > 0 && aDestId < 255 ) - { - aDestId = aDestId + KCmDefaultDestinationAPTagId; - } - else if ( aDestId < KCmDefaultDestinationAPTagId+1 - && ( aDestId > ( KCmDefaultDestinationAPTagId+255 ) ) ) - { - User::Leave( KErrArgument ); - } - if ( aDestId == destIdArray[i] ) - { - destIdArray.Close(); - User::Leave( KErrAlreadyExists ); - } - } - destIdArray.Close(); - - RCmDestinationExt dest; - - CCmDestinationImpl* destImp = - iImplementation->CreateDestinationL( aName, - aDestId ); - dest.iDestinatonData = destImp->GetData(); - dest.iDestinatonData->IncrementRefCounter(); - delete destImp; - - return dest; - } - -// ----------------------------------------------------------------------------- -// RCmManagerExt::CreateConnectionMethodL() -// ----------------------------------------------------------------------------- -// -EXPORT_C RCmConnectionMethodExt RCmManagerExt::CreateConnectionMethodL( - TUint32 aImplementationUid, - TUint32 aConnMethodId ) - { - if ( aConnMethodId == 0 ) - { - return CreateConnectionMethodL( aImplementationUid ); - } - - RCmConnectionMethodExt cm; - - CCmPluginBase* cM = - iImplementation->CreateConnectionMethodL( aImplementationUid, - aConnMethodId ); - cm.iImplementation = cM->Plugin(); - cm.iImplementation->IncrementRefCounter(); - delete cM; - - return cm; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmmanagerimpl.cpp --- a/cmmanager/cmmgr/Framework/Src/cmmanagerimpl.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3051 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmManagerImpl. -* -*/ - -#include "cmmanagerimpl.h" -#include -#include -#include -#include -#include "cmdestinationimpl.h" -#include "cmtransactionhandler.h" -#include "cmlogger.h" -#include "cmmanager.hrh" -#include -#include -#include -#include "cmobjectpool.h" -#include "cmcommsdatnotifier.h" - -#include -#include -#include // CCDWlanServiceRecord -#include -#include -#include -#include // BaflUtils -#include // resource -#include -#include // For REComSession -#include - -#include // icons -#include - -#include -#include - -using namespace CMManager; -using namespace CommsDat; - -// CONSTANTS - -const TInt KResFileGranularity = 5; -const TInt KPluginGranularity = 3; -// if a CmId is grater than KMaxIapId, than it has no iap record -// Otherwise cmId is the same as the IapId -const TUint32 KMaxIapID = 255; -// Safety margin when checking disk space -const TUint32 KBytesToWrite = 8000; - -const TUint32 KEndOfArray = KMaxTUint; -/** -* This array lists all the bearerspecific attributes. -* The bearerspecific attributes can be queried via both -* the manager interface's and connection method interface's ::Get functions. -*/ -static const TUint32 KBearerSpecificAttributes[]= - { - /** - */ - ECmCoverage, - ECmDefaultPriority, - ECmDestination, - ECmBearerHasUi, - ECmIPv6Supported, - ECmDefaultUiPriority, - ECmBearerIcon, - ECmBearerAvailableIcon, - ECmBearerAvailableName, - ECmBearerSupportedName, - ECmBearerAvailableText, - ECmBearerNamePopupNote, - ECmCommsDBBearerType, - ECmBearerSettingName, - ECmVirtual, - ECmExtensionLevel, - ECmAddToAvailableList, - KEndOfArray - }; - -// ----------------------------------------------------------------------------- -// Test functions -// ----------------------------------------------------------------------------- -// -/*#ifdef _DEBUG -void DumIapTableL( CMDBSession& aSession ) - { - CMDBRecordSet* ptrRecordSet = - new (ELeave) CMDBRecordSet( KCDTIdIAPRecord ); - CleanupStack::PushL( ptrRecordSet ); - - TRAP_IGNORE( ptrRecordSet->LoadL( aSession ) ); - - TInt iapRecords = ptrRecordSet->iRecords.Count(); - CLOG_WRITE_1_PTR( NULL, "Dumping IAP Table\nNo. of IAPs: [%d]", iapRecords ); - for ( TInt i = 0; i < iapRecords; i++ ) - { - CCDIAPRecord* iapRecord = (*ptrRecordSet)[i]; - - CLOG_WRITE_4_PTR( NULL, "Rec id:[%d] - Name: [%S] - Service Type: [%S] - Bearer Type: [%S]", - iapRecord->RecordId(), - &FIELD_TO_TDESC( iapRecord->iRecordName ), - &FIELD_TO_TDESC( iapRecord->iServiceType ), - &FIELD_TO_TDESC( iapRecord->iBearerType ) - ); - } - - CleanupStack::PopAndDestroy( ptrRecordSet ); - } -#endif */ // _DEBUG - -//============================================================================= -// CONSTRUCTION / DESTRUCTION API -//============================================================================= -// - -//----------------------------------------------------------------------------- -// CCmManagerImpl::NewL() -//----------------------------------------------------------------------------- -// -CCmManagerImpl* CCmManagerImpl::NewL( TBool aCreateTables ) - { - CCmManagerImpl* self = new (ELeave) CCmManagerImpl(); - CleanupStack::PushL( self ); - self->iCreateTables = aCreateTables; - self->ConstructL(); - CleanupStack::Pop( self ); // self - - return self; - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::CCmManagerImpl() -//----------------------------------------------------------------------------- -// -CCmManagerImpl::CCmManagerImpl() -:iDefConnSupported(EFalse),iCreateTables(ETrue) - { - CLOG_CREATE; - - Dll::SetTls( this ); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::CCmManagerImpl() -//----------------------------------------------------------------------------- -// -CCmManagerImpl::~CCmManagerImpl() - { - CLOG_WRITE( "CCmManagerImpl::~CCmManagerImpl" ); - - if ( iBearerPriorityArray ) - { - CleanupGlobalPriorityArray( *iBearerPriorityArray ); - delete iBearerPriorityArray; - } - - if ( iPlugins ) - { - iPlugins->ResetAndDestroy(); - delete iPlugins; - } - - - if ( iResourceFiles ) - { - TInt resCount = iResourceFiles->Count(); - for ( TInt i = 0; i < resCount; ++i ) - { - // close the resource file - (*iResourceFiles)[0]->iFile.Close(); - // delete the structure - delete (*iResourceFiles)[0]; - // delete array item - iResourceFiles->Delete( 0 ); - } - - iResourceFiles->Reset(); - delete iResourceFiles; - } - - iFs.Close(); - - delete iPluginImpl; - - delete &Session(); - delete iTrans; - - if( iIsFeatureManagerInitialised ) - { - FeatureManager::UnInitializeLib(); - } - - REComSession::FinalClose(); - - delete iObjectPool; - - delete iCommsDatIapNotifier; - delete iCommsDatSnapNotifier; - - CLOG_CLOSE; - } - - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::CheckTablesL() -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::CheckTablesL() - { - LOGGER_ENTERFN( "CCmManagerImpl::CheckDestinationNetworkTableL" ); - - TInt err( 0 ); - - CLOG_WRITE( "Destination network" ); - if (iCreateTables) - { - TRAP( err, iDestinationTableId = - CCDDataMobilitySelectionPolicyRecord::TableIdL( Session() )); - CLOG_WRITE_1( "err: [%d]", err ); - if( err == KErrNotFound ) - { - iDestinationTableId = - CCDDataMobilitySelectionPolicyRecord::CreateTableL( Session() ); - } - else - { - User::LeaveIfError( err ); - } - } - else - { - iDestinationTableId = - CCDDataMobilitySelectionPolicyRecord::TableIdL( Session() ); - } - - CLOG_WRITE( "Global Bearer Type Priorization Table" ); - TRAP( err, iBearerTypePriorizationTableId = - CCDGlobalBearerTypePriorizationRecord::TableIdL( Session() ) ); - CLOG_WRITE_1( "err: [%d]", err ); - if( err == KErrNotFound ) - { - iBearerTypePriorizationTableId = - CCDGlobalBearerTypePriorizationRecord::CreateTableL( Session() ); - } - else - { - User::LeaveIfError( err ); - } - - CLOG_WRITE( "Destination network - Icon table" ); - TRAP( err, iIconTableId = CCDSNAPMetadataRecord::TableIdL( Session() ) ); - if( err == KErrNotFound ) - { - iIconTableId = CCDSNAPMetadataRecord::CreateTableL( Session() ); - } - else - { - User::LeaveIfError( err ); - } - - CLOG_WRITE( "Seamlessness table" ); - TRAP( err, iSeamlessnessTableId = CCDIAPMetadataRecord::TableIdL( Session() ) ); - CLOG_WRITE_1( "err: [%d]", err ); - if( err == KErrNotFound ) - { - iSeamlessnessTableId = CCDIAPMetadataRecord::CreateTableL( Session() ); - } - else - { - User::LeaveIfError( err ); - } - if ( IsDefConnSupported() ) - { - CLOG_WRITE( "Default connection table" ); - TRAP( err, iDefConnTableId = CCDDefConnRecord::TableIdL( Session() ) ); - CLOG_WRITE_1( "err: [%d]", err ); - if( err == KErrNotFound ) - { - iDefConnTableId = CCDDefConnRecord::CreateTableL( Session() ); - } - else - { - User::LeaveIfError( err ); - } - } - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::CreateBearerPriorityArrayL() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::CreateBearerPriorityArrayL() - { - LOGGER_ENTERFN( "CCmManagerImpl:CreateBearerPriorityArray" ); - - iBearerPriorityArray = - new ( ELeave ) RArray( KCmArrayBigGranularity ); - - CMDBRecordSet* bpRS = - new (ELeave) CMDBRecordSet( - iBearerTypePriorizationTableId ); - CleanupStack::PushL( bpRS ); - - OpenTransactionLC(); - TRAP_IGNORE( bpRS->LoadL( Session() ) ); - RollbackTransaction(); - - TInt bpCount = bpRS->iRecords.Count(); - TInt i( 0 ); - - while ( i < bpCount ) // loop the Bearer Priority table - { - // Bearer Priority record ID - HBufC* bpServiceType = QUERY_HBUFC_FIELD( (*bpRS)[i], - KCDTIdGlobalServiceType ); - - TInt bpPriority = ( QUERY_INT_FIELD( (*bpRS)[i], - KCDTIdGlobalServicePriority ) ); - TInt uiPriority = ( QUERY_INT_FIELD( (*bpRS)[i], - KCDTIdGlobalServiceUIPriority ) ); - CLOG_WRITE( "Bearer Priority Table Values" ); - CLOG_WRITE_1( "Service Type: [%S]", bpServiceType ); - CLOG_WRITE_1( "Bearer Priority: [%d]", bpPriority ); - CLOG_WRITE_1( "UI Priority: [%d]", uiPriority ); - TBearerPriority bp; - bp.iServiceType = bpServiceType->AllocL(); - bp.iPriority = bpPriority; - bp.iUIPriority = uiPriority; - iBearerPriorityArray->AppendL( bp ); - i++; - } - - CleanupStack::PopAndDestroy( bpRS ); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::BearerPriorityArrayL() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::BearerPriorityArrayL( RArray& aArray ) const - { - LOGGER_ENTERFN( "CCmManagerImpl:BearerPriorityArray" ); - TRAPD( err, CopyBearerPriorityArrayL( aArray ) ); - if( err ) - // in case of any problem we clean up this array - { - User::Leave( err ); - } - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::CopyBearerPriorityArrayL() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::CopyBearerPriorityArrayL( - RArray& aArray ) const - { - LOGGER_ENTERFN( "CCmManagerImpl:BearerPriorityArray" ); - for ( TInt i = 0; i < iBearerPriorityArray->Count(); i++ ) - { - TBearerPriority item; - - TBearerPriority* orgItem = &(*iBearerPriorityArray)[i]; - - item.iServiceType = HBufC::NewLC( orgItem->iServiceType->Length() ); - item.iServiceType->Des().Copy( *orgItem->iServiceType ); - item.iPriority = orgItem->iPriority; - item.iUIPriority = orgItem->iUIPriority; - - User::LeaveIfError( aArray.Append( item ) ); - - CleanupStack::Pop(); // item->iServiceType - } - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::UpdateBearerPriorityArrayL() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::UpdateBearerPriorityArrayL( - const RArray& aArray ) - { - LOGGER_ENTERFN( "CCmManagerImpl::UpdateBearerPriorityArray" ); - - OpenTransactionLC(); - - CMDBRecordSet* bpRS = new (ELeave) - CMDBRecordSet( iBearerTypePriorizationTableId ); - CleanupStack::PushL( bpRS ); // 1 - TRAP_IGNORE( bpRS->LoadL( Session() ) ); - - // Delete the old record - for ( TInt i = 0; i < bpRS->iRecords.Count(); ++i ) - { - bpRS->iRecords[i]->DeleteL( Session() ); - } - - CleanupGlobalPriorityArray( *iBearerPriorityArray ); - - CleanupStack::PopAndDestroy( bpRS ); - bpRS = NULL; - - // Add the new content - CCmBearerPriRec* bpRcd = - new (ELeave) CCmBearerPriRec( iBearerTypePriorizationTableId ); - CleanupStack::PushL( bpRcd ); // 2 - - CLOG_WRITE( "Store bearer info to table" ); - for ( TInt i = 0; i < aArray.Count(); ++i ) - { - bpRcd->SetRecordId( KCDNewRecordRequest ); - - HBufC* serviceTypeVal = aArray[i].iServiceType; - TInt priorityVal = aArray[i].iPriority; - TInt uiPriorityVal = aArray[i].iUIPriority; - - CLOG_WRITE_FORMAT( "Set service type: [%S ]", serviceTypeVal ); - SET_HBUFC_FIELD( bpRcd, - KCDTIdGlobalServiceType, - serviceTypeVal ); - CLOG_WRITE_1( "Set priority: [%d]", priorityVal ); - SET_INT_FIELD( bpRcd, - KCDTIdGlobalServicePriority, - priorityVal ); - CLOG_WRITE_1( "Set uipriority: [%d]", uiPriorityVal ); - SET_INT_FIELD( bpRcd, - KCDTIdGlobalServiceUIPriority, - uiPriorityVal ); - bpRcd->StoreL( Session() ); - - TBearerPriority item; - - item.iServiceType = serviceTypeVal->AllocLC(); - item.iPriority = priorityVal; - item.iUIPriority = uiPriorityVal; - iBearerPriorityArray->AppendL( item ); - CleanupStack::Pop( item.iServiceType ); - } - - CleanupStack::PopAndDestroy( bpRcd ); - - CommitTransactionL( KErrNone ); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::GlobalBearerPriority() -//----------------------------------------------------------------------------- -// -TInt CCmManagerImpl::GlobalBearerPriority( TBool aUiPriority, - const TDesC& aServiceType ) const - { - for ( TInt i = 0; i < iBearerPriorityArray->Count(); ++i ) - { - if ( !aServiceType.CompareF( *(*iBearerPriorityArray)[i].iServiceType ) ) - { - if( aUiPriority ) - { - return (*iBearerPriorityArray)[i].iUIPriority; - } - else - { - return (*iBearerPriorityArray)[i].iPriority; - } - } - } - - return KDataMobilitySelectionPolicyPriorityWildCard; - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::CleanupGlobalPriorityArray() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::CleanupGlobalPriorityArray( - RArray& aArray ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::CleanupGlobalPriorityArray" ); - - for ( TInt i = 0; i < aArray.Count(); ++i ) - { - delete aArray[i].iServiceType; - } - - aArray.Reset(); - aArray.Close(); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::AddResourceFileL() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::AddResourceFileL( TFileName& aName ) - { - LOGGER_ENTERFN( "CCmManagerImpl::AddResourceFileL" ); - - TInt index = FindResourceFile( aName ); - - if ( index != KErrNotFound ) - { - ++(*iResourceFiles)[index]->iRefs; - return; - } - - TResourceFiles* newRes = new (ELeave) TResourceFiles; - CleanupStack::PushL( newRes ); - - RResourceFile resFile; - resFile.OpenL( iFs, aName ); - CleanupClosePushL( resFile ); - - resFile.ConfirmSignatureL(0); - - newRes->iFile = resFile; - newRes->iFName.Copy( aName ); - newRes->iRefs = 1; // 1 reference to this resource file - - iResourceFiles->AppendL( newRes ); - - CleanupStack::Pop( 2 ); // resFile, newRes - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::RemoveResourceFile() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::RemoveResourceFile( TFileName& aName ) - { - LOGGER_ENTERFN( "CCmManagerImpl::RemoveResourceFile" ); - - TInt index = FindResourceFile( aName ); - - if ( index == KErrNotFound ) - { - return; - } - - if ( !--(*iResourceFiles)[index]->iRefs ) - // it was the last reference - { - (*iResourceFiles)[index]->iFile.Close(); - delete (*iResourceFiles)[index]; - - iResourceFiles->Delete( index ); - } - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::FindResourceFile() -//----------------------------------------------------------------------------- -// -TInt CCmManagerImpl::FindResourceFile( TFileName& aName ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::FindResourceFile" ); - - BaflUtils::NearestLanguageFile( iFs, aName ); - - for ( TInt i = 0; i < iResourceFiles->Count(); ++i ) - { - if ( !(*iResourceFiles)[i]->iFName.CompareF( aName ) ) - { - return i; - } - } - - return KErrNotFound; - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::AllocReadL() -//----------------------------------------------------------------------------- -// -HBufC* CCmManagerImpl::AllocReadL( TInt aResourceId ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::AllocReadL" ); - - HBufC* retVal = NULL; - - // Scan all resource files to find owner - for (TInt i=0; i < iResourceFiles->Count(); i++) - { - RResourceFile& file=(*iResourceFiles)[i]->iFile; - if ( file.OwnsResourceId(aResourceId) ) - { - HBufC8* readBuffer = file.AllocReadLC( aResourceId ); - // as we are expecting HBufC16... - const TPtrC16 ptrReadBuffer( (TText16*) readBuffer->Ptr(), - readBuffer->Length() >> 1 ); - retVal=HBufC16::NewL( ptrReadBuffer.Length() ); - retVal->Des().Copy( ptrReadBuffer ); - CleanupStack::PopAndDestroy( readBuffer ); // readBuffer - - // exit from loop - break; - } - } - - return retVal; - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::ConstructL() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::ConstructL() - { - LOGGER_ENTERFN( "CCmManagerImpl::ConstructL" ); - CLOG_NAME_1( _L("ManagerImpl_0x%x"), this ); - - iObjectPool = new (ELeave) CCMObjectPool(*this); - - FeatureManager::InitializeLibL(); - iIsFeatureManagerInitialised = ETrue; - iHelp = FeatureManager::FeatureSupported( KFeatureIdHelp ); - iDefConnSupported = ETrue; - //iDefConnSupported = FeatureManager::FeatureSupported( KFeatureIdDefaultConnection ); - iWLan = FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ); - - CMDBSession* db = CMDBSession::NewL( KCDVersion1_2 ); - - iTrans = CCmTransactionHandler::NewL( *db ); - CLOG_ATTACH( iTrans, this ); - - User::LeaveIfError( iFs.Connect() ); - - iResourceFiles = new (ELeave) CArrayPtrFlat( - KResFileGranularity ); - - TParse fp; - TInt err = fp.Set( KACMManagerResDirAndFileName, - &KDC_RESOURCE_FILES_DIR, - NULL ); - CLOG_WRITE_1( "Set: [%d]", err ); - if ( err != KErrNone) - { - User::Leave( err ); - } - - TFileName fName; - - fName.Copy( fp.FullName() ); - - AddResourceFileL( fName ); - - CheckTablesL(); - CreateBearerPriorityArrayL(); - - BuildPluginArrayL(); - - TCmPluginInitParam params( *this ); - - params.iParentDest = NULL; - iPluginImpl = CCmConnectionMethodInfo::NewL( ¶ms ); - CLOG_ATTACH( iPluginImpl, this ); - } - -// --------------------------------------------------------------------------- -// CCmManagerImpl::OpenTransactionLC -// --------------------------------------------------------------------------- -// -void CCmManagerImpl::OpenTransactionLC( TBool aSetAttribs ) - { - LOGGER_ENTERFN( "CCmManagerImpl::OpenTransactionL" ); - - iTrans->OpenTransactionLC( aSetAttribs ); - } - -// --------------------------------------------------------------------------- -// CCmDestinationImpl::CommitTransactionL -// --------------------------------------------------------------------------- -// -void CCmManagerImpl::CommitTransactionL( TInt aError ) - { - LOGGER_ENTERFN( "CCmManagerImpl::CommitTransactionL" ); - - iTrans->CommitTransactionL( aError ); - } - -// --------------------------------------------------------------------------- -// CCmDestinationImpl::CommitTransactionL -// --------------------------------------------------------------------------- -// -void CCmManagerImpl::RollbackTransaction() - { - LOGGER_ENTERFN( "CCmManagerImpl::RollbackTransaction" ); - CleanupStack::Pop( iTrans ); - iTrans->Close(); - } - -// --------------------------------------------------------------------------- -// CCmDestinationImpl::StartCommsDatNotifier -// --------------------------------------------------------------------------- -// -void CCmManagerImpl::StartCommsDatNotifierL() - { - // Two instances of class CCmCommsDatNotifier are created here and - // referred by all watchers in CmManager. One is to watch change in Iap Table - // and the other is to watch change in Snap Table. - iCommsDatIapNotifier = CCmCommsDatNotifier::NewL( KCDTIdIAPRecord ); - - TUint32 snapTableId = GetSnapTableIdL(); - iCommsDatSnapNotifier = CCmCommsDatNotifier::NewL( snapTableId ); - } - -//============================================================================= -// CREATION / DELETION API -//============================================================================= -// - -//----------------------------------------------------------------------------- -// CCmManagerImpl::CreateDestinationL( const TDesC& aName ) -//----------------------------------------------------------------------------- -// -CCmDestinationImpl* CCmManagerImpl::CreateDestinationL( const TDesC& aName ) - { - LOGGER_ENTERFN( "CCmManagerImpl::CreateDestinationL" ); - - CheckAvailableSpaceL(); - - if ( aName.Length() == 0 ) - { - User::Leave( KErrArgument ); - } - - return iObjectPool->GetDestinationL( aName ); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::CreateDestinationL( const TDesC& aName, TUint32 -// aDestId ) -//----------------------------------------------------------------------------- -// -CCmDestinationImpl* CCmManagerImpl::CreateDestinationL( - const TDesC& aName, - TUint32 aDestId ) - { - LOGGER_ENTERFN( "CCmManagerImpl::CreateDestinationL" ); - - CheckAvailableSpaceL(); - - if ( aName.Length() == 0 ) - { - User::Leave( KErrArgument ); - } - - if ( aDestId == 0 ) - { - return CreateDestinationL( aName ); - } - - return iObjectPool->CreateDestinationL( aName, aDestId ); - } - - -//----------------------------------------------------------------------------- -// CCmManagerImpl::DestinationUpdated( CCmDestinationImpl* aDestination ) -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::DestinationUpdated( CCmDestinationImpl* aDestination ) - { - LOGGER_ENTERFN( "CCmManagerImpl::DestinationUpdatedL" ); - iObjectPool->DestinationUpdated( aDestination ); - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::CreateConnectionMethodL() -// -------------------------------------------------------------------------- -// -CCmPluginBase* - CCmManagerImpl::CreateConnectionMethodL( CCmPluginBaseEng* pluginBaseEng ) - { - LOGGER_ENTERFN( "CCmManagerImpl::CreateConnectionMethodL 2" ); - - CheckAvailableSpaceL(); - - return iObjectPool->CreateConnectionMethodL( pluginBaseEng ); - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::InsertConnectionMethodL() -// -------------------------------------------------------------------------- -// -void CCmManagerImpl::InsertConnectionMethodL( CCmPluginBaseEng* pluginBaseEng ) - { - iObjectPool->InsertConnectionMethodL( pluginBaseEng ); - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::CreateConnectionMethodL() -// -------------------------------------------------------------------------- -// -CCmPluginBase* - CCmManagerImpl::CreateConnectionMethodL( TUint32 aImplementationUid, - CCmDestinationImpl* aParentDestination ) - { - LOGGER_ENTERFN( "CCmManagerImpl::CreateConnectionMethodL" ); - - CheckAvailableSpaceL(); - - TCmPluginInitParam params( *this ); - if (aParentDestination) - { - params.iParentDest = aParentDestination->Id(); - } - - return iObjectPool->CreateConnectionMethodL( aImplementationUid, params ); - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::CreateConnectionMethodL() -// -------------------------------------------------------------------------- -// -CCmPluginBase* - CCmManagerImpl::CreateConnectionMethodL( TUint32 aImplementationUid, - TUint32 aConnMethodId, - CCmDestinationImpl* aParentDestination ) - { - LOGGER_ENTERFN( "CCmManagerImpl::CreateConnectionMethodL" ); - - CheckAvailableSpaceL(); - - TCmPluginInitParam params( *this ); - if ( aParentDestination ) - { - params.iParentDest = aParentDestination->Id(); - } - - return iObjectPool->CreateConnectionMethodL( aImplementationUid, - params, - aConnMethodId); - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::DoCreateConnectionMethodL() -// -------------------------------------------------------------------------- -// -CCmPluginBaseEng* - CCmManagerImpl::DoCreateConnectionMethodL( TUint32 aImplementationUid, - TCmPluginInitParam& aParams ) - { - LOGGER_ENTERFN( "CCmManagerImpl::DoCreateConnectionMethodL" ); - - const TUid KMCMmImplementationUid = { aImplementationUid }; - TAny* ptr = REComSession::CreateImplementationL( KMCMmImplementationUid, - _FOFF( CCmPluginBaseEng, - iDtor_ID_Key ), - (TAny*)&aParams ); - - CCmPluginBaseEng* plugin = STATIC_CAST( CCmPluginBaseEng*, ptr ); - CleanupStack::PushL( plugin ); - - plugin->CreateNewL(); - plugin->SetIdValidity(EFalse); - CleanupStack::Pop( plugin ); // plugin - - return plugin; - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::DoCreateConnectionMethodL() -// -------------------------------------------------------------------------- -// -CCmPluginBaseEng* - CCmManagerImpl::DoCreateConnectionMethodL( TUint32 aImplementationUid, - TCmPluginInitParam& aParams, - TUint32 aConnMethodId ) - { - LOGGER_ENTERFN( "CCmManagerImpl::DoCreateConnectionMethodL" ); - - const TUid KMCMmImplementationUid = { aImplementationUid }; - TAny* ptr = REComSession::CreateImplementationL( KMCMmImplementationUid, - _FOFF( CCmPluginBaseEng, - iDtor_ID_Key ), - (TAny*)&aParams ); - - CCmPluginBaseEng* plugin = STATIC_CAST( CCmPluginBaseEng*, ptr ); - CleanupStack::PushL( plugin ); - - plugin->CreateNewL(); - plugin->SetIdValidity( EFalse ); - plugin->SetPreDefinedId( aConnMethodId ); - CleanupStack::Pop( plugin ); // plugin - - return plugin; - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::ConnectionMethodL( TUint aId ) -//----------------------------------------------------------------------------- -// -EXPORT_C CCmPluginBaseEng* - CCmManagerImpl::ConnectionMethodL( TUint32 /*aCmId*/ ) - { - LOGGER_ENTERFN( "Error: Obsolete function CCmManagerImpl::ConnectionMethodL used" ); - User::Panic( _L("CMManager"), KErrNotSupported ); - return NULL; - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::GetConnectionMethodL( TUint aId ) -//----------------------------------------------------------------------------- -// -EXPORT_C CCmPluginBase* - CCmManagerImpl::GetConnectionMethodL( TUint32 aCmId ) - { - LOGGER_ENTERFN( "CCmManagerImpl::GetConnectionMethodL" ); - - CCmPluginBase* plugin = DoFindConnMethodL( aCmId, NULL ); - - return plugin; - } - - -//----------------------------------------------------------------------------- -// CCmManagerImpl::AppendUncatCmListL -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::AppendUncatCmListL( RPointerArray& aCMArray, - TBool aCheckBearerType, - TBool aLegacyOnly, - TBool aEasyWlan, - TBool aSortByBearer ) - { - LOGGER_ENTERFN( "CCmManagerImpl::AppendUncatCmListL" ); - - RArray cmUidArray; - CleanupClosePushL(cmUidArray); - ConnectionMethodL(cmUidArray, aCheckBearerType, aLegacyOnly, aEasyWlan, aSortByBearer); - AppendCmListFromUidsL( cmUidArray, aCMArray ); - - CleanupStack::PopAndDestroy(&cmUidArray); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::AppendUncatCmListLC -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::AppendUncatCmListLC( RPointerArray& aCMArray, - TBool aCheckBearerType, - TBool aLegacyOnly, - TBool aEasyWlan, - TBool aSortByBearer ) - { - LOGGER_ENTERFN( "CCmManagerImpl::AppendUncatCmListLC" ); - - AppendUncatCmListL( aCMArray, aCheckBearerType, aLegacyOnly, aEasyWlan, aSortByBearer); - - CleanupResetAndDestroyPushL< RPointerArray >( aCMArray ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::AppendCmListLC -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::AppendCmListLC( TUint32 aDestintaionId, RPointerArray& aCMArray ) - { - LOGGER_ENTERFN( "CCmManagerImpl::AppendCmListLC" ); - - AppendCmListL( aDestintaionId, aCMArray ); - CCmManagerImpl::CleanupResetAndDestroyPushL< RPointerArray >( aCMArray ); - } - -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::AppendCmListL -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::AppendCmListL( TUint32 aDestintaionId, RPointerArray& aCMArray ) - { - LOGGER_ENTERFN( "CCmManagerImpl::AppendCmListL" ); - - CCmDestinationImpl* dest = DestinationL( aDestintaionId ); - CleanupStack::PushL(dest); - RArray cmIdList; - CleanupClosePushL(cmIdList); - dest->ConnectMethodIdArrayL( cmIdList ); - AppendCmListFromUidsL( cmIdList, aCMArray ); - CleanupStack::PopAndDestroy(&cmIdList); - CleanupStack::PopAndDestroy(dest); - } -// ----------------------------------------------------------------------------- -// CCmDestinationImpl::AppendCmListFromUidsL -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::AppendCmListFromUidsL( RArray& cmIdList, RPointerArray& aCMArray ) - { - LOGGER_ENTERFN( "CCmManagerImpl::AppendCmListFromUidsL" ); - - TInt count = cmIdList.Count(); - for ( TInt i = 0; i< count; i++ ) - { - CCmPluginBase* cm = NULL; - TRAPD( err,cm = GetConnectionMethodL( cmIdList[i] )); - if (err == KErrNone) - { - aCMArray.AppendL( cm ); - } - } - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::ConnectionMethodL -//----------------------------------------------------------------------------- -// -EXPORT_C void CCmManagerImpl::ConnectionMethodL( RArray& aCMArray, - TBool aCheckBearerType, - TBool aLegacyOnly, - TBool aEasyWlan, - TBool aSortByBearer ) - { - LOGGER_ENTERFN( "CCmManagerImpl::ConnectionMethodL" ); - - OpenTransactionLC(); - - CMDBRecordSet* ptrRecordSet = AllIapsL(); - CleanupStack::PushL( ptrRecordSet ); - - TInt iapRecords = ptrRecordSet->iRecords.Count(); - CLOG_WRITE_1_PTR( NULL, "Record num [%d]", iapRecords ); - - // Time optimization to load the entire destination table - TInt destTblId = DestinationTableId(); - CMDBRecordSet* ptrDestSet = - new (ELeave) CMDBRecordSet( - destTblId ); - CleanupStack::PushL( ptrDestSet ); - TRAP_IGNORE( ptrDestSet->LoadL( Session() ) ); - - for ( TInt i = 0; i < iapRecords; i++ ) - { - TUint32 iapId = (*ptrRecordSet)[i]->RecordId(); - CLOG_WRITE_1_PTR( NULL, "IAP ID [%d]", iapId ); - if ( aCheckBearerType ) - { - TUint32 bearerType( 0 ); - TRAPD( err, - bearerType = BearerTypeFromIapRecordL( (*ptrRecordSet)[i] )); - if ( !err && bearerType ) - { - // append the IAP id - if aLegacyOnly is ETrue, only for legacy IAPs - if ( !aLegacyOnly || - !NumOfConnMethodReferencesL( iapId, ptrDestSet ) ) - { - if( !aEasyWlan && IsEasyWLanL( (*ptrRecordSet)[i] ) ) - { - continue; - } - - aCMArray.Append( iapId ); - } - } - } - else - { - // append the IAP id - if aLegacyOnly is ETrue, only for legacy IAPs - if ( !aLegacyOnly || - !NumOfConnMethodReferencesL( iapId, ptrDestSet ) ) - { - if( !aEasyWlan && IsEasyWLanL( (*ptrRecordSet)[i] ) ) - { - continue; - } - - aCMArray.Append( iapId ); - } - } - } - - // Re-order the array according to the global bearer ordering rules - if ( aSortByBearer ) - { - RArray bearers( KCmArrayMediumGranularity ); - CleanupClosePushL( bearers ); - SupportedBearersL( bearers ); - - TInt prevInsertedPos = -1; - for ( TInt i = 0; i < bearers.Count(); i++ ) - { - for ( TInt j = prevInsertedPos + 1; j < aCMArray.Count(); j++ ) - { - // Check if CM belongs to this bearer - TUint cmBearerId = GetConnectionMethodInfoIntL( aCMArray[j], - ECmBearerType ); - if ( cmBearerId == bearers[i] ) - { - // copy the cm id to the next 'sorted position' in the array - // the item removed will always be after the insertion position - TUint cmId = aCMArray[j]; - aCMArray.Remove(j); - aCMArray.Insert( cmId, ++prevInsertedPos ); - } - } - } - - CleanupStack::PopAndDestroy( &bearers ); - } - - CleanupStack::PopAndDestroy( 2, ptrRecordSet ); - - RollbackTransaction(); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::DoFindConnMethodL -//----------------------------------------------------------------------------- -// -CCmPluginBase* CCmManagerImpl::DoFindConnMethodL( TUint32 aCmId, - CCmDestinationImpl* aParentDest ) - { - LOGGER_ENTERFN( "CCmManagerImpl::DoFindConnMethodL" ); - return iObjectPool->GetConnectionMethodL(aCmId, aParentDest); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::FindConnMethodL -//----------------------------------------------------------------------------- -// -CCmPluginBaseEng* CCmManagerImpl::DoFindConnMethL( TUint32 aCmId, - CCmDestinationImpl* aParentDest ) - { - LOGGER_ENTERFN( "CCmManagerImpl::FindConnMethodL" ); - - // Step through each bearer to find which the CMId belongs to - CCmPluginBaseEng* plugin = NULL; - - TCmPluginInitParam params( *this ); - if (aParentDest) - { - params.iParentDest = aParentDest->Id(); - } - else - { - params.iParentDest = ParentDestinationL( aCmId ); - } - - TUint32 bearerType = BearerTypeFromCmIdL( aCmId ); - - for ( TInt i=0; iCount(); i++ ) - { - if( (*iPlugins)[i]->GetIntAttributeL( ECmBearerType ) == bearerType ) - { - plugin = (*iPlugins)[i]->CreateInstanceL( params ); - break; - } - } - - if ( !plugin ) - { - return plugin; - } - - CleanupStack::PushL( plugin ); - - plugin->LoadL( aCmId ); - - CleanupStack::Pop( plugin ); // 1 - plugin->SetIdValidity(ETrue); - - return plugin; - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::BearerTypeFromIapL( TUint aId ) -//----------------------------------------------------------------------------- -// -TUint32 CCmManagerImpl::BearerTypeFromCmIdL( TUint32 aCmId ) - { - LOGGER_ENTERFN( "CCmManagerImpl::BearerTypeFromIapL" ); - TUint32 bearerType; - if ( aCmId > KMaxIapID ) - { - bearerType = KUidEmbeddedDestination; - } - else - {//aCmId is an IapId - // Load this IAP record from the IAP table - // This is an optimization that plugins doesn't have - // to do it every time the CanHandleIapIdL() is called. - CCDIAPRecord *iapRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord)); - CleanupStack::PushL( iapRecord ); // 1 - iapRecord->SetRecordId( aCmId ); - - OpenTransactionLC(); - iapRecord->LoadL( Session() ); - RollbackTransaction(); - - bearerType = BearerTypeFromIapRecordL( iapRecord ); - - CleanupStack::PopAndDestroy( iapRecord ); // 0 - } - return bearerType; - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::BearerTypeFromIapRecordL( CCDIAPRecord* aIapRecord ) -//----------------------------------------------------------------------------- -// -TUint32 CCmManagerImpl::BearerTypeFromIapRecordL( CCDIAPRecord* aIapRecord ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::BearerTypeFromIapRecordL" ); - - CLOG_WRITE_1( "Plugin count: [%d]", iPlugins->Count() ); - - TInt err( KErrNone ); - TUint32 extLevel( 0 ); - TInt bearerType( 0 ); - TBool canHandle( EFalse ); - - // Check which bearer handles the given IAPid - for ( TInt i=0; iCount(); i++ ) - { - // a defective, or a wrong AP can't cause any trouble. - TRAP( err, canHandle = (*iPlugins)[i]->CanHandleIapIdL( aIapRecord ) ); - CLOG_WRITE_3( "plugin [%d] returned with error %d, CanH: %d", - i, err, TUint32(canHandle) ); - if ( !err && canHandle ) - { - if ( extLevel < - (*iPlugins)[i]->GetIntAttributeL( ECmExtensionLevel ) ) - { - extLevel = (*iPlugins)[i]->GetIntAttributeL(ECmExtensionLevel); - bearerType = (*iPlugins)[i]->GetIntAttributeL( ECmBearerType ); - } - } - else if ( err == KErrNoMemory ) - { - User::Leave( err ); - } - } - - if ( !bearerType ) - // No supporting plugin found. - { - CLOG_WRITE( "Plugin not found, Leaving." ); - User::Leave( KErrNotSupported ); - } - CLOG_WRITE_1( "Returning bearertype: [%d]", bearerType ); - return bearerType; - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::AllDestinationsL() -//----------------------------------------------------------------------------- -// -EXPORT_C void CCmManagerImpl::AllDestinationsL( RArray& aDestArray ) - { - LOGGER_ENTERFN( "CCmManagerImpl::AllDestinationsL" ); - - OpenTransactionLC(); - - CMDBRecordSet* destRecordSet = - new ( ELeave ) CMDBRecordSet( - iDestinationTableId ); - CleanupStack::PushL( destRecordSet ); - - TRAP_IGNORE( destRecordSet->LoadL( Session() ) ); - - iDestinationCount = destRecordSet->iRecords.Count(); - - //========================================================================= - // Step through every item in the NW Table and check whether it is linked - // in the DN_IAP table - // - for ( TInt i = 0; i < iDestinationCount; ++i ) - { - TInt nwId = QUERY_INT_FIELD( destRecordSet->iRecords[i], - KCDTIdDataMobilitySelectionPolicyNetwork ); - TBool found( EFalse ); - - for ( TInt j = 0; j < aDestArray.Count(); ++j ) - { - if ( aDestArray[j] == nwId ) - { - found = ETrue; - break; - } - } - - if ( !found ) - { - aDestArray.AppendL( nwId ); - CLOG_WRITE_2( "Dest(%d): [%d]", aDestArray.Count(), nwId ); - } - } - - CleanupStack::PopAndDestroy( destRecordSet ); - - RollbackTransaction(); - - CLOG_WRITE_1( "No. of dests found: [%d] ", aDestArray.Count() ); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::DestinationL() -//----------------------------------------------------------------------------- -// -EXPORT_C CCmDestinationImpl* CCmManagerImpl::DestinationL( TUint32 aId ) - { - LOGGER_ENTERFN( "CCmManagerImpl::DestinationL" ); - - // Create destination object - return iObjectPool->GetDestinationL( aId ); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::RemoveDestFromPool -//----------------------------------------------------------------------------- -// -EXPORT_C void CCmManagerImpl::RemoveDestFromPool( CCmDestinationImpl* aDestination ) - { - LOGGER_ENTERFN( "CCmManagerImpl::RemoveDestFromPool" ); - iObjectPool->RemoveDestination(aDestination); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::RemoveDestFromPool -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::RemoveDestFromPool( CCmDestinationData* aDestination ) - { - LOGGER_ENTERFN( "CCmManagerImpl::RemoveDestFromPool" ); - iObjectPool->RemoveDestination(aDestination); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::RemoveCMFromPool -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::RemoveCMFromPoolL( CCmPluginBaseEng* aCM ) - { - LOGGER_ENTERFN( "CCmManagerImpl::RemoveCMFromPool" ); - iObjectPool->RemoveConnectionMethodL( aCM ); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::RemoveCMFromPool -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::RemoveCMFromPoolL( CCmPluginBase* aCM ) - { - LOGGER_ENTERFN( "CCmManagerImpl::RemoveCMFromPool" ); - iObjectPool->RemoveConnectionMethodL( aCM ); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::CopyConnectionMethodL() -//----------------------------------------------------------------------------- -// -TInt CCmManagerImpl::CopyConnectionMethodL( - CCmDestinationImpl& aTargetDestination, - CCmPluginBase& aConnectionMethod ) - { - LOGGER_ENTERFN( "CCmManagerImpl::CopyConnectionMethodL" ); - - OpenTransactionLC(); - TInt index = aTargetDestination.AddConnectionMethodL( aConnectionMethod ); - aTargetDestination.UpdateL(); - CommitTransactionL( 0 ); - - return index; - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::MoveConnectionMethodL() -//----------------------------------------------------------------------------- -// -TInt CCmManagerImpl::MoveConnectionMethodL( - CCmDestinationImpl& aSourceDestination, - CCmDestinationImpl& aTargetDestination, - CCmPluginBase& aConnectionMethod ) - { - LOGGER_ENTERFN( "CCmManagerImpl::MoveConnectionMethodL" ); - - OpenTransactionLC(); - - TInt index = CopyConnectionMethodL( aTargetDestination, aConnectionMethod ); - aSourceDestination.RemoveConnectionMethodL( aConnectionMethod ); - aSourceDestination.UpdateL(); - - CommitTransactionL( KErrNone ); - - return index; - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::RemoveConnectionMethodL() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::RemoveConnectionMethodL( - CCmDestinationImpl& aDestination, - CCmPluginBase& aConnectionMethod ) - { - LOGGER_ENTERFN( "CCmManagerImpl::RemoveConnectionMethodL" ); - - OpenTransactionLC(); - aDestination.RemoveConnectionMethodL( aConnectionMethod ); - aDestination.UpdateL(); - CommitTransactionL( 0 ); - } - -//----------------------------------------------------------------------------- -// RCmManagerExt::SupportedBearers() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::SupportedBearersL( RArray& aArray ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::SupportedBearersL" ); - - for ( TInt i = 0; i < iPlugins->Count(); i++ ) - { - TUint32 bearerType( (*iPlugins)[i]->GetIntAttributeL(ECmBearerType) ); - - if ( KUidEmbeddedDestination != bearerType ) - { - aArray.AppendL( (*iPlugins)[i]->GetIntAttributeL(ECmBearerType) ); - } - } - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::NumOfConnMethodReferencesL() -// ----------------------------------------------------------------------------- -// -TUint32 CCmManagerImpl::NumOfConnMethodReferencesL( - TUint32 aId, - CMDBRecordSet* aRecSet ) - { - LOGGER_ENTERFN( "CCmManagerImpl::NumOfConnMethodReferencesL" ); - - OpenTransactionLC(); - - TUint32 retVal( 0 ); - - if ( aRecSet ) - { - TMDBElementId id( IAP_ELEMENT_ID(aId) ); - - for ( TInt i = 0; i < aRecSet->iRecords.Count(); ++i ) - { - if ( QUERY_UINT32_FIELD( (*aRecSet)[i], - KCDTIdDataMobilitySelectionPolicyIAP ) == - id ) - { - ++retVal; - } - } - } - else - { - // Just to test how many record we have - TInt destTblId = DestinationTableId(); - CMDBRecordSet* ptrRecordSet = - new (ELeave) CMDBRecordSet( - destTblId ); - CleanupStack::PushL( ptrRecordSet ); - - // Prime record - CCDDataMobilitySelectionPolicyRecord* record = - new (ELeave) CCDDataMobilitySelectionPolicyRecord( - DestinationTableId() ); - CleanupStack::PushL( record ); - - record->iIAP = IAP_ELEMENT_ID( aId ); - ptrRecordSet->iRecords.AppendL( record ); - - CleanupStack::Pop( record ); - record = NULL; - - if ( ptrRecordSet->FindL(Session()) ) - { - // we have a match - retVal = ptrRecordSet->iRecords.Count(); - CLOG_WRITE_1( "Found: [%d]", retVal ); - } - else - { - CLOG_WRITE( "Nothing" ); - } - - CleanupStack::PopAndDestroy( ); // ptrRecordSet - } - - RollbackTransaction(); - - return retVal; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::HasUnprotectedDestinationsL -// ----------------------------------------------------------------------------- -// -TBool CCmManagerImpl::HasUnprotectedDestinationsL() - { - LOGGER_ENTERFN( "CCmManagerImpl::HasUnprotectedDestinationsL" ); - - TBool hasUnprotectedDests( EFalse ); - - RArray destIdArray( KCmArrayBigGranularity ); - AllDestinationsL( destIdArray ); - CleanupClosePushL( destIdArray ); - - CCmDestinationImpl* dest = NULL; - for ( TInt i = 0; i < destIdArray.Count(); i++ ) - { - dest = DestinationL( destIdArray[i] ); - CleanupStack::PushL( dest ); - if ( dest->ProtectionLevel() != EProtLevel1 ) - { - hasUnprotectedDests = ETrue; - CleanupStack::PopAndDestroy( dest ); - break; - } - CleanupStack::PopAndDestroy( dest ); - } - - CleanupStack::PopAndDestroy( &destIdArray ); - - return hasUnprotectedDests; - } - - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::BuildPluginArrayL() -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::BuildPluginArrayL() - { - LOGGER_ENTERFN( "CCmManagerImpl::BuildPluginArrayL" ); - iPlugins = new (ELeave) CArrayPtrFlat( - KPluginGranularity ); - - // Get a list of all the bearer types - RImplInfoPtrArray implArray; - REComSession::ListImplementationsL( TUid::Uid( KCMPluginInterfaceUid ), - implArray ); - - CleanupClosePushL( implArray ); // 1 - - CCmPluginBaseEng* plugin = NULL; - for ( TInt i=0; iImplementationUid(), - _FOFF( CCmPluginBaseEng, - iDtor_ID_Key ), - (TAny*)¶ms )) ); - - if ( !err ) - { - CLOG_ATTACH( plugin, this ); - - CleanupStack::PushL( plugin ); - - TBool inserted( EFalse ); - TInt defaultPriority( KDataMobilitySelectionPolicyPriorityWildCard ); - - // No UI priority -> wildcard - TRAP_IGNORE( defaultPriority = plugin->GetIntAttributeL( ECmDefaultUiPriority ) ); - - for( TInt j( 0 ); j < iPlugins->Count(); ++j ) - { - if( defaultPriority > (*iPlugins)[j]->GetIntAttributeL( ECmDefaultUiPriority ) ) - { - continue; - } - else if( defaultPriority == (*iPlugins)[j]->GetIntAttributeL( ECmDefaultUiPriority ) ) - { - if( plugin->GetIntAttributeL( ECmExtensionLevel ) > - (*iPlugins)[j]->GetIntAttributeL( ECmExtensionLevel ) ) - { - iPlugins->InsertL( j, plugin ); - inserted = ETrue; - break; - } - } - else - { - iPlugins->InsertL( j, plugin ); - inserted = ETrue; - break; - } - } - - if( !inserted ) - { - iPlugins->AppendL( plugin ); - } - - CleanupStack::Pop( plugin ); - } - } - - implArray.ResetAndDestroy(); - - CleanupStack::PopAndDestroy(); // implArray; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::GetBearerInfoIntL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint32 CCmManagerImpl::GetBearerInfoIntL( TUint32 aBearerType, - TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::GetBearerInfoIntL" ); - if( !IsBearerSpecific( aAttribute ) ) - { - User::Leave( KErrNotSupported ); - } - - for ( TInt i = 0; i < iPlugins->Count(); ++i ) - { - if ( aBearerType == (*iPlugins)[i]->GetIntAttributeL( ECmBearerType ) ) - { - return (*iPlugins)[i]->GetIntAttributeL( aAttribute ); - } - } - - User::Leave( KErrNotSupported ); - - return 0; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::GetBearerInfoBoolL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CCmManagerImpl::GetBearerInfoBoolL( TUint32 aBearerType, - TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::GetBearerInfoBoolL" ); - if( !IsBearerSpecific( aAttribute ) ) - { - User::Leave( KErrNotSupported ); - } - - for ( TInt i = 0; i < iPlugins->Count(); ++i ) - { - if ( aBearerType == (*iPlugins)[i]->GetIntAttributeL( ECmBearerType ) ) - { - return (*iPlugins)[i]->GetBoolAttributeL( aAttribute ); - } - } - - User::Leave( KErrNotSupported ); - - return EFalse; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::GetBearerInfoStringL() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC* CCmManagerImpl::GetBearerInfoStringL( TUint32 aBearerType, - TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::GetBearerInfoStringL" ); - if( !IsBearerSpecific( aAttribute ) ) - { - User::Leave( KErrNotSupported ); - } - - for ( TInt i = 0; i < iPlugins->Count(); ++i ) - { - if ( aBearerType == (*iPlugins)[i]->GetIntAttributeL( ECmBearerType ) ) - { - return (*iPlugins)[i]->GetStringAttributeL( aAttribute ); - } - } - - User::Leave( KErrNotSupported ); - - return NULL; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::GetBearerInfoString8L() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC8* CCmManagerImpl::GetBearerInfoString8L( TUint32 aBearerType, - TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::GetBearerInfoStringL" ); - if( !IsBearerSpecific( aAttribute ) ) - { - User::Leave( KErrNotSupported ); - } - - for ( TInt i = 0; i < iPlugins->Count(); ++i ) - { - if ( aBearerType == (*iPlugins)[i]->GetIntAttributeL( ECmBearerType ) ) - { - return (*iPlugins)[i]->GetString8AttributeL( aAttribute ); - } - } - - User::Leave( KErrNotSupported ); - - return NULL; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::GetConnectionMethodInfoIntL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint32 CCmManagerImpl::GetConnectionMethodInfoIntL( TUint32 aCmId, - TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::GetConnectionMethodInfoIntL" ); - - if ( aAttribute == ECmBearerType ) - { - return const_cast(this)->BearerTypeFromCmIdL( aCmId ); - } - else - { - return iPluginImpl->GetConnectionInfoIntL( aCmId, aAttribute ); - } - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::GetConnectionMethodInfoBoolL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CCmManagerImpl::GetConnectionMethodInfoBoolL( TUint32 aCmId, - TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::GetConnectionMethodInfoBoolL" ); - - TBool retval = EFalse; - if ( aAttribute == ECmVirtual ) - { - TUint32 b = GetConnectionMethodInfoIntL( aCmId, ECmBearerType ); - retval = GetBearerInfoBoolL( b, ECmVirtual ); - } - else - { - retval = iPluginImpl->GetConnectionInfoBoolL( aCmId, aAttribute ); - } - return retval; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::GetConnectionMethodInfoStringL() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC* CCmManagerImpl::GetConnectionMethodInfoStringL( - TUint32 aCmId, - TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::GetConnectionMethodInfoStringL" ); - - return iPluginImpl->GetConnectionInfoStringL( aCmId, aAttribute ); - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::GetConnectionMethodInfoStringL() -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC8* CCmManagerImpl::GetConnectionMethodInfoString8L( - TUint32 aCmId, - TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::GetConnectionMethodInfoString8L" ); - - return iPluginImpl->GetConnectionInfoString8L( aCmId, aAttribute ); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::UncategorizedIconL() -//----------------------------------------------------------------------------- -// -CGulIcon* CCmManagerImpl::UncategorizedIconL() const - { - LOGGER_ENTERFN( "CCmManagerImpl::UncategorizedIconL" ); - - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - - TParse mbmFile; - User::LeaveIfError( mbmFile.Set( KManagerIconFilename, - &KDC_BITMAP_DIR, - NULL ) ); - - CGulIcon* icon = AknsUtils::CreateGulIconL( - skinInstance, - KAknsIIDQgnPropSetConnDestUncategorized, - mbmFile.FullName(), - EMbmCmmanagerQgn_prop_set_conn_dest_uncategorized, - EMbmCmmanagerQgn_prop_set_conn_dest_uncategorized_mask ); - - return icon; - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::UncategorizedIconL() -//----------------------------------------------------------------------------- -// -CMDBSession& CCmManagerImpl::Session() const - { - return iTrans->Session(); - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::HasCapabilityL() -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::HasCapabilityL( TCapability aCapability ) - { - TSecurityInfo info; - - info.SetToCurrentInfo(); - - if( !info.iCaps.HasCapability( aCapability ) ) - { - User::Leave( KErrPermissionDenied ); - } - } - -// --------------------------------------------------------------------------- -// CCmManagerImpl::FeatureSupported -// --------------------------------------------------------------------------- -TBool CCmManagerImpl::FeatureSupported( TInt aFeature ) - { - return FeatureManager::FeatureSupported( aFeature ); - } - -// --------------------------------------------------------------------------- -// CCmManagerImpl::IsEasyWLan -// -// We can't have any dependecy to WLan plugin, but -// in some cases we need to filter out EasyWLan access points. -// --------------------------------------------------------------------------- -TBool CCmManagerImpl::IsEasyWLanL( CCDIAPRecord* aIapRecord ) const - { - LOGGER_ENTERFN( "CCmManagerImpl::IsEasyWLanL" ); - if (!iWLan) - { - return EFalse; - } - if( (TPtrC(aIapRecord->iServiceType) != TPtrC(KCDTypeNameLANService) ) || - TPtrC(aIapRecord->iBearerType) != TPtrC(KCDTypeNameLANBearer) ) - { - return EFalse; - } - - TBool retVal( EFalse ); - TUint32 serviceId = aIapRecord->iService; - - CCDWlanServiceRecord* wLanServ = - new (ELeave) CCDWlanServiceRecord( CCDWlanServiceRecord::TableIdL( Session() ) ); - - CleanupStack::PushL( wLanServ ); - - wLanServ->iWlanServiceId.SetL( serviceId ); - - if( wLanServ->FindL( Session() ) ) - { - wLanServ->LoadL( Session() ); - - if( wLanServ->iWLanSSID.IsNull() || - !TPtrC(wLanServ->iWLanSSID).Compare( KNullDesC ) ) - { - retVal = ETrue; - } - } - - CleanupStack::PopAndDestroy( wLanServ ); - - return retVal; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::EasyWlanIdL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TUint32 CCmManagerImpl::EasyWlanIdL() - { - LOGGER_ENTERFN( "CCmManagerImpl::EasyWlanId" ); - - OpenTransactionLC(); - - TUint32 easyId( 0 ); - - CMDBRecordSet* ptrRecordSet = AllIapsL(); - CleanupStack::PushL( ptrRecordSet ); - TInt iapRecords = ptrRecordSet->iRecords.Count(); - CLOG_WRITE_1_PTR( NULL, "Record num [%d]", iapRecords ); - - for ( TInt i = 0; i < iapRecords; i++ ) - { - CCDIAPRecord* iapRecord = (*ptrRecordSet)[i]; - - if( (TPtrC(iapRecord->iServiceType) == TPtrC(KCDTypeNameLANService) ) && - TPtrC(iapRecord->iBearerType) == TPtrC(KCDTypeNameLANBearer) ) - { - if( IsEasyWLanL( iapRecord ) ) - { - easyId = (*ptrRecordSet)[i]->RecordId(); - break; - } - } - } - - CleanupStack::PopAndDestroy( ptrRecordSet ); - - RollbackTransaction(); - - return easyId; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::AllIapsL() -// ----------------------------------------------------------------------------- -// -CMDBRecordSet* CCmManagerImpl::AllIapsL() - { - LOGGER_ENTERFN( "CCmManagerImpl::AllIapsL" ); - - OpenTransactionLC(); - - CMDBRecordSet* ptrRecordSet = - new (ELeave) CMDBRecordSet( KCDTIdIAPRecord ); - - TRAP_IGNORE( ptrRecordSet->LoadL( Session() ) ); - - RollbackTransaction(); - - return ptrRecordSet; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::AllSNAPRecordsL() -// ----------------------------------------------------------------------------- -// -CMDBRecordSet* - CCmManagerImpl::AllSNAPRecordsL( TUint32 aSnapElementId ) - { - LOGGER_ENTERFN( "CCmManagerImpl::AllSNAPRecordsL" ); - - CMDBRecordSet* ptrRecordSet = - new (ELeave) CMDBRecordSet( - DestinationTableId() ); - CleanupStack::PushL( ptrRecordSet ); - - OpenTransactionLC(); - if( aSnapElementId ) - { - // Prime record - CCDSnapRecord* record = SNAPRecordL( 0 ); - CleanupStack::PushL( record ); - record->iEmbeddedSNAP = aSnapElementId; - ptrRecordSet->iRecords.AppendL( record ); - - CleanupStack::Pop( record ); - record = NULL; - - ptrRecordSet->FindL( Session() ); - } - else - { - ptrRecordSet->LoadL( Session() ); - } - - RollbackTransaction(); - - return ptrRecordSet; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::IsIapLinkedL() -// ----------------------------------------------------------------------------- -// -TBool CCmManagerImpl::IsIapLinkedL( const CCmPluginBaseEng& aPlugin ) - { - LOGGER_ENTERFN( "CCmManagerImpl::IsIapLinkedL" ); - - TUint32 iapId = aPlugin.GetIntAttributeL( ECmId ); - CMDBRecordSet* ptrRecordSet = AllIapsL(); - CleanupStack::PushL( ptrRecordSet ); - - TInt iapRecords = ptrRecordSet->iRecords.Count(); - CLOG_WRITE_1_PTR( NULL, "Record num [%d]", iapRecords ); - - TBool linked( EFalse ); - for ( TInt i = 0; !linked && i < iapRecords; i++ ) - { - CCDIAPRecord* iapRecord = (*ptrRecordSet)[i]; - - if( iapRecord->RecordId() == iapId ) - { - continue; - } - - TUint32 bearerType( 0 ); - - TRAP_IGNORE( bearerType = BearerTypeFromIapRecordL( iapRecord ) ); - if( bearerType ) - { - if( GetBearerInfoBoolL( bearerType, ECmVirtual ) ) - { - CCmPluginBase* plugin = NULL; - - TRAP_IGNORE( plugin = GetConnectionMethodL( iapRecord->RecordId() ) ); - if( plugin ) - { - linked = plugin->IsLinkedToIap( iapId ); - } - - delete plugin; - } - } - } - CleanupStack::PopAndDestroy( ptrRecordSet ); - - return linked; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::RemoveAllReferencesL() -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::RemoveAllReferencesL( const CCmPluginBaseEng& aPlugin ) - { - RArray dests; - CleanupClosePushL( dests ); - OpenTransactionLC(); - - AllDestinationsL( dests ); - - for( TInt i = 0; i < dests.Count(); ++i ) - { - CCmDestinationImpl* dest = DestinationL( dests[i] ); - CleanupStack::PushL( dest ); - TRAPD( err, dest->RemoveConnectionMethodL( aPlugin ) ); - - if( err != KErrNotFound ) - { - User::LeaveIfError( err ); - - dest->UpdateL(); - } - - CleanupStack::PopAndDestroy( dest ); - } - - CommitTransactionL( 0 ); - CleanupStack::PopAndDestroy( &dests ); - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::RemoveAllReferencesLWoTransL() -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::RemoveAllReferencesWoTransL( const CCmPluginBaseEng& aPlugin ) - { - LOGGER_ENTERFN( "CCmManagerImpl::RemoveAllReferencesWoTransL" ); - - RArray dests; - CleanupClosePushL( dests ); - - AllDestinationsL( dests ); - - for( TInt i = 0; i < dests.Count(); ++i ) - { - CCmDestinationImpl* dest = DestinationL( dests[i] ); - CleanupStack::PushL( dest ); - TRAPD( err, dest->RemoveConnectionMethodL( aPlugin ) ); - - if( err != KErrNotFound ) - { - User::LeaveIfError( err ); - - dest->UpdateL(); - } - - CleanupStack::PopAndDestroy( dest ); - } - CleanupStack::PopAndDestroy( &dests ); - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::HandleDefConnDeletedL() -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::HandleDefConnDeletedL( TCmDefConnValue& aDCSetting ) - { - LOGGER_ENTERFN( "CCmManagerImpl::HandleDefConnDeletedL" ); - - if ( IsDefConnSupported() ) - { - TCmDefConnValue defConn; - ReadDefConnWoTransL(defConn); - if ( defConn == aDCSetting ) - { - // Default connection deleted, setting it to default value. - TUint32 destId = GetInternetDestinationIdL(); - - if ( destId && ( destId != aDCSetting.iId ) ) - { - defConn.iType = ECmDefConnDestination; - defConn.iId = destId; - } - else - { - // Internet destination not found. Initialise to zero. - defConn.iType = TCmDefConnType ( 0 ); - defConn.iId = 0; - } - - WriteDefConnWoTransL( defConn ); - } - } // do nothing if default connection is not supported - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::ReadDefConnWoTransL() -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::ReadDefConnWoTransL( TCmDefConnValue& aDCSetting ) - { - LOGGER_ENTERFN( "CCmManagerImpl::ReadDefConnWoTransL" ); - if ( IsDefConnSupported() ) - { - CMDBRecordSet* defConnRecordSet = - new ( ELeave ) CMDBRecordSet( iDefConnTableId ); - CleanupStack::PushL( defConnRecordSet ); - - TRAPD( err, defConnRecordSet->LoadL( Session() ) ); - if (err == KErrNone) - { - TInt mode = QUERY_INT_FIELD( defConnRecordSet->iRecords[0], - KCDTIdDefConnType ); - aDCSetting.iType= TCmDefConnType (mode); - - aDCSetting.iId = QUERY_INT_FIELD( defConnRecordSet->iRecords[0], - KCDTIdDefConnUid ); - CLOG_WRITE( "Default Connection read OK " ); - } - else - { - //deleting old record, writing Always Ask (default value) - //aDCSetting.iType = ECmDefConnAlwaysAsk; - //aDCSetting.iId = 0; - TUint32 destId = GetInternetDestinationIdL(); - - if ( destId ) - { - aDCSetting.iType = ECmDefConnDestination; - aDCSetting.iId = destId; - } - else - { - // Internet destination not found. Initialise to zero. - aDCSetting.iType = TCmDefConnType ( 0 ); - aDCSetting.iId = 0; - } - - CLOG_WRITE( "Default Connection read FAILED, storing Always Ask! " ); - ReplaceDefConnRecordL( aDCSetting ); - } - CleanupStack::PopAndDestroy( defConnRecordSet ); - } - else - { - CLOG_WRITE( "Default Connection NOT supported, leaving with KErrNotSupported" ); - User::Leave(KErrNotSupported); - } - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::WriteDefConnWoTransL() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::WriteDefConnWoTransL( const TCmDefConnValue& aDCSetting ) - { - LOGGER_ENTERFN( "CCmManagerImpl::WriteDefConnWoTransL" ); - - if ( IsDefConnSupported() ) - { - ReplaceDefConnRecordL( aDCSetting ); - } - else - { - CLOG_WRITE( "Default Connection NOT supported, leaving with KErrNotSupported" ); - User::Leave(KErrNotSupported); - } - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::ReadDefConnL() -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::ReadDefConnL( TCmDefConnValue& aDCSetting ) - { - LOGGER_ENTERFN( "CCmManagerImpl::ReadDefConn" ); - - if ( IsDefConnSupported() ) - { - OpenTransactionLC(); - CMDBRecordSet* defConnRecordSet = - new ( ELeave ) CMDBRecordSet( iDefConnTableId ); - CleanupStack::PushL( defConnRecordSet ); - - TRAPD( err, defConnRecordSet->LoadL( Session() ) ); - if (err == KErrNone) - { - TInt mode = QUERY_INT_FIELD( defConnRecordSet->iRecords[0], - KCDTIdDefConnType ); - aDCSetting.iType= TCmDefConnType ( mode ); - - aDCSetting.iId = QUERY_INT_FIELD( defConnRecordSet->iRecords[0], - KCDTIdDefConnUid ); - CleanupStack::PopAndDestroy( defConnRecordSet ); - RollbackTransaction(); - } - else - { - //deleting old record, writing Always Ask (default value) - //aDCSetting.iType = ECmDefConnAlwaysAsk; - //aDCSetting.iId = 0; - - TUint32 destId = GetInternetDestinationIdL(); - - if ( destId ) - { - aDCSetting.iType = ECmDefConnDestination; - aDCSetting.iId = destId; - } - else - { - // Internet destination not found. Initialise to zero. - aDCSetting.iType = TCmDefConnType ( 0 ); - aDCSetting.iId = 0; - } - - CLOG_WRITE( "Default Connection read FAILED, storing Always Ask! " ); - ReplaceDefConnRecordL( aDCSetting ); - - CleanupStack::PopAndDestroy( defConnRecordSet ); - CommitTransactionL( KErrNone ); - } - } - else - { - CLOG_WRITE( "Default Connection NOT supported" ); - User::Leave(KErrNotSupported); - } - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::ReplaceDefConnRecordL() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::ReplaceDefConnRecordL( const TCmDefConnValue aDCSetting ) - { - - LOGGER_ENTERFN( "CCmManagerImpl::ReplaceDefConnRecordL" ); - // Check the Id first (that it exists) - if ( aDCSetting.iType == ECmDefConnConnectionMethod ) - { - CCDIAPRecord* iapRecord = static_cast - ( CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); - CleanupStack::PushL( iapRecord ); - iapRecord->SetRecordId( aDCSetting.iId ); - TRAPD( err, iapRecord->LoadL( Session() ) ); - if ( err == KErrNotFound ) - { - User::Leave( KErrArgument ); - } - CleanupStack::PopAndDestroy( iapRecord ); - - // Check that Connection Method is not hidden - if ( GetConnectionMethodInfoBoolL( aDCSetting.iId, ECmHidden ) ) - { - User::Leave( KErrArgument ); - } - } - else if ( aDCSetting.iType == ECmDefConnDestination ) - { - TUint32 destId = GetInternetDestinationIdL(); - - // Allow empty Internet destination, others must have some content - if ( destId != aDCSetting.iId ) - { - CCDAccessPointRecord* destAPRecord = static_cast( - CCDRecordBase::RecordFactoryL( KCDTIdAccessPointRecord ) ); - CleanupStack::PushL( destAPRecord ); - - destAPRecord->iRecordTag = aDCSetting.iId; - if ( !destAPRecord->FindL( Session() ) ) - { - User::Leave( KErrArgument ); - } - CleanupStack::PopAndDestroy( destAPRecord ); - } - } - - TInt ret = KErrNone; - TCmGenConnSettings genConnSettings; - - SetGenConnSettingsToDefault( genConnSettings ); - - CMDBRecordSet* defConnRecordSet = - new ( ELeave ) CMDBRecordSet( iDefConnTableId ); - CleanupStack::PushL( defConnRecordSet ); - - TRAP( ret, defConnRecordSet->LoadL( Session() ) ); - - if (ret == KErrNone) - { - TInt value = QUERY_INT_FIELD( defConnRecordSet->iRecords[0], KCDTIdUsageOfWlan ); - genConnSettings.iUsageOfWlan = TCmUsageOfWlan( value ); - - value = QUERY_INT_FIELD( defConnRecordSet->iRecords[0], KCDTIdCellularDataUsageHome ); - genConnSettings.iCellularDataUsageHome = TCmCellularDataUsage( value ); - - value = QUERY_INT_FIELD( defConnRecordSet->iRecords[0], KCDTIdCellularDataUsageVisitor ); - genConnSettings.iCellularDataUsageVisitor = TCmCellularDataUsage( value ); - } - - TInt typeVal = aDCSetting.iType; - TInt uidVal = aDCSetting.iId; - - // Delete the old record - for ( TInt i = 0; i < defConnRecordSet->iRecords.Count(); ++i ) - { - defConnRecordSet->iRecords[i]->DeleteL( Session() ); - } - CleanupStack::PopAndDestroy( defConnRecordSet ); - - CCDDefConnRecord* dcRcd = - new (ELeave) CCDDefConnRecord( iDefConnTableId ); - CleanupStack::PushL( dcRcd ); // 2 - - dcRcd->SetRecordId( KCDNewRecordRequest ); - - SET_INT_FIELD(dcRcd, KCDTIdUsageOfWlan, genConnSettings.iUsageOfWlan ); - SET_INT_FIELD(dcRcd, KCDTIdCellularDataUsageHome, genConnSettings.iCellularDataUsageHome ); - SET_INT_FIELD(dcRcd, KCDTIdCellularDataUsageVisitor, genConnSettings.iCellularDataUsageVisitor ); - - CLOG_WRITE_FORMAT( "Set default connection type: [%d]", typeVal ); - SET_INT_FIELD( dcRcd, - KCDTIdDefConnType, - typeVal ); - CLOG_WRITE_1( "Set uid: [%d]", uidVal ); - SET_INT_FIELD( dcRcd, - KCDTIdDefConnUid, - uidVal ); - dcRcd->StoreL( Session() ); - CleanupStack::PopAndDestroy( dcRcd ); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::WriteDefConnL() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::WriteDefConnL( const TCmDefConnValue& aDCSetting ) - { - LOGGER_ENTERFN( "CCmManagerImpl::WriteDefConnL" ); - - if ( ( aDCSetting.iType == ECmDefConnAlwaysAsk ) || - ( aDCSetting.iType == ECmDefConnAskOnce ) ) - { - User::Leave( KErrNotSupported ); - } - - if ( IsDefConnSupported() ) - { - OpenTransactionLC(); - - ReplaceDefConnRecordL( aDCSetting ); - CommitTransactionL( KErrNone ); - } - else - { - CLOG_WRITE( "Default Connection NOT supported, leaving with KErrNotSupported" ); - User::Leave(KErrNotSupported); - } - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::IsDefConnSupported() -//----------------------------------------------------------------------------- -// -TBool CCmManagerImpl::IsDefConnSupported( ) - { - LOGGER_ENTERFN( "CCmManagerImpl::IsDefConnSupported" ); - - return iDefConnSupported; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::ReadGenConneSettingsL() -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::ReadGenConnSettingsL( TCmGenConnSettings& aGenConnSettings ) - { - LOGGER_ENTERFN( "CCmManagerImpl::ReadGenConnSettingsL" ); - - OpenTransactionLC(); - CMDBRecordSet* defConnRecordSet = - new ( ELeave ) CMDBRecordSet( iDefConnTableId ); - CleanupStack::PushL( defConnRecordSet ); - - defConnRecordSet->LoadL( Session() ); - - TInt value = QUERY_INT_FIELD( defConnRecordSet->iRecords[0], KCDTIdUsageOfWlan ); - aGenConnSettings.iUsageOfWlan = TCmUsageOfWlan( value ); - - value = QUERY_INT_FIELD( defConnRecordSet->iRecords[0], KCDTIdCellularDataUsageHome ); - aGenConnSettings.iCellularDataUsageHome = TCmCellularDataUsage( value ); - - value = QUERY_INT_FIELD( defConnRecordSet->iRecords[0], KCDTIdCellularDataUsageVisitor ); - aGenConnSettings.iCellularDataUsageVisitor = TCmCellularDataUsage( value ); - - CleanupStack::PopAndDestroy( defConnRecordSet ); - RollbackTransaction(); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::ReplaceGenConnSettingsL() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::ReplaceGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings ) - { - - LOGGER_ENTERFN( "CCmManagerImpl::ReplaceGenConnSettingsL" ); - - TInt ret = KErrNone; - TCmDefConnValue defConn; - - defConn.iType = TCmDefConnType ( 0 ); - defConn.iId = 0; - - CMDBRecordSet* defConnRecordSet = - new ( ELeave ) CMDBRecordSet( iDefConnTableId ); - CleanupStack::PushL( defConnRecordSet ); - - TRAP(ret, defConnRecordSet->LoadL(Session())); - - if (ret == KErrNone) - { - TInt type = QUERY_INT_FIELD( defConnRecordSet->iRecords[0], KCDTIdDefConnType); - defConn.iType = TCmDefConnType( type ); - TInt id = QUERY_INT_FIELD( defConnRecordSet->iRecords[0], KCDTIdDefConnUid); - defConn.iId = id; - } - - TInt usageOfNewWlan = aGenConnSettings.iUsageOfWlan; - TInt cellularDataUsageHome = aGenConnSettings.iCellularDataUsageHome; - TInt cellularDataUsageVisitor = aGenConnSettings.iCellularDataUsageVisitor; - - // Delete the old record - for ( TInt i = 0; i < defConnRecordSet->iRecords.Count(); ++i ) - { - defConnRecordSet->iRecords[i]->DeleteL( Session() ); - } - CleanupStack::PopAndDestroy( defConnRecordSet ); - - CCDDefConnRecord* dcRcd = - new (ELeave) CCDDefConnRecord( iDefConnTableId ); - CleanupStack::PushL( dcRcd ); // 2 - - dcRcd->SetRecordId( KCDNewRecordRequest ); - - SET_INT_FIELD(dcRcd, KCDTIdDefConnType, defConn.iType); - SET_INT_FIELD(dcRcd, KCDTIdDefConnUid, defConn.iId); - - CLOG_WRITE_1( "Set wlan usage: [%d]", usageOfNewWlan ); - SET_INT_FIELD(dcRcd, KCDTIdUsageOfWlan, usageOfNewWlan ); - - CLOG_WRITE_1( "Set cellularDataUsageHome: [%d]", cellularDataUsageHome ); - SET_INT_FIELD(dcRcd, KCDTIdCellularDataUsageHome, cellularDataUsageHome ); - - CLOG_WRITE_1( "Set cellularDataUsageVisitor: [%d]", cellularDataUsageVisitor ); - SET_INT_FIELD(dcRcd, KCDTIdCellularDataUsageVisitor, cellularDataUsageVisitor ); - - dcRcd->StoreL( Session() ); - CleanupStack::PopAndDestroy( dcRcd ); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::WriteGenConnSettingsL() -//----------------------------------------------------------------------------- -// -void CCmManagerImpl::WriteGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings ) - { - LOGGER_ENTERFN( "CCmManagerImpl::WriteGenConnSettingsL" ); - - OpenTransactionLC(); - - ReplaceGenConnSettingsL( aGenConnSettings ); - CommitTransactionL( KErrNone ); - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::IsMemoryLow() -//----------------------------------------------------------------------------- -// -TBool CCmManagerImpl::IsMemoryLow() - { - LOGGER_ENTERFN( "CCmManagerImpl::IsMemoryLow" ); - - TBool ret( EFalse ); - // Any plugin can be used here, because CheckSpaceBelowCriticalLevelL - // is defined in their father class CCmPluginBaseEng - TRAPD( err, ret = (*iPlugins)[0]->CheckSpaceBelowCriticalLevelL() ); - if( err != KErrNone ) - { - ret = ETrue; - return ret; - } - return ret; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::SNAPRecordL -// ----------------------------------------------------------------------------- -CCDSnapRecord* CCmManagerImpl::SNAPRecordL( TUint32 aRecordId ) const - { - CCDSnapRecord* record = new (ELeave) CCDSnapRecord( - DestinationTableId() ); - - if( aRecordId ) - { - record->SetRecordId( aRecordId ); - - CleanupStack::PushL( record ); - record->LoadL( Session() ); - CleanupStack::Pop( record ); - } - - return record; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::SNAPRecordL -// ----------------------------------------------------------------------------- -CCDSnapRecord* CCmManagerImpl::CreateSNAPRecordL( TUint32 aRecordId ) const - { - CCDSnapRecord* record = new (ELeave) CCDSnapRecord( - DestinationTableId() ); - - if( aRecordId ) - { - record->SetRecordId( aRecordId ); - } - - return record; - } - -//----------------------------------------------------------------------------- -// CCmManagerImpl::WrapCmManager() -//----------------------------------------------------------------------------- -// -EXPORT_C void CCmManagerImpl::WrapCmManager( RCmManagerExt& aCmManagerExt ) - { - aCmManagerExt.iImplementation = this; - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::FilterOutVirtualsL -// -------------------------------------------------------------------------- -// -EXPORT_C void CCmManagerImpl::FilterOutVirtualsL( RPointerArray& aCmDataArray ) - { - LOGGER_ENTERFN( "CCmManagerImpl::FilterOutVirtualsL" ); - - TInt count = aCmDataArray.Count(); - - for ( TInt i = 0; i < aCmDataArray.Count(); i++ ) - { - if ( aCmDataArray[i]->GetBoolAttributeL( ECmVirtual ) ) - { - delete aCmDataArray[i]; - aCmDataArray.Remove(i); - i--; - } - } - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::CreateFlatCMListLC -// -------------------------------------------------------------------------- -// -EXPORT_C void CCmManagerImpl::CreateFlatCMListLC( TUint32 aDestinationId , - RPointerArray& aCmArray ) - { - LOGGER_ENTERFN( "CCmManagerImpl::CreateFlatCMListLC" ); - - CreateFlatCMListL(aDestinationId, aCmArray); - CleanupResetAndDestroyPushL< RPointerArray >(aCmArray); - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::CreateFlatCMListL -// -------------------------------------------------------------------------- -// -EXPORT_C void CCmManagerImpl::CreateFlatCMListL( TUint32 aDestinationId , - RPointerArray& aCmArray ) - { - LOGGER_ENTERFN( "CCmManagerImpl::CreateFlatCMListL" ); - // get the uncategorised connection methods - if ( aDestinationId == KDestItemUncategorized ) - { - AppendUncatCmListLC( aCmArray); - } - else - { - // Get the CM ids from the destination - AppendCmListLC( aDestinationId, aCmArray ); - } - - // get the possible embedded destinations to be able to list their content, too - // we only have to check in cmArray - // put them in a sep. array and get their data into another. - TInt cmCount = aCmArray.Count(); - RArray cmEmbDestArray ( KCmArrayMediumGranularity ); - CleanupClosePushL( cmEmbDestArray ); - for ( TInt i = 0; i < cmCount; i++ ) - { - if ( aCmArray[i]->GetBoolAttributeL( ECmDestination ) ) - { - cmEmbDestArray.AppendL( aCmArray[i]->GetIntAttributeL( ECmId ) ); - //remove embedded destination right now - delete aCmArray[i]; - aCmArray.Remove(i); - // i--; - } - } - // now we stored the needed emb.dest, - // we can filter out all virtual ones - //iCmManager.FilterOutVirtualsL( cmArray ); //no filtering here, we can do it later - - // now we have the list of emb.dest. inside current destination, - // now get their CM's data appended to one flat list - RPointerArray cmLinkedDataArray ( KCmArrayMediumGranularity ); - CleanupResetAndDestroyPushL< RPointerArray >( cmLinkedDataArray ); - TInt embdestcount = cmEmbDestArray.Count(); - for ( TInt i = 0; i < embdestcount; i++ ) - { - // get the list of CM's - CCmPluginBase* emdestcm = - GetConnectionMethodL( cmEmbDestArray[i] ); - CleanupStack::PushL( emdestcm ); - TUint destUid = emdestcm->Destination()->Id(); - AppendCmListL( destUid, cmLinkedDataArray ); - CleanupStack::PopAndDestroy( emdestcm ); - } - // filter out virtuals - //iCmManager.FilterOutVirtualsL( cmLinkedDataArray ); //still no filtering here - - // now we have the original, sorted list and an unsorted cmLinkedDataArray, - // add each element to original array with sorting - - CombineArraysForPriorityOrderL( aCmArray, cmLinkedDataArray ); - - // now we do no longer need the linked array - CleanupStack::Pop( &cmLinkedDataArray ); // don't destroy the cm objects! - - cmLinkedDataArray.Close(); // they are appended to aCmArray!!! - CleanupStack::PopAndDestroy( &cmEmbDestArray ); - - CleanupStack::Pop(&aCmArray); - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::CombineCmListsL -// -------------------------------------------------------------------------- -// -EXPORT_C void CCmManagerImpl::CombineArraysForPriorityOrderL( - RPointerArray& aCmArray , - RPointerArray& aCmLinkedArray ) - { - LOGGER_ENTERFN( "CCmManagerImpl::CombineArraysForPriorityOrderL" ); - - // now we have two arrays, the first is sorted as needed, - // the second is not. - // we have to insert the items from the second to the first into their - // correct position based on the bearer type priorities - - // so loop on the second array, and for ech element, find it's place - TInt count = aCmLinkedArray.Count(); - for ( TInt i = 0; i < count; i++ ) - { - TUint32 linkedpriority( aCmLinkedArray[i]->GetIntAttributeL( ECmDefaultPriority ) ); - // InsertItemL( aCmArray, aCmLinkedArray[i]); - // higher priority means smaller number - // if same priority elements exist, then - // - we need to insert our element inside the elements - // of the same priority according to - // bearetypes and extension levels - // or before the first element having higher priority numbers. - TInt cc = aCmArray.Count(); - if ( cc ) - { - TInt ii = 0; - for ( ; ii < cc; ii++ ) - { - if ( linkedpriority < aCmArray[ii]->GetIntAttributeL( ECmDefaultPriority ) ) - { - // the next element already has larger number, - // we must insert it HERE - break; - } - else - { - // priorities either same, then we need to check bearer, - // ext.level, etc - // or we simply still need to go to next element - if ( linkedpriority == aCmArray[ii]->GetIntAttributeL( ECmDefaultPriority )) - { - // check if the same bearer - if ( aCmArray[ii]->GetIntAttributeL( ECmBearerType ) == - aCmLinkedArray[i]->GetIntAttributeL( ECmBearerType ) ) - { - // we need to find the last one of these bearers, - // and insert after the last one - do - { - ii++; - }while ( ( ii < cc ) - && (aCmArray[ii]->GetIntAttributeL( ECmBearerType ) == - aCmLinkedArray[i]->GetIntAttributeL( ECmBearerType )) ); - // now we either found a correct place or - // we are at the end of the list - break; - } - else - { - // diff. bearers, check Ext.level - if ( aCmArray[ii]->GetIntAttributeL( ECmExtensionLevel ) < aCmLinkedArray[i]->GetIntAttributeL( ECmExtensionLevel ) ) - { - break; - } - // if not, then go for the next one... - } - } - } - } - // now we either found a correct place or - // we are at the end of the list - // ( we break-ed for cycle when found the correct place ) - if ( ii == cc ) - { - // end of the list, append - aCmArray.AppendL( aCmLinkedArray[i]); - } - else - { - // we found the place to be inserted - aCmArray.InsertL( aCmLinkedArray[i], ii ); - } - } - else - { - // no elements in original array yet, - // so simply append - aCmArray.AppendL( aCmLinkedArray[i]); - } - } - } - - -// -------------------------------------------------------------------------- -// CCmManagerImpl::ParentDestinationL -// -------------------------------------------------------------------------- -// -TUint32 CCmManagerImpl::ParentDestinationL( TUint32 aCmId ) - { - LOGGER_ENTERFN( "CCmManagerImpl::ParentDestinationL" ); - - TUint32 retval(0); - - TUint32 destTblId = DestinationTableId(); - CMDBRecordSet* ptrRecordSet = - new (ELeave) CMDBRecordSet( - destTblId ); - CleanupStack::PushL( ptrRecordSet ); - - // Prime record - CCDDataMobilitySelectionPolicyRecord* record = - new (ELeave) CCDDataMobilitySelectionPolicyRecord( - DestinationTableId() ); - CleanupStack::PushL( record ); - - record->iIAP = IAP_ELEMENT_ID( aCmId ); - ptrRecordSet->iRecords.AppendL( record ); - - CleanupStack::Pop( record ); - record = NULL; - - if ( ptrRecordSet->FindL(Session()) ) - { - // we have a match - retval = QUERY_INT_FIELD( (*ptrRecordSet)[0], - KCDTIdDataMobilitySelectionPolicyNetwork ); - - } - CleanupStack::PopAndDestroy( ptrRecordSet ); - - return retval; - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::GetInternetDestinationIdL -// -------------------------------------------------------------------------- -// -TUint32 CCmManagerImpl::GetInternetDestinationIdL() - { - - LOGGER_ENTERFN( "CCmManagerImpl::GetInternetDestinationIdL" ); - - TUint32 destId = 0; - - // Get all destinations - RArray destIdArray( KCmArrayBigGranularity ); - AllDestinationsL( destIdArray ); - CleanupClosePushL( destIdArray ); - - CCmDestinationImpl* dest = NULL; - - for ( TInt i = 0; i < destIdArray.Count(); i++ ) - { - dest = DestinationL( destIdArray[i] ); - CleanupStack::PushL( dest ); - - // Check if destination is internet - if ( dest->MetadataL(ESnapMetadataInternet) ) - { - destId = destIdArray[i]; - } - - CleanupStack::PopAndDestroy( dest ); - - if ( destId ) - { - break; - } - } - - CleanupStack::PopAndDestroy( &destIdArray ); - - return destId; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::SetGenConnSettingsToDefault() -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::SetGenConnSettingsToDefault( TCmGenConnSettings& aGenConnSettings ) - { - LOGGER_ENTERFN( "CCmManagerImpl::SetGenConnSettingsToDefault" ); - - aGenConnSettings.iUsageOfWlan = ECmUsageOfWlanKnown; - aGenConnSettings.iCellularDataUsageHome = ECmCellularDataUsageAutomatic; - aGenConnSettings.iCellularDataUsageVisitor = ECmCellularDataUsageConfirm; - } - - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::CheckAvailableSpaceL() -// ----------------------------------------------------------------------------- -// -void CCmManagerImpl::CheckAvailableSpaceL() - { - LOGGER_ENTERFN( "CCmManagerImpl::CheckAvailableSpaceL" ); - TBool belowCritical = SysUtil::FFSSpaceBelowCriticalLevelL( &(this->iFs), KBytesToWrite ); - CLOG_WRITE_1( "belowCritical: [%d]", belowCritical ); - if ( belowCritical ) - { - User::Leave( KErrDiskFull ); - } - } - - -// -------------------------------------------------------------------------- -// CCmManagerImpl::WatcherRegisterL -// -------------------------------------------------------------------------- -// -EXPORT_C void CCmManagerImpl::WatcherRegisterL( MCmCommsDatWatcher* aWatcher ) - { - iCommsDatIapNotifier->WatcherRegisterL( aWatcher ); - iCommsDatSnapNotifier->WatcherRegisterL( aWatcher ); - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::WatcherUnRegister -// -------------------------------------------------------------------------- -// -EXPORT_C void CCmManagerImpl::WatcherUnRegister() - { - iCommsDatIapNotifier->WatcherUnRegister(); - iCommsDatSnapNotifier->WatcherUnRegister(); - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::DestinationStillExistedL -// -------------------------------------------------------------------------- -// -EXPORT_C TBool CCmManagerImpl::DestinationStillExistedL( CCmDestinationImpl* aDest ) - { - TUint32 destId = aDest->Id(); - TBool found( EFalse ); - TInt count; - - OpenTransactionLC(); - - CMDBRecordSet* destRecordSet = - new ( ELeave ) CMDBRecordSet( - iDestinationTableId ); - CleanupStack::PushL( destRecordSet ); - - TRAP_IGNORE( destRecordSet->LoadL( Session() ) ); - - count = destRecordSet->iRecords.Count(); - - for ( TInt i = 0; i < count; ++i ) - { - TInt nwId = QUERY_INT_FIELD( destRecordSet->iRecords[i], - KCDTIdDataMobilitySelectionPolicyNetwork ); - //nwId = RECORD_FROM_ELEMENT_ID( nwId ); - - if( nwId == destId ) - { - found = ETrue; - break; - } - } - - CleanupStack::PopAndDestroy( destRecordSet ); - - RollbackTransaction(); - - return found; - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::IapStillExistedL -// -------------------------------------------------------------------------- -// -EXPORT_C TBool CCmManagerImpl::IapStillExistedL( const CCmPluginBaseEng& aPlugin ) - { - TUint32 iapId = aPlugin.GetIntAttributeL( ECmId ); - CMDBRecordSet* ptrRecordSet = AllIapsL(); - CleanupStack::PushL( ptrRecordSet ); - - TInt iapRecords = ptrRecordSet->iRecords.Count(); - - TBool found( EFalse ); - for ( TInt i = 0; !found && i < iapRecords; i++ ) - { - CCDIAPRecord* iapRecord = (*ptrRecordSet)[i]; - - if( iapRecord->RecordId() == iapId ) - { - found = ETrue; - break; - } - } - - CleanupStack::PopAndDestroy( ptrRecordSet ); - - return found; - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::IsIapStillInDestL -// -------------------------------------------------------------------------- -// -EXPORT_C TBool CCmManagerImpl::IsIapStillInDestL( - CCmDestinationImpl* aDest, - const CCmPluginBaseEng& aPlugin ) - { - TUint32 iapId = aPlugin.GetIntAttributeL( ECmId ); - - aDest->ReLoadConnectionMethodsL(); - RArray cmIds; - aDest->ConnectMethodIdArrayL( cmIds ); - CleanupClosePushL( cmIds ); - - TBool found( EFalse ); - for ( TInt i = 0; i < cmIds.Count(); i++ ) - { - if( cmIds[i] == iapId ) - { - found = ETrue; - break; - } - } - - CleanupStack::PopAndDestroy( &cmIds ); - - return found; - } - -// -------------------------------------------------------------------------- -// CCmManagerImpl::GetSnapTableIdL -// -------------------------------------------------------------------------- -// -TUint32 CCmManagerImpl::GetSnapTableIdL() - { - TUint32 snapTableId; - - CMDBSession* db = CMDBSession::NewLC( CMDBSession::LatestVersion() ); - db->SetAttributeMask( ECDHidden | ECDProtectedWrite ); - - snapTableId = CCDDataMobilitySelectionPolicyRecord::TableIdL( *db ); - - CleanupStack::PopAndDestroy( db ); - - return snapTableId; - } - -// ----------------------------------------------------------------------------- -// CCmManagerImpl::IsBearerSpecific() -// ----------------------------------------------------------------------------- -// -TBool CCmManagerImpl::IsBearerSpecific( TUint32 aAttribute ) const - { - TUint32 i = 0; - while( KBearerSpecificAttributes[i] != KEndOfArray ) - { - if( KBearerSpecificAttributes[i] == aAttribute ) - { - return ETrue; - } - i++; - } - return EFalse; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmobjectpool.cpp --- a/cmmanager/cmmgr/Framework/Src/cmobjectpool.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,343 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCMObjectPool. -* -*/ - - -#include "cmobjectpool.h" -#include "cmmanagerimpl.h" -#include -#include -#include - -#include -#include - - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// -const TInt KDestGranularity = 20; -const TInt KCMethodGranularity = 20; -CCMObjectPool::CCMObjectPool(CCmManagerImpl& aCmManagerImpl) : - iCmManagerImpl(aCmManagerImpl), - iDestinationArray(KDestGranularity, - _FOFF(TObjectPoolDestinationItem,iDestinationId)), - iConnectionMethodArray(KCMethodGranularity, - _FOFF(TObjectPoolCMItem,iConnectionMethodId)) - { - } - -CCMObjectPool::~CCMObjectPool() - { - // The get and remove functions must be used in pairs - // If the arrays have any element here than the client - // of this class made a programming error - for (TInt index = 0; index < iDestinationArray.Count(); index++) - { - delete iDestinationArray[index].iDestinationItem; - } - for (TInt index = 0; index < iConnectionMethodArray.Count(); index++) - { - delete iConnectionMethodArray[index].iConnectionMethodItem; - } - iDestinationArray.Close(); - iConnectionMethodArray.Close(); - } - -CCMObjectPool::TObjectPoolDestinationItem::TObjectPoolDestinationItem( - CCmDestinationData* aDestinationItem, - TUint32 aDestinationId) : - iDestinationId(aDestinationId), - iDestinationItem(aDestinationItem) - { - } - -CCMObjectPool::TObjectPoolCMItem::TObjectPoolCMItem( - CCmPluginBaseEng* aConnectionMethodItem, - TUint32 aConnectionMethodId) : - iConnectionMethodId(aConnectionMethodId), - iConnectionMethodItem(aConnectionMethodItem) - { - } - -CCmDestinationImpl* CCMObjectPool::GetDestinationL( TUint32 aDestinationId ) - { - TUint32 destinationId( aDestinationId ); - if ( destinationId > 0 && destinationId < 255 ) - { - destinationId += KCmDefaultDestinationAPTagId; - } - TObjectPoolDestinationItem findD( NULL, destinationId ); - TInt index = iDestinationArray.FindInUnsignedKeyOrder(findD); - if (index == KErrNotFound) - { - // If the destinaton is not in the pool create it than return it. - CCmDestinationImpl* dest = CCmDestinationImpl::NewL( iCmManagerImpl, - destinationId ); - TObjectPoolDestinationItem aDest( - dest->GetData(), - destinationId ); - User::LeaveIfError( - iDestinationArray.InsertInUnsignedKeyOrder(aDest)); - dest->IncrementRefCounter(); - return dest; - } - else - { - // If the destination is allready in the pool than return it. - CCmDestinationImpl* dest = CCmDestinationImpl::NewL( iCmManagerImpl, - iDestinationArray[index].iDestinationItem ); - iDestinationArray[index].iDestinationItem->IncrementRefCounter(); - return dest; - } - } - -CCmPluginBase* CCMObjectPool::GetConnectionMethodL( TUint32 aCmId, - CCmDestinationImpl* aParentDest ) - { - CCmPluginBase* connMethod = NULL; - TObjectPoolCMItem findCM( NULL, aCmId ); - TInt index = iConnectionMethodArray.FindInUnsignedKeyOrder(findCM); - if (index == KErrNotFound) - { - CCmPluginBaseEng* pluginBaseEng = iCmManagerImpl.DoFindConnMethL( - aCmId, aParentDest); - if (!pluginBaseEng) User::Leave(KErrNotFound); //There is no such plugin - CleanupStack::PushL( pluginBaseEng ); - connMethod = new (ELeave) CCmPluginBase(pluginBaseEng); - CleanupStack::PushL( connMethod ); - TObjectPoolCMItem aCM( pluginBaseEng, aCmId ); - User::LeaveIfError( - iConnectionMethodArray.InsertInUnsignedKeyOrder(aCM)); - pluginBaseEng->IncrementRefCounter(); - CleanupStack::Pop( connMethod ); - CleanupStack::Pop( pluginBaseEng ); - } - else - { - // If the cm is allready in the pool than return it. - iConnectionMethodArray[index].iConnectionMethodItem->IncrementRefCounter(); - connMethod = new (ELeave) CCmPluginBase( - iConnectionMethodArray[index].iConnectionMethodItem); - } - return connMethod; - } - -CCmPluginBase* CCMObjectPool::CreateConnectionMethodL( CCmPluginBaseEng* pluginBaseEng ) - { - CCmPluginBase* connMethod = new (ELeave) CCmPluginBase(pluginBaseEng); - CleanupStack::PushL( connMethod ); - TObjectPoolCMItem aCM( pluginBaseEng, 0 );//The new id is zero till update - User::LeaveIfError( - iConnectionMethodArray.InsertInUnsignedKeyOrderAllowRepeats(aCM)); - pluginBaseEng->IncrementRefCounter(); - CleanupStack::Pop( connMethod ); - return connMethod; - } - -void CCMObjectPool::InsertConnectionMethodL( CCmPluginBaseEng* pluginBaseEng ) - { - TObjectPoolCMItem aCM( pluginBaseEng, 0 );//The new id is zero till update - User::LeaveIfError( - iConnectionMethodArray.InsertInUnsignedKeyOrderAllowRepeats(aCM)); - pluginBaseEng->IncrementRefCounter(); - } - -CCmPluginBase* CCMObjectPool::CreateConnectionMethodL( TUint32 aImplementationUid, - TCmPluginInitParam& aParams ) - { - CCmPluginBaseEng* pluginBaseEng = iCmManagerImpl.DoCreateConnectionMethodL( - aImplementationUid, aParams); - CleanupStack::PushL( pluginBaseEng ); - CCmPluginBase* connMethod = new (ELeave) CCmPluginBase(pluginBaseEng); - CleanupStack::PushL( connMethod ); - TObjectPoolCMItem aCM( pluginBaseEng, 0 );//The new id is zero till update - User::LeaveIfError( - iConnectionMethodArray.InsertInUnsignedKeyOrderAllowRepeats(aCM)); - pluginBaseEng->IncrementRefCounter(); - CleanupStack::Pop( connMethod ); - CleanupStack::Pop( pluginBaseEng ); - return connMethod; - } - -CCmPluginBase* CCMObjectPool::CreateConnectionMethodL( TUint32 aImplementationUid, - TCmPluginInitParam& aParams, - TUint32 aConnMethodId ) - { - CCmPluginBaseEng* pluginBaseEng = iCmManagerImpl.DoCreateConnectionMethodL( - aImplementationUid, - aParams, - aConnMethodId); - CleanupStack::PushL( pluginBaseEng ); - CCmPluginBase* connMethod = new (ELeave) CCmPluginBase(pluginBaseEng); - CleanupStack::PushL( connMethod ); - TObjectPoolCMItem aCM( pluginBaseEng, 0 );//The new id is zero till update - User::LeaveIfError( - iConnectionMethodArray.InsertInUnsignedKeyOrderAllowRepeats(aCM)); - pluginBaseEng->IncrementRefCounter(); - CleanupStack::Pop( connMethod ); - CleanupStack::Pop( pluginBaseEng ); - return connMethod; - } - -CCmDestinationImpl* CCMObjectPool::GetDestinationL( const TDesC& aName ) - { - // CmManagerImpl.GetDestinationL will leave with KErrAlreadyExists - // if the destination already exists - CCmDestinationImpl* destImpl = CCmDestinationImpl::NewL( iCmManagerImpl, - aName ); - // Yet destImpl->Id() == 0 - TObjectPoolDestinationItem aDest( destImpl->GetData(), destImpl->Id() ); - // InsertInUnsignedKeyOrderAllowRepeats is used because all - // new destinations' Id is zero - User::LeaveIfError( - iDestinationArray.InsertInUnsignedKeyOrderAllowRepeats(aDest) ); - destImpl->IncrementRefCounter(); - return destImpl; - } - -CCmDestinationImpl* CCMObjectPool::CreateDestinationL( const TDesC& aName, - TUint32 aDestId ) - { - // CmManagerImpl.GetDestinationL will leave with KErrAlreadyExists - // if the destination already exists - CCmDestinationImpl* destImpl = CCmDestinationImpl::NewL( iCmManagerImpl, - aName, - aDestId); - // Yet destImpl->Id() == 0 - TObjectPoolDestinationItem aDest( destImpl->GetData(), destImpl->Id() ); - // InsertInUnsignedKeyOrderAllowRepeats is used because all - // new destinations' Id is zero - User::LeaveIfError( - iDestinationArray.InsertInUnsignedKeyOrderAllowRepeats(aDest) ); - destImpl->IncrementRefCounter(); - return destImpl; - } - - -void CCMObjectPool::RemoveDestination( CCmDestinationData* aDestination ) - { - if (aDestination->IdIsValid()) - { - aDestination->DecrementRefCounter(); - if (!aDestination->GetRefCounter()) - {// this was the last reference -> must delete - TObjectPoolDestinationItem findD( NULL, aDestination->Id() ); - TInt index = iDestinationArray.FindInUnsignedKeyOrder(findD); - iDestinationArray.Remove(index); - delete aDestination; - } - } - else - { // this is a new destination which hasn't been updated yet - // there may be more than one dest with id 0 -> must search by - // iDestinationItem - for (TInt index = 0; index < iDestinationArray.Count(); index++) - { - if ( iDestinationArray[index].iDestinationItem == - aDestination ) - { - aDestination->DecrementRefCounter(); - if (!aDestination->GetRefCounter()) - {// this was the last reference -> must delete - iDestinationArray.Remove(index); - delete aDestination; - } - break; - } - } - } - } - -void CCMObjectPool::RemoveDestination( CCmDestinationImpl* aDestination ) - { - RemoveDestination(aDestination->GetData()); - aDestination->SetData(NULL); - } - -void CCMObjectPool::DestinationUpdated( CCmDestinationImpl* aDestination ) - { - // there may be more than one dest with id 0 -> must search by - // iDestinationItem - for (TInt index = 0; index < iDestinationArray.Count(); index++) - { - if ( iDestinationArray[index].iDestinationItem == - aDestination->GetData() ) - { - if (aDestination->IdIsValid()) break; //allready updated - iDestinationArray[index].iDestinationId = aDestination->Id(); - iDestinationArray.SortUnsigned(); - break; - } - } - } - -void CCMObjectPool::ConnMethodUpdatedL( CCmPluginBaseEng* aCM ) - { - // there may be more than one dest with id 0 -> must search by - // iDestinationItem - for (TInt index = 0; index < iConnectionMethodArray.Count(); index++) - { - if ( iConnectionMethodArray[index].iConnectionMethodItem == - aCM ) - { - TInt cmId = aCM->GetIntAttributeL(CMManager::ECmId); - iConnectionMethodArray[index].iConnectionMethodId = cmId; - iConnectionMethodArray.SortUnsigned(); - break; - } - } - } - -void CCMObjectPool::RemoveConnectionMethodL( CCmPluginBase* aCM) - { - RemoveConnectionMethodL(aCM->Plugin()); - aCM->SetPlugin(NULL); - } - -void CCMObjectPool::RemoveConnectionMethodL( CCmPluginBaseEng* aCM) - { - if (aCM->IdIsValid()) - { - aCM->DecrementRefCounter(); - if (!aCM->GetRefCounter()) - {// this was the last reference -> must delete - TUint32 cmId = aCM->GetIntAttributeL(CMManager::ECmId); - TObjectPoolCMItem findD( NULL, cmId ); - TInt index = iConnectionMethodArray.FindInUnsignedKeyOrder(findD); - iConnectionMethodArray.Remove(index); - delete aCM; - } - } - else - { // this is a new cm which hasn't been updated yet - // there may be more than one cm with id 0 -> must search by pointer - for (TInt index = 0; index < iConnectionMethodArray.Count(); index++) - { - if ( iConnectionMethodArray[index].iConnectionMethodItem == aCM ) - { - aCM->DecrementRefCounter(); - if (!aCM->GetRefCounter()) - {// this was the last reference -> must delete - iConnectionMethodArray.Remove(index); - delete aCM; - } - break; - } - } - } - } - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmpbasesettingsdlg.cpp --- a/cmmanager/cmmgr/Framework/Src/cmpbasesettingsdlg.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1503 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: base class for connection method plugin dialogs -* -*/ - - -// INCLUDE FILES - -// System -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -// User -#include -#include -#include -#include -#include "cmmanagerimpl.h" -#include "cmmanager.hrh" -#include -#include -#include -#include "cmpluginmultilinedialog.h" -#include "cmlogger.h" -#include "ccmdexec.h" - -using namespace CMManager; - -// Maximum speed mapping -struct TIPv6DNSMapping - { - TInt iResId; - TInt iSettingValue; - }; - -// Mapping for IPv6 DNS types -const TIPv6DNSMapping KTIPv6DNSItems[] = - { - { R_QTN_SET_DNS_SERVERS_AUTOMATIC, EIPv6Unspecified }, - { R_QTN_SET_IP_WELL_KNOWN, EIPv6WellKnown }, - { R_QTN_SET_IP_USER_DEFINED, EIPv6UserDefined }, - { 0, 0 } - }; - -const TUint32 KMaxInt32Length = 10; - -// ================= MEMBER FUNCTIONS ======================================= - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::ConstructAndRunLD -// Constructs the dialog and runs it. -// -------------------------------------------------------------------------- -// -EXPORT_C TInt CmPluginBaseSettingsDlg::ConstructAndRunLD( ) - { - CleanupStack::PushL( this ); - FeatureManager::InitializeLibL(); - iHelp = FeatureManager::FeatureSupported( KFeatureIdHelp ); - FeatureManager::UnInitializeLib(); - ConstructL( R_PLUGIN_BASE_MENUBAR ); - PrepareLC( R_PLUGIN_BASE_DIALOG ); - CleanupStack::Pop( this ); - iSettingIndex = new ( ELeave ) CArrayFixFlat( 4 ); - - if (!iHasSettingChanged) - { - iHasSettingChanged = ETrue; - } - - return RunLD(); - } - - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::CmPluginBaseSettingsDlg() -// -------------------------------------------------------------------------- -// -EXPORT_C CmPluginBaseSettingsDlg::CmPluginBaseSettingsDlg( - CCmPluginBaseEng& aCmPluginBase ) : - iCmPluginBaseEng( aCmPluginBase ), - iExitReason( KDialogUserBack ), - iResourceReader( *CCoeEnv::Static() ), - iIsPossibleToSaveSetting( ETrue ), - iHasSettingChanged( EFalse ) - { - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::~CApSelectorDialog -// -------------------------------------------------------------------------- -// -EXPORT_C CmPluginBaseSettingsDlg::~CmPluginBaseSettingsDlg() - { - // iModel is deleted by the ListBox because LB owns the model... - // of course only after we passed ownership... - if ( iNaviDecorator ) - { - delete iNaviDecorator; - } - if ( iTitlePane ) - { - // set old text back, if we have it... - if ( iOldTitleText ) - { - TRAP_IGNORE( iTitlePane->SetTextL( *iOldTitleText ) ); - delete iOldTitleText; - } - } - if ( iSettingIndex ) - { - delete iSettingIndex; - } - iResourceReader.Close(); - - delete iCmdExec; - iCmdExec = NULL; - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::PreLayoutDynInitL(); -// called by framework before dialog is shown -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::PreLayoutDynInitL() - { - iListbox = STATIC_CAST( CAknSettingStyleListBox*, - Control( KPluginBaseListboxId ) ); - iListbox->CreateScrollBarFrameL( ETrue ); - iListbox->ScrollBarFrame()->SetScrollBarVisibilityL - ( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); - iListbox->SetListBoxObserver( this ); - - HandleListboxDataChangeL(); - iListbox->HandleItemAdditionL(); - InitTextsL(); - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::UpdateListBoxContentL -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::UpdateListBoxContentL() - { - // Must save listbox indexes because content will be deleted - TInt lastListBoxPos = iListbox->CurrentItemIndex(); - TInt lastListBoxTopPos = iListbox->TopItemIndex(); - - // deleting listbox content - MDesCArray* itemList = iListbox->Model()->ItemTextArray(); - CDesCArray* itemArray = (CDesCArray*)itemList; - - while ( itemArray->Count() ) - { - itemArray->Delete( 0 ); - } - while ( iSettingIndex->Count() ) - { - iSettingIndex->Delete( 0 ); - } - - // CONNECTION NAME - AppendSettingTextsL( *itemArray, ECmName ); - - // BEARER SPECIFIC SETTINGS - UpdateListBoxContentBearerSpecificL( *itemArray ); - - //----------------------------------------------------------------------- - // Handle content changes - iListbox->Reset(); - iListbox->HandleItemAdditionL(); - - // Listbox might not have index - if ( lastListBoxPos != -1 ) - { - iListbox->SetCurrentItemIndex( lastListBoxPos ); - iListbox->SetTopItemIndex( lastListBoxTopPos ); - } - iListbox->DrawNow(); - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::AppendSettingTextsL -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::AppendSettingTextsL( - CDesCArray& aItemArray, - const TInt aSettingItemId, - const TInt aValueResId ) - { - HBufC* value = StringLoader::LoadLC( aValueResId ); - - AppendSettingTextsL( aItemArray, aSettingItemId, value ); - - CleanupStack::PopAndDestroy( value ); - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::AppendSettingTextsL -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::AppendSettingTextsL( - CDesCArray& aItemArray, - const TInt aSettingItemId, - const HBufC* aValueString ) - { - const TCmAttribConvTable* convItem = - iCmPluginBaseEng.ConvTableItem( aSettingItemId ); - HBufC* value = NULL; - - if ( aValueString ) - { - value = (HBufC*)aValueString; - } - else - { - if ( convItem->iAttribFlags & EConvNumber ) - { - TUint32 num = iCmPluginBaseEng.GetIntAttributeL( aSettingItemId ); - - if( !num && convItem->iDefSettingResId ) - { - value = StringLoader::LoadL( convItem->iDefSettingResId ); - } - else - { - value = HBufC::NewL( KMaxInt32Length ); - value->Des().AppendNum( num ); - - TPtr number( value->Des() ); - AknTextUtils::LanguageSpecificNumberConversion( number ); - } - } - else - { - if( convItem->iAttribFlags & EConv8Bits ) - // make 16bits copy of this 8bits buffer - { - HBufC8* value8 = iCmPluginBaseEng.GetString8AttributeL( aSettingItemId ); - CleanupStack::PushL( value8 ); - value = HBufC::NewL( value8->Length() ); - value->Des().Copy( *value8 ); - CleanupStack::PopAndDestroy( value8 ); - } - else - { - value = iCmPluginBaseEng.GetStringAttributeL( aSettingItemId ); - } - - if ( convItem->iDefSettingResId ) - // We have default value in resource. - // Check if we have use it, instead of current value. - { - if ( convItem->iAttribFlags & EConvIPv4 ) - // This is an IPv4 text attribute - { - if ( IsUnspecifiedIPv4Address( *value ) ) - // Use default value from resource instead of - // displaying unspecified IP address - { - delete value; value = NULL; - } - } - else if ( convItem->iAttribFlags & EConvIPv6 ) - // This is an IPv4 text attribute - { - } - else if( convItem->iAttribFlags & EConvPassword ) - // In case of password, we can show only the resource - // string. - { - delete value; value = NULL; - } - else if ( *value == KNullDesC && convItem->iDefSettingResId ) - // empty string, but it has a default value in resource - // Use the resource value. - { - delete value; value = NULL; - } - - if ( !value ) - // use default value from resource. - { - value = StringLoader::LoadL( convItem->iDefSettingResId ); - } - } - } - - CleanupStack::PushL( value ); - } - - HBufC* title = StringLoader::LoadLC( convItem->iTitleId ); - - _LIT( KSettingListFormat, "\t%S\t\t%S" ); - HBufC* itemTextBuf = HBufC::NewLC( KSettingListFormat().Length() + - title->Length() + - value->Length() + - KTxtCompulsory().Length() ); - - TPtr itemText = itemTextBuf->Des(); - - itemText.Format( KSettingListFormat, title, value ); - - // indicator for compulsory settings - if ( convItem->iAttribFlags & EConvCompulsory ) - { - itemText.Append( KTxtCompulsory ); - } - - aItemArray.AppendL( itemText ); - CleanupStack::PopAndDestroy( 2, title ); // itemTextBuf, title - - if ( !aValueString ) - { - CleanupStack::PopAndDestroy( (HBufC*)value ); - } - - iSettingIndex->AppendL( aSettingItemId ); - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::AppendSettingTextsL -// -------------------------------------------------------------------------- -// - -EXPORT_C void CmPluginBaseSettingsDlg::AppendSettingTextsL( - CDesCArray& aItemArray, - const TInt aSettingItemId, - const TInt aTitleResId, - const TInt aValueResId, - const TBool aCompulsory ) const - { - HBufC* value = NULL; - if ( aValueResId ) - { - value = StringLoader::LoadLC( aValueResId ); - } - else - { - value = KNullDesC().AllocL(); - CleanupStack::PushL( value ); - } - TPtr ptrValue = value->Des(); - - AppendSettingTextsL( aItemArray, aSettingItemId, - aTitleResId, ptrValue, aCompulsory ); - - CleanupStack::PopAndDestroy( value ); - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::AppendSettingTextsL -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::AppendSettingTextsL( - CDesCArray& aItemArray, - const TInt aSettingItemId, - const TInt aTitleResId, - const TDesC& aValueString, - const TBool aCompulsory ) const - { - // Title - HBufC* title = StringLoader::LoadLC( aTitleResId ); - - _LIT( KSettingListFormat, "\t%S\t\t%S" ); - HBufC* itemTextBuf = HBufC::NewLC( KSettingListFormat().Length() + - title->Length() + - aValueString.Length() + - KTxtCompulsory().Length() ); - - TPtr itemText = itemTextBuf->Des(); - - itemText.Format( KSettingListFormat, title, &aValueString ); - - // indicator for compulsory settings - if ( aCompulsory ) - { - itemText.Append( KTxtCompulsory ); - } - - aItemArray.AppendL( itemText ); - CleanupStack::PopAndDestroy( 2, title ); // itemTextBuf, title - iSettingIndex->AppendL( aSettingItemId ); - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::DynInitMenuPaneL -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::DynInitMenuPaneL( - TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - CAknDialog::DynInitMenuPaneL( aResourceId, aMenuPane ); - - if ( aResourceId == R_PLUGIN_BASE_MENU ) - { - if (!iHelp) - { - aMenuPane->DeleteMenuItem( EAknCmdHelp ); - } - TInt currentItem = iSettingIndex->At( iListbox->CurrentItemIndex() ); - if ( currentItem == ECmBearerSettingName ) - { - - aMenuPane->SetItemDimmed( EPluginBaseCmdChange, ETrue ); - } - } - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::ProcessCommandL -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::ProcessCommandL( TInt aCommandId ) - { - if ( MenuShowing() ) - { - HideMenu(); - } - - switch ( aCommandId ) - { - case EAknSoftkeyOptions: - { - DisplayMenuL(); - break; - } - case EPluginBaseCmdExit: - { - iExitReason = KDialogUserExit; - if( iIsPossibleToSaveSetting && iHasSettingChanged ) - { - iCmPluginBaseEng.UpdateL(); - iHasSettingChanged = EFalse; - } - - TryExitL( iExitReason ); - break; - } - case EAknSoftkeyOk: - case EAknSoftkeyChange: - { - // Function CheckSpaceBelowCriticalLevelL may User::Leave with KLeaveWithoutAlert - // if no space available to save changes. The User::Leave message will be caught - // by iCmdExec. So,it is not caught here. - iCmPluginBaseEng.CheckSpaceBelowCriticalLevelL(); - - ShowPopupSettingPageL( - iSettingIndex->At( iListbox->CurrentItemIndex() ), - aCommandId ); - - break; - } - case EAknCmdHelp: - { - // Help context (the default value) has been set so this value is used. - HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), - iEikonEnv->EikAppUi()->AppHelpContextL() ); - } - break; - default: - { - break; - } - } - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::InitTextsL -// called before the dialog is shown -// to initialize localized textual data -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::InitTextsL() - { - // set pane text if neccessary... - // pane text needed if not pop-up... - if ( iEikonEnv ) - { - iStatusPane = iEikonEnv->AppUiFactory()->StatusPane(); - iTitlePane = ( CAknTitlePane* )iStatusPane->ControlL( - TUid::Uid( EEikStatusPaneUidTitle ) ); - - iOldTitleText = iTitlePane->Text()->AllocL(); - HBufC* pdConnName = iCmPluginBaseEng.GetStringAttributeL( ECmName ); - CleanupStack::PushL( pdConnName ); // 1 - - if ( pdConnName ) - { - iTitlePane->SetTextL( *pdConnName ); - } - else - { - iTitlePane->SetTextL( KNullDesC ); - } - CleanupStack::PopAndDestroy( pdConnName ); // 0 - - - iNaviPane = ( CAknNavigationControlContainer* )iStatusPane->ControlL( - TUid::Uid( EEikStatusPaneUidNavi ) ); - iNaviDecorator = iNaviPane->CreateNavigationLabelL( KNullDesC ); - iNaviPane->PushL( *iNaviDecorator ); - } - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::OkToExitL -// Good to know : EAknSoftkeyCancel is never called, because -// EEikDialogFlagNotifyEsc flag is not set in the resource. -// -------------------------------------------------------------------------- -// -EXPORT_C TBool CmPluginBaseSettingsDlg::OkToExitL( TInt aButtonId ) - { - // Translate the button presses into commands for the appui & current - // view to handle - TBool retval( EFalse ); - - switch ( aButtonId ) - { - case EAknSoftkeyOk: - case EAknSoftkeyChange: - { - ProcessCommandL( aButtonId ); - break; - } - case EAknSoftkeyBack: - case EAknSoftkeyExit: - case KDialogUserExit: - { - - if ( iIsPossibleToSaveSetting && iHasSettingChanged ) - { - iCmPluginBaseEng.UpdateL(); - iHasSettingChanged = EFalse; - } - retval = ETrue; - break; - } - case EAknSoftkeyOptions: - { - DisplayMenuL(); - break; - } - default: - { - retval = ETrue; - break; - } - } - - return retval; - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::HandleListBoxEventL -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::HandleListBoxEventL( - CEikListBox* /*aListBox*/, TListBoxEvent aEventType ) - { - switch ( aEventType ) - { - case EEventEnterKeyPressed: - case EEventItemSingleClicked: - { - if ( !iProcessing ) - { - delete iCmdExec; - iCmdExec = NULL; - iCmdExec = new (ELeave) CCmdExec(*this); - iCmdExec->Execute(); - } - break; - } - case EEventEditingStarted: - { - break; - } - case EEventEditingStopped: - { - break; - } - default: - { - break; -// User::Leave( KErrNotSupported ); - } - } - } - -// --------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::OfferKeyEventL -// --------------------------------------------------------------------------- -// -EXPORT_C TKeyResponse CmPluginBaseSettingsDlg::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - return iListbox->OfferKeyEventL( aKeyEvent, aType ); - } - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::LoadResourceL -//--------------------------------------------------------------------------- -// -EXPORT_C TInt CmPluginBaseSettingsDlg::LoadResourceL ( - const TDesC& aResFileName ) - { - TInt err( KErrNone ); - // Add resource file. - TParse* fp = new ( ELeave ) TParse(); - err = fp->Set( aResFileName, - &KDC_RESOURCE_FILES_DIR, - NULL ); - if ( err ) - { - User::Leave( err ); - } - - TFileName resourceFileNameBuf = fp->FullName(); - delete fp; - - iResourceReader.OpenL( resourceFileNameBuf ); - return err; - } - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::HandleListboxDataChangeL -// called before the dialog is shown to initialize listbox data -//--------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::HandleListboxDataChangeL() - { - UpdateListBoxContentL(); - iListbox->HandleItemAdditionL(); - } - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::ShowPopupSettingPageL -//--------------------------------------------------------------------------- -// -EXPORT_C TBool CmPluginBaseSettingsDlg::ShowPopupSettingPageL( - TUint32 aAttribute, TInt /*aCommandId*/ ) - { - TBool retval( EFalse ); - - switch ( aAttribute ) - { - case ECmBearerSettingName: - { - TCmCommonUi::ShowNoteL ( R_PLUGIN_BASE_INFO_BEARER_NOT_EDITABLE, - TCmCommonUi::ECmInfoNote ); - break; - } - case ECmName: - default: - { - retval = ShowPopupTextSettingPageL( aAttribute ); - break; - } - } - return retval; - } - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::SelectItem -//--------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::SelectItem( TInt aItemIndex ) - { - iListbox->ScrollToMakeItemVisible( aItemIndex ); - iListbox->SetCurrentItemIndexAndDraw( aItemIndex ); - } - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::StringAttributeWithDefaultL -//--------------------------------------------------------------------------- -// -EXPORT_C HBufC* CmPluginBaseSettingsDlg::StringAttributeWithDefaultL( - TUint32 aAttribute, TUint32 aDefRes ) - { - HBufC* value = iCmPluginBaseEng.GetStringAttributeL( aAttribute ); - if ( *value == KNullDesC ) - { - delete value; - value = NULL; - value = StringLoader::LoadL( aDefRes ); - } - - return value; - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::GetHelpContext -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::GetHelpContext( TCoeHelpContext& aContext ) const - { - aContext.iMajor = KHelpUidPlugin; - aContext.iContext = iHelpContext; - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::ShowPopupIpSettingPageL -// -------------------------------------------------------------------------- -// -EXPORT_C TBool CmPluginBaseSettingsDlg::ShowPopupIpSettingPageL( - TUint32 aAttribute, - TUint32 aTitleId ) - - { - TBool retval = EFalse; - const TCmAttribConvTable* convItem = - iCmPluginBaseEng.ConvTableItem( aAttribute ); - - HBufC* servName = HBufC::NewLC( convItem->iMaxLength ); - TPtr ptrServName ( servName->Des() ); - - HBufC* orig = iCmPluginBaseEng.GetStringAttributeL( aAttribute ); - CleanupStack::PushL( orig ); - ptrServName.Copy( *orig ); - - TInetAddr addr; - addr.Input( ptrServName ); - - TInt resId = EditorId( convItem->iEditorResId, R_TEXT_SETTING_PAGE_IP ); - - CAknIpFieldSettingPage* dlg = - new ( ELeave ) CAknIpFieldSettingPage( - resId, - addr ); - - CleanupStack::PushL( dlg ); - SetTitleL( dlg, convItem->iTitleId, aTitleId ); - CleanupStack::Pop( dlg ); - - if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted ) ) - { - addr.Output( ptrServName ); - - if ( orig->Des().CompareF( ptrServName ) ) - // User modified IP address - { - iCmPluginBaseEng.SetStringAttributeL( aAttribute, ptrServName ); - retval = ETrue; - UpdateListBoxContentL(); - } - } - - CleanupStack::PopAndDestroy( 2, servName ); // orig, servName - return retval; - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::ShowRadioButtonSettingPageL -// -------------------------------------------------------------------------- -// -EXPORT_C TInt CmPluginBaseSettingsDlg::ShowRadioButtonSettingPageL( - const TUint32* aResIds, - TInt& aCurrentItem, - TUint32 aTitleId ) - { - CDesCArrayFlat* items = - new ( ELeave ) CDesCArrayFlat( KCmArraySmallGranularity ); - - CleanupStack::PushL( items ); - TInt count( 0 ); - for( ; aResIds[count]; ++count ) - { - HBufC* item = StringLoader::LoadLC( aResIds[count] ); - items->AppendL( *item ); - } - - TUint32 resId = EditorId( 0, R_RADIO_BUTTON_SETTING_PAGE_OK_CANCEL ); - CAknRadioButtonSettingPage* dlg = - new ( ELeave ) CAknRadioButtonSettingPage( - resId, - aCurrentItem, - items ); - CleanupStack::PushL( dlg ); - SetTitleL( dlg, 0, aTitleId ); - CleanupStack::Pop( dlg ); - - TBool retVal = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); - - CleanupStack::PopAndDestroy( count ); // selection items - CleanupStack::PopAndDestroy( items ); - - return retVal; - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::ShowRadioButtonSettingPageL -// -------------------------------------------------------------------------- -// -EXPORT_C TInt CmPluginBaseSettingsDlg::ShowRadioButtonSettingPageL( - CDesCArrayFlat& aItems, - TInt& aCurrentItem, - TUint32 aTitleId ) - { - TUint32 resId = EditorId( 0, R_RADIO_BUTTON_SETTING_PAGE_OK_CANCEL ); - CAknRadioButtonSettingPage* dlg = - new ( ELeave ) CAknRadioButtonSettingPage( - resId, - aCurrentItem, - &aItems ); - CleanupStack::PushL( dlg ); - SetTitleL( dlg, 0, aTitleId ); - CleanupStack::Pop( dlg ); - - TBool retVal = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); - - return retVal; - } - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::ShowPopupTextSettingPageL -//--------------------------------------------------------------------------- -// -EXPORT_C TBool CmPluginBaseSettingsDlg::ShowPopupTextSettingPageL( - TUint32 aAttribute, - TUint32 aTitleId ) - { - TBool retval( EFalse ); - const TCmAttribConvTable* convItem = - iCmPluginBaseEng.ConvTableItem( aAttribute ); - - HBufC* textToChange = HBufC::NewLC( convItem->iMaxLength ); - TPtr ptrTextToChange( textToChange->Des() ); - - HBufC* value = HBufC::NewLC( convItem->iMaxLength ); - if ( convItem->iAttribFlags & EConv8Bits ) - // convert 8bits attribute to 16bits - { - HBufC8* stringFromCm = - iCmPluginBaseEng.GetString8AttributeL( aAttribute ); - value->Des().Copy( *stringFromCm ); - - delete stringFromCm; stringFromCm = NULL; - } - else - { - HBufC* stringFromCm = - iCmPluginBaseEng.GetStringAttributeL( aAttribute ); - value->Des().Copy( *stringFromCm ); - - delete stringFromCm; stringFromCm = NULL; - } - - if( *value == KNullDesC && convItem->iDefValueResId ) - // empty string is replaced with the default value from resource - { - HBufC* stringFromCm = StringLoader::LoadL( convItem->iDefValueResId ); - - value->Des().Copy( *stringFromCm ); - - delete stringFromCm; stringFromCm = NULL; - } - - TPtr ptrValue( value->Des() ); - ptrTextToChange.Copy( ptrValue ); - - TInt textSettingPageFlags( EAknSettingPageNoOrdinalDisplayed ); - - if ( !(convItem->iAttribFlags & EConvNoZeroLength) ) - { - textSettingPageFlags = CAknTextSettingPage::EZeroLengthAllowed; - } - - TUint32 resId = EditorId( convItem->iEditorResId, 0 ); - - CAknTextSettingPage* dlg = new ( ELeave ) CAknTextSettingPage( - resId, - ptrTextToChange, - textSettingPageFlags ); - - CleanupStack::PushL( dlg ); - SetTitleL( dlg, convItem->iTitleId, aTitleId ); - CleanupStack::Pop( dlg ); - - if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted ) ) - { - if ( aAttribute == ECmName ) - { - iTitlePane->SetTextL( ptrTextToChange ); - } - if ( ptrTextToChange.Compare( ptrValue ) ) - // user modified the value - { - if ( convItem->iAttribFlags & EConv8Bits ) - // convert back from 16bits to 8bits - { - HBufC8* stringTo = HBufC8::NewLC( ptrTextToChange.Length() ); - - stringTo->Des().Copy( ptrTextToChange ); - iCmPluginBaseEng.SetString8AttributeL( aAttribute, *stringTo ); - - CleanupStack::PopAndDestroy( stringTo ); - } - else - { - if( aAttribute == ECmName ) - { - SetUniqueNameL( ptrTextToChange ); - } - else - { - iCmPluginBaseEng.SetStringAttributeL( aAttribute, - ptrTextToChange ); - } - } - - retval = ETrue; - UpdateListBoxContentL(); - } - } - - CleanupStack::PopAndDestroy( 2, textToChange ); - return retval; - } - - -void CmPluginBaseSettingsDlg::SetUniqueNameL( TPtr aPtrTextToChange ) - { - // Saves the recent naming method and set it to "Not accept" - TUint32 savedNM = iCmPluginBaseEng.GetIntAttributeL( ECmNamingMethod ); - iCmPluginBaseEng.SetIntAttributeL( ECmNamingMethod, ENamingNotAccept ); - - // Tries to save the nem name. If it is not unique - // then ret == KErrArgument - TRAPD( err, iCmPluginBaseEng.SetStringAttributeL( ECmName, aPtrTextToChange ) ); - - if( KErrArgument == err ) - { - // Opens a info note - HBufC* noteLine = StringLoader::LoadLC( - R_CMMANAGERUI_INFO_DEST_ALREADY_IN_USE, aPtrTextToChange ); - - TCmCommonUi::ShowNoteL( *noteLine, TCmCommonUi::ECmInfoNote ); - - CleanupStack::PopAndDestroy( noteLine ); - } - - // Sets back the original naming method - iCmPluginBaseEng.SetIntAttributeL( ECmNamingMethod, savedNM ); - } - - - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::ShowPopupPasswordSettingPageL -//--------------------------------------------------------------------------- -// -EXPORT_C TBool CmPluginBaseSettingsDlg::ShowPopupPasswordSettingPageL( - TUint32 aAttribute, - TUint32 aTitleId ) - { - TBool retVal( EFalse ); - - const TCmAttribConvTable* convItem = - iCmPluginBaseEng.ConvTableItem( aAttribute ); - HBufC* newPassword = HBufC::NewLC( KCmMaxPasswordLength ); - TPtr16 ptrNewPassword = newPassword->Des(); - - HBufC* oldPassword = NULL; - oldPassword = iCmPluginBaseEng.GetStringAttributeL( aAttribute ); - CleanupStack::PushL( oldPassword ); - - TUint32 resId = EditorId( convItem->iEditorResId, - R_TEXT_SETTING_PAGE_PASSWD ); - CAknAlphaPasswordSettingPage* dlg = - new ( ELeave ) CAknAlphaPasswordSettingPage( - resId, - ptrNewPassword, - *oldPassword ); - CleanupStack::PushL( dlg ); - SetTitleL( dlg, convItem->iTitleId, aTitleId ); - CleanupStack::Pop( dlg ); - - if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) - { - iCmPluginBaseEng.SetStringAttributeL( aAttribute, newPassword->Des() ); - UpdateListBoxContentL(); - - retVal = ETrue; - } - CleanupStack::PopAndDestroy( 2, newPassword ); - - return retVal; - } - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::ShowNumSettingPageL -//--------------------------------------------------------------------------- -// -EXPORT_C TBool CmPluginBaseSettingsDlg::ShowPopupPortNumSettingPageL( - TUint32 aAttribute, TUint32 aTitleId ) - { - TBool retVal( EFalse ); - const TCmAttribConvTable* convItem = - iCmPluginBaseEng.ConvTableItem( aAttribute ); - - TInt value( 0 ); - value = iCmPluginBaseEng.GetIntAttributeL( aAttribute ); - - TInt origVal = value; - - HBufC* buf = HBufC::NewLC( convItem->iMaxLength ); - TPtr ptr( buf->Des() ); - - ptr.Num( value ); - - TInt flags = EAknSettingPageNoOrdinalDisplayed; - - if ( !(convItem->iAttribFlags & EConvNoZeroLength) ) - { - flags |= CAknTextSettingPage::EZeroLengthAllowed; - } - - TUint32 resId = EditorId( convItem->iEditorResId, - R_PORT_NUMBER_SETTING_PAGE ); - CAknTextSettingPage* dlg = new ( ELeave ) CAknTextSettingPage( - resId, - ptr, - flags ); - - CleanupStack::PushL( dlg ); - SetTitleL( dlg, convItem->iTitleId, aTitleId ); - CleanupStack::Pop( dlg ); - - if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted ) ) - { - TLex lex ( buf->Des() ); - - // An empty string should be treated as default - if ( buf->Des() == KNullDesC ) - { - value = 0; - } - else - { - lex.Val( value ); - } - if ( value != origVal ) - { - iCmPluginBaseEng.SetIntAttributeL( aAttribute, value ); - retVal = ETrue; - UpdateListBoxContentL(); - } - } - - CleanupStack::PopAndDestroy( buf ); - return retVal; - } - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::ShowPopupIPv4DNSEditorL -//--------------------------------------------------------------------------- -// -EXPORT_C TBool CmPluginBaseSettingsDlg::ShowPopupIPv4DNSEditorL( - TUint32 aDNSUsageAttribute, - TUint32 aDNS1ServAttribute, - TUint32 aDNS2ServAttribute, - TUint32 aTitleId ) - { - // In default the return value is 'Automatic' - TBool retVal( EFalse ); - // In default DNS setting is automatic. - const TCmAttribConvTable* convItem = - iCmPluginBaseEng.ConvTableItem( aDNSUsageAttribute ); - - HBufC* primServ = iCmPluginBaseEng.GetStringAttributeL( aDNS1ServAttribute ); - CleanupStack::PushL( primServ ); - HBufC* secServ = iCmPluginBaseEng.GetStringAttributeL( aDNS2ServAttribute ); - CleanupStack::PushL( secServ ); - - TBuf newPrim; - TBuf newSec; - - newPrim.Copy( *primServ ); - newSec.Copy( *secServ ); - - TInetAddr dns1Addr; - TInetAddr dns2Addr; - - dns1Addr.Input( newPrim ); - dns2Addr.Input( newSec ); - - CAknMultiLineIpQueryDialog* dlg = - CAknMultiLineIpQueryDialog::NewL( dns1Addr, - dns2Addr ); - - CleanupStack::PushL( dlg ); - - TUint32 editorId = EditorId( convItem->iEditorResId, R_DNSIP4_QUERY ); - dlg->PrepareLC( editorId ); - - TUint32 titleId = TitleId( convItem->iTitleId, aTitleId ); - if ( titleId ) - { - dlg->SetTitleL( titleId ); - } - - CleanupStack::Pop( dlg ); - - if ( dlg->RunLD() ) - { - dns1Addr.Output( newPrim ); - dns2Addr.Output( newSec ); - - if ( newPrim.CompareF( *primServ ) || - newSec.CompareF( *secServ ) ) - // User modified the DNS setting - { - iCmPluginBaseEng.SetDNSServerAddressL( - aDNS1ServAttribute, - newPrim, - aDNS2ServAttribute, - newSec, - aDNSUsageAttribute, - EFalse ); - - UpdateListBoxContentL(); - - retVal = ETrue; - } - } - - CleanupStack::PopAndDestroy( 2, primServ ); - - return retVal; - } - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::ShowPopupIPv6DNSEditorL -//--------------------------------------------------------------------------- -// -EXPORT_C TInt CmPluginBaseSettingsDlg::ShowPopupIPv6DNSEditorL( - const TUint32* aSelectionItems, - TUint32 aDNSUsageAttribute, - TUint32 aDNS1ServAttribute, - TUint32 aDNS2ServAttribute ) - { - TBool update( EFalse ); - TInt selected = GetIPv6DNSTypeL( aDNS1ServAttribute, aDNS2ServAttribute ); - - // convert the current setting value to the selection index - TInt resId = KTIPv6DNSItems[selected].iResId; - TInt i = 0; - while ( aSelectionItems[i] ) - { - if ( resId == aSelectionItems[i] ) - { - selected = i; - break; - } - i++; - } - - if ( ShowRadioButtonSettingPageL( aSelectionItems, - selected, - R_QTN_SET_DNS_SERVERS_IP ) ) - { - // convert the selection to the setting value - resId = aSelectionItems[selected]; - TInt j = 0; - - while ( KTIPv6DNSItems[j].iResId ) - { - if ( resId == KTIPv6DNSItems[j].iResId ) - { - selected = KTIPv6DNSItems[j].iSettingValue; - break; - } - j++; - } - - switch ( selected ) - { - case EIPv6WellKnown: - { - iCmPluginBaseEng.SetStringAttributeL( - aDNS1ServAttribute, KKnownIp6NameServer1 ); - iCmPluginBaseEng.SetStringAttributeL( - aDNS2ServAttribute, KKnownIp6NameServer2 ); - - iCmPluginBaseEng.SetBoolAttributeL( - aDNSUsageAttribute, EFalse ); - - update = ETrue; - } - break; - - case EIPv6Unspecified: - { - iCmPluginBaseEng.SetStringAttributeL( - aDNS1ServAttribute, KDynamicIpv6Address ); - iCmPluginBaseEng.SetStringAttributeL( - aDNS2ServAttribute, KDynamicIpv6Address ); - iCmPluginBaseEng.SetBoolAttributeL( - aDNSUsageAttribute, ETrue ); - - update = ETrue; - } - break; - - case EIPv6UserDefined: - { - TInt err1; - TInt err2; - TBool cancelled(EFalse); - do - { - // These has to be reset to KErrNone in case of - // inputting an invalid address (DLAN-7FJD68). - err1 = KErrNone; - err2 = KErrNone; - - HBufC* dns1 = HBufC::NewLC( KMaxIPv6NameServerLength ); - HBufC* dns2 = HBufC::NewLC( KMaxIPv6NameServerLength ); - - TPtr dns1ptr( dns1->Des() ); - TPtr dns2ptr( dns2->Des() ); - - HBufC* temp = iCmPluginBaseEng.GetStringAttributeL( - aDNS1ServAttribute ); - dns1ptr.Copy( *temp ); - delete temp; temp = NULL; - - temp = iCmPluginBaseEng.GetStringAttributeL( - aDNS2ServAttribute ); - dns2ptr.Copy( *temp ); - delete temp; temp = NULL; - - // KDynamicIpv6Address is offered instead of empty string - if ( dns1ptr.Length() == 0 ) - { - dns1ptr = KDynamicIpv6Address; - } - if ( dns2ptr.Length() == 0 ) - { - dns2ptr = KDynamicIpv6Address; - } - - - if ( ( dns1ptr.Compare( KKnownIp6NameServer1 ) == 0 ) && - ( dns2ptr.Compare( KKnownIp6NameServer2 ) == 0 ) ) - { // special value, well-known - // in this case 'dynamic' string must be offered so - // temp data must be changed to 'dynamic' - dns1ptr = KDynamicIpv6Address; - dns2ptr = KDynamicIpv6Address; - } - - CCmPluginMultiLineDialog* ipquery = - CCmPluginMultiLineDialog::NewL( dns1ptr, - dns2ptr ); - - if ( ipquery->ExecuteLD( R_DNSIP6_QUERY ) ) - { - TInetAddr dns1Addr; - TInetAddr dns2Addr; - - if ( dns1ptr.Compare( KNullDesC ) ) - { - err1 = dns1Addr.Input( dns1ptr ); - } - if ( dns2ptr.Compare( KNullDesC ) ) - { - err2 = dns2Addr.Input( dns2ptr ); - } - if ( err1 || err2 ) - { - TCmCommonUi::ShowNoteL - ( R_QTN_SET_INFO_INVALID_IP, - TCmCommonUi::ECmErrorNote ); - } - else - { - iCmPluginBaseEng.SetDNSServerAddressL( - aDNS1ServAttribute, - dns1ptr, - aDNS2ServAttribute, - dns2ptr, - aDNSUsageAttribute, - ETrue ); - - update = ETrue; - } - } - else - { - cancelled = ETrue; - } - CleanupStack::PopAndDestroy( dns2 ); - CleanupStack::PopAndDestroy( dns1 ); - } while ( (err1 || err2) && (!cancelled) ); - break; - } - default: - { - User::Leave( KErrNotSupported ); - } - } - } - - if( update ) - { - UpdateListBoxContentL(); - } - - return selected; - } - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::TitleId -//--------------------------------------------------------------------------- -// -TUint32 CmPluginBaseSettingsDlg::TitleId( TUint32 aConvTitleId, - TUint32 aTitleId ) const - { - TUint32 titleId( 0 ); - if ( aTitleId ) - { - titleId = aTitleId; - } - else if ( !titleId ) - { - titleId = aConvTitleId; - } - - return titleId; - } - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::SetTitleL -//--------------------------------------------------------------------------- -// -void CmPluginBaseSettingsDlg::SetTitleL( CAknSettingPage* aDlg, - TUint32 aConvTitleId, - TUint32 aTitleId ) const - { - TUint32 titleId( TitleId( aConvTitleId, aTitleId ) ); - - if ( titleId ) - { - HBufC* title = StringLoader::LoadLC( titleId ); - aDlg->SetSettingTextL( *title ); - CleanupStack::PopAndDestroy( title ); - } - } - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::EditorId -//--------------------------------------------------------------------------- -// -TUint32 CmPluginBaseSettingsDlg::EditorId( TUint32 aConvEditorId, - TUint32 aEditorId ) const - { - TUint32 resId( 0 ); - if ( aConvEditorId ) - { - resId = aConvEditorId; - } - if ( !resId ) - { - resId = aEditorId; - } - - return resId; - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::GetIPv6DNSTypeL -// -------------------------------------------------------------------------- -// -EXPORT_C TInt CmPluginBaseSettingsDlg::GetIPv6DNSTypeL( - TUint32 aDNS1ServAttribute, - TUint32 aDNS2ServAttribute ) - { - TIPv6Types retval( EIPv6UserDefined ); - - HBufC* priServ = NULL; - priServ = iCmPluginBaseEng.GetStringAttributeL( aDNS1ServAttribute ); - CleanupStack::PushL( priServ ); - TPtr16 ptr1( priServ->Des() ); - - HBufC* secServ = NULL; - secServ = iCmPluginBaseEng.GetStringAttributeL( aDNS2ServAttribute ); - CleanupStack::PushL( secServ ); - TPtr16 ptr2( secServ->Des() ); - - // net type 6: if IspIPv6NameServ <> 0.0.0.0 - // => User defined OR well-known - - if ( ( !ptr1.Compare( KKnownIp6NameServer1 ) ) - && ( !ptr2.Compare( KKnownIp6NameServer2 ) ) ) - { // special value, well-known - retval = EIPv6WellKnown; - } - else - { - // dynamic, if 0:0:... - // OR EMPTY text... - if ( ( ( !ptr1.Compare( KDynamicIpv6Address ) ) - || ( !ptr1.Compare( KNullDesC ) ) ) - &&( ( !ptr2.Compare( KDynamicIpv6Address ) ) - ||( !ptr2.Compare( KDynamicIpv6Address ) ) ) ) - { // dynamic, 0:0:... - retval = EIPv6Unspecified; - } - else - { // other value, user defined - retval = EIPv6UserDefined; - } - } - - CleanupStack::PopAndDestroy( 2, priServ ); - - return retval; - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::HandleResourceChange -// -------------------------------------------------------------------------- -// - -EXPORT_C void CmPluginBaseSettingsDlg::HandleResourceChange( TInt aType ) - { - CCoeControl::HandleResourceChange( aType ); - - CAknDialog::HandleResourceChange(aType); - - if( aType == KEikDynamicLayoutVariantSwitch ) - { - DrawNow(); - } - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::Execute -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::Execute() - { - iProcessing = ETrue; - - TRAPD( err, ProcessCommandL( EAknSoftkeyChange ) ); - if ( err ) - { - HandleLeaveError( err ); - } - iProcessing = EFalse; - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::HandleLeaveError -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlg::HandleLeaveError( TInt aError ) -{ - switch( aError ) - { - case KLeaveWithoutAlert: - case KErrNoMemory: - // Indicate no memory to save setting changes - iIsPossibleToSaveSetting = EFalse; - - if (iProcessing) - { - // Release processing protection so that the next processing can be done - iProcessing = EFalse; - } - break; - default: - // More leave errors may be handled if necessary - // Now other leave errors are ignored here - break; - } -} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmpbasesettingsdlgadv.cpp --- a/cmmanager/cmmgr/Framework/Src/cmpbasesettingsdlgadv.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Dialog for advanced settings for plugin base. -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include "cmpluginmenucommands.hrh" -#include "cmmanager.hrh" - -using namespace CMManager; - -enum TSMTPSettingIds - { - EPluginBaseCmCmdSmtp - }; - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlgAdv::CmPluginBaseSettingsDlgAdv() -// -------------------------------------------------------------------------- -// -EXPORT_C CmPluginBaseSettingsDlgAdv::CmPluginBaseSettingsDlgAdv( - CCmPluginBaseEng& aCmPluginBase ) - : CmPluginBaseSettingsDlg( aCmPluginBase ) - { - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlgAdv::~CmPluginBaseSettingsDlgAdv -// Destructor -// -------------------------------------------------------------------------- -// -EXPORT_C CmPluginBaseSettingsDlgAdv::~CmPluginBaseSettingsDlgAdv() - { - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlgAdv::DynInitMenuPaneL -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlgAdv::DynInitMenuPaneL( - TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - CmPluginBaseSettingsDlg::DynInitMenuPaneL( aResourceId, aMenuPane ); - if ( aResourceId == R_PLUGIN_BASE_MENU ) - { - aMenuPane->SetItemDimmed( EPluginBaseCmdAdvanced, ETrue ); - } - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlgAdv::UpdateListBoxContentBearerSpecificL -// -------------------------------------------------------------------------- -// -void CmPluginBaseSettingsDlgAdv::UpdateListBoxContentBearerSpecificL( - CDesCArray& /*aItemArray*/ ) - { - // Empty implementation - forced by inheritance - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlgAdv::RunAdvancedSettingsL -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlgAdv::RunAdvancedSettingsL() - { - // Empty implementation. This function has no meaning here - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlgAdv::UpdateListBoxContentL -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlgAdv::UpdateListBoxContentL() - { - // Must save listbox indexes because content will be deleted - TInt lastListBoxPos = iListbox->CurrentItemIndex(); - TInt lastListBoxTopPos = iListbox->TopItemIndex(); - - // deleting listbox content - MDesCArray* itemList = iListbox->Model()->ItemTextArray(); - CDesCArray* itemArray = (CDesCArray*)itemList; - while ( itemArray->Count() ) - { - itemArray->Delete( 0 ); - } - while ( iSettingIndex->Count() ) - { - iSettingIndex->Delete( 0 ); - } - - UpdateListBoxContentBearerSpecificL( *itemArray ); - - // Handle content changes - iListbox->Reset(); - - iListbox->HandleItemAdditionL(); - - // Listbox might not have index - if ( lastListBoxPos != -1 ) - { - iListbox->SetCurrentItemIndex( lastListBoxPos ); - iListbox->SetTopItemIndex( lastListBoxTopPos ); - } - // Draw it - iListbox->DrawNow(); - } - -//--------------------------------------------------------------------------- -// CmPluginBaseSettingsDlgAdv::ShowPopupSettingPageL -//--------------------------------------------------------------------------- -// -EXPORT_C TBool CmPluginBaseSettingsDlgAdv::ShowPopupSettingPageL( - TInt aAttribute, TInt aCommandId ) - { - TBool retval( EFalse ); - - switch ( aAttribute ) - { - case EPluginBaseCmCmdSmtp: - { - // Show the SMTP settings page - User::Leave( KErrNotSupported ); - break; - } - default: - { - CmPluginBaseSettingsDlg::ProcessCommandL( aCommandId ); - break; - } - } - return retval; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmpbasesettingsdlgip.cpp --- a/cmmanager/cmmgr/Framework/Src/cmpbasesettingsdlgip.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Dialog for IPv4 settings for plugin base. -* -*/ - -#include - -#include -#include -#include -#include "cmmanager.hrh" - -using namespace CMManager; - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlgIp::CmPluginBaseSettingsDlgIp() -// -------------------------------------------------------------------------- -// -EXPORT_C CmPluginBaseSettingsDlgIp::CmPluginBaseSettingsDlgIp( - CCmPluginBaseEng& aCmPluginBase ) - : CmPluginBaseSettingsDlg( aCmPluginBase ) - { - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlgIp::~CmPluginBaseSettingsDlgIp -// Destructor -// -------------------------------------------------------------------------- -// -EXPORT_C CmPluginBaseSettingsDlgIp::~CmPluginBaseSettingsDlgIp() - { - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlgIp::DynInitMenuPaneL -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlgIp::DynInitMenuPaneL( - TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - CmPluginBaseSettingsDlg::DynInitMenuPaneL( aResourceId, aMenuPane ); - if ( aResourceId == R_PLUGIN_BASE_MENU ) - { - aMenuPane->SetItemDimmed( EPluginBaseCmdAdvanced, ETrue ); - } - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlgIp::UpdateListBoxContentBearerSpecificL -// -------------------------------------------------------------------------- -// -void CmPluginBaseSettingsDlgIp::UpdateListBoxContentBearerSpecificL( - CDesCArray& /*aItemArray*/ ) - { - // Empty implementation - forced by inheritance - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlgIp::RunAdvancedSettingsL -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlgIp::RunAdvancedSettingsL() - { - // Empty implementation. This function has no meaning here - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlgIp::UpdateListBoxContentL -// -------------------------------------------------------------------------- -// -EXPORT_C void CmPluginBaseSettingsDlgIp::UpdateListBoxContentL() - { - // Must save listbox indexes because content will be deleted - TInt lastListBoxPos = iListbox->CurrentItemIndex(); - TInt lastListBoxTopPos = iListbox->TopItemIndex(); - - // deleting listbox content - MDesCArray* itemList = iListbox->Model()->ItemTextArray(); - CDesCArray* itemArray = (CDesCArray*)itemList; - while ( itemArray->Count() ) - { - itemArray->Delete( 0 ); - } - while ( iSettingIndex->Count() ) - { - iSettingIndex->Delete( 0 ); - } - - UpdateListBoxContentBearerSpecificL( *itemArray ); - - // Handle content changes - iListbox->Reset(); - // Listbox might not have index - if ( lastListBoxPos != -1 ) - { - iListbox->SetCurrentItemIndex( lastListBoxPos ); - iListbox->SetTopItemIndex( lastListBoxTopPos ); - } - // Draw it - iListbox->DrawNow(); - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmpluginbase.cpp --- a/cmmanager/cmmgr/Framework/Src/cmpluginbase.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,823 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of plugin base class -* -*/ - -#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#endif -#include -#include // RSocketServ, RConnection -#include // KAfInet -#include // TConnectionInfo -#include -#include -#include -#include -#include - -#include -#include "cmmanagerimpl.h" -#include "cmdestinationimpl.h" -#include -#include -#include "cmlogger.h" -#include - -using namespace CMManager; -using namespace CommsDat; - - -// --------------------------------------------------------------------------- -// CCmPluginBase::CCmPluginBase -// --------------------------------------------------------------------------- -// -EXPORT_C CCmPluginBase::CCmPluginBase( CCmPluginBaseEng* plugin ) - : iPlugin( plugin ) - { - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::~CCmPluginBase -// --------------------------------------------------------------------------- -// -EXPORT_C CCmPluginBase::~CCmPluginBase() - { - if (iPlugin) - { - TRAP_IGNORE( CmMgr().RemoveCMFromPoolL(this) ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::ConstructL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::ConstructL() - { - iPlugin->ConstructL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::ConstructL -// --------------------------------------------------------------------------- -// - CCmPluginBase* CCmPluginBase::CreateInstanceL( TCmPluginInitParam& aInitParam ) - { - CCmPluginBaseEng* plugin = iPlugin->CreateInstanceL(aInitParam); - CleanupStack::PushL( plugin ); - CCmPluginBase* connMethod = new (ELeave) CCmPluginBase(plugin); - CleanupStack::Pop( plugin ); // plugin - return connMethod; - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::RunSettingsL -// --------------------------------------------------------------------------- -// -TInt CCmPluginBase::RunSettingsL() - { - return iPlugin->RunSettingsL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::InitializeWithUiL -// --------------------------------------------------------------------------- -// -TInt CCmPluginBase::InitializeWithUiL(TBool aManuallyConfigure) - { - return iPlugin->InitializeWithUiL(aManuallyConfigure); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::CanHandleIapIdL -// --------------------------------------------------------------------------- -// -TBool CCmPluginBase::CanHandleIapIdL(TUint32 aIapId) const - { - return iPlugin->CanHandleIapIdL(aIapId); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::CanHandleIapIdL -// --------------------------------------------------------------------------- -// -TBool CCmPluginBase::CanHandleIapIdL(CommsDat::CCDIAPRecord* aIapRecord) const - { - return iPlugin->CanHandleIapIdL(aIapRecord); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::AdditionalReset -// --------------------------------------------------------------------------- -// -void CCmPluginBase::AdditionalReset() - { - iPlugin->AdditionalReset(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::ServiceRecordIdLC -// --------------------------------------------------------------------------- -// -void CCmPluginBase::ServiceRecordIdLC(HBufC* &aServiceName, - TUint32& aRecordId) - { - iPlugin->ServiceRecordIdLC(aServiceName, aRecordId); - } - - -// --------------------------------------------------------------------------- -// CCmPluginBase::BearerRecordIdLC -// --------------------------------------------------------------------------- -// -void CCmPluginBase::BearerRecordIdLC(HBufC* &aBearerName, - TUint32& aRecordId) - { - iPlugin->BearerRecordIdLC(aBearerName, aRecordId); - } - - -// --------------------------------------------------------------------------- -// CCmPluginBase::PrepareToDeleteRecordsL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::PrepareToDeleteRecordsL() - { - iPlugin->PrepareToDeleteRecordsL(); - } - - -// --------------------------------------------------------------------------- -// CCmPluginBase::DeleteAdditionalRecordsL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::DeleteAdditionalRecordsL() - { - iPlugin->DeleteAdditionalRecordsL(); - } - - -// --------------------------------------------------------------------------- -// CCmPluginBase::CreateNewServiceRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::CreateNewServiceRecordL() - { - iPlugin->CreateNewServiceRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase:: -// --------------------------------------------------------------------------- -// -void CCmPluginBase::CreateAdditionalRecordsL() - { - iPlugin->CreateAdditionalRecordsL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::PrepareToCopyDataL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::PrepareToCopyDataL(CCmPluginBaseEng& aDestInst) const - { - iPlugin->PrepareToCopyDataL(aDestInst); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::CopyAdditionalDataL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::CopyAdditionalDataL(CCmPluginBaseEng& aDestInst) const - { - iPlugin->CopyAdditionalDataL(aDestInst); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::LoadAdditionalRecordsL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::LoadAdditionalRecordsL() - { - iPlugin->LoadAdditionalRecordsL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::UpdateAdditionalRecordsL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::UpdateAdditionalRecordsL() - { - iPlugin->UpdateAdditionalRecordsL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::IsLinkedToIap -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CCmPluginBase::IsLinkedToIap( TUint32 aIapId ) - { - return iPlugin->IsLinkedToIap( aIapId ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::IsLinkedToIap -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CCmPluginBase::IsLinkedToSnap( TUint32 aSnapId ) - { - return iPlugin->IsLinkedToSnap( aSnapId ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::GetIntAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C TUint32 - CCmPluginBase::GetIntAttributeL( const TUint32 aAttribute ) const - { - return iPlugin->GetIntAttributeL(aAttribute); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::GetBoolAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C TBool - CCmPluginBase::GetBoolAttributeL( const TUint32 aAttribute ) const - { - return iPlugin->GetBoolAttributeL(aAttribute); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::GetStringAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C HBufC* - CCmPluginBase::GetStringAttributeL( const TUint32 aAttribute ) const - { - return iPlugin->GetStringAttributeL(aAttribute); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::GetString8AttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C HBufC8* - CCmPluginBase::GetString8AttributeL( const TUint32 aAttribute ) const - { - return iPlugin->GetString8AttributeL(aAttribute); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::SetIntAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::SetIntAttributeL( const TUint32 aAttribute, - TUint32 aValue ) - { - iPlugin->SetIntAttributeL(aAttribute, aValue); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::SetBoolAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::SetBoolAttributeL( const TUint32 aAttribute, - TBool aValue ) - { - iPlugin->SetBoolAttributeL(aAttribute, aValue); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::SetStringAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::SetStringAttributeL( const TUint32 aAttribute, - const TDesC16& aValue ) - { - iPlugin->SetStringAttributeL(aAttribute, aValue); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::SetString8AttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::SetString8AttributeL( const TUint32 aAttribute, - const TDesC8& aValue ) - { - iPlugin->SetString8AttributeL(aAttribute, aValue); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::RestoreAttributeL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::RestoreAttributeL( const TUint32 aAttribute ) - { - iPlugin->RestoreAttributeL(aAttribute); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::Destination -// --------------------------------------------------------------------------- -// -EXPORT_C CCmDestinationImpl* CCmPluginBase::Destination() const - { - return iPlugin->Destination(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::UpdateL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::UpdateL() - { - iPlugin->UpdateL(); - iPlugin->SetIdValidity(ETrue); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::NumOfConnMethodReferencesL -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CCmPluginBase::NumOfConnMethodReferencesL() - { - return iPlugin->NumOfConnMethodReferencesL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::Session -// --------------------------------------------------------------------------- -// -EXPORT_C CMDBSession& CCmPluginBase::Session()const - { - return iPlugin->Session(); - } - -// --------------------------------------------------------------------------- -// Delete this connection methond. -// Record ids are checked to be sure that we delete only records -// that were loaded before. -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CCmPluginBase::DeleteL( TBool aForced, - TBool aOneRefAllowed ) - { - return iPlugin->DeleteL(aForced, aOneRefAllowed); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::LoadL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::LoadL( TUint32 aIapId ) - { - iPlugin->LoadL(aIapId); - CmMgr().ConnMethodUpdatedL( this->Plugin() ); - iPlugin->SetIdValidity(ETrue); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::ReLoadL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::ReLoadL() - { - TUint32 cmID = iPlugin->GetIntAttributeL( ECmId ); - TUint32 refCounter = iPlugin->iRefCounter; - - iPlugin->iRefCounter = 1; - CCmManagerImpl* mgr = &CmMgr(); - mgr->RemoveCMFromPoolL(iPlugin); - iPlugin = NULL; - CCmPluginBase* cm = mgr->GetConnectionMethodL( cmID ); - iPlugin = cm->iPlugin; - cm->iPlugin = NULL; - delete cm; - iPlugin->SetIdValidity(ETrue); - iPlugin->iRefCounter = refCounter; - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::CreateNewL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::CreateNewL() - { - iPlugin->CreateNewL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::CreateCopyL -// --------------------------------------------------------------------------- -// -EXPORT_C CCmPluginBase* CCmPluginBase::CreateCopyL() const - { - CCmPluginBaseEng* plugin = iPlugin->CreateCopyL(); - CleanupStack::PushL( plugin ); - CCmPluginBase* connMethod = CmMgr().CreateConnectionMethodL(plugin); - CleanupStack::Pop( plugin ); - return connMethod; - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::AddResourceFileL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::AddResourceFileL( const TDesC& aName ) - { - iPlugin->AddResourceFileL(aName); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::RemoveResourceFile -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::RemoveResourceFile( const TDesC& aName ) - { - iPlugin->RemoveResourceFile(aName); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::AllocReadL -// --------------------------------------------------------------------------- -// -EXPORT_C HBufC* CCmPluginBase::AllocReadL( TInt aResourceId ) const - { - return iPlugin->AllocReadL( aResourceId ); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::OpenTransactionLC -// --------------------------------------------------------------------------- -// -void CCmPluginBase::OpenTransactionLC() - { - iPlugin->OpenTransactionLC(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::CommitTransactionL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::CommitTransactionL( TInt aError ) - { - iPlugin->CommitTransactionL(aError); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::PrepareToLoadRecordsL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::DoLoadL( TUint32 aIapId ) - { - iPlugin->CommitTransactionL(aIapId); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::PrepareToLoadRecordsL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::PrepareToLoadRecordsL() - { - iPlugin->PrepareToLoadRecordsL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::LoadIAPRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::LoadIAPRecordL( TUint32 aIapId ) - { - iPlugin->LoadIAPRecordL(aIapId); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::LoadProxySettingL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::LoadProxySettingL() - { - iPlugin->LoadProxySettingL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::LoadServiceSettingL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::LoadServiceSettingL() - { - iPlugin->LoadServiceSettingL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::LoadChargeCardSettingL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::LoadChargeCardSettingL( TUint32 aRecordId ) - { - iPlugin->LoadChargeCardSettingL(aRecordId); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::LoadNetworkSettingL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::LoadNetworkSettingL() - { - iPlugin->LoadNetworkSettingL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::LoadLocationSettingL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::LoadLocationSettingL() - { - iPlugin->LoadLocationSettingL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::PrepareToUpdateRecordsL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::PrepareToUpdateRecordsL() - { - iPlugin->PrepareToUpdateRecordsL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::UpdateIAPRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::UpdateIAPRecordL() - { - iPlugin->UpdateIAPRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::UpdateProxyRecordL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::UpdateProxyRecordL() - { - iPlugin->UpdateProxyRecordL(); - } - - -// --------------------------------------------------------------------------- -// CCmPluginBase::UpdateSeamlessnessRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::UpdateSeamlessnessRecordL() - { - iPlugin->UpdateSeamlessnessRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::UpdateChargeCardRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::UpdateChargeCardRecordL() - { - iPlugin->UpdateChargeCardRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::UpdateServiceRecordL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::UpdateServiceRecordL() - { - iPlugin->UpdateServiceRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::UpdateNetworkRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::UpdateNetworkRecordL() - { - iPlugin->UpdateNetworkRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::UpdateLocationRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::UpdateLocationRecordL() - { - iPlugin->UpdateLocationRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::UpdateConnPrefSettingL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::UpdateConnPrefSettingL() - { - iPlugin->UpdateConnPrefSettingL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::EnableProxyL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::EnableProxyL( TBool aEnable ) - { - iPlugin->EnableProxyL(aEnable); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::EnableChargeCardL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::EnableChargeCardL( TBool aEnable ) - { - iPlugin->EnableChargeCardL(aEnable); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::EnableLocationL -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginBase::EnableLocationL( TBool aEnable ) - { - iPlugin->EnableLocationL(aEnable); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::LoadWapRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::LoadWapRecordL() - { - iPlugin->LoadWapRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::LoadSeamlessnessRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::LoadSeamlessnessRecordL() - { - iPlugin->LoadSeamlessnessRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::UpdateWapRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::UpdateWapRecordL() - { - iPlugin->UpdateWapRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::NewWapRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginBase::NewWapRecordL() - { - iPlugin->NewWapRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::NewSeamlessnessRecordL -// --------------------------------------------------------------------------- -// -CCDIAPMetadataRecord* CCmPluginBase::NewSeamlessnessRecordL( TBool aSetDef ) - { - return iPlugin->NewSeamlessnessRecordL(aSetDef); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::SetAttribute -// --------------------------------------------------------------------------- -// -void CCmPluginBase::SetAttribute( CCDRecordBase* aRecord, - TUint32 aAttribute, - TBool aSet ) - { - iPlugin->SetAttribute(aRecord, aAttribute, aSet); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::CopyAttributes -// --------------------------------------------------------------------------- -// -void CCmPluginBase::CopyAttributes( CCDRecordBase* aSrcRecord, - CCDRecordBase* aDstRecord ) - { - iPlugin->CopyAttributes(aSrcRecord, aDstRecord); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::FindWAPRecordL -// --------------------------------------------------------------------------- -// -CCDWAPIPBearerRecord* CCmPluginBase::FindWAPRecordL() - { - return iPlugin->FindWAPRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::FindSeamlessnessRecordL -// --------------------------------------------------------------------------- -// -CCDIAPMetadataRecord* CCmPluginBase::FindSeamlessnessRecordL() - { - return iPlugin->FindSeamlessnessRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::IAPRecordElementId -// --------------------------------------------------------------------------- -TMDBElementId CCmPluginBase::IAPRecordElementId() const - { - return iPlugin->IAPRecordElementId(); - } -// --------------------------------------------------------------------------- -// CCmPluginBase::ParentDestination -// --------------------------------------------------------------------------- -EXPORT_C CCmDestinationImpl* CCmPluginBase::ParentDestination() const - { - return iPlugin->ParentDestination(); - } - -// --------------------------------------------------------------------------- -// CCmPluginBase::CmMgr -// --------------------------------------------------------------------------- -EXPORT_C CCmManagerImpl& CCmPluginBase::CmMgr() const - { - return iPlugin->CmMgr(); - }; - - -// --------------------------------------------------------------------------- -// CCmPluginBase::Plugin -// --------------------------------------------------------------------------- -void CCmPluginBase::SetPlugin(CCmPluginBaseEng* aPlugin) - { - iPlugin = aPlugin; - }; - -// --------------------------------------------------------------------------- -// CCmPluginBase::Plugin -// --------------------------------------------------------------------------- -EXPORT_C CCmPluginBaseEng* CCmPluginBase::Plugin() const - { - return iPlugin; - }; - -// ----------------------------------------------------------------------------- -// CCmPluginBase::IncrementRefCounter -// ----------------------------------------------------------------------------- -void CCmPluginBase::IncrementRefCounter() - { - iPlugin->IncrementRefCounter(); - } -// ----------------------------------------------------------------------------- -// CCmPluginBase::DecrementRefCounter -// ----------------------------------------------------------------------------- -void CCmPluginBase::DecrementRefCounter() - { - iPlugin->DecrementRefCounter(); - } -// ----------------------------------------------------------------------------- -// CCmPluginBase::GetRefCounter -// ----------------------------------------------------------------------------- -TInt CCmPluginBase::GetRefCounter() - { - return iPlugin->GetRefCounter(); - } - -// ----------------------------------------------------------------------------- -// CCmPluginBase::GetAdditionalUids -// ----------------------------------------------------------------------------- -EXPORT_C void CCmPluginBase::GetAdditionalUids( RArray& aIapIds ) - { - iPlugin->GetAdditionalUids( aIapIds ); - } - -//----------------------------------------------------------------------------- -// CCmPluginBase::FilterPossibleParentsL -// ----------------------------------------------------------------------------- -void CCmPluginBase::FilterPossibleParentsL( RArray& aDests ) - { - iPlugin->FilterPossibleParentsL( aDests ); - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmpluginlanbase.cpp --- a/cmmanager/cmmgr/Framework/Src/cmpluginlanbase.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,328 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of base for Lan Plugin interface -* for Lan Bearer. -* -*/ -#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#endif -#include -#include "cmlogger.h" -#include // For REComSession -#include -#include -#include "cmmanagerimpl.h" -#include -#include - -using namespace CMManager; -using namespace CommsDat; - -// default values for fields... -// CONSTANTS -_LIT( KEmpty, ""); - -_LIT( KLanBearerName, "LANBearer" ); -_LIT( KLanBearerAgent, "lanagt.agt" ); -_LIT( KLanBearerNif, "lannif" ); - -_LIT( KLanLDDName, "not used" ); -_LIT( KLanPDDName, "not used" ); - -const TInt KLanLastSocketActivityTimeout = -1; -const TInt KLanLastSocketClosedTimeout = -1; - -const TBool KDefIpAddrFromServer = ETrue; -const TBool KDefIpDnsAddrFromServer = ETrue; -const TBool KDefIp6DnsAddrFromServer = ETrue; - -static const TCmAttribConvTable SLanConvTbl[] = - { - { ELanBaseIfNetworks, ELanBaseRangeMax, NULL }, - { ELanBaseIfNetworks, KCDTIdLANIfNetworks, NULL }, - { ELanBaseIpNetMask, KCDTIdLANIpNetMask, &CheckIPv4ValidityL, - R_QTN_NETW_SETT_SUBNET_MASK, - KIpAddressWidth, EConvCompulsory | EConvIPv4, R_QTN_SELEC_SETTING_COMPULSORY, 0, NULL, NULL }, - { ELanBaseIpGateway, KCDTIdLANIpGateway, &CheckIPv4ValidityL, - R_QTN_NETW_SETT_DEFAULT_GATEWAY, - KIpAddressWidth, EConvCompulsory | EConvIPv4, R_QTN_SELEC_SETTING_COMPULSORY, 0, NULL, NULL }, - { ELanBaseIpAddrFromServer, KCDTIdLANIpAddrFromServer, NULL }, - { ELanBaseIpAddr, KCDTIdLANIpAddr, &CheckIPv4ValidityL, - R_QTN_SET_IP_ADDRESS, - KIpAddressWidth, EConvIPv4, R_QTN_SET_IP_ADDRESS_DYNAMIC, 0, NULL, NULL }, - { ELanBaseIpDNSAddrFromServer, KCDTIdLANIpDNSAddrFromServer, NULL, - R_QTN_SET_DNS_SERVERS_IP, - 0, 0, 0, 0, NULL, NULL }, - { ELanBaseIpNameServer1, KCDTIdLANIpNameServer1, &CheckIPv4ValidityL, - R_QTN_SET_PRIMARY_DNS, - KMaxIPv4NameServerLength, EConvIPv4, R_QTN_SET_DNS_SERVERS_AUTOMATIC, 0, NULL, NULL }, - { ELanBaseIpNameServer2, KCDTIdLANIpNameServer2, &CheckIPv4ValidityL, - R_QTN_SET_SECONDARY_DNS, - KMaxIPv4NameServerLength, EConvIPv4, R_QTN_SET_DNS_SERVERS_AUTOMATIC, 0, NULL, NULL }, - { ELanBaseIp6DNSAddrFromServer, KCDTIdLANIp6DNSAddrFromServer, NULL, - R_QTN_SET_DNS_SERVERS_IP, - 0, 0, 0, 0, NULL, NULL }, - { ELanBaseIp6NameServer1, KCDTIdLANIp6NameServer1, &CheckIPv6ValidityL }, - { ELanBaseIp6NameServer2, KCDTIdLANIp6NameServer2, &CheckIPv6ValidityL }, - { ELanBaseIpAddrLeaseValidFrom, KCDTIdLANIpAddrLeaseValidFrom, NULL }, - { ELanBaseIpAddrLeaseValidTo, KCDTIdLANIpAddrLeaseValidTo, NULL }, - { ELanBaseConfigDaemonManagerName, KCDTIdLANConfigDaemonManagerName, NULL }, - { ELanBaseConfigDaemonName, KCDTIdLANConfigDaemonName, NULL }, - { ELanBaseServiceExtensionTableName, KCDTIdLANServiceExtensionTableName, NULL }, - { ELanBaseServiceExtensionTableRecordId, KCDTIdLANServiceExtensionTableRecordId, &CheckRecordIdValidityL }, - { 0,0, NULL } - }; - -static const TCmCommonAttrConvArrayItem SCommonConvTbl[] = -{ - { ELanBaseIfNetworks, ECmIFNetworks }, - { ELanBaseIpNetMask, ECmIPNetmask }, - { ELanBaseIpGateway, ECmIPGateway }, - { ELanBaseIpAddrFromServer, ECmIPAddFromServer }, - { ELanBaseIpAddr, ECmIPAddress }, - { ELanBaseIpDNSAddrFromServer, ECmIPDNSAddrFromServer }, - { ELanBaseIpNameServer1, ECmIPNameServer1 }, - { ELanBaseIpNameServer2, ECmIPNameServer2 }, - { ELanBaseIp6DNSAddrFromServer, ECmIP6DNSAddrFromServer }, - { ELanBaseIp6NameServer1, ECmIP6NameServer1 }, - { ELanBaseIp6NameServer2, ECmIP6NameServer2 }, - { ELanBaseIpAddrLeaseValidFrom, ECmIPAddrLeaseValidFrom }, - { ELanBaseIpAddrLeaseValidTo, ECmIPAddrLeaseValidTo }, - { ELanBaseConfigDaemonManagerName, ECmConfigDaemonManagerName }, - { ELanBaseConfigDaemonName, ECmConfigDaemonName }, - { 0, 0 } - }; - -// --------------------------------------------------------------------------- -// CCmPluginLanBase::CCmPluginLanBase() -// --------------------------------------------------------------------------- -// -EXPORT_C CCmPluginLanBase::CCmPluginLanBase( TCmPluginInitParam* aInitParam ) - : CCmPluginBaseEng( aInitParam ) - { - CLOG_CREATE; - - - } - -EXPORT_C CCmPluginLanBase::~CCmPluginLanBase() - { - CLOG_CLOSE; - } - -// --------------------------------------------------------------------------- -// CCmPluginLanBase::ConstructL() -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginLanBase::ConstructL() - { - LOGGER_ENTERFN( "CCmPluginLanBase::ConstructL" ); - - CCmPluginBaseEng::ConstructL(); - - AddConverstionTableL( (CCDRecordBase**)&iServiceRecord, NULL, SLanConvTbl ); - AddCommonConversionTableL( SCommonConvTbl ); - } - -// --------------------------------------------------------------------------- -// CCmPluginLanBase::RunSettingsL() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CCmPluginLanBase::RunSettingsL() - { - User::Leave( KErrNotSupported ); - return 0; - } - -// --------------------------------------------------------------------------- -// CCmPluginLanBase::InitializeWithUiL() -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CCmPluginLanBase::InitializeWithUiL( - TBool /*aManuallyConfigure*/ ) - { - User::Leave(KErrNotSupported); - return ETrue; - } - -// --------------------------------------------------------------------------- -// CCmPluginLanBase::LoadServiceSettingL() -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginLanBase::LoadServiceSettingL() - { - LOGGER_ENTERFN( "CCmPluginLanBase::LoadServiceSettingL" ); - - if( TPtrC(KCDTypeNameLANService) == iIapRecord->iServiceType ) - { - iServiceRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord)); - } - else - // this IAP service is not supported by this plugin. - { - User::Leave( KErrNotSupported ); - } - - CCmPluginBaseEng::LoadServiceSettingL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginLanBase::ServiceRecord() -// --------------------------------------------------------------------------- -// -EXPORT_C CCDLANServiceRecord& CCmPluginLanBase::ServiceRecord()const - { - LOGGER_ENTERFN( "CCmPluginLanBase::ServiceRecord" ); - return *static_cast(iServiceRecord); - } - -// --------------------------------------------------------------------------- -// CCmPluginLanBase::ServiceRecordIdLC -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginLanBase::ServiceRecordIdLC( HBufC* &aName, - TUint32& aRecordId ) - { - LOGGER_ENTERFN( "CCmPluginLanBase::ServiceRecordIdLC" ); - - aName = TPtrC( KCDTypeNameLANService ).AllocLC(); - aRecordId = iServiceRecord->RecordId(); - } - -// --------------------------------------------------------------------------- -// CCmPluginLanBase::BearerRecordIdLC() -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginLanBase::BearerRecordIdLC( HBufC* &aBearerName, - TUint32& aRecordId ) - { - LOGGER_ENTERFN( "CCmPluginLanBase::BearerRecordIdLC" ); - - CCDLANBearerRecord* tmprec = static_cast - (CCDRecordBase::RecordFactoryL( KCDTIdLANBearerRecord )); - CleanupStack::PushL( tmprec ); - - tmprec->iRecordName.SetL( TPtrC(iBearerRecName) ); - if ( !tmprec->FindL( Session() ) ) - { // bearer not found -> create dummy values - CLOG_WRITE( "No bearer found" ); - - tmprec->SetRecordId( KCDNewRecordRequest ); - tmprec->iBearerAgent = KLanBearerAgent; - tmprec->iRecordName = KLanBearerName; - tmprec->iLanBearerNifName = KLanBearerNif; - tmprec->iLanBearerLddName = KLanLDDName; - tmprec->iLanBearerPddName = KLanPDDName; - tmprec->iLastSocketActivityTimeout = - (TUint32)KLanLastSocketActivityTimeout; - tmprec->iLastSocketClosedTimeout = - (TUint32)KLanLastSocketClosedTimeout; - - tmprec->StoreL( Session() ); - } - - aRecordId = tmprec->RecordId(); - - CLOG_WRITE_2( "Name: [%S], id: [%d]", - &tmprec->iRecordName.GetL(), - aRecordId ); - - CleanupStack::PopAndDestroy( tmprec ); - - aBearerName = TPtrC(KCDTypeNameLANBearer).AllocLC(); - } - -// --------------------------------------------------------------------------- -// CCmPluginLanBase::CreateNewServiceRecordL() -// --------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginLanBase::CreateNewServiceRecordL() - { - LOGGER_ENTERFN( "CCmPluginLanBase::CreateNewServiceRecordL" ); - - delete iServiceRecord; - iServiceRecord = NULL; - - iServiceRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord)); - - // I do not think that we have to use the default record, - // but for compatibility with ApEngine, we write all fields - - CCDLANServiceRecord* record = - static_cast(iServiceRecord); - - - if( FeatureSupported( KFeatureIdIPv6 ) ) - { - record->iIfNetworks.SetL( KDefIspIfNetworksIPv4IPv6LAN ); - } - else - { - record->iIfNetworks.SetL( KDefIspIfNetworksIPv4 ); - } - -// record->iIpNetmask.SetL(); - - record->iIpGateway.SetL( KUnspecifiedIPv4 ); - record->iIpAddrFromServer.SetL( KDefIpAddrFromServer ); - - record->iIpAddr.SetL( KUnspecifiedIPv4 ); - - record->iIpDnsAddrFromServer.SetL( KDefIpDnsAddrFromServer ); - - record->iIpNameServer1.SetL( KUnspecifiedIPv4 ); - record->iIpNameServer2.SetL( KUnspecifiedIPv4 ); - record->iIp6DnsAddrFromServer.SetL( KDefIp6DnsAddrFromServer ); - record->iIp6NameServer1.SetL( KDynamicIpv6Address ); - record->iIp6NameServer2.SetL( KDynamicIpv6Address ); - -// record->iIpAddrLeaseValidFrom.SetL(); -// record->iIpAddrLeaseValidTo.SetL(); - - if ( KDefIpAddrFromServer ) - { - record->iConfigDaemonManagerName.SetL( KDaemonManagerName ); - record->iConfigDaemonName.SetL( KConfigDaemonName ); - } - else - { - record->iConfigDaemonManagerName.SetL( KEmpty ); - record->iConfigDaemonName.SetL( KEmpty ); - } - -// record->iServiceExtensionTableName.SetL(); -// record->iServiceExtensionTableRecordId.SetL(); - } - -// -------------------------------------------------------------------------- -// CCmPluginLanBase::PrepareToUpdateRecordsL() -// -------------------------------------------------------------------------- -// -EXPORT_C void CCmPluginLanBase::PrepareToUpdateRecordsL() - { - LOGGER_ENTERFN( "CCmPluginLanBase::PrepareToUpdateRecordsL" ); - - CheckDNSServerAddressL( ETrue, - ServiceRecord().iIp6NameServer1, - ServiceRecord().iIp6NameServer2, - ServiceRecord().iIp6DnsAddrFromServer ); - - CheckDNSServerAddressL( EFalse, - ServiceRecord().iIpNameServer1, - ServiceRecord().iIpNameServer2, - ServiceRecord().iIpDnsAddrFromServer ); - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmpluginmultilinedialog.cpp --- a/cmmanager/cmmgr/Framework/Src/cmpluginmultilinedialog.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmPluginMultiLineDialog. -* -*/ - -#include "cmpluginmultilinedialog.h" - -// --------------------------------------------------------------------------- -// CCmPluginMultiLineDialog::NewL -// --------------------------------------------------------------------------- -// -EXPORT_C CCmPluginMultiLineDialog* CCmPluginMultiLineDialog::NewL( - TDes& aText1, TDes& aText2, - TTone aTone ) - { - CCmPluginMultiLineDialog* self = - new (ELeave) CCmPluginMultiLineDialog(aTone); - CleanupStack::PushL(self); - - self->SetDataL( aText1, aText2 ); - - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CCmPluginMultiLineDialog::CCmPluginMultiLineDialog -// --------------------------------------------------------------------------- -// -CCmPluginMultiLineDialog::CCmPluginMultiLineDialog( const TTone& aTone ) -: CAknMultiLineDataQueryDialog( aTone ) - { - } - -// --------------------------------------------------------------------------- -// CCmPluginMultiLineDialog::UpdateLeftSoftKeyL -// --------------------------------------------------------------------------- -// -void CCmPluginMultiLineDialog::UpdateLeftSoftKeyL() - { - CAknMultiLineDataQueryDialog::UpdateLeftSoftKeyL(); - MakeLeftSoftkeyVisible( ETrue ); - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmsettingsui.cpp --- a/cmmanager/cmmgr/Framework/Src/cmsettingsui.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmSettingsUi. -* -*/ - -#include -#include "cmsettingsuiimpl.h" -#include - -//----------------------------------------------------------------------------- -// CCmSettingsUi::NewL() -//----------------------------------------------------------------------------- -// -EXPORT_C CCmSettingsUi* CCmSettingsUi::NewL() - { - CCmSettingsUi* self = new (ELeave) CCmSettingsUi(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); // self - return self; - } - -//----------------------------------------------------------------------------- -// CCmSettingsUi::CCmSettingsUi() -//----------------------------------------------------------------------------- -// -CCmSettingsUi::CCmSettingsUi() - { - } - -//----------------------------------------------------------------------------- -// CCmSettingsUi::~CCmSettingsUi() -//----------------------------------------------------------------------------- -// -EXPORT_C CCmSettingsUi::~CCmSettingsUi() - { - delete iImpl; - } - -//----------------------------------------------------------------------------- -// CCmSettingsUi::ConstructL() -//----------------------------------------------------------------------------- -// -void CCmSettingsUi::ConstructL() - { - iImpl = CCmSettingsUiImpl::NewL(); - } - -//----------------------------------------------------------------------------- -// CCmSettingsUi::RunSettingsL() -//----------------------------------------------------------------------------- -// -EXPORT_C CCmSettingsUi::TResult CCmSettingsUi::RunSettingsL() - { - if ( iImpl->RunSettingsL() == KDialogUserExit ) - { - return EExit; - } - else - { - return EBack; - } - } - -//----------------------------------------------------------------------------- -// CCmSettingsUi::SelectDestinationDlgL() -//----------------------------------------------------------------------------- -// -EXPORT_C TBool CCmSettingsUi::SelectDestinationDlgL( TUint32& aDestinationId ) - { - return iImpl->SelectDestinationDlgL( aDestinationId ); - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmsettingsuiimpl.cpp --- a/cmmanager/cmmgr/Framework/Src/cmsettingsuiimpl.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmSettingsUiImpl. -* -*/ - -#include - -#include "cmsettingsuiimpl.h" -#include "cmmanagerimpl.h" -#include "destdlg.h" -#include -#include "selectdestinationdlg.h" -#include - -//----------------------------------------------------------------------------- -// CCmSettingsUiImpl::NewL() -//----------------------------------------------------------------------------- -// -CCmSettingsUiImpl* CCmSettingsUiImpl::NewL() - { - CCmSettingsUiImpl* self = new (ELeave) CCmSettingsUiImpl(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -//----------------------------------------------------------------------------- -// CCmSettingsUiImpl::CCmSettingsUiImpl -//----------------------------------------------------------------------------- -// -CCmSettingsUiImpl::CCmSettingsUiImpl(): - iResourceReader( *CCoeEnv::Static() ) - { - } - -//----------------------------------------------------------------------------- -// CCmSettingsUiImpl::LoadResourceL -// Load the resource for the dll module -// ---------------------------------------------------------------------------- -// -TInt CCmSettingsUiImpl::LoadResourceL () - { - // Add resource file. - TParse* fp = new(ELeave) TParse(); - TInt err = fp->Set( KACMManagerResDirAndFileName, - &KDC_RESOURCE_FILES_DIR, - NULL ); - if ( err != KErrNone) - { - User::Leave( err ); - } - - TFileName resourceFileNameBuf = fp->FullName(); - delete fp; - - iResourceReader.OpenL (resourceFileNameBuf); - return err; - } - -//----------------------------------------------------------------------------- -// CCmSettingsUiImpl::~CCmSettingsUiImpl -//----------------------------------------------------------------------------- -// -CCmSettingsUiImpl::~CCmSettingsUiImpl() - { - delete iCmManagerImpl; - iResourceReader.Close(); - } - -//----------------------------------------------------------------------------- -// CCmSettingsUiImpl::ConstructL -//----------------------------------------------------------------------------- -// -void CCmSettingsUiImpl::ConstructL() - { - iCmManagerImpl = CCmManagerImpl::NewL(); - LoadResourceL(); - AknsUtils::SetAvkonSkinEnabledL( ETrue ); - } - -//----------------------------------------------------------------------------- -// CCmSettingsUiImpl::RunSettingsL -//----------------------------------------------------------------------------- -// -TInt CCmSettingsUiImpl::RunSettingsL() - { - CDestDlg* destDlg = new (ELeave) CDestDlg; - - TUint32 selected = 0; - // No need to push it on to the cleanup stack as CEikDialog::PrepareLC - // does this favour for us. - - TBool exiting = EFalse; - - TInt result = destDlg->ConstructAndRunLD( - iCmManagerImpl, 0, selected, exiting ); - - return ( exiting ) ? KDialogUserExit: KDialogUserBack; - } - -//----------------------------------------------------------------------------- -// CCmSettingsUiImpl::SelectDestinationDlgL -//----------------------------------------------------------------------------- -// -TBool CCmSettingsUiImpl::SelectDestinationDlgL( TUint32& aDestinationId ) - { - CSelectDestinationDlg* dlg = CSelectDestinationDlg::NewL( aDestinationId, - *iCmManagerImpl ); - - return dlg->ExecuteLD( R_CMMANAGER_LIST_QUERY_WITH_MSGBOX ); - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmtransactionhandler.cpp --- a/cmmanager/cmmgr/Framework/Src/cmtransactionhandler.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Common transaction handler of framework and plugins. -* -*/ - -#include -#include - -#include "cmlogger.h" -#include "cmmanagerimpl.h" -#include "cmtransactionhandler.h" - -using namespace CommsDat; - -const TUint32 KMaxOpenTransAttempts = 10; -const TUint32 KRetryAfter = 100000; - -// --------------------------------------------------------------------------- -// CCmTransactionHandler::NewL -// --------------------------------------------------------------------------- -// -CCmTransactionHandler* CCmTransactionHandler::NewL( CMDBSession& aDb ) - { - CCmTransactionHandler* self = new (ELeave) CCmTransactionHandler( aDb ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); // self - return self; - } - -// --------------------------------------------------------------------------- -// CCmTransactionHandler::CCmTransactionHandler -// --------------------------------------------------------------------------- -// -CCmTransactionHandler::CCmTransactionHandler( CMDBSession& aDb ) - : iDb( aDb ) - { - CLOG_CREATE; - } - -// --------------------------------------------------------------------------- -// CCmTransactionHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CCmTransactionHandler::ConstructL() - { - TRAPD( err, CCmManagerImpl::HasCapabilityL( ECapabilityNetworkControl ) ); - - if( !err ) - { - iProtectionFlag = ECDProtectedWrite; - } - else - { - iProtectionFlag = 0; - } - } - -// --------------------------------------------------------------------------- -// CCmTransactionHandler::~CCmTransactionHandler -// --------------------------------------------------------------------------- -// -CCmTransactionHandler::~CCmTransactionHandler() - { - CLOG_CLOSE; - } - -// --------------------------------------------------------------------------- -// CCmTransactionHandler::OpenTransactionLC -// --------------------------------------------------------------------------- -// -void CCmTransactionHandler::OpenTransactionLC( TBool aSetAttribs ) - { - LOGGER_ENTERFN( "CCmTransactionHandler::OpenTransactionL" ); - - ++iRefCount; - CLOG_WRITE_1( "Refs: [%d]", iRefCount ); - - // To call ::Close() on leave - CleanupClosePushL( *this ); - - // We don't have parent destination -> Session is opened only once - if( !iDb.IsInTransaction() ) - { - TInt err( KErrNone ); - TUint32 attempts( KMaxOpenTransAttempts ); - - do - { - CLOG_WRITE( "Opening" ); - TRAP( err, iDb.OpenTransactionL() ); - CLOG_WRITE_1( "Error: [%d]", err ); - - if( err ) - { - User::After( KRetryAfter ); - } - }while( err && attempts-- ); - - User::LeaveIfError( err ); - - if( aSetAttribs ) - { - iDb.SetAttributeMask( ECDHidden | iProtectionFlag ); - } - } - } - -// --------------------------------------------------------------------------- -// CCmTransactionHandler::CommitTransactionL -// --------------------------------------------------------------------------- -// -void CCmTransactionHandler::CommitTransactionL( TInt aError ) - { - LOGGER_ENTERFN( "CCmTransactionHandler::CommitTransactionL" ); - - --iRefCount; - CLOG_WRITE_1( "ref: [%d]", iRefCount ); - CLOG_WRITE_1( "Error: [%d]", aError ); - - CleanupStack::Pop( this ); - - if( !iRefCount ) - { - if( aError ) - { - iDb.RollbackTransactionL(); - } - else - { - iDb.CommitTransactionL(); - } - - iDb.ClearAttributeMask( ECDHidden | ECDProtectedWrite ); - } - } - -// --------------------------------------------------------------------------- -// CCmTransactionHandler::Close -// --------------------------------------------------------------------------- -// -void CCmTransactionHandler::Close() - { - LOGGER_ENTERFN( "CCmTransactionHandler::Close" ); - - if( 0 == iRefCount ) - { - CLOG_WRITE( "No active transaction. Do nothing" ); - return; - } - - if( !iDb.IsInTransaction() ) - // Sometimes CommsDat closes the transaction - // on its own decision w/o any notification or reaseon. - // e.g. when you try to delete a non-existing record. - // It leaves with KErrNotFound, but rolls back the transaction. - { - CLOG_WRITE( "CommsDat already rolled back transaction. :(((" ); - iRefCount = 0; - } - else - { - --iRefCount; - CLOG_WRITE_1( "ref: [%d]", iRefCount ); - - if( !iRefCount ) - { - iDb.ClearAttributeMask( ECDHidden | ECDProtectedWrite ); - - if( iDb.IsInTransaction() ) - { - TRAP_IGNORE( iDb.RollbackTransactionL() ); - } - } - } - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/cmwizard.cpp --- a/cmmanager/cmmgr/Framework/Src/cmwizard.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,487 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Wizard used for adding connection methods -* -*/ - -#include -#include -#include -#include -#include "cmwizard.h" -#include -#include -#include "cmdestinationimpl.h" -#include "cmlogger.h" -#include "cmmanagerimpl.h" -#include -#include -#include "selectdestinationdlg.h" - -using namespace CMManager; - -// --------------------------------------------------------------------------- -// CCmWizard::CCmWizard -// --------------------------------------------------------------------------- -// -CCmWizard::CCmWizard( CCmManagerImpl& aCmManager ) - : iCmManager( aCmManager ) - { - CLOG_CREATE; - } - -// --------------------------------------------------------------------------- -// CCmWizard::~CCmWizard -// --------------------------------------------------------------------------- -// -CCmWizard::~CCmWizard() - { - if( iCheckConnDlg ) - { - delete iCheckConnDlg; - } - CLOG_CLOSE; - } - -// --------------------------------------------------------------------------- -// CCmWizard::CreateConnectionMethodL -// --------------------------------------------------------------------------- -// -TInt CCmWizard::CreateConnectionMethodL - ( CCmDestinationImpl* aTargetDestination ) - { - TInt index( KErrCancel ); - - LOGGER_ENTERFN( "CCmWizard::CreateConnectionMethodL" ); - TBool wizardCancelled = EFalse; // indicates if the wizard has got cancelled - TUint32 bearerType = 0; - TBool manuallyConfigure ( EFalse ); - - if ( AutoCheckForCmsL() ) - { - RArray availableBearers( KCmArrayMediumGranularity ); - CleanupClosePushL( availableBearers ); - - CLOG_WRITE( "CCmWizard::Starting CheckForCms" ); - CheckForCmsL( availableBearers ); - - // If user has cancelled the dialog, then (s)he wanted to terminate - // the whole procedure. - if ( iCheckConnDlgCancelled ) - { - CLOG_WRITE( "CCmWizard::wizardCancelled" ); - wizardCancelled = ETrue; - } - else - { - // If there's coverage for at least one of the bearer types - if ( availableBearers.Count() ) - { - CLOG_WRITE_1( "CCmWizard::CreateConnectionMethodL av. bearers: [%d]", - availableBearers.Count() ); - // Show available conn methods in a list from which user has to - // select. - bearerType = TCmCommonUi::ShowAvailableMethodsL - ( availableBearers, - iCmManager ); - if ( !bearerType ) - { - wizardCancelled = ETrue; - CLOG_WRITE( "CCmWizard::wizardCancelled" ); - } - } - else // no coverage at all - { - CLOG_WRITE( "CCmWizard::CreateConnectionMethodL no available bearers, manual selection." ); - // "Do you want to configure conn methods manually?" - if ( ManualCheckForCmsL() ) - { - // Yes, select a bearer manually - bearerType = TCmCommonUi::SelectBearerL( iCmManager ); - if ( !bearerType ) - { - // Cancelled dialog - wizardCancelled = ETrue; - } - else - { - manuallyConfigure = ETrue; - } - } - else - { - // No, user has cancelled the dialog - wizardCancelled = ETrue; - } - } - } - - CleanupStack::PopAndDestroy( &availableBearers ); - } - else // "No" for checking conn methods automatically - { - CLOG_WRITE( "CCmWizard::AutoCheckForCmsL returned FALSE" ); - // Manual bearer selection - bearerType = TCmCommonUi::SelectBearerL( iCmManager ); - if ( !bearerType ) - { - // Cancelled dialog - wizardCancelled = ETrue; - } - else - { - manuallyConfigure = ETrue; - } - } - - if ( !wizardCancelled ) - { - CCmPluginBase* plugin = iCmManager.CreateConnectionMethodL( - bearerType, aTargetDestination ); - CleanupStack::PushL( plugin ); - - CLOG_WRITE( "CCmWizard::CreateConnectionMethodL plugin created, starting initialization" ); - - // Bearer-specific UI-supported initialization is done by plug-ins - TBool ret = EFalse; - TRAPD(err, ret = plugin->InitializeWithUiL( manuallyConfigure ) ); - if ( err == KErrNone && ret ) - { - CCmDestinationImpl* targetDest = aTargetDestination; - // If target destination is not yet specified... - if ( !aTargetDestination ) - { - // For virtual bearers: eliminated the underlying destination - // from the destination selection dialog - TUint32 targetDestId( 0 ); - - RArray destArray( iCmManager.DestinationCountL() ); - CleanupClosePushL( destArray ); - iCmManager.AllDestinationsL( destArray ); - // now do the filtering - plugin->FilterPossibleParentsL( destArray ); - - if ( !destArray.Count() ) - { - // there are no destinations to put the CM into - TCmCommonUi::ShowNoteL( R_CMWIZARD_NO_VPN_STACKING, - TCmCommonUi::ECmErrorNote ); - - CleanupStack::PopAndDestroy( &destArray ); - CleanupStack::PopAndDestroy( plugin ); - - CLOG_WRITE_1( "CCmWizard::CreateConnectionMethodL no valid parents after filtering, index: [%d]", index ); - return index; - } - - // ... then let the user select a destination. - CSelectDestinationDlg* dlg = CSelectDestinationDlg::NewL( targetDestId, - iCmManager, - &destArray ); - dlg->ExecuteLD( R_CMMANAGER_LIST_QUERY_WITH_MSGBOX ); - - CleanupStack::PopAndDestroy( &destArray ); - - if ( targetDestId ) - { - // CREATE an object based on an ID. - targetDest = iCmManager.DestinationL( targetDestId ); - CleanupStack::PushL( targetDest ); - } - } - - CLOG_WRITE_1( "CCmWizard::CreateConnectionMethodL target dest: [0x%x]", - targetDest ); - - // If the target destination is still unspecified at this point, - // then the only reason could be that the previous dialog was - // cancelled ==> do something only if we have the target - // destination - if ( targetDest ) - { - plugin->UpdateL(); // commit changes - - index = iCmManager.CopyConnectionMethodL( *targetDest, - *plugin ); - - RArray additionalCms; - CleanupClosePushL (additionalCms); - plugin->GetAdditionalUids( additionalCms ); - if ( additionalCms.Count() ) - {//if there are additional cms created, move them to the target destination as well - for ( TInt i = 0; iNameLC(); - - TCmCommonUi::ShowNoteL( R_CMWIZARD_NEW_METHOD_ADDED, - *destName, - TCmCommonUi::ECmOkNote ); - - CleanupStack::PopAndDestroy( destName ); - - // Here's a tricky one: if 'aTargetDestination' was NULL, then - // I had to create 'targetDest' myself (with - // iCmManager.DestinationL), consequently I have to - // free it up, too. - if ( !aTargetDestination ) - { - CleanupStack::PopAndDestroy( targetDest ); - } - } - else // Wi-Fi may have set IAP in database. So, delete it. - { - CLOG_WRITE( "CCmWizard::CreateConnectionMethodL, handling cancel add destination -- start" ); - RArray additionalCms; - CleanupClosePushL (additionalCms); - - plugin->GetAdditionalUids( additionalCms ); - CLOG_WRITE_1( "CCmWizard::CreateConnectionMethodL, addtionalCms count [%d]", additionalCms.Count() ); - for ( TInt i = 0; iDeleteL( ETrue ); - CleanupStack::PopAndDestroy( cm ); - } - // If plugin hasn't got Iap Id, it's "normal" CM which has not been saved - // into CommsDat yet. Otherwise it's Wifi CM and has to be deleted by using - // DeleteL() method. - if( plugin->GetIntAttributeL( ECmIapId ) ) - { - plugin->DeleteL( ETrue ); - } - - CleanupStack::PopAndDestroy( &additionalCms ); - CLOG_WRITE( "CCmWizard::CreateConnectionMethodL, handling cancel add destination -- end" ); - } - } - CleanupStack::PopAndDestroy( plugin ); - } - - return index; - } - -// --------------------------------------------------------------------------- -// CCmWizard::DialogDismissedL -// --------------------------------------------------------------------------- -// -void CCmWizard::DialogDismissedL( TInt aButtonId ) - { - LOGGER_ENTERFN( "CCmWizard::DialogDismissedL" ); - - CLOG_WRITE_1( "CCmWizard::DialogDismissedL, aButtonId: [%d]", aButtonId ); - if ( aButtonId == EAknSoftkeyCancel ) - { - if ( iCheckConnDlg != NULL ) - { - CLOG_WRITE( "CCmWizard::CheckConnDlg is not NULL" ); - iCheckConnDlgCancelled = ETrue; - } - } - } - -// --------------------------------------------------------------------------- -// CCmWizard::AutoCheckForCmsL -// --------------------------------------------------------------------------- -// -TBool CCmWizard::AutoCheckForCmsL() const - { - LOGGER_ENTERFN( "CCmWizard::AutoCheckForCmsL" ); - // Automatically check for available conn methods? - TInt retval = - TCmCommonUi::ShowConfirmationQueryL( R_CMWIZARD_AUTOMATIC_CHECK ); - - return ( retval == EAknSoftkeyYes || retval == EAknSoftkeyOk ) - ? ETrue : EFalse; - } - -// --------------------------------------------------------------------------- -// CCmWizard::ManualCheckForCmsL -// --------------------------------------------------------------------------- -// -TBool CCmWizard::ManualCheckForCmsL() const - { - LOGGER_ENTERFN( "CCmWizard::ManualCheckForCmsL" ); - // Manually configure CMs? - TInt retval = - TCmCommonUi::ShowConfirmationQueryL( - R_CMWIZARD_MANUAL_CONFIGURATION ); - - return ( retval == EAknSoftkeyYes || retval == EAknSoftkeyOk ) - ? ETrue : EFalse; - } - -// --------------------------------------------------------------------------- -// CCmWizard::CheckForCmsL -// --------------------------------------------------------------------------- -// -void CCmWizard::CheckForCmsL( RArray& aCoverageArray ) - { - LOGGER_ENTERFN( "CCmWizard::CheckForCmsL" ); - // Show a wait dialog - iCheckConnDlgCancelled = FALSE; - iCheckConnDlg = new (ELeave) CAknWaitDialog( - ( REINTERPRET_CAST( CEikDialog**, &iCheckConnDlg )) ); - - iCheckConnDlg->SetCallback( this ); - - iCheckConnDlg->SetTone( CAknNoteDialog::EConfirmationTone ); - - HBufC* text = StringLoader::LoadLC( R_CMWIZARD_CHECKING_METHODS ); - iCheckConnDlg->SetTextL( *text ); - CleanupStack::PopAndDestroy( text ); - - iCheckConnDlg->ExecuteLD( R_CMMANAGER_WAIT_NOTE ); - - RArray bearers( KCmArrayMediumGranularity ); - CleanupClosePushL( bearers ); - - iCmManager.SupportedBearersL( bearers ); - - for ( TInt i = 0; i < bearers.Count() && !iCheckConnDlgCancelled; i++ ) - { - TBool avail( EFalse ); - - TRAPD( err, avail = iCmManager.GetBearerInfoBoolL( bearers[i], ECmCoverage ) ); - - CLOG_WRITE_2( "CCmWizard::CheckForCms, bearer [%d] coverage error [%d]", i, err ); - - if( err ) - { - continue; - } - - - if ( avail && - iCmManager.GetBearerInfoBoolL( bearers[i], ECmAddToAvailableList ) ) - { - aCoverageArray.AppendL( bearers[i] ); - CLOG_WRITE_1( "CCmWizard::CheckForCms, bearer [%d] appended", i ); - } - } - - CleanupStack::PopAndDestroy( &bearers ); - - // Dismiss wait dialog - if( !iCheckConnDlgCancelled ) - { - CLOG_WRITE( "CCmWizard::CheckForCms, cancelling wait dlg" ); - iCheckConnDlg->SetCallback( NULL ); - iCheckConnDlg->ProcessFinishedL(); - CLOG_WRITE( "CCmWizard::CheckForCms, wait dialog deleted" ); - } - else - { - CLOG_WRITE( "CCmWizard::CheckForCms, wait dlg was already cancelled" ); - } - - - // Set the member to NULL every case - iCheckConnDlg = NULL; - } - - - -// --------------------------------------------------------------------------- -// CCmWizard::FindTargetDestinationL -// --------------------------------------------------------------------------- -// -TUint32 CCmWizard::FindTargetDestinationL( CCmPluginBase* aPlugin ) - { - LOGGER_ENTERFN( "CCmWizard::FindTargetDestinationL" ); - - // Tries to read the destination id - TUint32 targetDestId (0); - TRAPD( err, targetDestId = - aPlugin->GetIntAttributeL( ECmNextLayerSNAPId ) ); - - // only supported by virtual bearers, don't leave - if ( err && err != KErrNotSupported ) - { - User::Leave( err ); - } - - // targetDestId == 0 means that not destination but a connection - // method have been selected - if ( targetDestId == 0 ) - { - // Now the destination containing the connection method - // should be obtained - TUint32 targetCmId (0); - TRAPD( err, targetCmId = - aPlugin->GetIntAttributeL( ECmNextLayerIapId ) ); - - // only supported by virtual bearers, don't leave - if ( err && err != KErrNotSupported ) - { - User::Leave( err ); - } - - targetDestId = FindParentDestinationL( targetCmId ); - } - - return targetDestId; - } - -// --------------------------------------------------------------------------- -// CCmWizard::FindParentDestinationL -// --------------------------------------------------------------------------- -// -TUint32 CCmWizard::FindParentDestinationL( TUint32 aCmId ) - { - LOGGER_ENTERFN( "CCmWizard::FindParentDestinationL" ); - - TBool found = EFalse; - TUint32 targetDestId (0); - - RArray destinations; - - iCmManager.AllDestinationsL( destinations ); - CleanupClosePushL( destinations ); - - RArray cms; - - for ( TInt i = 0; i < destinations.Count() && !found; i++ ) - { - CCmDestinationImpl* dest = - iCmManager.DestinationL( destinations[i] ); - CleanupStack::PushL( dest ); - dest->ConnectMethodIdArrayL( cms ); - CleanupClosePushL( cms ); - - for ( TInt j = 0; j < cms.Count() && !found; j++ ) - { - if( cms[j] == aCmId) - { - targetDestId = destinations[i]; - found = ETrue; - } - } - CleanupStack::PopAndDestroy( &cms ); - CleanupStack::PopAndDestroy( dest ); - } - - CleanupStack::PopAndDestroy( &destinations ); - - return targetDestId; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/destdlg.cpp --- a/cmmanager/cmmgr/Framework/Src/destdlg.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1696 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Dialog for setting the gateway. It's used temporarily. -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include // CDesCArray -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include "cmmanager.hrh" -#include "destlistitem.h" -#include "destlistitemlist.h" -#include "destdlg.h" -#include "cmwizard.h" -#include "uncatdlg.h" -#include "cmdlg.h" -#include "cmdesticondialog.h" -#include "cmlistboxmodel.h" -#include "cmlistitem.h" -#include -#include "ccmdexec.h" -#include "cmlogger.h" - -using namespace CMManager; -using namespace CommsDat; - -// --------------------------------------------------------------------------- -// CDestDlg::ConstructAndRunLD -// Constructs the dialog and runs it. -// --------------------------------------------------------------------------- -// -TInt CDestDlg::ConstructAndRunLD( CCmManagerImpl* aCmManagerImpl, - TUint32 aHighlight, - TUint32& aSelected, - TBool& aExiting ) - { - iHighlight = aHighlight; - iSelected = &aSelected; - iCmManagerImpl = aCmManagerImpl; - iExiting = &aExiting; - *iExiting = EFalse; - - iCmdExec = new (ELeave) CCmdExec(*this); - - ConstructL( R_DEST_MENUBAR ); - PrepareLC( R_DEST_DIALOG ); - iModel = new( ELeave )CDestListboxModel(); - iConnSettingsImpl = CCmConnSettingsUiImpl::NewL( iCmManagerImpl ); - - // CommsDat notifier should be started with this first UI view for - // it will create active object - iCmManagerImpl->StartCommsDatNotifierL(); - iCmManagerImpl->WatcherRegisterL( this ); - - return RunLD(); - } - -// --------------------------------------------------------------------------- -// CDestDlg::CDestDlg() -// --------------------------------------------------------------------------- -// -CDestDlg::CDestDlg() - : iModelPassed( EFalse ) - , iExitReason( KDialogUserExit ) - , iEscapeArrived( EFalse ) - { - CLOG_CREATE; - } - -// --------------------------------------------------------------------------- -// CDestDlg::~CApSelectorDialog -// Destructor -// --------------------------------------------------------------------------- -// -CDestDlg::~CDestDlg() - { - // iModel is deleted by the ListBox because LB owns the model... - // of course only after we passed ownership... - if ( !iModelPassed ) - { - delete iModel; - } - if ( iNaviDecorator ) - { - delete iNaviDecorator; - } - if ( iTitlePane ) - { - // set old text back, if we have it... - if ( iOldTitleText ) - { - TRAP_IGNORE( iTitlePane->SetTextL( *iOldTitleText ) ); - delete iOldTitleText; - } - } - if ( iConnSettingsImpl ) - { - delete iConnSettingsImpl; - } - - if( iCmWizard ) - { - delete iCmWizard; - } - - delete iCmdExec; - - CLOG_CLOSE; - } - -// --------------------------------------------------------------------------- -// CDestDlg::PreLayoutDynInitL(); -// called by framework before dialog is shown -// --------------------------------------------------------------------------- -// -void CDestDlg::PreLayoutDynInitL() - { - iListbox = - STATIC_CAST( CDestListbox*, Control( KDestListboxId ) ); - iListbox->CreateScrollBarFrameL( ETrue ); - iListbox->ScrollBarFrame()->SetScrollBarVisibilityL - ( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); - iListbox->SetListBoxObserver( this ); - - iListbox->Model()->SetItemTextArray( iModel ); - iModelPassed = ETrue; - InitTextsL(); - HandleListboxDataChangeL(); - iListbox->HandleItemAdditionL(); - } - -// ---------------------------------------------------------------------------- -// CDestDlg::DynInitMenuPaneL -// ---------------------------------------------------------------------------- -// -void CDestDlg::DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - switch ( aResourceId ) - { - case R_DEST_MENU: - { - // Check if it is the 'New connection' list item - // rather than a real destination - TUint32 listItemUid = iListbox->CurrentItemUid(); - if ( listItemUid == KDestItemNewConnection ) - { - aMenuPane->SetItemDimmed( ECmManagerUiCmdDestEdit, ETrue ); - aMenuPane->SetItemDimmed( ECmManagerUiCmdDestRename, ETrue ); - aMenuPane->SetItemDimmed( ECmManagerUiCmdDestDelete, ETrue ); - aMenuPane->SetItemDimmed( ECmManagerUiCmdDestChangeIcon, ETrue ); - } - if ( !iCmManagerImpl->IsDefConnSupported() ) - { - aMenuPane->SetItemDimmed( ECmManagerUiCmdDestDefaultConnection, ETrue ); - } - if (!iCmManagerImpl->IsHelpOn()) - { - aMenuPane->DeleteMenuItem( EAknCmdHelp ); - } - break; - } - default: - break; - } - } - -// --------------------------------------------------------------------------- -// CDestDlg::OfferKeyEventL -// --------------------------------------------------------------------------- -// -TKeyResponse CDestDlg::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - LOGGER_ENTERFN( "CDestDlg::OfferKeyEventL" ); - CLOG_WRITE_1("Key iCode: %d", aKeyEvent.iCode ); - - TKeyResponse retVal ( EKeyWasNotConsumed ); - - TBool down( EFalse ); - - switch ( aKeyEvent.iCode ) - { - case EKeyEscape: - { - // Handling application close needs special care - // because of iCmWizard - if ( iCmWizard ) - { - // if wizard alives then escape should do after wizard has ended. - CLOG_WRITE( "CDestDlg::OfferKeyEventL: Wizard in long process" ); - iEscapeArrived = ETrue; - retVal = EKeyWasConsumed; - } - else - { - CLOG_WRITE( "CDestDlg::OfferKeyEventL:Escape" ); - retVal = CAknDialog::OfferKeyEventL( aKeyEvent, aType ); - } - break; - } - case EKeyBackspace: - { - ProcessCommandL( ECmManagerUiCmdDestDelete ); - retVal = EKeyWasConsumed; - break; - } - case EKeyDownArrow: - { - down = ETrue; - // intended flow-through - } - case EKeyUpArrow: - { - // When moving from the 'New connection' (first) item, MSK should be 'Open' - if ( iListbox->CurrentItemUid() == KDestItemNewConnection ) - { - SetMskL( R_QTN_MSK_OPEN ); - } - - // When moving to the 'New connection' (first item) - else if ( ( iListbox->CurrentItemIndex() == 1 && !down ) || - ( iListbox->CurrentItemIndex() + 1 == - iModel->MdcaCount() && down ) ) - { - SetMskL( R_QTN_MSK_SELECT ); - } - // flow through to 'default' intended - } - default: - { - retVal = iListbox->OfferKeyEventL(aKeyEvent, aType); - break; - } - } - return retVal; - } - -// ---------------------------------------------------------------------------- -// CDestDlg::ShowDefaultSetNoteL -// ---------------------------------------------------------------------------- -// -void CDestDlg::ShowDefaultSetNoteL( TCmDefConnValue aSelection ) - { - switch ( aSelection.iType ) - { - case ECmDefConnDestination: - case ECmDefConnConnectionMethod: - { - HBufC* connName = iConnSettingsImpl->CreateDefaultConnectionNameL( aSelection ); - CleanupStack::PushL(connName); - TCmCommonUi::ShowNoteL( R_CMMANAGERUI_DEFAULT_CONNECTION_SET_TO, - *connName, - TCmCommonUi::ECmOkNote ); - CleanupStack::PopAndDestroy( connName ); - } - } - } - - -// ---------------------------------------------------------------------------- -// CDestDlg::SetDefaultNaviL -// ---------------------------------------------------------------------------- -// -void CDestDlg::SetDefaultNaviL( TCmDefConnValue aSelection ) - { - HBufC* title = NULL; - - switch ( aSelection.iType ) - { - case ECmDefConnDestination: - case ECmDefConnConnectionMethod: - { - HBufC* connName = iConnSettingsImpl->CreateDefaultConnectionNameL( aSelection ); - CleanupStack::PushL(connName); - title = StringLoader::LoadL( R_CMMANAGERUI_NAVI_DEFAULT, *connName ); - CleanupStack::PopAndDestroy( connName ); - CleanupStack::PushL( title ); - break; - } - } - - if ( iNaviDecorator ) - { - if ( iNaviDecorator->ControlType() == - CAknNavigationDecorator::ENaviLabel ) - { - CAknNaviLabel* naviLabel = - (CAknNaviLabel*)iNaviDecorator->DecoratedControl(); - if ( title ) - { - naviLabel->SetTextL(*title); - } - else - { - naviLabel->SetTextL( KNullDesC ); - } - - iNaviPane->PushL( *iNaviDecorator ); - } - } - - if ( title ) - { - CleanupStack::PopAndDestroy( title ); - } - } - -// ---------------------------------------------------------------------------- -// CDestDlg::ProcessCommandL -// ---------------------------------------------------------------------------- -// -void CDestDlg::ProcessCommandL( TInt aCommandId ) - { - LOGGER_ENTERFN( "CDestDlg::ProcessCommandL" ); - CLOG_WRITE_1("Command: %d", aCommandId ); - - if ( MenuShowing() ) - { - HideMenu(); - } - - switch ( aCommandId ) - { - case EAknSoftkeyOptions: - { - DisplayMenuL(); - break; - } - case ECmManagerUiCmdDestUserExit: - { - CLOG_WRITE( "CDestDlg::ProcessCommandL command: exit"); - iExitReason = KDialogUserExit; - } - case EAknSoftkeyBack: - { - iCmManagerImpl->WatcherUnRegister(); - TryExitL( iExitReason ); - break; - } - case ECmManagerUiCmdDestEdit: - { - OnCommandDestinationEditL(); - break; - } - case ECmManagerUiCmdDestDefaultConnection: - { - TCmDCSettingSelection selection; - TCmDefConnValue defConnValue; - iCmManagerImpl->ReadDefConnL( defConnValue ); - switch (defConnValue.iType) - { - case ECmDefConnConnectionMethod: - { - selection.iResult = EDCConnectionMethod; - selection.iId = defConnValue.iId; - break; - } - case ECmDefConnDestination: - { - selection.iResult = EDCDestination; - selection.iId = defConnValue.iId; - break; - } - default: - { - break; - } - } - if ( iConnSettingsImpl->RunDefaultConnecitonRBPageL( selection ) ) - { - defConnValue = selection.ConvertToDefConn(); - ShowDefaultSetNoteL( defConnValue ); - - iCmManagerImpl->WriteDefConnL( defConnValue ); - HandleListboxDataChangeL(); - } - break; - } - - case ECmManagerUiCmdDestChangeIcon: - { - // Check if this is UnCat - if ( iListbox->CurrentItemUid() == KDestItemUncategorized ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - break; - } - - // Check that destination is not protected - CCmDestinationImpl* dest = - iCmManagerImpl->DestinationL( iListbox->CurrentItemUid() ); - CleanupStack::PushL( dest ); - if ( dest->ProtectionLevel() ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - - CleanupStack::PopAndDestroy( dest ); - break; - } - - TInt iconSelected = 0; - CCmDestinationIconDialog* popup = - new (ELeave) CCmDestinationIconDialog( iconSelected ); - if ( popup->ExecuteLD() ) - { - dest->SetIconL( iconSelected ); // subclass implements - dest->UpdateL(); - CleanupStack::PopAndDestroy( dest ); - - HandleListboxDataChangeL(); - break; - } - - CleanupStack::PopAndDestroy( dest ); - - break; - - } - - - case ECmManagerUiCmdDestAdd: - { - AddDestinationL(); - break; - } - - case EAknSoftkeyClear: - case ECmManagerUiCmdDestDelete: - { - OnCommandDestinationDeleteL(); - break; - - } - - case ECmManagerUiCmdDestRename: - { - OnCommandDestinationRenameL(); - break; - } - - case EAknCmdHelp: - { - HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), - iEikonEnv->EikAppUi()->AppHelpContextL() ); - } - break; - - default: - { - break; - } - } - } - -// --------------------------------------------------------------------------- -// CDestDlg::InitTextsL -// called before the dialog is shown -// to initialize localized textual data -// --------------------------------------------------------------------------- -// -void CDestDlg::InitTextsL() - { - // set pane text if neccessary... - // pane text needed if not pop-up... - if ( iEikonEnv ) - { - iStatusPane = iEikonEnv->AppUiFactory()->StatusPane(); - iTitlePane = - ( CAknTitlePane* )iStatusPane->ControlL( - TUid::Uid( EEikStatusPaneUidTitle ) ); - - iOldTitleText = iTitlePane->Text()->AllocL(); - iTitlePane->SetTextL( - *(StringLoader::LoadLC( R_CMMANAGERUI_NAVI )) ); - - CleanupStack::PopAndDestroy(); // resource R_CMMANAGERUI_NAVI - iNaviPane = ( CAknNavigationControlContainer* ) - iStatusPane->ControlL( - TUid::Uid( EEikStatusPaneUidNavi ) ); - iNaviDecorator = iNaviPane->CreateNavigationLabelL( KNullDesC ); - iNaviPane->PushL( *iNaviDecorator ); - if ( iCmManagerImpl->IsDefConnSupported() ) - { - TCmDefConnValue selection; - selection.iType = ECmDefConnAlwaysAsk; - iCmManagerImpl->ReadDefConnL( selection ); - SetDefaultNaviL( selection ); - } - } - } - -// --------------------------------------------------------------------------- -// CDestDlg::SetNoOfDestsL -// --------------------------------------------------------------------------- -// -void CDestDlg::SetNoOfDestsL( TInt aCount ) - { - HBufC* title = NULL; - - if ( aCount == 1 ) - { - title = StringLoader::LoadLC( R_QTN_NETW_CONSET_NAVI_ONE_DESTINATION ); - } - else - { - title = StringLoader::LoadLC( R_QTN_NETW_CONSET_NAVI_NOF_DESTINATIONS, - aCount ); - } - if (iNaviDecorator) - { - if ( iNaviDecorator->ControlType() == - CAknNavigationDecorator::ENaviLabel ) - { - CAknNaviLabel* naviLabel = - (CAknNaviLabel*)iNaviDecorator->DecoratedControl(); - naviLabel->SetTextL(*title); - iNaviPane->PushL( *iNaviDecorator ); - } - } - - CleanupStack::PopAndDestroy( title ); - } - -// --------------------------------------------------------------------------- -// CDestDlg::CreateCustomControlL -// --------------------------------------------------------------------------- -// -SEikControlInfo CDestDlg::CreateCustomControlL -( TInt aControlType ) - { - SEikControlInfo controlInfo; - controlInfo.iTrailerTextId = 0; - controlInfo.iFlags = 0; - if ( aControlType == KDestListboxType ) - { - controlInfo.iControl = new ( ELeave ) CDestListbox; - } - else - { - controlInfo.iControl = NULL; - } - return controlInfo; - } - -// --------------------------------------------------------------------------- -// CDestDlg::OkToExitL -// Good to know : EAknSoftkeyCancel is never called, because -// EEikDialogFlagNotifyEsc flag is not set in the resource. -// --------------------------------------------------------------------------- -// -TBool CDestDlg::OkToExitL( TInt aButtonId ) - { - CLOG_WRITE_1( "CDestDlg::OkToExitL buttonId: %d", aButtonId ); - - // Translate the button presses into commands for the appui & current - // view to handle - TBool retval( EFalse ); - switch ( aButtonId ) - { - case EAknSoftkeyOk: - case EAknSoftkeySelect: - case ECmManagerUiCmdCmAdd: - { - if ( !iProcessing ) - { - iProcessing = ETrue; - ProcessCommandL( ECmManagerUiCmdDestEdit ); - iProcessing = EFalse; - } - break; - } - case EAknSoftkeyBack: - { - if (!iProcessing) - { - *iExiting = EFalse; - retval = ETrue; - } - break; - } - case EAknSoftkeyOptions: - { - if ( !iProcessing ) - { - DisplayMenuL(); - } - break; - } - default: - { - - CLOG_WRITE_1( "CDestDlg::OkToExitL: High level stop %d", aButtonId ); - - *iExiting = ETrue; - retval = ETrue; - break; - } - } - return retval; - } - -// --------------------------------------------------------------------------- -// CDestDlg::HandleListBoxEventL -// --------------------------------------------------------------------------- -void CDestDlg::HandleListBoxEventL( CEikListBox* /*aListBox*/, - TListBoxEvent aEventType ) - { - LOGGER_ENTERFN( "CDestDlg::HandleListBoxEventL" ); - - switch ( aEventType ) - { - case EEventEnterKeyPressed: - case EEventItemSingleClicked: - { - if ( !iProcessing ) - { - iCmdExec->Execute(); - } - break; - } - case EEventEditingStarted: - { - break; - } - case EEventEditingStopped: - { - break; - } - default: - { - break; - }; - }; - } - -// ---------------------------------------------------------------------------- -// CDestDlg::HandleListboxDataChangeL -// called before the dialog is shown to initialize listbox data -// ---------------------------------------------------------------------------- -// -void CDestDlg::HandleListboxDataChangeL() - { - LOGGER_ENTERFN( "CDestDlg::HandleListboxDataChangeL" ); - - iCmManagerImpl->OpenTransactionLC(); - - iModel->ResetAndDestroy(); - RArray destIdArray = RArray( KCmArrayBigGranularity ); - - CArrayPtr< CGulIcon >* icons = new( ELeave ) CAknIconArray( KGranularity ); - CleanupStack::PushL( icons ); - - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - - iCmManagerImpl->AllDestinationsL(destIdArray); - - // Append the destinations to the list - CleanupClosePushL( destIdArray ); // 1 - - TCmDefConnValue defConnSel; - defConnSel.iType = ECmDefConnAlwaysAsk;//default value - if ( iCmManagerImpl->IsDefConnSupported() ) - { - //refresh default connection in navi pane - iCmManagerImpl->ReadDefConnL(defConnSel); - SetDefaultNaviL( defConnSel ); - } - else - { - SetNoOfDestsL( destIdArray.Count() ); - } - ///!!!TEMP, no icon for add connection yet - TParse mbmFile; - User::LeaveIfError( mbmFile.Set( KManagerIconFilename, - &KDC_APP_BITMAP_DIR, - NULL ) ); - - CGulIcon* icon = AknsUtils::CreateGulIconL( //second, KDestReservedIconIndexProtected - skinInstance, - KAknsIIDQgnPropSetConnDestAdd, - mbmFile.FullName(), - EMbmCmmanagerQgn_prop_set_conn_dest_add, - EMbmCmmanagerQgn_prop_set_conn_dest_add_mask ); - CleanupStack::PushL( icon ); - icons->AppendL( icon ); - CleanupStack::Pop( icon ); - - icon = AknsUtils::CreateGulIconL( //second, KDestReservedIconIndexProtected - skinInstance, - KAknsIIDQgnIndiSettProtectedAdd, - mbmFile.FullName(), - EMbmCmmanagerQgn_indi_sett_protected_add, - EMbmCmmanagerQgn_indi_sett_protected_add_mask ); - - -// Previous must me changed to following if any problems with theme colours -/* AknsUtils::CreateColorIconLC( skinInstance, - KAknsIIDQgnIndiSettProtectedAdd, - KAknsIIDQsnIconColors, - EAknsCIQsnIconColorsCG13, - bitmap, - mask, - mbmFile.FullName(), - EMbmCmmanagerQgn_indi_sett_protected_add, - EMbmCmmanagerQgn_indi_sett_protected_add_mask, - AKN_LAF_COLOR( 215 ) ); - - icon = CGulIcon::NewL( bitmap, mask ); // Ownership transferred - CleanupStack::Pop( 2 ); // bitmap, mask*/ - - CleanupStack::PushL( icon ); - icons->AppendL( icon ); - CleanupStack::Pop( icon ); - - //third, uncategorized KDestReservedIconIndexUncategorized - icons->AppendL( iCmManagerImpl->UncategorizedIconL() ); - - //0..3 are reserved indexes! - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - AknsUtils::CreateColorIconLC( skinInstance, - KAknsIIDQgnIndiDefaultConnAdd, - KAknsIIDQsnIconColors, - EAknsCIQsnIconColorsCG13, - bitmap, - mask, - mbmFile.FullName(), - EMbmCmmanagerQgn_indi_default_conn_add, - EMbmCmmanagerQgn_indi_default_conn_add_mask, - AKN_LAF_COLOR( 215 ) ); - - icon = CGulIcon::NewL( bitmap, mask ); // Ownership transferred - CleanupStack::Pop( 2 ); // bitmap, mask - - CleanupStack::PushL( icon ); - icons->AppendL( icon ); - CleanupStack::Pop( icon ); - - // Add the New Connection Item - HBufC* newConnection = StringLoader::LoadLC( - R_CMMANAGERUI_NEW_CONNECTION ); // 2 - - CDestListItem* newConnItem = - CDestListItem::NewLC( - KDestItemNewConnection, - newConnection, - 0, - KDestReservedIconIndexNewConn, EProtLevel0, EFalse ); // 3 - iModel->AppendL( newConnItem ); // ownership relinquished - CleanupStack::Pop( newConnItem ); - CleanupStack::Pop( newConnection ); - - TTime destTime; - -//refresh default connection icon in list - no effect if feature flag is off (defConnSel -// is ECmDefConnAlwaysAsk) - TInt defUid = KErrNotFound; - if ( defConnSel.iType == ECmDefConnDestination ) - { - defUid = defConnSel.iId; - } - - - for (TInt i = 0; i < destIdArray.Count(); i++) - { - // Get the destinations from their IDs - CCmDestinationImpl* dest = NULL; - - - TRAPD( err, dest = iCmManagerImpl->DestinationL( destIdArray[i] ) ); - if( err ) - { - continue; - } - CleanupStack::PushL( dest ); - - // Check whether the MMS SNAP is in question. - // It should not be shown on the UI in the destinations list - TInt snapMetadata = 0; - TRAPD(metaErr, snapMetadata = dest->MetadataL( CMManager::ESnapMetadataPurpose )); - if ( metaErr == KErrNone && snapMetadata == CMManager::ESnapPurposeMMS ) - { - // This is the MMS SNAP, skip this item - if( dest ) - { - CleanupStack::PopAndDestroy( dest ); - dest = NULL; - } - continue; - } - - // Also hidden destinations are shown (TSW id ERUN-79KFAK) - icons->AppendL( dest->IconL() ); - HBufC* name = dest->NameLC(); // 3 - TBool def = EFalse; - if ( defUid == dest->Id() ) //this is the default destination, indicate it! - { - def = ETrue; - } - - // The connection methods bound to this destination may have to be checked with - // validity. Some connection methods might be invalid. - TInt numOfCms = dest->ConnectionMethodCount(); - if (numOfCms > 0) - { - RArray cmIds; - dest->ConnectMethodIdArrayL( cmIds ); - CleanupClosePushL( cmIds ); - - for ( TInt j = 0; j < cmIds.Count(); j++ ) - { - TUint recId = cmIds[j]; - - TRAP( err, TUint32 bearerType = iCmManagerImpl->BearerTypeFromCmIdL( recId ) ); - if( err == KErrNotSupported ) - { - CLOG_WRITE_1( "CDestDlg::HandleListboxDataChangeL, IAP(%d) unsupported", recId ); - numOfCms = numOfCms -1; - } - } - - CleanupStack::PopAndDestroy( &cmIds ); - } - - CDestListItem* item = CDestListItem::NewLC( - dest->Id(), - name, - numOfCms, - icons->Count()-1, dest->ProtectionLevel(), def ); // 4 - iModel->AppendL( item ); // ownership passed - CleanupStack::Pop( item ); - CleanupStack::Pop( name ); - if( dest ) - { - CleanupStack::PopAndDestroy( dest ); - dest = NULL; - } - } - - // Add the Uncategorised Item - RArray uncatArray(KCmArraySmallGranularity); - CleanupClosePushL(uncatArray); - - iCmManagerImpl->ConnectionMethodL( uncatArray, ETrue ); - TUint32 numberOfCMs = NumberOfCMsL( uncatArray ); - if ( numberOfCMs ) - { - icon = AknsUtils::CreateGulIconL( - skinInstance, - KAknsIIDQgnPropSetConnDestUncategorized, - mbmFile.FullName(), - EMbmCmmanagerQgn_prop_set_conn_dest_uncategorized, - EMbmCmmanagerQgn_prop_set_conn_dest_uncategorized_mask ); - CleanupStack::PushL( icon ); - icons->AppendL( icon ); - CleanupStack::Pop( icon ); - - HBufC* uncat = StringLoader::LoadLC( - R_CMMANAGERUI_DEST_UNCATEGORIZED ); // 2 - - // Check the hidden connection methods - for ( TInt k = 0; k < uncatArray.Count(); k++ ) - { - TUint recId = uncatArray[k]; - if ( iCmManagerImpl->GetConnectionMethodInfoBoolL( recId, ECmHidden ) ) - { - numberOfCMs = numberOfCMs -1; - } - } - - CDestListItem* uncatItem = - CDestListItem::NewLC( - KDestItemUncategorized, - uncat, - numberOfCMs, - icons->Count()-1, EProtLevel0, EFalse ); // 3 - iModel->AppendL( uncatItem ); // ownership relinquished - CleanupStack::Pop( uncatItem ); - CleanupStack::Pop( uncat ); - } - - CleanupStack::PopAndDestroy( 2, &destIdArray ); // destIdArray - - CArrayPtr* oldIcons = - iListbox->ItemDrawer()->ColumnData()->IconArray(); - if( oldIcons ) - { - oldIcons->ResetAndDestroy(); - delete oldIcons; - } - - iListbox->ItemDrawer()->ColumnData()->SetIconArray( icons ); - iListbox->HandleItemAdditionL(); - iListbox->UpdateScrollBarsL(); - - if ( !iListbox->CurrentItemUid() && !numberOfCMs ) - { - // selection is out of range (e.g. Uncategorized deleted) - iListbox->SetCurrentItemIndexAndDraw( 0 ); - } - - CleanupStack::Pop( icons ); - - iCmManagerImpl->RollbackTransaction(); - } - -// ---------------------------------------------------------------------------- -// CDestDlg::NumberOfCMsL -// ---------------------------------------------------------------------------- -// -TUint32 CDestDlg::NumberOfCMsL(RArray cmArray) - { - LOGGER_ENTERFN( "CDestDlg::NumberOfCMsL" ); - - TUint32 cmCount = cmArray.Count(); - TUint32 retValue = cmArray.Count(); - CCDIAPRecord* iapRecord = NULL; - for ( TInt i = 0; i < cmCount; i++ ) - { - if ( cmArray[i] <= 255 )// not embedded destination - { - iapRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord)); - CleanupStack::PushL( iapRecord ); - - iapRecord->SetRecordId( cmArray[i] ); - iapRecord->LoadL( iCmManagerImpl->Session() ); - - TRAPD( err, iCmManagerImpl->BearerTypeFromIapRecordL( iapRecord ) ); - - if( err == KErrNotSupported ) - // This is unsupported connection method -> don't display - { - retValue--; - } - else - { - User::LeaveIfError( err ); - } - CleanupStack::PopAndDestroy( iapRecord ); - } - } - return retValue; - } - -// ---------------------------------------------------------------------------- -// CDestDlg::AddDestinationL -// ---------------------------------------------------------------------------- -// -void CDestDlg::AddDestinationL() - { - LOGGER_ENTERFN( "CDestDlg::AddDestinationL" ); - - TBuf destName; - - TBool okToAdd = EFalse; - TBool nameAccepted = ETrue; - do - { - okToAdd = TCmCommonUi::ShowConfirmationQueryWithInputL( - R_CMMANAGERUI_PRMPT_DESTINATION_NAME, - destName ); - if ( okToAdd ) - { - CCmDestinationImpl* dest = NULL; - - TRAPD(err, dest = iCmManagerImpl->CreateDestinationL( destName ) ); - if ( err == KErrAlreadyExists ) - { - nameAccepted = EFalse; - TCmCommonUi::ShowNoteL - ( R_CMMANAGERUI_INFO_DEST_ALREADY_IN_USE, - destName, - TCmCommonUi::ECmErrorNote ); - } - else if ( err == KErrDiskFull ) - { - CTextResolver* iTextResolver = CTextResolver::NewLC(*iCoeEnv); - okToAdd = EFalse; - TPtrC buf; - buf.Set(iTextResolver->ResolveErrorString(err)); - TCmCommonUi::ShowNoteL( buf, TCmCommonUi::ECmErrorNote ); - CleanupStack::PopAndDestroy( iTextResolver ); - } - else if ( err == KErrNone ) - { - CleanupStack::PushL( dest ); - nameAccepted = ETrue; - TInt index = 0; - TInt iconSelected = 0; - CCmDestinationIconDialog* popup = - new (ELeave) CCmDestinationIconDialog( iconSelected ); - - // Show the icon dialogs - if ( popup->ExecuteLD() ) - { - index = iconSelected; - - dest->SetIconL( index ); // subclass implements - //dest->UpdateL(); - TRAPD( err, dest->UpdateL() ); - if( err ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - } - else - { - TRAP( err, HandleListboxDataChangeL() ); - if ( err ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - } - } - - CDestListboxModel* lbmodel = - STATIC_CAST( CDestListboxModel*, - iListbox->Model()->ItemTextArray() ); - CDestListItem* lbitem = - lbmodel->At( lbmodel->MdcaCount() - 1 ); - - //returns null if item is not present - if ( lbitem->Uid() == KDestItemUncategorized ) - { - //last item is uncategorized - iListbox->ScrollToMakeItemVisible( - lbmodel->MdcaCount() - 2 ); - //last item is uncategorized - iListbox->SetCurrentItemIndexAndDraw( - lbmodel->MdcaCount() - 2 ); - } - else - { - iListbox->ScrollToMakeItemVisible( - lbmodel->MdcaCount() - 1 ); - iListbox->SetCurrentItemIndexAndDraw( - lbmodel->MdcaCount() - 1 ); - } - - iListbox->HandleItemAdditionL(); - - TCmCommonUi::ShowNoteL( R_CMWIZARD_NEW_DEST_ADDED, - destName, - TCmCommonUi::ECmOkNote ); - - // Sets the mittle soft key text to "Open" - SetMskL( R_QTN_MSK_OPEN ); - - } - if(dest) - { - CleanupStack::PopAndDestroy( dest ); - dest = NULL; - } - } - } - } while ( !nameAccepted && okToAdd ); - } - -// ---------------------------------------------------------------------------- -// CDestDlg::OnCommandDestinationEdit -// ---------------------------------------------------------------------------- -// -void CDestDlg::OnCommandDestinationEditL() - { - LOGGER_ENTERFN( "CDestDlg::OnCommandDestinationEditL" ); - - // Check if memory full - TBool ret ( EFalse ); - ret = iCmManagerImpl->IsMemoryLow(); - if( ret ) - { - CLOG_WRITE( "CDestDlg::OnCommandDestinationEditL: Memory Full, return!" ); - return; - } - - if ( iListbox->CurrentItemUid() == KDestItemNewConnection ) - { - // If there's at least one uprotected destination available - if ( iCmManagerImpl->DestinationCountL() ) - { - if ( iCmManagerImpl->HasUnprotectedDestinationsL() ) - { - // Opens a Connection method creation wizard - CLOG_WRITE( "CDestDlg::OnCommandDestinationEditL iCmWizard constructing" ); - iCmWizard = new (ELeave) CCmWizard( *iCmManagerImpl ); - TInt ret( KErrNone ); - TRAPD( err, ret = iCmWizard->CreateConnectionMethodL() ); - if ( err == KErrDiskFull ) - { - CTextResolver* iTextResolver = CTextResolver::NewLC(*iCoeEnv); - ret = KErrCancel; - TPtrC buf; - buf.Set(iTextResolver->ResolveErrorString(err)); - TCmCommonUi::ShowNoteL( buf, TCmCommonUi::ECmErrorNote ); - CleanupStack::PopAndDestroy( iTextResolver ); - } - else if ( err ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - ret = KErrCancel; - } - delete iCmWizard; - iCmWizard = NULL; - CLOG_WRITE_1( "CDestDlg::iCmWizard ret %d", ret ); - - // If application wanted to be closed before then RunAppShutter() - // should be called here - if( iEscapeArrived ) - { - CLOG_WRITE_1( "CDestDlg::iEscapeArrived %d", iEscapeArrived ); - ( ( CAknAppUi* )iEikonEnv->EikAppUi() )->RunAppShutter(); - } - else - { - if( ret != KErrCancel ) - { - TRAP( err, HandleListboxDataChangeL() ); - if ( err ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - return; - } - } - } - - } - else - { - // Show a warning here - TCmCommonUi::ShowNoteL( R_CMWIZARD_NO_UNPROTECTED_DESTINATION, - TCmCommonUi::ECmWarningNote ); - } - } - else - { - // ... otherwise show a warning. - TCmCommonUi::ShowNoteL( R_CMWIZARD_NO_DESTINATION, - TCmCommonUi::ECmWarningNote ); - } - } - else - { - if ( iListbox->CurrentItemUid() == KDestItemUncategorized ) - { - CUncatDlg* uncatDlg = CUncatDlg::NewL( iCmManagerImpl ); - - TUint32 selected = 0; - if ( uncatDlg->ConstructAndRunLD( 0, selected ) == - KDialogUserExit) - { - TryExitL(ETrue); - } - else - { - HandleListboxDataChangeL(); - } - } - else - { - CCmDlg* cmDlg = CCmDlg::NewL( iCmManagerImpl , - iListbox->CurrentItemUid(), this ); - - TUint32 selected = 0; - if ( cmDlg->ConstructAndRunLD( 0, selected ) == - KDialogUserExit ) - { - TryExitL(ETrue); - } - else - { - HandleListboxDataChangeL(); - } - } - } - } - -// ---------------------------------------------------------------------------- -// CDestDlg::OnCommandDestinationDelete -// ---------------------------------------------------------------------------- -// -void CDestDlg::OnCommandDestinationDeleteL() - { - LOGGER_ENTERFN( "CDestDlg::OnCommandDestinationDeleteL" ); - - TCmDefConnValue oldConn; - if (iCmManagerImpl->IsDefConnSupported()) - { - iCmManagerImpl->ReadDefConnL( oldConn ); - } - TUint32 listItemUid = iListbox->CurrentItemUid(); - - if ( listItemUid == KDestItemNewConnection ) - { - // ignore this command - it's not a destination - return; - } - - if ( listItemUid == KDestItemUncategorized ) - { - // Cannot delete Uncategoried Destination - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - - return; - } - - TBool carryOn( ETrue ); - // Cannot delete if the destination is embedded somewhere - CCmDestinationImpl* dest = - iCmManagerImpl->DestinationL( iListbox->CurrentItemUid() ); - CleanupStack::PushL( dest ); - // We need this trap only because this function is called from a trap - TRAPD( err, dest->CheckIfEmbeddedL( dest->Id() ) ); - if ( err == KErrNotSupported ) - { - CleanupStack::PopAndDestroy( dest ); - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - return; - } - else if ( err ) - { - CleanupStack::PopAndDestroy( dest ); - User::Leave(err); - } - - // Show an error message to the user - if ( dest->ProtectionLevel() ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - carryOn = EFalse; - } - - if( carryOn ) - { - if( dest->IsConnectedL() ) - { - TCmCommonUi::ShowNoteL( - R_CMMANAGERUI_INFO_DEST_IN_USE_CANNOT_DELETE, - TCmCommonUi::ECmErrorNote ); - carryOn = EFalse; - } - } - - // check if it is linked by anybody - - if ( carryOn ) - { - // for each IAP in CM manager - // 1. check if it is virtual - // if not => goto 1. - // if yes: - // 2. check if it links to the destination to be deleted - // if yes => carryOn = EFalse, ERROR - // if not: - // 3. check if it links to any of the CMs in this destination - // if not => goto 1. - // if yes: - // 4. check if it is also in this destination - // if not => carryOn = EFalse, ERROR - // if yes => goto 1. - // As we need different notes in different cases: - TUint32 noteresId = R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED; - CommsDat::CMDBRecordSet* iaps = - iCmManagerImpl->AllIapsL(); - - CleanupStack::PushL( iaps ); - - // for each IAP in CM manager - for ( TInt i = 0; carryOn && i < iaps->iRecords.Count(); ++i ) - { - CommsDat::CCDIAPRecord* rec = (*iaps)[i]; - TUint32 bearerType = 0; - - TRAP_IGNORE( bearerType = - iCmManagerImpl->BearerTypeFromIapRecordL( rec ) ); - if ( !bearerType ) - { - continue; - } - - // check if it is virtual - if ( iCmManagerImpl->GetBearerInfoBoolL( bearerType, ECmVirtual ) ) - { - // check if it links to the destination to be deleted - CCmPluginBase* plugin = NULL; - TRAP_IGNORE( plugin = iCmManagerImpl->GetConnectionMethodL( - rec->RecordId() ) ); - - if ( !plugin ) - { - continue; - } - - CleanupStack::PushL( plugin ); - - if ( plugin->IsLinkedToSnap( dest->Id() ) ) - { - // the CM links to this destination, deletion not allowed - carryOn = EFalse; - noteresId = R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED; - } - else - { - - // check if the CM links to any of the CMs in this destination - for ( TInt j = 0; j < dest->ConnectionMethodCount(); ++j ) - { - CCmPluginBase* destPlugin = NULL; - - TRAP_IGNORE( destPlugin = dest->GetConnectionMethodL( j ) ); - if ( !destPlugin ) - { - continue; - } - - if ( destPlugin->GetIntAttributeL( ECmId ) == - rec->RecordId() ) - { - // the CM shouldn't be compared to itself - continue; - } - - if ( plugin->IsLinkedToIap( - destPlugin->GetIntAttributeL( ECmId ) ) ) - { - // the CM links to at least one CM in this destination - carryOn = EFalse; - noteresId = R_QTN_NETW_CONSET_INFO_CANNOT_DELETE_VIRTUAL_REF; - break; - } - } - - } - - CleanupStack::PopAndDestroy( plugin ); - } - - - } - - CleanupStack::PopAndDestroy( iaps ); - - if ( !carryOn ) - { - TCmCommonUi::ShowNoteL( - noteresId, - TCmCommonUi::ECmErrorNote ); - } - } - - - // check if it has protected method - if( carryOn ) - { - if( IsThereProtectedMethodL( dest ) ) - { - TCmCommonUi::ShowNoteL( - R_QTN_NETW_CONSET_INFO_CANNOT_DELETE_DEST_PROT_CM, - TCmCommonUi::ECmErrorNote ); - carryOn = EFalse; - } - } - - if( carryOn ) - { - HBufC* destName = dest->NameLC(); // 2 - if ( TCmCommonUi::ShowConfirmationQueryL( - R_CMMANAGERUI_QUEST_DEST_DELETE, *destName ) ) - { - CleanupStack::PopAndDestroy( destName ); - TRAPD( err, dest->DeleteLD() ); - switch ( err ) - { - case KErrInUse: - { - TCmCommonUi::ShowNoteL( - R_CMMANAGERUI_INFO_DEST_IN_USE_CANNOT_DELETE, - TCmCommonUi::ECmErrorNote ); - } - break; - - case KErrLocked: - { - TCmCommonUi::ShowNoteL - ( R_QTN_NETW_CONSET_INFO_CANNOT_DELETE_VIRTUAL_REF, - TCmCommonUi::ECmErrorNote ); - } - break; - - case KErrNone: - { - if (iCmManagerImpl->IsDefConnSupported()) - { - ShowDefaultConnectionNoteL(oldConn); - } - CleanupStack::Pop( dest ); - dest = NULL; - - TInt selected = iListbox->CurrentItemIndex(); - - HandleListboxDataChangeL(); - - if ( iListbox->Model()->NumberOfItems() ) - { - if( selected == iListbox->Model()->NumberOfItems() ) - { - --selected; - } - - //first item cannot be deleted - iListbox->ScrollToMakeItemVisible( selected); - iListbox->SetCurrentItemIndexAndDraw( selected ); - } - } - break; - - default: - { - } - } - } - else - { - CleanupStack::PopAndDestroy( destName ); - } - } - - if( dest ) - { - CleanupStack::PopAndDestroy( dest ); - } - - } - - -// ---------------------------------------------------------------------------- -// CDestDlg::OnCommandDestinationRenameL -// ---------------------------------------------------------------------------- -// -void CDestDlg::OnCommandDestinationRenameL() - { - LOGGER_ENTERFN( "CDestDlg::OnCommandDestinationRenameL" ); - - // Check if this is UnCat - if ( iListbox->CurrentItemUid() == KDestItemUncategorized ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - return; - } - - // Get currently selected destination. - CCmDestinationImpl* dest = - iCmManagerImpl->DestinationL( iListbox->CurrentItemUid() ); - CleanupStack::PushL( dest ); - - // Show an error message to the user - if ( dest->ProtectionLevel() ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - - CleanupStack::PopAndDestroy( dest ); - return; - } - - // Allocate max length for the buffer, since we don't know how long - // the new name will be. Copy the actual name of the destination - // into the buffer. - TBuf< KDestinationNameMaxLength > destName; - destName.Copy( *( dest->NameLC() ) ); - - TBool okToRename = EFalse; - TBool nameAccepted = ETrue; - do - { - okToRename = TCmCommonUi::ShowConfirmationQueryWithInputL( - R_CMMANAGERUI_PRMPT_DESTINATION_NAME, - destName ); - if ( okToRename ) - { - TRAPD(err, dest->SetNameL( destName )); - if ( err == KErrAlreadyExists ) - { - nameAccepted = EFalse; - TCmCommonUi::ShowNoteL( R_CMMANAGERUI_INFO_DEST_ALREADY_IN_USE, - destName, - TCmCommonUi::ECmErrorNote ); - } - else if ( err == KErrNone ) - { - nameAccepted = ETrue; - dest->UpdateL(); - HandleListboxDataChangeL(); - } - } - } while ( !nameAccepted && okToRename ); - - // dest->NameLC() - CleanupStack::PopAndDestroy( ); - CleanupStack::PopAndDestroy( dest ); - } - -// ---------------------------------------------------------------------------- -// CDestDlg::IsThereProtectedMethodL -// ---------------------------------------------------------------------------- -// -TBool CDestDlg::IsThereProtectedMethodL( CCmDestinationImpl* aDest ) - { - LOGGER_ENTERFN( "CDestDlg::IsThereProtectedMethodL" ); - - TInt count( aDest->ConnectionMethodCount() ); - - for( TInt i = 0; i < count; ++i ) - { - CCmPluginBase* cm = aDest->GetConnectionMethodL( i ); - - if( cm->GetBoolAttributeL( ECmProtected ) ) - { - return ETrue; - } - } - - return EFalse; - } - - -// ---------------------------------------------------------------------------- -// CDestDlg::SetMskL -// ---------------------------------------------------------------------------- -// -void CDestDlg::SetMskL( TInt aResourceId ) - { - HBufC* text = StringLoader::LoadLC( aResourceId ); - ButtonGroupContainer().SetCommandL( EAknSoftkeySelect, *text ); - ButtonGroupContainer().DrawDeferred(); - CleanupStack::PopAndDestroy( text ); - - } - -// -------------------------------------------------------------------------- -// CDestDlg::GetHelpContext -// -------------------------------------------------------------------------- -// -void CDestDlg::GetHelpContext( TCoeHelpContext& aContext ) const - { - aContext.iMajor = KHelpUidPlugin; - aContext.iContext = KSET_HLP_CONN_DEST_VIEW; - } - -// -------------------------------------------------------------------------- -// CDestDlg::Execute -// -------------------------------------------------------------------------- -// -void CDestDlg::Execute() - { - LOGGER_ENTERFN( "CDestDlg::Execute" ); - iProcessing = ETrue; - - TRAPD( err, ProcessCommandL(ECmManagerUiCmdDestEdit) ); - if ( err ) - { - HandleLeaveError( err ); - } - - iProcessing = EFalse; - } - -// -------------------------------------------------------------------------- -// CDestDlg::HandleResourceChange -// -------------------------------------------------------------------------- -// - -void CDestDlg::HandleResourceChange( TInt aType ) - { - CCoeControl::HandleResourceChange( aType ); - - if( aType == KEikDynamicLayoutVariantSwitch ) - { - DrawNow(); - } - - CAknDialog::HandleResourceChange(aType); - } - -// -------------------------------------------------------------------------- -// CDestDlg::HandleLeaveError -// -------------------------------------------------------------------------- -// -void CDestDlg::HandleLeaveError( TInt aError ) - { - LOGGER_ENTERFN( "CDestDlg::HandleLeaveError" ); - - switch( aError ) - { - case KLeaveWithoutAlert: - case KErrNoMemory: - EnforcedResetCDestDlg(); - break; - default: - // More leave errors may be handled if necessary - // Now other leave errors are ignored here - break; - } - } - -// -------------------------------------------------------------------------- -// CDestDlg::EnforcedResetCDestDlg -// -------------------------------------------------------------------------- -// -void CDestDlg::EnforcedResetCDestDlg() - { - LOGGER_ENTERFN( "CDestDlg::EnforcedResetCDestDlg" ); - - if( iCmWizard != NULL ) - { - delete iCmWizard; - iCmWizard = NULL; - } - - if( iProcessing ) - { - iProcessing = EFalse; - } -} - -// -------------------------------------------------------------------------- -// CDestDlg::ShowDefaultConnectionNoteL -// -------------------------------------------------------------------------- -// -void CDestDlg::ShowDefaultConnectionNoteL(TCmDefConnValue aOldDefConn) - { - LOGGER_ENTERFN( "CDestDlg::ShowDefaultConnectionNoteL" ); - TCmDefConnValue newConn; - - iCmManagerImpl->ReadDefConnL( newConn ); - - if ( newConn != aOldDefConn ) - { - ShowDefaultSetNoteL( newConn ); - } - } - -// -------------------------------------------------------------------------- -// CDestDlg::CommsDatChanges -// -------------------------------------------------------------------------- -// -void CDestDlg::CommsDatChangesL() - { - // Update list box - HandleListboxDataChangeL(); - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/destlistbox.cpp --- a/cmmanager/cmmgr/Framework/Src/destlistbox.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CDestListbox -* -*/ - -#include -#include -#include -#include -#include - -#include "destlistbox.h" -#include "destlistboxmodel.h" -#include "destlistitem.h" - -// --------------------------------------------------------------------------- -// CDestListbox::NewL -// --------------------------------------------------------------------------- -// -CDestListbox* CDestListbox::NewL( const CCoeControl* aParent ) - { - CDestListbox* listbox = new ( ELeave ) CDestListbox(); - CleanupStack::PushL( listbox ); - listbox->ConstructL( aParent, EAknListBoxSelectionList ); - CleanupStack::Pop( listbox ); - return listbox; - } - -// --------------------------------------------------------------------------- -// CDestListbox::CDestListbox -// --------------------------------------------------------------------------- -// -CDestListbox::CDestListbox() - { - } - -// --------------------------------------------------------------------------- -// CDestListbox::~CDestListbox -// --------------------------------------------------------------------------- -// -CDestListbox::~CDestListbox() - { - } - -// --------------------------------------------------------------------------- -// CDestListbox::OfferKeyEventL -// --------------------------------------------------------------------------- -// -TKeyResponse CDestListbox::OfferKeyEventL -( const TKeyEvent& aKeyEvent, TEventCode aType ) - { - if ( aKeyEvent.iCode == EKeyOK && - !( aKeyEvent.iModifiers & EModifierShift ) ) - { - // Enter pressed (not Shift-Enter). This will report an - // EEnterKeyPressed event sent to the observer (the view), which may - // delete this listbox. The code which processes keypresses by - // default, will continue (on the already deleted listbox), and - // will crash. So we grab this keypress here, and generate the - // same event, but after that, quit immediately! - ReportListBoxEventL( MEikListBoxObserver::EEventEnterKeyPressed ); - // By now the listbox may have been deleted! - // Do not access it after this point! - return EKeyWasConsumed; - } - else - { - return CAknDoubleLargeStyleListBox::OfferKeyEventL( aKeyEvent, aType ); - } - } - -// --------------------------------------------------------------------------- -// CDestListbox::FocusChanged -// --------------------------------------------------------------------------- -// -void CDestListbox::FocusChanged( TDrawNow aDrawNow ) - { - // Do nothing until the listbox is fully constructed - // The dialogpage sets the focus before calling ConstructL - if ( iView ) - { - CAknDoubleLargeStyleListBox::FocusChanged( aDrawNow ); - } - } - -// --------------------------------------------------------------------------- -// CDestListbox::Uid4Item -// --------------------------------------------------------------------------- -// -TUint32 CDestListbox::Uid4Item( TInt aItem ) const - { - CDestListboxModel* lbmodel = - STATIC_CAST( CDestListboxModel*, Model()->ItemTextArray() ); - return lbmodel->At( aItem )->Uid(); - } - -// --------------------------------------------------------------------------- -// CDestListbox::CurrentItemUid -// --------------------------------------------------------------------------- -// -TUint32 CDestListbox::CurrentItemUid() const - { - CDestListboxModel* lbmodel = - STATIC_CAST( CDestListboxModel*, Model()->ItemTextArray() ); - TInt idx = CurrentItemIndex(); - TUint32 retval( 0 ); - if ( idx >= 0 ) - { - retval = lbmodel->At( idx )->Uid(); - } - return retval; - } - -// --------------------------------------------------------------------------- -// CDestListbox::CurrentItemNameL -// --------------------------------------------------------------------------- -// -const TDesC& CDestListbox::CurrentItemNameL() - { - CDestListboxModel* lbmodel = new( ELeave )CDestListboxModel; - lbmodel = STATIC_CAST( CDestListboxModel*, Model()->ItemTextArray() ); - return lbmodel->At( CurrentItemIndex() )->Name(); - } - -// --------------------------------------------------------------------------- -// CDestListbox::HandleResourceChange -// --------------------------------------------------------------------------- -// -void CDestListbox::HandleResourceChange(TInt aType) - { - if ( aType == KAknsMessageSkinChange ) - { - SizeChanged(); - } - - CAknDoubleLargeStyleListBox::HandleResourceChange( aType ); - } - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/destlistboxmodel.cpp --- a/cmmanager/cmmgr/Framework/Src/destlistboxmodel.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CDestListboxModel -* -*/ - -#include -#include -#include -#include - -#include "destlistboxmodel.h" -#include "destlistitem.h" -#include "destlistitemlist.h" -#include - -using namespace CMManager; - -// --------------------------------------------------------------------------- -// CDestListboxModel::CDestListboxModel -// --------------------------------------------------------------------------- -// -CDestListboxModel::CDestListboxModel() - : iOffset( 0 ) - { - } - -// --------------------------------------------------------------------------- -// CDestListboxModel::~CDestListboxModel -// --------------------------------------------------------------------------- -// -CDestListboxModel::~CDestListboxModel() - { - ResetAndDestroy(); // deletes all elements... - } - -// --------------------------------------------------------------------------- -// CDestListboxModel::MdcaCount -// --------------------------------------------------------------------------- -// -TInt CDestListboxModel::MdcaCount() const - { - return Count(); - } - -// --------------------------------------------------------------------------- -// CDestListboxModel::SetOwnIconOffset -// --------------------------------------------------------------------------- -// -void CDestListboxModel::SetOwnIconOffset( TInt aOffset ) - { - iOffset = aOffset; - } - -// --------------------------------------------------------------------------- -// CDestListboxModel::MdcaPoint -// --------------------------------------------------------------------------- -// -TPtrC CDestListboxModel::MdcaPoint( TInt aIndex ) const - { - // We need to cast away the const-ness from the buffer. - // It was definitely made for formatting! - FormatListboxText( aIndex, - ( MUTABLE_CAST( TBuf&, iBuf ) ) ); - - return iBuf; - } - -// --------------------------------------------------------------------------- -// CDestListboxModel::FormatListboxTextL -// --------------------------------------------------------------------------- -// -void CDestListboxModel::FormatListboxTextL( TInt aIndex, - TDes& aBuf ) const - { - aBuf.Zero(); - HBufC* secondLine; - if ( At(aIndex)->NumOfCMs() ) - { - if ( At(aIndex)->NumOfCMs() == 1 ) - { - secondLine = - StringLoader::LoadLC( R_CMMANAGERUI_CONN_METHODS_AMOUNT_ONE ); - } - else - { - secondLine = - StringLoader::LoadLC( R_CMMANAGERUI_CONN_METHODS_AMOUNT_MANY, - At( aIndex )->NumOfCMs() ); - } - } - else - { - if ( At( aIndex )->Uid() == KDestItemNewConnection ) - { - //add cm if list is empty - secondLine = - StringLoader::LoadLC( R_CMMANAGERUI_ADD_CONNECTION_METHOD ); - } - else - { - secondLine = - StringLoader::LoadLC( R_CMMANAGERUI_CONN_METHODS_AMOUNT_NONE ); - } - } - - if ( At( aIndex )->IsDefault() ) - { - aBuf.Format( KListItemFormatDestProt, - At(aIndex)->IconIndex(), - &At(aIndex)->Name(), - secondLine, - KDestReservedIconIndexDefaultConn ); - } - else - { - // Protected icon must be put only if the protection level is 1 - if ( At( aIndex )->GetProtectionLevel() == EProtLevel1 ) - { - aBuf.Format( KListItemFormatDestProt, - At(aIndex)->IconIndex(), - &At(aIndex)->Name(), - secondLine, - KDestReservedIconIndexProtected ); - } - else - { - aBuf.Format( KListItemFormatDest, - At(aIndex)->IconIndex(), - &At(aIndex)->Name(), - secondLine ); - } - } - CleanupStack::PopAndDestroy( secondLine ); - } - -// --------------------------------------------------------------------------- -// CDestListboxModel::FormatListboxText -// --------------------------------------------------------------------------- -// - -void CDestListboxModel::FormatListboxText( TInt aIndex, - TDes& aBuf ) const - { - TRAP_IGNORE( FormatListboxTextL( aIndex, aBuf ) ); - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/destlistitem.cpp --- a/cmmanager/cmmgr/Framework/Src/destlistitem.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CDestListItem. -* -*/ - -#include -#include "destlistitem.h" -#include - -using namespace CMManager; - -// --------------------------------------------------------------------------- -// CDestListItem::NewLC -// --------------------------------------------------------------------------- -// -CDestListItem* CDestListItem::NewLC( TUint32 aUid, - HBufC* aName, - TInt aNumOfCMs, - TUint aIconIndex, - TProtectionLevel aProtectionLevel, - TBool aIsDefault ) - { - CDestListItem* db = new( ELeave ) CDestListItem( aName ); - CleanupStack::PushL( db ); - db->ConstructL( aUid, aNumOfCMs, aIconIndex , - aProtectionLevel, aIsDefault ); - return db; - } - -// --------------------------------------------------------------------------- -// CDestListItem::~CDestListItem -// --------------------------------------------------------------------------- -// -CDestListItem::~CDestListItem() - { - delete iName; - } - -// --------------------------------------------------------------------------- -// CDestListItem::CDestListItem -// --------------------------------------------------------------------------- -// -CDestListItem::CDestListItem( HBufC* aName ) - : iName( aName ) - { - } - -// --------------------------------------------------------------------------- -// CDestListItem::ConstructL -// --------------------------------------------------------------------------- -// -void CDestListItem::ConstructL( TUint32 aUid, - TInt aNumOfCMs, - TUint aIconIndex, - TProtectionLevel aProtectionLevel, - TBool aIsDefault ) - { - iProtectionLevel = aProtectionLevel; - if (aProtectionLevel == EProtLevel0) - { - iIsProtected = EFalse; - } - else - { - iIsProtected = ETrue; - } - iIconIndex = aIconIndex; - iNumOfCMs = aNumOfCMs; - iIsDefault = aIsDefault; - iUid = aUid; - } -// --------------------------------------------------------------------------- -// CDestListItem::Name -// --------------------------------------------------------------------------- -// -const TDesC& CDestListItem::Name() - { - return *iName; - } - -// --------------------------------------------------------------------------- -// CDestListItem::Uid -// --------------------------------------------------------------------------- -// -TUint32 CDestListItem::Uid() - { - return iUid; - } - -// --------------------------------------------------------------------------- -// CDestListItem::NumOfCMs -// --------------------------------------------------------------------------- -// -TInt CDestListItem::NumOfCMs() - { - return iNumOfCMs; - } - -// --------------------------------------------------------------------------- -// CDestListItem::IconIndex -// --------------------------------------------------------------------------- -// -TUint CDestListItem::IconIndex() - { - return iIconIndex; - } - -// --------------------------------------------------------------------------- -// CDestListItem::IsProtected -// --------------------------------------------------------------------------- -// -TUint CDestListItem::IsProtected() - { - return iIsProtected; - } - -// --------------------------------------------------------------------------- -// CDestListItem::IsProtected -// --------------------------------------------------------------------------- -// -TProtectionLevel CDestListItem::GetProtectionLevel() - { - return iProtectionLevel; - } - -// --------------------------------------------------------------------------- -// CDestListItem::IsDefault -// --------------------------------------------------------------------------- -// -TUint CDestListItem::IsDefault() - { - return iIsDefault; - } - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/destlistitemlist.cpp --- a/cmmanager/cmmgr/Framework/Src/destlistitemlist.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CDestListItemList -* -*/ - -#include "destlistitemlist.h" -#include "destlistitem.h" - -LOCAL_D const TInt KGranularity = 4; ///< Granularity of the list. - -// --------------------------------------------------------- -// CDestListItemList::CDestListItemList -// --------------------------------------------------------- -// -CDestListItemList::CDestListItemList() - : CArrayPtrFlat( KGranularity ) - { - } - -// --------------------------------------------------------- -// CDestListItemList::~CDestListItemList -// --------------------------------------------------------- -// -CDestListItemList::~CDestListItemList() - { - ResetAndDestroy(); - } - -// --------------------------------------------------------- -// CDestListItemList::ItemByUid -// --------------------------------------------------------- -// -CDestListItem* CDestListItemList::ItemForUid( TUint32 aUid ) const - { - // This method cannot return "const CDestListItem*", because all methods - // of CDestListItem are non-const -> if the returned item was const, it - // would be unusable. - TInt i; - TInt count = Count(); - for ( i = 0; i < count; i++ ) - { - if ( At( i )->Uid() == aUid ) - { - return At( i ); - } - } - - return NULL; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/selectdestination.cpp --- a/cmmanager/cmmgr/Framework/Src/selectdestination.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,285 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shows the "Select destination:" dialog, where the user can -* select one of the available destinations. -* -*/ - -#include -#include -#include -#include -#include "selectdestinationdlg.h" -#include -#include -#include "cmdestinationimpl.h" -#include "cmlogger.h" -#include "cmmanagerimpl.h" - -#include - -// ---------------------------------------------------------------------------- -// CSelectDestinationDlg::CSelectDestinationDlg -// ---------------------------------------------------------------------------- -// -CSelectDestinationDlg::CSelectDestinationDlg( TInt aDummyIndex, - TUint32& aDestinationId ) - : CAknListQueryDialog( &aDummyIndex ) - , iDestinationId( aDestinationId ) - , iDestinations( KCmArrayMediumGranularity ) - { - CLOG_CREATE; - } - -// ---------------------------------------------------------------------------- -// CSelectDestinationDlg::ConstructL -// ---------------------------------------------------------------------------- -// -void CSelectDestinationDlg::ConstructL( CCmManagerImpl& aCmManager, - RArray* aDestArray ) - { - LOGGER_ENTERFN( "CSelectDestinationDlg::ConstructL" ); - RArray destinations( KCmArrayMediumGranularity ); - CleanupClosePushL( destinations ); - - aCmManager.AllDestinationsL( destinations ); - - TBool mmsFound = EFalse; - for ( TInt i = 0; i < destinations.Count(); i++ ) - { - CCmDestinationImpl* dest = aCmManager.DestinationL( destinations[i] ); - CleanupStack::PushL( dest ); - - // Don't count the current destination - if ( dest->Id() == iDestinationId ) - { - CleanupStack::PopAndDestroy( dest ); - continue; - } - - // Do not give the option to copy into a Level 1 Protected Destination - if ( dest->ProtectionLevel() == CMManager::EProtLevel1 ) - { - CleanupStack::PopAndDestroy( dest ); - continue; - } - - // check if the destination is valid as parent (e.g. for VPN) - if ( aDestArray && aDestArray->Find( dest->Id() ) == KErrNotFound ) - { - CleanupStack::PopAndDestroy( dest ); - continue; - } - - // Skip the MMS Snap, it it not shown in the list - if ( !mmsFound ) - { - TInt snapMetadata = 0; - TRAPD(metaErr, snapMetadata = dest->MetadataL( CMManager::ESnapMetadataPurpose )); - if ( metaErr == KErrNone && snapMetadata == CMManager::ESnapPurposeMMS ) - { - CleanupStack::PopAndDestroy( dest ); - mmsFound = ETrue; - continue; - } - } - - iDestinations.AppendL( dest ); - CleanupStack::Pop( dest ); - } - CleanupStack::PopAndDestroy( &destinations ); - } - -// ---------------------------------------------------------------------------- -// CSelectDestinationDlg::~CSelectDestinationDlg -// ---------------------------------------------------------------------------- -// -CSelectDestinationDlg::~CSelectDestinationDlg() - { - for ( TInt i = 0; i < iDestinations.Count(); i++ ) - { - delete iDestinations[i]; - } - iDestinations.Close(); - CLOG_CLOSE; - } - -// ---------------------------------------------------------------------------- -// CSelectDestinationDlg::NewL -// ---------------------------------------------------------------------------- -// -CSelectDestinationDlg* CSelectDestinationDlg::NewL( TUint32& aDestinationId, - CCmManagerImpl& aCmManager, - RArray* aDestArray ) - { - CSelectDestinationDlg* self = NewLC( aDestinationId, aCmManager, aDestArray ); - - CleanupStack::Pop( self ); - - return self; - } - - -// ---------------------------------------------------------------------------- -// CSelectDestinationDlg::NewLC -// ---------------------------------------------------------------------------- -// -CSelectDestinationDlg* CSelectDestinationDlg::NewLC( TUint32& aDestinationId, - CCmManagerImpl& aCmManager, - RArray* aDestArray ) - { - CSelectDestinationDlg* self = - new (ELeave) CSelectDestinationDlg( 0, aDestinationId ); - - CleanupStack::PushL( self ); - - self->ConstructL( aCmManager, aDestArray ); - - return self; - } - - -// ---------------------------------------------------------------------------- -// CSelectDestinationDlg::OkToExitL -// ---------------------------------------------------------------------------- -// -TBool CSelectDestinationDlg::OkToExitL( TInt aButtonId ) - { - TBool result = EFalse; - - if ( aButtonId == EAknSoftkeySelect || aButtonId == EAknSoftkeyOk ) - { - iDestinationId = iDestinations[ ListBox()->CurrentItemIndex() ]->Id(); - - result = ETrue; - } - else if ( aButtonId == EAknSoftkeyCancel ) - { - iDestinationId = 0; - - result = ETrue; - } - - CLOG_WRITE_2( "CSelectDestinationDlg::OkToExitL dest ID: [%d], result: [%d]", - iDestinationId, result ); - - return result; - } - - -// ---------------------------------------------------------------------------- -// CSelectDestinationDlg::PreLayoutDynInitL -// ---------------------------------------------------------------------------- -// -void CSelectDestinationDlg::PreLayoutDynInitL() - { - LOGGER_ENTERFN( "CSelectDestinationDlg::PreLayoutDynInitL" ); - // Let the base class do its job first - CAknListQueryDialog::PreLayoutDynInitL(); - - // Set the description field on the query - HBufC* desc = - StringLoader::LoadLC( R_CMWIZARD_SELECT_DESTINATION_DESCRIPTION ); - - MessageBox()->SetMessageTextL( desc ); - CleanupStack::PopAndDestroy( desc ); - - // Specify the item text array - CDesCArrayFlat* itemArray = - new (ELeave) CDesCArrayFlat( KCmArrayMediumGranularity ); - SetItemTextArray( itemArray ); - SetOwnershipType( ELbmOwnsItemArray ); - - // Note: we don't have to put 'itemArray' on to the cleanup stack, as the - // model has already taken this object over. - - for ( TInt i = 0; i < iDestinations.Count(); i++ ) - { - // Here we take advantage of the fact that our icon array is ordered. - // That is, the indices of the icons in the array will always be - // in sync with those in the item text array (i.e. each bearer will - // have the right icon associated with it). - HBufC* destName = iDestinations[i]->NameLC(); - HBufC* lineText = - TCmCommonUi::FormattedTextForListBoxLC( i, *destName ); - - itemArray->AppendL( *lineText ); - CleanupStack::PopAndDestroy( 2, destName ); // destName, lineText - } - - // Icons ... - SetIconsL(); - } - - -// ---------------------------------------------------------------------------- -// CSelectDestinationDlg::SetIconsL() -// ---------------------------------------------------------------------------- -// -void CSelectDestinationDlg::SetIconsL() - { - CArrayPtr* icons = - new (ELeave) CArrayPtrFlat( KCmArrayMediumGranularity ); - CleanupStack::PushL( icons ); - - for ( TInt i = 0; i < iDestinations.Count(); i++ ) - { - CGulIcon* icon = iDestinations[i]->IconL(); - CleanupStack::PushL( icon ); - - icons->AppendL( icon ); - - CleanupStack::Pop( icon ); // icon array took over ownership - } - - SetIconArrayL( icons ); // ownership passed, too - - CleanupStack::Pop( icons ); - } - - -// ---------------------------------------------------------------------------- -// void CSelectDestinationDlg::HandleResourceChange -// ---------------------------------------------------------------------------- -// -void CSelectDestinationDlg::HandleResourceChange( TInt aType ) - { - if ( aType == KAknsMessageSkinChange ) - { - CAknListQueryDialog::HandleResourceChange( aType ); - - TRAP_IGNORE( SetIconsL() ); - - SizeChanged(); - } - else - { - if ( aType == KEikDynamicLayoutVariantSwitch ) - { - TRect mainPaneRect; - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, - mainPaneRect ); - - TAknLayoutRect layoutRect; - layoutRect.LayoutRect( TRect( TPoint( 0, 0 ), - mainPaneRect.Size() ), - AKN_LAYOUT_WINDOW_list_gen_pane( 0 ) ); - - ListBox()->SetRect( layoutRect.Rect() ); - } - - // Base call - CAknListQueryDialog::HandleResourceChange( aType ); - } - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/Src/uncatdlg.cpp --- a/cmmanager/cmmgr/Framework/Src/uncatdlg.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,454 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CUncatDlg. -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cmmanager.hrh" -#include "uncatdlg.h" -#include "cmlistitem.h" -#include "cmlistitemlist.h" -#include -#include -#include "cmdestinationimpl.h" -#include -#include -#include -#include "cmlistboxmodel.h" -#include "selectdestinationdlg.h" -#include "cmlogger.h" - -using namespace CMManager; - -// --------------------------------------------------------------------------- -// CUncatDlg::ConstructAndRunLD -// Constructs the dialog and runs it. -// --------------------------------------------------------------------------- -// -TInt CUncatDlg::ConstructAndRunLD( TUint32 aHighlight, - TUint32& aSelected ) - { - CleanupStack::PushL( this ); - iHighlight = aHighlight; - iSelected = &aSelected; - ConstructL( R_CM_MENUBAR ); - PrepareLC(R_CM_DIALOG); - CleanupStack::Pop( this ); // it will be PushL-d by ExecuteLD... - iModel = new( ELeave ) CCmListboxModel(); - //destructed in base class destructor - iInfoPopupNoteController = CAknInfoPopupNoteController::NewL(); - - // Trace changes in CommsDat - iCmManager->WatcherRegisterL( this ); - - return RunLD(); - } - -// --------------------------------------------------------------------------- -// CUncatDlg::NewL() -// Two-phase dconstructor, second phase is ConstructAndRunLD -// --------------------------------------------------------------------------- -// -CUncatDlg* CUncatDlg::NewL(CCmManagerImpl* aCmManager ) - { - CUncatDlg* self = new (ELeave) CUncatDlg( aCmManager ); - return self; - } - -// --------------------------------------------------------------------------- -// CUncatDlg::CUncatDlg() -// --------------------------------------------------------------------------- -// -CUncatDlg::CUncatDlg( CCmManagerImpl* aCmManager ) - : CCmDlg( aCmManager, NULL, NULL ) - , iCmUncatItems(KCmArraySmallGranularity) - { - CLOG_CREATE; - CLOG_ATTACH( this, iCmManager ); - } - -// --------------------------------------------------------------------------- -// CUncatDlg::~CUncatDlg -// Destructor -// --------------------------------------------------------------------------- -// -CUncatDlg::~CUncatDlg() - { - CLOG_WRITE( "CUncatDlg::~CUncatDlg" ); - CleanupUncatArray(); - CLOG_CLOSE; - } - -// --------------------------------------------------------------------------- -// CUncatDlg::DynInitMenuPaneL -// --------------------------------------------------------------------------- -// -void CUncatDlg::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) - { - TBool hideAdd ( EFalse ); - TBool hideMove ( EFalse ); - TBool hideCopy( EFalse ); - TBool hidePrioritise( EFalse ); - - CCmDlg::DynInitMenuPaneL( aResourceId, aMenuPane ); - if ( aResourceId == R_CM_MENU ) - { - // There are no destinatons to move to OR - // the highlighted connection method is in use - if ( !iCmManager->DestinationCountL() ) - { - hideMove = ETrue; - } - - // No priorities in Uncategorized -> always disabled - hidePrioritise = ETrue; - - aMenuPane->SetItemDimmed( ECmManagerUiCmdCmAdd, hideAdd ); - aMenuPane->SetItemDimmed( ECmManagerUiCmdCmPrioritise, hidePrioritise ); - aMenuPane->SetItemDimmed( ECmManagerUiCmdCmCopyToOtherDestination, hideCopy ); - aMenuPane->SetItemDimmed( ECmManagerUiCmdCmCopyToOtherDestination, hideMove ); - } - } - -// --------------------------------------------------------------------------- -// CUncatDlg::InitTextsL -// called before the dialog is shown -// to initialize localized textual data -// --------------------------------------------------------------------------- -// -void CUncatDlg::InitTextsL() - { - // set pane text if neccessary... - // pane text needed if not pop-up... - HBufC* primary = - iEikonEnv->AllocReadResourceLC( R_CMMANAGERUI_EMPTY_METHOD_VIEW_PRIMARY ); - HBufC* secondary = - iEikonEnv->AllocReadResourceLC( R_CMMANAGERUI_EMPTY_METHOD_VIEW_SECONDARY ); - CDesCArrayFlat* items = new (ELeave) CDesCArrayFlat(2); - CleanupStack::PushL(items); - items->AppendL(primary->Des()); - items->AppendL(secondary->Des()); - HBufC* emptyText = - StringLoader::LoadLC( R_TWO_STRING_FOR_EMPTY_VIEW , *items); - iListbox->View()->SetListEmptyTextL( *emptyText ); - CleanupStack::PopAndDestroy( emptyText ); - CleanupStack::PopAndDestroy( items ); - CleanupStack::PopAndDestroy( secondary ); - CleanupStack::PopAndDestroy( primary ); - - iStatusPane = iEikonEnv->AppUiFactory()->StatusPane(); - iTitlePane = - ( CAknTitlePane* )iStatusPane->ControlL( - TUid::Uid( EEikStatusPaneUidTitle ) ); - - iOldTitleText = iTitlePane->Text()->AllocL(); - HBufC* name = StringLoader::LoadLC( R_CMMANAGERUI_DEST_UNCATEGORIZED ); - iTitlePane->SetTextL( *name ); - CleanupStack::PopAndDestroy( name ); - iNaviPane = ( CAknNavigationControlContainer* ) - iStatusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ); - iNaviDecorator = iNaviPane->CreateNavigationLabelL( KNullDesC ); - iNaviPane->PushL( *iNaviDecorator ); - } - -// --------------------------------------------------------------------------- -// CUncatDlg::ProcessCommandL -// --------------------------------------------------------------------------- -// -void CUncatDlg::ProcessCommandL( TInt aCommandId ) - { - if ( MenuShowing() ) - { - HideMenu(); - } - - switch ( aCommandId ) - { - case ECmManagerUiCmdCmMoveToOtherDestination: - { - if ( CurrentCML()->GetBoolAttributeL( ECmConnected ) ) - { - TCmCommonUi::ShowNoteL( R_QTN_SET_NOTE_AP_IN_USE_EDIT, - TCmCommonUi::ECmErrorNote ); - } - else - { - // The selected item will be at the same position - TInt selected = iListbox->CurrentItemIndex(); - TInt noi = iListbox->Model()->NumberOfItems(); - // If it is the last then the previous will be selected. - if( selected == noi-1 ) - { - selected--; - } - - TRAPD( err, CCmDlg::ProcessCommandL( - ECmManagerUiCmdCmCopyToOtherDestination ) ); - if ( err == KErrCancel ) - { - break; - } - else - { - User::LeaveIfError( err ); - } - - if ( iListbox->Model()->NumberOfItems() ) - { - //first item cannot be deleted - iListbox->ScrollToMakeItemVisible( selected); - iListbox->SetCurrentItemIndexAndDraw( selected ); - } - else - { - TCmCommonUi::ShowNoteL( R_QTN_NETW_CONSET_INFO_UNCAT_EMPTY, - TCmCommonUi::ECmInfoNote ); - iCmManager->WatcherUnRegister(); - TryExitL( KDialogUserBack ); - } - } - } - break; - - case EAknSoftkeyClear: - case ECmManagerUiCmdCmDelete: - { - CCmPluginBase* cm = CurrentCML(); - - if ( cm->GetBoolAttributeL( ECmProtected ) ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - - break; - } - - if ( cm->GetBoolAttributeL( ECmIsLinked ) )//same check as KErrLocked below - { - TCmCommonUi::ShowNoteL( R_QTN_NETW_CONSET_INFO_CANNOT_DELETE_VIRTUAL_REF, - TCmCommonUi::ECmErrorNote ); - - break; - } - - if ( cm->GetBoolAttributeL( ECmConnected ) )//same check as KErrInUse below - { - TCmCommonUi::ShowNoteL( R_CMMANAGERUI_INFO_CM_IN_USE_CANNOT_DELETE, - TCmCommonUi::ECmErrorNote ); - - break; - } - - HBufC* cmName = cm->GetStringAttributeL(ECmName); - CleanupStack::PushL(cmName); - - if ( TCmCommonUi::ShowConfirmationQueryL( - R_CMMANAGERUI_QUEST_CM_DELETE, *cmName ) ) - { - TRAPD( err, CurrentCML()->DeleteL( ETrue ) ); - - switch ( err ) - { - case KErrInUse: - { - TCmCommonUi::ShowNoteL - ( R_CMMANAGERUI_INFO_CM_IN_USE_CANNOT_DELETE, - TCmCommonUi::ECmErrorNote ); - } - break; - - case KErrLocked: - { - TCmCommonUi::ShowNoteL - ( R_QTN_NETW_CONSET_INFO_CANNOT_DELETE_VIRTUAL_REF, - TCmCommonUi::ECmErrorNote ); - } - break; - - case KErrNone: - { - HandleListboxDataChangeL(); - - if ( !iListbox->Model()->NumberOfItems() ) - { - TCmCommonUi::ShowNoteL( R_QTN_NETW_CONSET_INFO_UNCAT_EMPTY, - TCmCommonUi::ECmInfoNote ); - iCmManager->WatcherUnRegister(); - TryExitL( KDialogUserBack ); - } - } - break; - - default: - { - } - } - - } - CleanupStack::PopAndDestroy( cmName ); - - } - break; - - case ECmManagerUiCmdCmAdd: - case ECmManagerUiCmdCmCopyToOtherDestination: - case ECmManagerUiCmdCmPrioritise: - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED, - TCmCommonUi::ECmErrorNote ); - } - break; - - default: - { - CCmDlg::ProcessCommandL(aCommandId); - } - } - } - -// --------------------------------------------------------------------------- -// CUncatDlg::CurrentCML -// called before the dialog is shown to initialize listbox data -// --------------------------------------------------------------------------- -// -CCmPluginBase* CUncatDlg::CurrentCML() - { - return CMByIndexL( iListbox->CurrentItemIndex() ); - } - -// --------------------------------------------------------------------------- -// CUncatDlg::CMByIndexL -// a connection method in the list -// --------------------------------------------------------------------------- -// -CCmPluginBase* CUncatDlg::CMByIndexL( TInt aIndex ) - { - TInt anIndex = iItemIndex[aIndex]; - if( !iCmUncatItems[anIndex].iPlugin ) - { - iCmUncatItems[anIndex].iPlugin = - iCmManager->GetConnectionMethodL( - iCmUncatItems[anIndex].iCmId ); - } - return iCmUncatItems[anIndex].iPlugin; - } - -// --------------------------------------------------------------------------- -// CUncatDlg::CMCount -// number of cms in the list -// --------------------------------------------------------------------------- -// -TInt CUncatDlg::CMCount() - { - return iCmUncatItems.Count(); - } - -// -------------------------------------------------------------------------- -// CUncatDlg::ConstructCMArrayL -// -------------------------------------------------------------------------- -// -void CUncatDlg::ConstructCMArrayL( RArray& aCmIds ) - { - // empty the array - reuse - CleanupUncatArray( ETrue ); - iCmManager->ConnectionMethodL( aCmIds, EFalse ); - CleanupClosePushL( aCmIds ); - - for( TInt i = 0; i < aCmIds.Count(); ++i ) - { - TUncatItem item; - - item.iPlugin = NULL; - item.iCmId = aCmIds[i]; - - User::LeaveIfError( iCmUncatItems.Append( item ) ); - } - - CleanupStack::Pop( &aCmIds ); - } - -// -------------------------------------------------------------------------- -// CCmDlg::ClearHiddenCMsFromArrayL -// -------------------------------------------------------------------------- -// -void CUncatDlg::ClearHiddenCMsFromArrayL( RArray& aCmIds ) - { - TBool hidden( EFalse ); - TInt err( KErrNone ); - for ( TInt index = 0; index < aCmIds.Count(); index++ ) - { - TUint recId = aCmIds[index]; - TRAP( err, hidden = iCmManager->GetConnectionMethodInfoBoolL( recId, ECmHidden ) ); - if ( err || hidden ) - { - aCmIds.Remove( index ); - index--; - // Remove the same item from iCmUncatItems array - for( TInt i = 0; i < iCmUncatItems.Count(); i++ ) - { - if( iCmUncatItems[i].iCmId == recId ) - { - iCmUncatItems.Remove( i ); - break; - } - } - } - } - } - - -// -------------------------------------------------------------------------- -// CUncatDlg::CleanupUncatArray -// -------------------------------------------------------------------------- -// -void CUncatDlg::CleanupUncatArray( TBool aReuseArray ) - { - CLOG_WRITE( "CUncatDlg::CleanupUncatArray" ); - for ( TInt i = 0; i < iCmUncatItems.Count(); ++i ) - { - CCmPluginBase* cm = iCmUncatItems[i].iPlugin; - delete cm; - } - - if ( aReuseArray ) - { - iCmUncatItems.Reset(); - } - else - { - iCmUncatItems.Close(); - } - } - -// -------------------------------------------------------------------------- -// CUncatDlg::CommsDatChangesL -// -------------------------------------------------------------------------- -// -void CUncatDlg::CommsDatChangesL() - { - // Update list box - HandleListboxDataChangeL(); - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/SrcData/cmmanager.rss --- a/cmmanager/cmmgr/Framework/SrcData/cmmanager.rss Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1412 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource file. -* -*/ - -// RESOURCE IDENTIFIER -NAME CMMG // 4 letter ID - -// INCLUDES - -// System -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// User -#include -#include -#include "cmmanager.hrh" - -//For Ip address editor -#define IPADDRESS_MIN_FIRST_FIELD_VALUE 0 -#define IPADDRESS_MIN_SECOND_FIELD_VALUE 0 -#define IPADDRESS_MIN_THIRD_FIELD_VALUE 0 -#define IPADDRESS_MIN_FOURTH_FIELD_VALUE 0 -#define IPADDRESS_MAX_FIRST_FIELD_VALUE 255 -#define IPADDRESS_MAX_SECOND_FIELD_VALUE 255 -#define IPADDRESS_MAX_THIRD_FIELD_VALUE 255 -#define IPADDRESS_MAX_FOURTH_FIELD_VALUE 255 - -// RESOURCE DEFINITIONS -RESOURCE RSS_SIGNATURE {} - -RESOURCE TBUF R_CMMANAGER_CM_NAME_DEFAULT - { buf = "Default Connection Method"; } - -// NON-LOCALIZED STRINGS -RESOURCE TBUF r_start_page_def_value - { buf = "http://"; } - -// LOCALISED STRINGS -RESOURCE TBUF r_qtn_netw_conset_info_cannot_delete_dest_prot_cm - { buf = qtn_netw_conset_info_cannot_delete_dest_prot_cm; } - -RESOURCE TBUF r_qtn_netw_sett_subnet_mask - { buf = qtn_netw_sett_subnet_mask; } - -RESOURCE TBUF r_qtn_netw_sett_default_gateway - { buf = qtn_netw_sett_default_gateway; } - -RESOURCE TBUF r_qtn_selec_setting_compulsory - { buf = qtn_selec_setting_compulsory; } - -RESOURCE TBUF r_qtn_set_dns_servers_automatic - { buf = qtn_set_dns_servers_automatic; } - -RESOURCE TBUF r_qtn_set_passwd_aut - { buf = qtn_set_passwd_aut; } - -RESOURCE TBUF r_qtn_set_ap_passwd - { buf = qtn_set_ap_passwd; } - -RESOURCE TBUF r_qtn_set_prompt_passwd_yes - { buf = qtn_set_prompt_passwd_yes; } - -RESOURCE TBUF r_qtn_set_prompt_passwd_no - { buf = qtn_set_prompt_passwd_no; } - -RESOURCE TBUF r_qtn_set_prompt_passwd - { buf = qtn_set_prompt_passwd; } - -RESOURCE TBUF r_qtn_set_ap_username_none - { buf = qtn_set_ap_username_none; } - -RESOURCE TBUF r_qtn_set_passwd_aut_normal - { buf = qtn_set_passwd_aut_normal; } - -RESOURCE TBUF r_qtn_set_passwd_aut_secure - { buf = qtn_set_passwd_aut_secure; } - -RESOURCE TBUF r_qtn_set_ap_username - { buf = qtn_set_ap_username; } - -RESOURCE TBUF r_qtn_set_ip_well_known - { buf = qtn_set_ip_well_known; } - -RESOURCE TBUF r_qtn_set_dns_servers_ip - { buf = qtn_set_dns_servers_ip; } - -RESOURCE TBUF r_qtn_set_secondary_dns - { buf = qtn_set_secondary_dns; } - -RESOURCE TBUF r_qtn_set_primary_dns - { buf = qtn_set_primary_dns; } - -RESOURCE TBUF r_qtn_set_ip_address_dynamic - { buf = qtn_set_ip_address_dynamic; } - -RESOURCE TBUF r_qtn_set_ip_address - { buf = qtn_set_ip_address; } - -RESOURCE TBUF r_qtn_set_ipv6_settings - { buf = qtn_set_ipv6_settings; } - -RESOURCE TBUF r_qtn_set_ipv4_settings - { buf = qtn_set_ipv4_settings; } - -RESOURCE TBUF r_qtn_set_ip_user_defined - { buf = qtn_set_ip_user_defined; } - -RESOURCE TBUF r_qtn_netw_quest_iap_incomplete_delete - { buf = qtn_netw_quest_iap_incomplete_delete; } - -RESOURCE TBUF r_qtn_set_info_invalid_ip - { buf = qtn_set_info_invalid_ip; } - -RESOURCE TBUF r_qtn_set_proxy_server_address - { buf = qtn_set_proxy_server_address; } - -RESOURCE TBUF r_qtn_set_proxy_server_address_none - { buf = qtn_set_proxy_server_address_none; } - -RESOURCE TBUF r_qtn_set_proxy_port_number - { buf = qtn_set_proxy_port_number; } - -RESOURCE TBUF r_qtn_set_home_page_none - { buf = qtn_set_home_page_none; } - -RESOURCE TBUF r_qtn_set_starting_page - { buf = qtn_set_starting_page; } - -RESOURCE TBUF r_qtn_netw_conset_info_cannot_delete_virtual_ref - { buf = qtn_netw_conset_info_cannot_delete_virtual_ref; } - -RESOURCE TBUF64 r_cmmanagereng_default_ap_name - { buf = qtn_set_ap_default_name; } - -RESOURCE TBUF r_qtn_netw_conset_info_uncat_empty - { buf = qtn_netw_conset_info_uncat_empty ; } - -RESOURCE TBUF r_qtn_netw_conset_embedded_dest - { buf = qtn_netw_conset_embedded_dest ; } - -RESOURCE TBUF r_cmmanagerui_add_connection_method - { buf = qtn_netw_conset_add_connection_method; } -RESOURCE TBUF r_cmmanagerui_new_connection - { buf = qtn_netw_conset_add_connection; } - -RESOURCE TBUF r_cmmanagerui_conn_methods_amount_many - { buf = qtn_netw_conset_conn_methods_amount_many; } - -RESOURCE TBUF r_cmmanagerui_conn_methods_amount_one - { buf = qtn_netw_conset_conn_methods_amount_one; } - -RESOURCE TBUF r_cmmanagerui_conn_methods_amount_none - { buf = qtn_netw_conset_conn_methods_amount_none; } - -RESOURCE TBUF r_cmmanagerui_method_priority_other - { buf = qtn_netw_conset_method_priority_other; } - -RESOURCE TBUF r_qtn_netw_conset_method_priority_auto - { buf = qtn_netw_conset_method_priority_auto; } - -RESOURCE TBUF r_cmmanagerui_navi - { buf = qtn_netw_conset_network_connections_title; } - -RESOURCE TBUF r_cmmanagerui_empty_method_view_primary - { buf = qtn_netw_conset_empty_method_view_primary; } - -RESOURCE TBUF r_cmmanagerui_empty_method_view_secondary - { buf = qtn_netw_conset_empty_method_view_secondary; } - -RESOURCE TBUF r_cmmanagerui_connection_name - { buf = qtn_set_ap_conn_name; } - -RESOURCE TBUF r_cmmanagerui_prmpt_cm_mame - { buf = qtn_netw_conset_prmpt_method_name; } - -RESOURCE TBUF r_cmmanagerui_prmpt_destination_name - { buf =qtn_netw_conset_prmpt_destination_name;} - -RESOURCE TBUF r_cmmanagerui_quest_cm_delete - { buf = qtn_netw_conset_quest_delete_method;} - -RESOURCE TBUF r_cmmanagerui_info_cm_protected_cannot_delete - { buf = qtn_netw_conset_info_cannot_delete_protected_method;} - -RESOURCE TBUF r_cmmanagerui_info_cm_in_use_cannot_delete - { buf = qtn_netw_conset_info_cannot_delete_method_in_use;} - -RESOURCE TBUF r_cmmanagerui_quest_dest_delete - { buf = qtn_netw_conset_quest_delete_destination; } - -RESOURCE TBUF r_cmmanagerui_info_dest_in_use_cannot_delete - { buf = qtn_netw_conset_info_cannot_delete_dest_in_use; } - -RESOURCE TBUF r_qtn_set_note_ap_in_use_edit - { buf = qtn_set_note_ap_in_use_edit; } - -RESOURCE TBUF r_cmmanagerui_info_dest_protected_cannot_delete - { buf = qtn_netw_conset_info_cannot_delete_dest_protected;} - -RESOURCE TBUF r_cmmanagerui_dest_uncategorized - { buf = qtn_netw_conset_dest_uncategorized; } - -RESOURCE TBUF r_cmmanagerui_dest_internet - { buf = qtn_netw_conset_dest_internet; } - -RESOURCE TBUF r_cmmanagerui_dest_wap - { buf = qtn_netw_conset_dest_wap; } - -RESOURCE TBUF r_cmmanagerui_dest_mms - { buf = qtn_netw_conset_dest_mms; } - -RESOURCE TBUF r_cmmanagerui_dest_intranet - { buf = qtn_netw_conset_dest_intranet; } - -RESOURCE TBUF r_cmmanagerui_msk_add_method - { buf = qtn_msk_add_method; } - -RESOURCE TBUF r_plugin_base_options_change - { buf = qtn_set_options_change; } - -RESOURCE TBUF r_plugin_base_options_ap_advanced - { buf = qtn_set_options_ap_advanced; } - -RESOURCE TBUF r_plugin_base_cmd_exit - { buf = qtn_set_options_exit; } - -RESOURCE TBUF r_cmwizard_automatic_check - { buf = qtn_netw_conset_quest_check_conn_methods; } - -RESOURCE TBUF r_cmwizard_checking_methods - { buf = qtn_netw_conset_wait_checking_methods; } - -RESOURCE TBUF r_cmwizard_manual_configuration - { buf = qtn_netw_conset_quest_conf_method_manually; } - -RESOURCE TBUF r_cmwizard_available_methods - { buf = qtn_netw_conset_prmpt_available_methods; } - -RESOURCE TBUF r_cmwizard_bearer_available_wlan - { buf = qtn_netw_conset_bearer_available_wlan; } - -RESOURCE TBUF r_cmwizard_one_wlan_nw_available - { buf = qtn_netw_conset_one_wlan_nw_available; } - -RESOURCE TBUF r_cmwizard_many_wlan_nw_available - { buf = qtn_netw_conset_many_wlan_nw_available; } - -RESOURCE TBUF r_cmwizard_select_conn_method - { buf = qtn_netw_conset_prmpt_select_conn_method; } - -RESOURCE TBUF r_cmwizard_select_destination_description - { buf = qtn_netw_conset_detail_add_to_destination; } - -RESOURCE TBUF r_cmwizard_new_method_added - { buf = qtn_netw_conset_conf_new_method_added; } - -RESOURCE TBUF r_cmwizard_new_dest_added - { buf = qtn_netw_conset_conf_new_dest_added; } - -RESOURCE TBUF r_cmwizard_no_destination - { buf = qtn_netw_conset_info_no_destinations; } - -RESOURCE TBUF r_cmwizard_no_unprotected_destination - { buf = qtn_new_conset_info_cannot_add_all_dest_protected; } - -RESOURCE TBUF r_cmwizard_no_unprotected_destination_dup - { buf = qtn_netw_conset_info_cannot_add_all_dest_protected; } - -RESOURCE TBUF r_cmwizard_cannot_perform_for_protected - { buf = qtn_netw_conset_info_cannot_perform_for_protected; } - -RESOURCE TBUF r_cmwizard_no_vpn_stacking - { buf = qtn_netw_conset_info_no_vpn_stacking; } - -RESOURCE TBUF r_cmmanagerui_sett_destination - { buf = qtn_netw_conset_sett_destination; } - -RESOURCE TBUF r_cmmanagerui_sett_always_ask - { buf = qtn_netw_conset_sett_always_ask; } - -RESOURCE TBUF r_cmmanagerui_sett_ask_once - { buf = qtn_netw_conset_sett_ask_once; } - -RESOURCE TBUF r_cmmanagerui_sett_default_connection - { buf = qtn_netw_conset_sett_default_connection; } - -RESOURCE TBUF r_cmmanagerui_sett_user_defined - { buf = qtn_netw_conset_sett_user_defined; } - -RESOURCE TBUF r_cmmanagerui_navi_default - { buf = qtn_netw_conset_navi_default; } - -RESOURCE TBUF r_cmmanagerui_navi_default_always_ask - { buf = qtn_netw_conset_navi_default_always_ask; } - -RESOURCE TBUF r_cmmanagerui_navi_default_ask_once - { buf = qtn_netw_conset_navi_default_ask_once; } - -RESOURCE TBUF r_cmmanagerui_default_connection_set_to - { buf = qtn_netw_conset_default_connection_set_to; } - -RESOURCE TBUF r_cmmanagerui_conf_default_always_ask - { buf = qtn_netw_conset_conf_default_always_ask; } - -RESOURCE TBUF r_cmmanagerui_conf_default_ask_once - { buf = qtn_netw_conset_conf_default_ask_once; } - -RESOURCE TBUF r_cmmanagerui_default_connection_title - { buf = qtn_netw_conset_default_connection_title; } - -RESOURCE TBUF r_qtn_netw_conset_navi_nof_destinations - { buf = qtn_netw_conset_navi_nof_destinations; } - -RESOURCE TBUF r_qtn_netw_conset_navi_one_destination - { buf = qtn_netw_conset_navi_one_destination; } - -RESOURCE TBUF r_cmmanagerui_navi_one_conn_method - { buf = qtn_netw_conset_navi_one_conn_method; } - -RESOURCE TBUF r_cmmanagerui_navi_many_conn_methods - { buf = qtn_netw_conset_navi_many_conn_methods; } - -RESOURCE TBUF r_cmmanagerui_popup_title_data_bearer - { buf = qtn_netw_conset_popup_title_data_bearer; } - -RESOURCE TBUF r_cmmanagerui_prmpt_select_icon - { buf = qtn_netw_conset_prmpt_select_icon; } - -RESOURCE TBUF r_cmmanagerui_info_dest_already_in_use - { buf = qtn_netw_conset_info_name_already_in_use; } - -RESOURCE TBUF r_plugin_base_set_ap_bearer - { buf = qtn_set_ap_bearer; } - -RESOURCE TBUF r_plugin_base_info_bearer_not_editable - { buf = qtn_netw_conset_info_bearer_not_editable; } - -RESOURCE TBUF r_plugin_base_sett_smtp_override - { buf = qtn_netw_conset_sett_smtp_override; } - -RESOURCE TBUF r_cmmanagerui_info_prio_not_possible - { buf = qtn_netw_conset_info_prio_not_possible; } - -RESOURCE TBUF r_cmmanagerui_info_protected_cannot_edit - { buf = qtn_netw_conset_info_cannot_edit_protected; } - -RESOURCE TBUF r_cmmanagerui_quest_embedded_dest_delete - { buf = qtn_netw_conset_quest_delete_embedded_dest; } - -// SMTP settings -RESOURCE TBUF r_plugin_base_sett_smtp_outgoing_mail_server - { buf = qtn_mce_settings_mail_sending_h; } - -RESOURCE TBUF r_plugin_base_sett_smtp_user_name - { buf = qtn_mce_settings_mail_user_name; } - -RESOURCE TBUF r_plugin_base_sett_smtp_password - { buf = qtn_mce_settings_mail_password; } - -RESOURCE TBUF r_plugin_base_prompt_server_addr - { buf = qtn_mbxs_settings_mail_srvr_prompt; } - -RESOURCE TBUF r_plugin_base_sett_smtp_security - { buf = qtn_mce_settings_mail_security; } - -RESOURCE TBUF r_plugin_base_sett_security_on_starttls - { buf = qtn_mbxs_settings_mail_sec_starttls; } - -RESOURCE TBUF r_plugin_base_sett_security_on_ssltls - { buf = qtn_mbxs_settings_mail_sec_ssltls; } - -RESOURCE TBUF r_plugin_base_sett_security_off - { buf = qtn_mbxs_settings_mail_sec_off; } - -RESOURCE TBUF r_plugin_base_sett_port_default - { buf = qtn_mbxs_settings_mail_port_def; } - -RESOURCE TBUF r_plugin_base_sett_smtp_port - { buf = qtn_mce_settings_mail_port; } - -RESOURCE TBUF r_plugin_base_sett_port_userdef - { buf = qtn_mbxs_settings_mail_port_userdef; } - -RESOURCE TBUF r_text_softkey_option - { - buf = text_softkey_option; - } - -RESOURCE TBUF r_qtn_memlo_memory_full - { - buf = qtn_memlo_memory_full; - } - -RESOURCE TBUF r_qtn_fldr_name_already_used - { - buf = qtn_fldr_name_already_used; - } - -RESOURCE TBUF r_cmmanagerui_info_cm_already_in_use - { buf = qtn_netw_conset_info_name_already_in_use; } - - - -RESOURCE TBUF r_two_string_for_empty_view { buf = "%0U\n%1U"; } - -// -------------------------------------------------------------------------- -// Menu bars -// -------------------------------------------------------------------------- -// -// r_dest_menubar -// menubar for the settings view -// -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_BAR r_dest_menubar - { - titles= - { - MENU_TITLE { menu_pane=r_dest_menu; - txt="App"; } - }; - } -// ----------------------------------------------------------------------------- -// -// r_dest_menu -// menu pane for destination list -// -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_dest_menu - { - items= - { - MENU_ITEM - { - command = ECmManagerUiCmdDestEdit; - txt = qtn_options_open; - flags = EEikMenuItemAction; - }, - MENU_ITEM - { - command = ECmManagerUiCmdDestDefaultConnection; - txt = qtn_netw_conset_options_default_connection; - }, - MENU_ITEM - { - command = ECmManagerUiCmdDestAdd; - txt = qtn_netw_conset_options_add_destination; - }, - MENU_ITEM - { - command = ECmManagerUiCmdDestRename; - txt = qtn_netw_conset_options_rename_destination; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command = ECmManagerUiCmdDestChangeIcon; - txt = qtn_netw_conset_options_change_dest_icon; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command = ECmManagerUiCmdDestDelete; - txt = qtn_netw_conset_options_delete_destination; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command = EAknCmdHelp; - txt = qtn_options_help; - }, - MENU_ITEM - { - command = ECmManagerUiCmdDestUserExit; - txt=qtn_options_exit; - } - }; - } - -// ----------------------------------------------------------------------------- -// -// r_select_netw_conn_menubar -// menubar for the settings view -// -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_BAR r_select_netw_conn_menubar - { - titles= - { - MENU_TITLE { menu_pane=r_select_netw_conn_menu; - txt="App"; } - }; - } - -// ----------------------------------------------------------------------------- -// -// r_select_netw_conn_menu -// menu pane for destination list -// -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_select_netw_conn_menu - { - items= - { - MENU_ITEM - { - command = ECmManagerUiCmdDestSelect; - txt = qtn_set_cmd_select; - } - ,MENU_ITEM - { - command = ECmManagerUiCmdCMSelect; - txt = qtn_netw_conset_options_select_method; - } - ,MENU_ITEM - { - command = EAknCmdHelp; - txt = qtn_options_help; - } - }; - } - -// ----------------------------------------------------------------------------- -// -// r_dest_dialog -// -// -// ----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_dest_dialog - { - flags = EEikDialogFlagWait | - EEikDialogFlagNoDrag | - EEikDialogFlagNoTitleBar | - EEikDialogFlagFillAppClientRect | - EEikDialogFlagCbaButtons; - buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK__SELECT; - items = - { - DLG_LINE - { - type = KDestListboxType; - id = KDestListboxId; - itemflags = EEikDlgItemTakesEnterKey; - control= LISTBOX { flags = EAknListBoxSelectionList;}; - } - }; - } - -// ----------------------------------------------------------------------------- -// -// r_dest_listbox -// List of individual settings -// -// ----------------------------------------------------------------------------- -// -RESOURCE LISTBOX r_dest_listbox - { - flags = EAknListBoxSelectionList; - } - - -//----------------------------------------------------------------------------- -// Menu bars -// ----------------------------------------------------------------------------- -// -// r_cm_menubar -// menubar for the settings view -// -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_BAR r_cm_menubar - { - titles= - { - MENU_TITLE { menu_pane=r_cm_menu; txt="App"; } - }; - } -// ----------------------------------------------------------------------------- -// -// r_cm_menu -// menu pane for cmination list -// -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_cm_menu - { - items= - { - MENU_ITEM - { - command = ECmManagerUiCmdCmEdit; - txt = qtn_netw_conset_options_edit; - flags = EEikMenuItemAction; - }, - MENU_ITEM - { - command = ECmManagerUiCmdCmAdd; - txt = qtn_netw_conset_options_add_method; - }, - MENU_ITEM - { - command = ECmManagerUiCmdCmRename; - txt = qtn_netw_conset_options_rename_method; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command = ECmManagerUiCmdCmDelete; - txt = qtn_netw_conset_options_delete_method; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command = ECmManagerUiCmdCmPrioritise; - txt = qtn_netw_conset_options_prioritise; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command = ECmManagerUiCmdCmMoveToOtherDestination; - txt = qtn_netw_conset_options_move_to_dest; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command = ECmManagerUiCmdCmCopyToOtherDestination; - txt = qtn_netw_conset_options_copy_to_dest; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command = EAknCmdHelp; - txt = qtn_options_help; - }, - MENU_ITEM - { - command = ECmManagerUiCmdCmUserExit; - txt = qtn_options_exit; - } - }; - } - -// ----------------------------------------------------------------------------- -// r_softkeys_options_cancel__connect -// option/add method/cancel button set -// ----------------------------------------------------------------------------- -RESOURCE CBA r_softkeys_options_back__edit - { - buttons = - { - CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; }, - CBA_BUTTON { id = ECmManagerUiCmdCmEdit; txt = qtn_msk_edit; } - }; - } - -// ----------------------------------------------------------------------------- -// r_softkeys_prio_ok_cancel__ok -// ok/ok/cancel button set for prioritise -// ----------------------------------------------------------------------------- -RESOURCE CBA r_softkeys_prio_ok_cancel__ok - { - buttons = - { - CBA_BUTTON { id = ECmManagerUiCmdCmPrioOk; txt = text_softkey_ok; }, - CBA_BUTTON { id = ECmManagerUiCmdCmPrioCancel; txt = text_softkey_cancel; }, - CBA_BUTTON { id = ECmManagerUiCmdCmPrioOk; txt = text_softkey_ok; } - }; - } - - -// ----------------------------------------------------------------------------- -// -// r_cm_dialog -// -// -// ----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_cm_dialog - { - flags = EEikDialogFlagWait | - EEikDialogFlagNoDrag | - EEikDialogFlagNoTitleBar | - EEikDialogFlagFillAppClientRect | - EEikDialogFlagCbaButtons | - EEikDialogFlagNotifyEsc; - buttons = r_softkeys_options_back__edit; - items = - { - DLG_LINE - { - type = KCmListboxType; - id = KCmListboxId; - itemflags = EEikDlgItemTakesEnterKey; - control= LISTBOX { flags = EAknListBoxSelectionList;}; - } - }; - } - -// ----------------------------------------------------------------------------- -// r_cm_listbox -// List of individual settings -// ----------------------------------------------------------------------------- -// -RESOURCE LISTBOX r_cm_listbox - { - flags = EAknListBoxSelectionList; - } - -// ----------------------------------------------------------------------------- -// r_plugin_base_menubar -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_BAR r_plugin_base_menubar - { - titles= - { - MENU_TITLE { menu_pane=r_plugin_base_menu; txt="A"; } - }; - } - -// ----------------------------------------------------------------------------- -// r_plugin_base_menu -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_plugin_base_menu - { - items= - { - MENU_ITEM - { - command = EPluginBaseCmdChange; - txt = qtn_set_options_change; - flags = EEikMenuItemAction; - }, - MENU_ITEM - { - command = EPluginBaseCmdAdvanced; - txt = qtn_set_options_ap_advanced; - }, - MENU_ITEM - { - command = EAknCmdHelp; - txt=qtn_options_help; - }, - MENU_ITEM - { - command = EPluginBaseCmdExit; - txt = qtn_options_exit; - } - }; - } - -// ----------------------------------------------------------------------------- -// r_softkeys_options_back__change -// option/add connection/cancel button set -// ----------------------------------------------------------------------------- -RESOURCE CBA r_softkeys_options_back__change - { - buttons = - { - CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; }, - CBA_BUTTON { id = EAknSoftkeyChange; txt = qtn_msk_change; } - }; - } - -// ----------------------------------------------------------------------------- -// r_plugin_base_dialog -// ----------------------------------------------------------------------------- -// -RESOURCE DIALOG r_plugin_base_dialog - { - flags= EEikDialogFlagWait | - EEikDialogFlagNoDrag | - EEikDialogFlagNoTitleBar | - EEikDialogFlagFillAppClientRect | - EEikDialogFlagCbaButtons; - - buttons = r_softkeys_options_back__change; - items= - { - DLG_LINE - { - type = EAknCtSettingListBox; - id = KPluginBaseListboxId; - control= LISTBOX { flags = EEikListBoxMultipleSelection;}; - } - }; - } - -RESOURCE LISTBOX r_listbox_ap_settings - { - flags = EEikListBoxMultipleSelection; - } - -// Ap data editor resources -// Connection name - -RESOURCE EDWIN r_setting_app_edwin_conn_name - { - width=KConnNameWidth; - lines=KConnNameLines; - maxlength=KMaxConnNameLength; - allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode; - default_input_mode = EAknEditorTextInputMode; - flags= EEikEdwinAutoSelection | EEikEdwinNoLineOrParaBreaks; - } -RESOURCE AVKON_SETTING_PAGE r_text_setting_page_conn_name - { - number= EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - label= qtn_set_ap_conn_name; - type = EEikCtEdwin; - editor_resource_id = r_setting_app_edwin_conn_name; - } - -RESOURCE DIALOG r_ok_note - { - flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar | - EEikDialogFlagCbaButtons | EEikDialogFlagWait; - buttons = R_AVKON_SOFTKEYS_EMPTY; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control = AVKON_NOTE - { - layout = EGeneralLayout; - animation = R_QGN_NOTE_OK_ANIM; - }; - } - }; - } - -RESOURCE DIALOG r_info_note - { - flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar | - EEikDialogFlagCbaButtons | EEikDialogFlagWait; - buttons = R_AVKON_SOFTKEYS_EMPTY; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control = AVKON_NOTE - { - layout = EGeneralLayout; - animation = R_QGN_NOTE_INFO_ANIM; - }; - } - }; - } - - -RESOURCE DIALOG r_warning_note - { - flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar | - EEikDialogFlagCbaButtons | EEikDialogFlagWait; - buttons = R_AVKON_SOFTKEYS_EMPTY; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control = AVKON_NOTE - { - layout = EGeneralLayout; - animation = R_QGN_NOTE_WARNING_ANIM; - }; - } - }; - } - - -RESOURCE DIALOG r_error_note - { - flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar | - EEikDialogFlagCbaButtons | EEikDialogFlagWait; - buttons = R_AVKON_SOFTKEYS_EMPTY; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control = AVKON_NOTE - { - layout = EGeneralLayout; - animation = R_QGN_NOTE_ERROR_ANIM; - }; - } - }; - } - - -RESOURCE DIALOG r_confirmation_query - { - flags = EGeneralQueryFlags; - buttons = R_AVKON_SOFTKEYS_YES_NO__YES; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationLayout; - }; // AVKON_CONFIRMATION_QUERY - } // DLG_LINE - }; // items - } // DIALOG - -RESOURCE DIALOG r_memory_full_confirmation_query - { - flags = EGeneralQueryFlags; - buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationLayout; - animation = R_QGN_NOTE_WARNING_ANIM; - }; // AVKON_CONFIRMATION_QUERY - } // DLG_LINE - }; // items - } // DIALOG - -RESOURCE DIALOG r_text_query - { - flags = EEikDialogFlagWait | EEikDialogFlagNoDrag | - EEikDialogFlagNoTitleBar | EEikDialogFlagCbaButtons | - EEikDialogFlagNoShadow; - buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_DATA_QUERY - { - layout = EDataLayout; - control = EDWIN - { - flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable; - }; // EDWIN - }; // AVKON_DATA_QUERY - } // DLG_LINE - }; // items - } // DIALOG - -RESOURCE LISTBOX r_setting_app_listbox - { - flags = EEikListBoxMultipleSelection; - } - -RESOURCE AVKON_SETTING_PAGE r_radio_button_setting_page - { - number = EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OPTIONS_CANCEL__SELECT; - menubar = r_select_netw_conn_menubar; - type = EAknSetListBox; - editor_resource_id= r_setting_app_listbox; - } - -RESOURCE AVKON_SETTING_PAGE r_radio_button_setting_page_ok_cancel - { - number = EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - type = EAknSetListBox; - editor_resource_id= r_setting_app_listbox; - } - -// -------------------------------------------------------------------------- -// -// Generic numeric setting edwin -// -------------------------------------------------------------------------- -// -RESOURCE EDWIN r_edwin_port_number_setting_page - { - width=KNumericPageWidth; - lines=KNumericPageLines; - maxlength=KMaxProxyPortNumberLength; - allowed_input_modes = EAknEditorNumericInputMode; - default_input_mode = EAknEditorNumericInputMode; - default_case = EAknEditorLowerCase; - flags = EEikEdwinAutoSelection | EEikEdwinNoLineOrParaBreaks; - avkon_flags = EAknEditorFlagLatinInputModesOnly; - numeric_keymap = EAknEditorPlainNumberModeKeymap; - } - -// -------------------------------------------------------------------------- -// r_port_number_setting_page -// Port number setting page -// -------------------------------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_port_number_setting_page - { - number= EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - type = EEikCtEdwin; - editor_resource_id = r_edwin_port_number_setting_page; - } - - -RESOURCE DIALOG r_cmmanager_wait_note - { - flags = EAknWaitNoteFlags; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = ECmWaitDialog; - control= AVKON_NOTE - { - layout = EWaitLayout; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } - - -RESOURCE AVKON_LIST_QUERY r_cmmanager_list_query_with_msgbox - { - softkeys = R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT; - flags = EEikDialogFlagNotifyEsc | EEikDialogFlagWait; - items = - { - AVKON_LIST_QUERY_DLG_LINE - { - id = EListQueryControl; - control = AVKON_LIST_QUERY_CONTROL_WITH_MSGBOX - { - actuallisttype = EAknCtSingleGraphicPopupMenuListBox; - listbox = AVKON_LIST_QUERY_LIST - { - flags = EAknListBoxSelectionList; - }; - - heading = qtn_netw_conset_prmpt_add_to_destination; - }; - } - }; - } - -// ----------------------------------------------------------------------------- -// -// r_iconsel_dialog -// -// -// ----------------------------------------------------------------------------- -// - -RESOURCE DIALOG r_iconsel_dialog - { - flags = EGeneralQueryFlags | - EEikDialogFlagNoBorder | - EEikDialogFlagNoShadow; - buttons = - R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT; - items= - { - DLG_LINE - { - type = EAknCtPopupHeadingPane; - id = EAknSCTQueryHeadingId; - control = AVKON_HEADING - { - headinglayout = R_AVKON_SCT_LIST_HEADING_PANE; - }; - }, - DLG_LINE - { - type = KCmDestIconMapType;//0x2001 - id = ECmDestIconMapContentId; - } - }; - } - -// --------------------------------------------------------------------------- -// r_setting_app_edwin_proxy_server_addr -// edwin for proxy server address setting page -// --------------------------------------------------------------------------- -// -RESOURCE EDWIN r_setting_app_edwin_proxy_server_addr - { - width = KProxyServerWidth; - lines = KProxyServerLines; - maxlength = KMaxProxyServerLength; - numeric_keymap = EAknEditorCalculatorNumberModeKeymap; - allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode; - default_input_mode = EAknEditorTextInputMode; - special_character_table = R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG; - default_case = EAknEditorLowerCase; - allowed_case_modes = EAknEditorLowerCase | EAknEditorUpperCase; - avkon_flags = EAknEditorFlagLatinInputModesOnly | EAknEditorFlagUseSCTNumericCharmap; - flags = EEikEdwinAutoSelection | EAknEditorLowerCase | EEikEdwinNoLineOrParaBreaks; - } - -// -------------------------------------------------------------------------- -// r_text_setting_page_proxy_server_addr -// Proxy server address page -// -------------------------------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_text_setting_page_proxy_server_addr - { - number= EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - label= qtn_set_proxy_server_address; - type = EEikCtEdwin; - editor_resource_id = r_setting_app_edwin_proxy_server_addr; - } - -// -------------------------------------------------------------------------- -// r_setting_app_edwin_starting_page -// Starting Page edwin -// -------------------------------------------------------------------------- -// -RESOURCE EDWIN r_setting_app_edwin_starting_page - { - width=KStartPageWidth; - lines=KStartPageLines; - maxlength=KMaxStartPageLength; - numeric_keymap=EAknEditorAlphanumericNumberModeKeymap; - allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode; - default_input_mode = EAknEditorTextInputMode; - special_character_table = R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG; - default_case = EAknEditorLowerCase; - flags= EEikEdwinAutoSelection | EAknEditorLowerCase | EEikEdwinNoLineOrParaBreaks; - avkon_flags=EAknEditorFlagNoT9 | EAknEditorFlagLatinInputModesOnly; - } - -// -------------------------------------------------------------------------- -// r_text_setting_page_starting_page -// starting page -// -------------------------------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_text_setting_page_starting_page - { - number= EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - label= qtn_set_starting_page; - type = EEikCtEdwin; - editor_resource_id = r_setting_app_edwin_starting_page; - } - -// --------------------------------------------------------------------------- -// r_setting_app_edwin_login_name -// edwin for login name page -// --------------------------------------------------------------------------- -RESOURCE EDWIN r_setting_app_edwin_login_name - { - width = KLoginNameWidth; - lines = KLoginNameLines; - maxlength = KMaxLoginNameLength; - allowed_input_modes = EAknEditorTextInputMode | - EAknEditorNumericInputMode; - default_input_mode = EAknEditorTextInputMode; - default_case = EAknEditorLowerCase; - flags = EEikEdwinAutoSelection | EEikEdwinNoLineOrParaBreaks; - avkon_flags = EAknEditorFlagNoT9 | EAknEditorFlagLatinInputModesOnly; - } - -// --------------------------------------------------------------------------- -// r_text_setting_page_login_name -// setting page for login name -// --------------------------------------------------------------------------- -RESOURCE AVKON_SETTING_PAGE r_text_setting_page_login_name - { - number = EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - label = qtn_set_ap_username; - type = EEikCtEdwin; - editor_resource_id = r_setting_app_edwin_login_name; - } - -// -------------------------------------------------------------------------- -// r_setting_app_ip_editor -// IP Editor -// -------------------------------------------------------------------------- -// -RESOURCE IP_FIELD_EDITOR r_setting_app_ip_editor - { - min_field_values = IP_FIELD - { - first_field = 0; - second_field = 0; - third_field = 0; - fourth_field = 0; - }; - max_field_values = IP_FIELD - { - first_field = 255; - second_field = 255; - third_field = 255; - fourth_field = 255; - }; - flags = 0; - } - -// -------------------------------------------------------------------------- -// r_text_setting_page_ip_addr -// IspIPAddr page -// -------------------------------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_text_setting_page_ip_addr - { - number= EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - label= qtn_set_ip_address; - type = EAknCtIpFieldEditor; - editor_resource_id = r_setting_app_ip_editor; - } - -// -------------------------------------------------------------------------- -// r_dnsip4_query -// IP4 dialog -// -------------------------------------------------------------------------- -// -RESOURCE DIALOG r_dnsip4_query - { - flags=EGeneralQueryFlags; - buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK; - items= - { - DLG_LINE - { - type=EAknExtCtMultilineQuery; - id=EMultilineFirstLine; - control = AVKON_DATA_QUERY - { - layout = EMultiDataFirstIpEd; - label = qtn_set_primary_dns; - control = IP_FIELD_EDITOR - { - min_field_values = IP_FIELD - { - first_field = IPADDRESS_MIN_FIRST_FIELD_VALUE; - second_field = IPADDRESS_MIN_SECOND_FIELD_VALUE; - third_field = IPADDRESS_MIN_THIRD_FIELD_VALUE; - fourth_field = IPADDRESS_MIN_FOURTH_FIELD_VALUE; - }; - max_field_values = IP_FIELD - { - first_field = IPADDRESS_MAX_FIRST_FIELD_VALUE; - second_field = IPADDRESS_MAX_SECOND_FIELD_VALUE; - third_field = IPADDRESS_MAX_THIRD_FIELD_VALUE; - fourth_field = IPADDRESS_MAX_FOURTH_FIELD_VALUE; - }; - flags = 0; - }; - }; - }, - DLG_LINE - { - type = EAknExtCtMultilineQuery; - id = EMultilineSecondLine; - control = AVKON_DATA_QUERY - { - layout = EMultiDataSecondIpEd; - label = qtn_set_secondary_dns; - control = IP_FIELD_EDITOR - { - min_field_values = IP_FIELD - { - first_field = IPADDRESS_MIN_FIRST_FIELD_VALUE; - second_field = IPADDRESS_MIN_SECOND_FIELD_VALUE; - third_field = IPADDRESS_MIN_THIRD_FIELD_VALUE; - fourth_field = IPADDRESS_MIN_FOURTH_FIELD_VALUE; - }; - max_field_values = IP_FIELD - { - first_field = IPADDRESS_MAX_FIRST_FIELD_VALUE; - second_field = IPADDRESS_MAX_SECOND_FIELD_VALUE; - third_field = IPADDRESS_MAX_THIRD_FIELD_VALUE; - fourth_field = IPADDRESS_MAX_FOURTH_FIELD_VALUE; - }; - flags = 0; - }; - }; - } - }; - } - -// -------------------------------------------------------------------------- -// r_dnsip6_query -// IP6 dialog -// -------------------------------------------------------------------------- -// -RESOURCE DIALOG r_dnsip6_query - { - flags=EGeneralQueryFlags; - buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK; - items= - { - DLG_LINE - { - type=EAknCtMultilineQuery; - id=EMultilineFirstLine; - control = AVKON_DATA_QUERY - { - layout = EMultiDataFirstEdwin; - label = qtn_set_primary_dns; - control = EDWIN - { - avkon_flags = EAknEditorFlagLatinInputModesOnly; - flags=0; - width=16; - lines=1; - maxlength=KMaxIPv6NameServerLength; - default_input_mode = EAknEditorNumericInputMode; - }; - }; - }, - DLG_LINE - { - type=EAknCtMultilineQuery; - id=EMultilineSecondLine; - control= AVKON_DATA_QUERY - { - layout = EMultiDataSecondEdwin; - label = qtn_set_secondary_dns; - control=EDWIN - { - avkon_flags = EAknEditorFlagLatinInputModesOnly; - flags= 0; - width=16; - lines=1; - maxlength=KMaxIPv6NameServerLength; - default_input_mode = EAknEditorNumericInputMode; - }; - }; - } - }; - } - -// -------------------------------------------------------------------------- -// r_text_setting_page_ip -// IPNameServer1 page -// -------------------------------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_text_setting_page_ip - { - number= EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - label= qtn_set_primary_dns; - type = EAknCtIpFieldEditor; - editor_resource_id = r_setting_app_ip_editor; - } - -// -------------------------------------------------------------------------- -// r_setting_app_edwin_passwd -// login password secret input box -// -------------------------------------------------------------------------- -// -RESOURCE SECRETED r_setting_app_edwin_passwd - { - num_letters=KMaxLoginPasswordLength; - } - -// -------------------------------------------------------------------------- -// r_text_setting_page_login_passwd -// login password page -// -------------------------------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_text_setting_page_passwd - { - number= EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - label= qtn_set_ap_passwd; - type = EEikCtSecretEd; - editor_resource_id = r_setting_app_edwin_passwd; - } - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/conf/cmmanager.confml Binary file cmmanager/cmmgr/Framework/conf/cmmanager.confml has changed diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/conf/cmmanager_10207376.crml Binary file cmmanager/cmmgr/Framework/conf/cmmanager_10207376.crml has changed diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Framework/loc/cmmanager.loc --- a/cmmanager/cmmgr/Framework/loc/cmmanager.loc Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1070 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Localization file. -* -*/ - -// LOCALISATION STRINGS - -//============================================================================ -// GENERAL SETTINGS VIEW -//============================================================================ -//d: Network destinations setting item under General Settings/Connection Settings -//l: list_single_large_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_network_connections "Network destinations" - -//============================================================================= -// DESTINATION VIEW -//============================================================================= - -//----------------------------------------------------------------------------- -// Options Menu Items -//----------------------------------------------------------------------------- - -//d: Options menu text. Edit the highlighted item, used for destination and -//d: connection methods views -//l: list_single_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_options_edit "Edit" - - -//d: Options menu text. Opens a radio button page to select default conneciton -//l: list_single_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_options_default_connection "Default Connection" - -//d: Options menu text, subitem of Manage. Adds a new destination -//l: list_single_popup_submenu_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_options_add_destination "Add destination" - -//d:Options menu text, subitem of Manage -//l: list_single_popup_submenu_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_options_rename_destination "Rename destination" - -//d:Options menu text, subitem of Manage -//l: list_single_popup_submenu_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_options_change_dest_icon "Change icon" - -//d:Options menu text, subitem of Manage -//l: list_single_popup_submenu_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_options_delete_destination "Delete destination" - - -//d: Destination name query prompt text -//l: popup_query_data_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_prmpt_destination_name "Destination name: " - -//d: Title text for destination icon selection dialog. -//l: heading_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_prmpt_select_icon "Select an icon:" - - -//d: Connection method name query prompt text -//l: popup_query_data_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_prmpt_method_name "Connection method name:" - -//d: Connection method delete query text -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_quest_delete_method "Delete connection method ’%U’?" - -//d: Connection method delete info text -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_cannot_delete_protected_method "Unable to delete protected connection method" - -//d: Connection method delete info text -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_cannot_delete_method_in_use "Connection method currently in use. Unable to delete." - -//d: Destination delete query text -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_quest_delete_destination "Delete destination ’%U’ and associated connection methods?" - -//d: Destination delete info text -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_cannot_delete_dest_in_use "Destination currently in use. Unable to delete." - -//d: Note to indicate the the selected connection method cannot be currently edited as it is being used -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_set_note_ap_in_use_edit "Connection method is currently in use. Unable to edit." - -//d: Destination delete info text -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_cannot_delete_dest_protected "Unable to delete protected destination" - -//d: Destination name info text, shown when destination name already exists -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_name_already_in_use "Name ’%U’ already in use" - -//d: Embedded Destination delete query text -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_quest_delete_embedded_dest "Link cannot be restored by user. Delete anyway?" - -//d: Common text used to indicate that a destination or connection method -//d: cannot be edited if it is protected -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_cannot_edit_protected "Unable to edit protected settings" - -//----------------------------------------------------------------------------- -// List Items -//----------------------------------------------------------------------------- - -//d: The name of a new, default connection. Max.30 chars, -//d: longer ones will be truncated. -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_add_connection "Add connection" - -//d: The group of legacy access points -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_dest_uncategorized "Uncategorized" - -//d: Destination list text. The second line for qtn_netw_conset_add_connection -//d: Indicates that selecting the item will start the UI for adding a -//d: a connection method -//l: list_double_large_graphic_pane_t2_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_add_connection_method "New connection method" - -//d: Destination list text, notes the number of connections methods -//d: belonging to the destination -//l: list_double_large_graphic_pane_t2_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_conn_methods_amount_many "%N connection methods" - -//d: Destination list text. Notes that the destination has one -//d: connection method -//l: list_double_large_graphic_pane_t2_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_conn_methods_amount_one "1 connection method" - -//d: Destination list text. Notes that the destination is empty -//l: list_double_large_graphic_pane_t2_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_conn_methods_amount_none "No connection methods" - -//----------------------------------------------------------------------------- -// Status Pane -//----------------------------------------------------------------------------- - -//d: Destination list title text -//l: title_pane_t2/opt9 -//w: -//r: 3.2 -// -#define qtn_netw_conset_network_connections_title "Network destinations" - -//d: Destination list text. Shows the number of configured destinations in the -//d: navi pane -//l: navi_text_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_navi_nof_destinations "%N destinations defined" - -//d: Destination list text. Shows the number of configured destinations in the -//d: navi pane -//l: navi_text_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_navi_one_destination "1 destination defined" - -//d: Destination list text. Shows the default connection in the -//d: navi pane -//l: navi_text_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_navi_default "Default: %U" - -//d: Destination list text. Shows that the default connection -//d: is Always ask -//l: navi_text_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_navi_default_always_ask "Default: Always ask" - -//d: Destination list text. Shows that the default connection -//d: is Ask once -//l: navi_text_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_navi_default_ask_once "Default: Ask once" - -//============================================================================= -// CONNECTION METHOD VIEW -//============================================================================= - -//----------------------------------------------------------------------------- -// Options Menu Items -//----------------------------------------------------------------------------- - -//d: Connection method list text. Starts a wizard for adding a -//d: new connection method -//l: list_single_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_options_add_method "Add connection method" - -//d: Connection method list text. Renames the highlighted connection methof -//l: list_single_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_options_rename_method "Rename" - -//d: Connection method list text. Deletes the highlighted connection method -//l: list_single_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_options_delete_method "Delete" - - -//d:Connection method list text. Prioritise the highlighted connecton method -//l: list_single_popup_submenu_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_options_prioritise "Prioritise" - -//d: Connection method list text. Moves the highlighted connection method -//d: to a selected target destination -//l: list_single_popup_submenu_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_options_move_to_dest "Move to other destination" - -//d: Connection method list text. Copies the highlighted connection method -//d: to a selected target destination -//l: list_single_popup_submenu_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_options_copy_to_dest "Copy to other destination" - -//----------------------------------------------------------------------------- -// List Items -//----------------------------------------------------------------------------- - -//d: Connection method list text. Indicates the priority of the -//d: connection method -//l: list_double_graphic_pane_t2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_method_priority_other "Priority %N connection method " - -//d: Shown if the method is bound to a destination. -//l: list_double_graphic_pane_t2 -//w: -//r: 5.1 -// -#define qtn_netw_conset_method_priority_auto "Priority: Automatic" - -//d: Connection method list text. The name of an embedded destination -//l: list_double_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_embedded_dest "Link to '%U'" - -//d: Connection method list popup note. Text shown in a toolip (info popup) -//d: which is prefixed to the Bearer type of the highlighted connection method -//l: popup_preview_text_window_t1 -//w: -//r:3.2 -// -#define qtn_netw_conset_popup_title_data_bearer "Data Bearer: " - -//d: Connection method list popup note. WLAN Bearer type shown in info popup -//l: popup_preview_text_window_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_popup_bearer_wlan "Wireless LAN" - -//d: Connection method list popup note. -//d: Packet Data Bearer type shown in info popup -//l: popup_preview_text_window_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_popup_bearer_packet_data "Packet data" - -//d: Connection method list empty text. -//d: Shown if there are no connection methods -//l: main_pane_empty_t1/opt2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_empty_method_view_primary "No connection methods" - -//d: Connection method list empty text. Second line in the list item if -//d: no connection methods exist. Indicates how to create one. -//l: main_list_empty_pane/opt2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_empty_method_view_secondary "Select Add connection method from Options menu to define a method " - -//d: radio button popup menu title text -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_sett_destination "Network connection" - -//d: radio button popup menu title text -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_sett_always_ask "Always ask" - - -//d: radio button popup menu title text -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_default_connection_title "Default connection" - -//d: radio button popup menu text -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_sett_ask_once "Ask Once" - -//d: radio button popup menu text -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_sett_default_connection "Default Connection" - -//d: radio button popup menu text -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_sett_user_defined "User Defined" - -//d: radio button popup options menu text -//l: list_single_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_set_cmd_select "Select" - -//d: popup options menu text -//l: list_single_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_options_select_method "Choose connection method" - -//d: First line of a double large graphic style listbox - WLAN specific -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_bearer_available_wlan "Wireless LAN" - -//d: Second line of a double large graphic style listbox - WLAN specific -//l: list_double_large_graphic_pane_t2_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_one_wlan_nw_available "1 network available" - -//d: Second line of a double large graphic style listbox - WLAN specific -//l: list_double_large_graphic_pane_t2_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_many_wlan_nw_available "%N networks available" - -//----------------------------------------------------------------------------- -// Status Pane -//----------------------------------------------------------------------------- - -//d: Connection method view. Indicates that there is one connection method -//d: in the current destination -//l: navi_text_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_navi_one_conn_method "1 conn. method" - -//d: Connection method view. Indicates the number of connection methods -//d: in the current destination -//l: navi_text_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_navi_many_conn_methods "%N conn. methods" - -//----------------------------------------------------------------------------- -// Soft Keys -//----------------------------------------------------------------------------- - -//d: Middle soft key whose action is to start the wizard for adding -//d: a connection method from the connection method view -//d: -//l: control_pane_t3/opt7 -//w: -//r: 3.2 -// -#define qtn_msk_add_method "Add method" - -//----------------------------------------------------------------------------- -// Strings used in dialogs -//----------------------------------------------------------------------------- - -//d: Confirmation query used to ask the user if he/she wants to check for -//d: available connection methods automatically. -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_quest_check_conn_methods "Automatically check for available connection methods?" - -//d: String used to inform user what is going on while the dialog is displayed. -//l: popup_note_wait_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_wait_checking_methods "Checking connection methods..." - -//d: Question asked from the user when automatic configuration has failed. User -//d: must answer if he/she wants to proceed with manual configuration. -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_quest_conf_method_manually "Could not automatically detect availability. Do you want to configure manually?" - -//d: Title of "Available methods:" list query. -//l: heading_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_prmpt_available_methods "Available methods:" - -//d: Title of "Select connection method:" list query. -//l: heading_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_prmpt_select_conn_method "Select connection method:" - -//d: Title of "Select destination:" list query. -//l: heading_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_prmpt_add_to_destination "Select destination:" - -//d: Heading text used in "Select destination:" list query. -//l: loc_type_pane -//w: -//r: 3.2 -// -#define qtn_netw_conset_detail_add_to_destination "What destination or service you want to access via this method?" - -//d: Text of an information note used to ensure the user the a new connection -//d: method has been added successfully. -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_conf_new_method_added "New connection method for '%U' added" - -//d: Text of an information note used to ensure the user the a new destination -//d: has been created successfully. -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_conf_new_dest_added "New destination '%U' created" - -//d: Confirmation query text shown when user enters empty Conn methods view. -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_quest_add_method "No connection methods for '%U' defined. Define one now?" - -//d: Warning about having no destinations in Destinations view when trying to -//d: create a new connection method. -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_no_destinations "No destinations defined. Create one first." - -//d: Warning about having no unprotected destinations in Destinations view when trying to -//d: create a new connection method. -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_new_conset_info_cannot_add_all_dest_protected "Unable to add to any existing destination. All destinations are protected. Create a new one." - -//d: Warning shown when user tries to prioritise a conn. method 'over' an embedded destination -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_prio_not_possible "Priority not possible" - - -//d: Text of an information note used to ensure the user the a new default destination -//d: has been set successfully. -//l: popup_note_window -//w: -//r: 3.2 -// - -#define qtn_netw_conset_default_connection_set_to "Default connection set to '%U'" - -//d: Text of an information note used to ensure the user the new default destination -//d: has been set successfully when it is set to always ask -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_conf_default_always_ask "Default connection set to 'Always Ask'" - -//d: Text of an information note used to ensure the user the new default destination -//d: has been set successfully when it is set to ask once -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_conf_default_ask_once "Default connection set to 'Ask Once'" - -//============================================================================= -// FRAMEWORK BASE STRINGS -//============================================================================= - -//d: The name of a Internet destination. Max.30 chars, -//d: longer ones will be truncated. -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_dest_internet "Internet" - -//d: The name of a "WAP services" destination. Max.30 chars, -//d: longer ones will be truncated. -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_dest_wap "WAP services" - -//d: The name of a "Multimedia message" destination. Max.30 chars, -//d: longer ones will be truncated. -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_dest_mms "Multimedia message" - -//d: The name of a "Intranet" destination. Max.30 chars, -//d: longer ones will be truncated. -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_dest_intranet "Intranet" - -//============================================================================= -// PLUGIN BASE STRINGS -//============================================================================= - -//d: Item text in setting list. -//d: The name of the connection -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_ap_conn_name "Connection name" - -//d: Name of the data bearer. -//d: Used in Connection method view. -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_ap_bearer "Data bearer" - -//d: Command in options menu in access points view. -//d: Modifies the currently selected access point. -//l: list_single_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_set_options_change "Change" - - -//d: Command in options menu in access points view. -//d: Opens advanced settings for the access point. -//l: list_single_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_set_options_ap_advanced "Advanced settings" - -//d: Command in options menu. -//d: Opens help application with context sensitive help. -//l: list_single_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_set_options_help "Help" - - -//d: Command in options menu. -//d: Exits access point settings. -//l: list_single_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_set_options_exit "Exit" - -//d: Bearer type cannot be modified info text -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_bearer_not_editable "Unable to edit data bearer type once selected. Define a new connection method." - -//d:Item text in setting list for password. -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_ap_passwd "Password" - -// -//SMTP Settings - -//d: Setting list item text to access smtp settings. -//l: list_double2_pane -//w: -//r: 3.2 -// -#define qtn_netw_conset_sett_smtp_override "Outgoing mail server settings" - -//d: SMTP outgoing mail server setting text -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_mce_settings_mail_sending_h "Outgoing mail server" - -//d: Error note for when invalid server/IP data is input -//d: in relation to the Outgoing mail server setting -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_mbxs_settings_mail_srvr_prompt "Please, insert proper server name." - -//d: SMTP User name setting text -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_mce_settings_mail_user_name "User name" - -//d: SMTP Password setting text -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_mce_settings_mail_password "Password" - -//d: SMTP Security setting text -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_mce_settings_mail_security "Security" - -//d: Security setting is set to 'on' with Start TLS -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_mbxs_settings_mail_sec_starttls "STARTTLS" - -//d: Security setting is set to 'on' with SSL TLS -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_mbxs_settings_mail_sec_ssltls "SSL/TLS" - -//d: Security setting set to 'off' -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_mbxs_settings_mail_sec_off "Off" - -//d: SMTP Port number setting text -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_mce_settings_mail_port "Port" - -//d: SMTP Port number setting to 'default' -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_mbxs_settings_mail_port_def "Default" - -//d: SMTP Port number setting to 'User defined' -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_mbxs_settings_mail_port_userdef "User defined" - -//d: Note after the last legacy IAP from "Uncategorized" group -//d: is deleted -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_uncat_empty "Uncategorized folder is empty and will be removed" - -//d: The name of a new, default connection. Max.30 chars, -//d: longer ones will be truncated. -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_ap_default_name "Connection" - -//d: Error message when user wants to delete a connection method that is -//d: linked to a virtual connection method. -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_cannot_delete_virtual_ref "Unable to delete referenced method" - -//d: Item text in setting list. -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_starting_page "Homepage" - -//d: Connection method list text -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_home_page_none "None" - -//d: Invalid ip address note text -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_set_info_invalid_ip "Invalid IP address" - -//d: Connection method settings query text -//d: displayed when there are empty compulsory settings -//d: and user presses 'back' from settings view -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_quest_iap_incomplete_delete "Incomplete access point details. Exit without saving?" - -//d:Domain name servers 'User defined' -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -#define qtn_set_ip_user_defined "User defined" - -//d:Item text in setting list. Offers IPv4 settings to be changed -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_ipv4_settings "IPv4 settings" - -//d:Item text in setting list. Offers IPv6 settings to be changed -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_ipv6_settings "IPv6 settings" - -//d:Item text in setting list. "Phone IP address" -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_ip_address "Phone IP address" - -//d:Default value for "Phone ip address" item. 'Automatic' -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -#define qtn_set_ip_address_dynamic "Automatic" - -//d:Item text in setting list. -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_primary_dns "Primary Name Server" - -//d:Item text in setting list. -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_secondary_dns "Secondary Name Server" - -//d:Item text in setting list. "Proxy server address" -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_proxy_server_address "Proxy server address" - -//d: Proxy server address 'None' -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_proxy_server_address_none "None" - -//d: Item text in setting list for Proxy port number -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_proxy_port_number "Proxy port number" - -//d:Item text in setting list. Entrance for the Domain name servers settings -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_dns_servers_ip "Domain name servers" - -//d:Domain name servers 'Automatic' -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -#define qtn_set_dns_servers_automatic "Automatic" - -//d:Domain name servers 'Well-known' -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -#define qtn_set_ip_well_known "Well-known" - -//d: Item text in setting list. "User name" -//l: list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_ap_username "User name" - -//d: Answer to: qtn_set_passwd_aut, -//d: whether password authentication is secure or normal -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_passwd_aut_secure "Secure" - -//d: Answer to: qtn_set_passwd_aut, -//d: whether password authentication is secure or normal -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_passwd_aut_normal "Normal" - -//d: Item text for empty user name in setting list -//l: list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_ap_username_none "None" - -//d: Item text in setting list. "Prompt password" -//l: list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_prompt_passwd "Prompt password" - -//d: Item text in setting list for not prompting for password. -//l: list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_prompt_passwd_no "No" - -//d: Item text in setting list for prompting for password. -//l: list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_set_prompt_passwd_yes "Yes" - -//d: Item text in setting list. -//d: Indicates whther password authentication is secure or normal -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_passwd_aut "Authentication" - -//d:Defines the WLAN subnet mask to be used -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_netw_sett_subnet_mask "Subnet mask" - -//d:Defines the WLAN default gateway to be used -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_netw_sett_default_gateway "Default gateway" - -//d: Error note when user tries to delete a destination -//d: which contains one or more protected connection methods -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_cannot_delete_dest_prot_cm "Unable to delete destination; contains protected connection methods." - -//d: Denied execution of management-like functions on protected destinations info text -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_cannot_perform_for_protected "Unable to perform due to protection" - -//d: No existing unprotected destinations to add to info text -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_cannot_add_all_dest_protected "Unable to add to any existing destination. Destinations are protected. Create a new one." - -//d: VPN CM (re)placement failure (due to circular referencing) info text -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_no_vpn_stacking "Unable to proceed. VPN connections cannot be stacked." - -// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/Group/bld.inf --- a/cmmanager/cmmgr/Plugins/Group/bld.inf Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build information for the Plugins \ Connection Method manager -* -* -*/ - - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -// None - -PRJ_MMPFILES -// None - - -#include "../cmpluginpacketdata/group/bld.inf" -#include "../cmpluginlan/group/bld.inf" -#include "../cmpluginwlan/group/bld.inf" -#include "../cmpluginembdestination/group/bld.inf" -#include "../cmpluginvpn/group/bld.inf" - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginembdestination/data/1020737D.rss --- a/cmmanager/cmmgr/Plugins/cmpluginembdestination/data/1020737D.rss Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Embedded Destination Plug-in resource file -* -*/ - -#include "ecom/registryinfo.rh" - -// Because attribute enums had to be added to namespace CMManager -// it's not possible to included cmpluginpacketdata.hrh. -// Thus bearer type id had to be redefine here. -#define KEmbeddedDestination 0x10207379 - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = 0x1020737D; - interfaces = - { - INTERFACE_INFO - { - interface_uid = 0x10207377; // = KCMPluginInterfaceUid - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KEmbeddedDestination; - version_no = 1; - display_name = "Embedded Destination"; - default_data = "EmbeddedDestination"; - opaque_data = ""; - } - }; - } - }; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginembdestination/data/cmpluginembdestinationui.rss --- a/cmmanager/cmmgr/Plugins/cmpluginembdestination/data/cmpluginembdestinationui.rss Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Embedded Destination plug-in's UI resources -* -*/ - -#include -#include -#include -#include -#include -#include "eikon.rsg" -#include - -NAME EDES - -RESOURCE RSS_SIGNATURE { } - -RESOURCE TBUF { buf = "cmpluginembdestination"; } - - -// LOCALISED STRINGS diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginembdestination/group/bld.inf --- a/cmmanager/cmmgr/Plugins/cmpluginembdestination/group/bld.inf Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build information for the Embedded Destination plug-in. -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -PRJ_MMPFILES -./cmpluginembdestination.mmp - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginembdestination/group/cmpluginembdestination.mmp --- a/cmmanager/cmmgr/Plugins/cmpluginembdestination/group/cmpluginembdestination.mmp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project specification for Embedded Destination plug-in -* -*/ - -#include -#include - -TARGET cmpluginembdestination.dll -UID 0x10009D8D 0x1020737D - -TARGETTYPE PLUGIN - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -SOURCEPATH ../src - -SOURCE cmpluginembdestinationproxy.cpp -SOURCE cmpluginembdestination.cpp -SOURCE ../../../Framework/Src/cmlogger.cpp - -SOURCEPATH ../data - -START RESOURCE 1020737D.rss -TARGET cmpluginembdestination.rsc -END - -START RESOURCE cmpluginembdestinationui.rss -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - -USERINCLUDE ../../../Framework/Inc - -// Component specific internal headers -USERINCLUDE ../inc - -// ADO specific internal headers -SYSTEMINCLUDE ../../../../../inc - -//Macro to /epoc32 headers -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY ECOM.LIB -LIBRARY cmmanager.lib -LIBRARY COMMSDAT.lib -LIBRARY CommonEngine.lib -LIBRARY cone.lib -LIBRARY efsrv.lib -LIBRARY bafl.lib -DEBUGLIBRARY flogger.lib diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginembdestination/inc/cmpluginembdestination.h --- a/cmmanager/cmmgr/Plugins/cmpluginembdestination/inc/cmpluginembdestination.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of CCmPluginEmbDestination -* -*/ - -#ifndef EMBEDDEDDESTINATION_PLUGIN_H -#define EMBEDDEDDESTINATION_PLUGIN_H - -#include -#include - -/** - * Embedded Destination Plugin IF implementation class - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS(CCmPluginEmbDestination) : public CCmPluginBaseEng - { - public: // Constructors and destructor - - /** - * Two phased constructor. Leaves on failure. - * @param - aInitParam initialization parameters for plug-ins. - * @return The created object. - */ - static CCmPluginEmbDestination* NewL( TCmPluginInitParam* aInitParam ); - - /** - * Destructor. - */ - virtual ~CCmPluginEmbDestination(); - - virtual CCmPluginBaseEng* CreateInstanceL( - TCmPluginInitParam& aInitParam ) const; - - public: // From CCmPluginBaseEng - - virtual TUint32 GetIntAttributeL( const TUint32 aAttribute ) const; - virtual TBool GetBoolAttributeL( const TUint32 aAttribute ) const; - virtual HBufC* GetStringAttributeL( const TUint32 aAttribute ) const; - virtual HBufC8* GetString8AttributeL( const TUint32 aAttribute ) const; - virtual void SetBoolAttributeL( const TUint32 aAttribute, - TBool aValue ); - virtual void SetStringAttributeL( const TUint32 aAttribute, - const TDesC16& aValue ); - virtual void UpdateL(); - virtual CCmDestinationImpl* Destination() const; - - virtual TBool CanHandleIapIdL( TUint32 aIapId ) const; - virtual TBool CanHandleIapIdL( CommsDat::CCDIAPRecord *aIapRecord ) const; - - virtual TBool DeleteL( TBool aForced, - TBool aOneRefAllowed = ETrue ); - virtual void LoadL( TUint32 aIapId ); - virtual void CreateNewL(); - - virtual TInt RunSettingsL(); - - /** - * From CCmPluginBaseEng - * see base class definition - * - * @since S60 3.2 - */ - virtual TBool InitializeWithUiL( TBool aManuallyConfigure ); - - virtual TBool IsMultipleReferencedL(); - - virtual void LoadServiceSettingL(); - virtual void LoadBearerSettingL(); - - virtual void ServiceRecordIdLC( HBufC* &aServiceName, - TUint32& aRecordId ); - - virtual void BearerRecordIdLC( HBufC* &aBearerName, - TUint32& aRecordId); - - virtual void AdditionalReset(){}; - - virtual CCmPluginBaseEng* CreateCopyL() const; - - virtual TBool IsLinkedToSnap( TUint32 aSnapId ); - - private: // Constructors - - /** - * Constructor. - */ - CCmPluginEmbDestination( TCmPluginInitParam* aInitParam ); - - /** - * Second phase constructor. Leaves on failure. - * @param - */ - void ConstructL(); - - private: // From CCmPluginBaseEng - - virtual void CreateNewServiceRecordL(); - virtual void CreateNewBearerRecordL(); - virtual void CopyAdditionalDataL( CCmPluginBaseEng* aDestInst ) const; - - private: // Data - - CCmDestinationImpl* iDestination; - TInt iLoadResult; - TUint32 iCmId; - }; - -#endif // EMBEDDEDDESTINATION_PLUGIN_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginembdestination/src/cmpluginembdestination.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginembdestination/src/cmpluginembdestination.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,624 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmPluginEmbDestination -* -*/ - -#include "cmdestinationimpl.h" -#include "cmpluginembdestination.h" -#include "datamobilitycommsdattypes.h" -#include "cmmanagerimpl.h" -#include "cmlogger.h" -#include // For REComSession -#include -#include -#include -#include -#include - -using namespace CMManager; -using namespace CommsDat; - -_LIT( KPluginEmbDestinationDataResDirAndFileName, - "z:cmpluginembdestinationui.rsc" ); - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::NewL() -// --------------------------------------------------------------------------- -// -CCmPluginEmbDestination* CCmPluginEmbDestination::NewL( - TCmPluginInitParam* aInitParam ) - { - CCmPluginEmbDestination* self = - new( ELeave ) CCmPluginEmbDestination( aInitParam ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::~CCmPluginEmbDestination() -// --------------------------------------------------------------------------- -// -CCmPluginEmbDestination::~CCmPluginEmbDestination() - { - RemoveResourceFile( KPluginEmbDestinationDataResDirAndFileName ); - - if(iDestination) - { - delete iDestination; - iDestination = NULL; - } - - CLOG_CLOSE; - } - -// ---------------------------------------------------------------------------- -// CCmPluginEmbDestination::CreateInstanceL -// ---------------------------------------------------------------------------- -// -CCmPluginBaseEng* - CCmPluginEmbDestination::CreateInstanceL( TCmPluginInitParam& aInitParam ) const - { - CCmPluginEmbDestination* self = new( ELeave ) CCmPluginEmbDestination( &aInitParam ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::CCmPluginEmbDestination() -// --------------------------------------------------------------------------- -// -CCmPluginEmbDestination::CCmPluginEmbDestination( - TCmPluginInitParam* aInitParam ) - : CCmPluginBaseEng( aInitParam ) - { - CLOG_CREATE; - - iBearerType = KUidEmbeddedDestination; - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::ConstructL() -// --------------------------------------------------------------------------- -// -void CCmPluginEmbDestination::ConstructL() - { - // Nothing is needed from CCmPluginBaseEng. - AddResourceFileL( KPluginEmbDestinationDataResDirAndFileName ); - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::GetIntAttributeL() -// --------------------------------------------------------------------------- -// -TUint32 - CCmPluginEmbDestination::GetIntAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::GetIntAttributeL" ); - - TUint32 retVal( 0 ); - - switch( aAttribute ) - { - case ECmBearerType: - { - retVal = iBearerType; - } - break; - - case ECmId: - { - retVal = iCmId; - } - break; - - case ECmIapId: - { - User::Leave(KErrNotSupported); - } - break; - - case ECmBearerIcon: - { - retVal = (TUint32)iDestination->IconL(); - } - break; - - case ECmDefaultPriority: - case ECmDefaultUiPriority: - { - retVal = KDataMobilitySelectionPolicyPriorityWildCard; - } - break; - - case ECmExtensionLevel: - { - retVal = KExtensionBaseLevel; - } - break; - - case ECmInvalidAttribute: - { - retVal = 0; - } - break; - - case ECmLoadResult: - { - retVal = iLoadResult; - } - break; - - default: - { - User::Leave( KErrNotSupported ); - } - break; - } - - return retVal; - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::GetBoolAttributeL() -// --------------------------------------------------------------------------- -// -TBool CCmPluginEmbDestination::GetBoolAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::GetBoolAttributeL" ); - - TBool retVal( EFalse ); - - switch( aAttribute ) - { - case ECmDestination: - { - retVal = ETrue; - } - break; - - case ECmCoverage: - { - retVal = EFalse; - } - break; - - case ECmProtected: - { - if( iDestination->ProtectionLevel() == EProtLevel1 || - iDestination->ProtectionLevel() == EProtLevel2 ) - { - retVal = ETrue; - } - else - { - retVal = EFalse; - } - } - break; - - case ECmHidden: - { - retVal = iDestination->IsHidden(); - } - break; - - case ECmBearerHasUi: - case ECmAddToAvailableList: - { - retVal = EFalse; - } - break; - - case ECmVirtual: - { - retVal = ETrue; - } - break; - - case ECmIPv6Supported: - { - retVal = CCmPluginBaseEng::GetBoolAttributeL( aAttribute ); - } - break; - - case ECmIsLinked: - { - retVal = EFalse; - } - break; - - case ECmConnected: - { - retVal = iDestination->IsConnectedL(); - } - break; - - default: - { - User::Leave( KErrNotSupported ); - } - break; - } - - return retVal; - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::GetStringAttributeL() -// --------------------------------------------------------------------------- -// -HBufC* - CCmPluginEmbDestination::GetStringAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::GetStringAttributeL" ); - - HBufC* retVal = NULL; - - switch( aAttribute ) - { - case ECmName: - { - RFs fs; - CleanupClosePushL( fs ); - User::LeaveIfError( fs.Connect() ); - - // There may not be a UI context yet.... - TFileName resourceFile; - _LIT( KDriveZ, "z:" ); - resourceFile.Append( KDriveZ ); - resourceFile.Append( KDC_RESOURCE_FILES_DIR ); - _LIT( KCmmResFileName, "cmmanager.rsc" ); - resourceFile.Append( KCmmResFileName ); - BaflUtils::NearestLanguageFile( fs, resourceFile ); - - RResourceFile rf; - CleanupClosePushL( rf ); - rf.OpenL( fs, resourceFile ); - rf.ConfirmSignatureL( 0 ); - HBufC8* readBuffer = rf.AllocReadLC( R_QTN_NETW_CONSET_EMBEDDED_DEST ); - const TPtrC16 ptrReadBuffer( (TText16*) readBuffer->Ptr(), - ( readBuffer->Length() + 1 ) >> 1 ); - HBufC16* textBuffer=HBufC16::NewL( ptrReadBuffer.Length() ); - CleanupStack::PushL( textBuffer ); - *textBuffer=ptrReadBuffer; - - TPtr format = textBuffer->Des(); - _LIT(KPercentS,"%S"); - _LIT(KPercentU,"%U"); - TInt puPos = format.Find(KPercentU); - if ( puPos >= 0 ) - { - format.Replace( puPos, - static_cast(KPercentS).Length(), KPercentS ); - } - HBufC* desName = iDestination->NameLC(); - TPtr16 destName = desName->Des(); - retVal = HBufC::NewL( format.Length() + destName.Length() ); - retVal->Des().Format(format, &destName); - - CleanupStack::PopAndDestroy( desName ); - CleanupStack::PopAndDestroy( textBuffer ); - CleanupStack::PopAndDestroy( readBuffer ); - CleanupStack::PopAndDestroy(); //rf - CleanupStack::PopAndDestroy(); //fs - } - break; - - default: - { - User::Leave( KErrNotSupported ); - } - } - - return retVal; - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::GetString8AttributeL -// --------------------------------------------------------------------------- -// -HBufC8* - CCmPluginEmbDestination::GetString8AttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::GetString8AttributeL" ); - - switch( aAttribute ) - { - default: - { - User::Leave( KErrNotSupported ); - } - break; - } - - // dead code - return NULL; - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::SetBoolAttributeL() -// --------------------------------------------------------------------------- -// -void CCmPluginEmbDestination::SetBoolAttributeL( const TUint32 aAttribute, - TBool /*aValue*/ ) - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::SetBoolAttributeL" ); - - switch( aAttribute ) - { - case ECmProtected: - case ECmHidden: - break; - - default: - { - User::Leave( KErrNotSupported ); - } - } - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::SetStringAttributeL() -// --------------------------------------------------------------------------- -// -void CCmPluginEmbDestination::SetStringAttributeL( const TUint32 aAttribute, - const TDesC16& ) - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::SetStringAttributeL" ); - - switch( aAttribute ) - { - case ECmName: - { - User::Leave( KErrNotSupported ); - } - break; - - default: - { - User::Leave( KErrNotSupported ); - } - } - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::CanHandleIapIdL() -// --------------------------------------------------------------------------- -// -TBool CCmPluginEmbDestination::CanHandleIapIdL( TUint32 /*aIapId*/ ) const - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::CanHandleIapIdL" ); - - // Embedded Destination cannot handle any IAP id. - return EFalse; - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::CanHandleIapIdL() -// --------------------------------------------------------------------------- -// -TBool - CCmPluginEmbDestination::CanHandleIapIdL( CCDIAPRecord* /*aIapRecord*/ ) const - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::CanHandleIapIdL" ); - - // Embedded Destination cannot handle any IAP id. - return EFalse; - } - -// --------------------------------------------------------------------------- -// ?description_if_needed -// --------------------------------------------------------------------------- -// -CCmDestinationImpl* CCmPluginEmbDestination::Destination() const - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::Destination" ); - - return iDestination; - } - -// --------------------------------------------------------------------------- -// ?description_if_needed -// --------------------------------------------------------------------------- -// -void CCmPluginEmbDestination::UpdateL() - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::UpdateL" ); - - iDestination->UpdateL(); - } - -// --------------------------------------------------------------------------- -// Delete embedded destination. -// --------------------------------------------------------------------------- -// -TBool CCmPluginEmbDestination::DeleteL( TBool aForced, - TBool aOneRefAllowed ) - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::DeleteL" ); - - (void)aForced; - (void)aOneRefAllowed; - - // Embedded destination cannot be deleted. - return EFalse; - } - -// --------------------------------------------------------------------------- -// ?description_if_needed -// --------------------------------------------------------------------------- -// -void CCmPluginEmbDestination::LoadL( TUint32 aCmId) - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::LoadL" ); - - if (!iDestination) - { - iCmId = aCmId; - iDestination = iCmMgr.DestinationL( aCmId ); - } - } - -// --------------------------------------------------------------------------- -// ?description_if_needed -// --------------------------------------------------------------------------- -// -void CCmPluginEmbDestination::CreateNewL() - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::CreateNewL" ); - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::RunSettingsL() -// --------------------------------------------------------------------------- -// -TInt CCmPluginEmbDestination::RunSettingsL() - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::RunSettingsL" ); - - return 0; - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::InitializeWithUiL() -// --------------------------------------------------------------------------- -// -TBool CCmPluginEmbDestination::InitializeWithUiL( - TBool /*aManuallyConfigure*/ ) - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::InitializeWithUiL" ); - - // Has no UI - return ETrue; - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::IsMultipleReferencedL() -// --------------------------------------------------------------------------- -// -TBool CCmPluginEmbDestination::IsMultipleReferencedL() - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::IsMultipleReferencedL" ); - - return EFalse; - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::LoadServiceSettingL() -// --------------------------------------------------------------------------- -// -void CCmPluginEmbDestination::LoadServiceSettingL() - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::LoadServiceSettingL" ); - - User::Leave( KErrNotSupported ); - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::LoadBearerRecordL() -// --------------------------------------------------------------------------- -// -void CCmPluginEmbDestination::LoadBearerSettingL() - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::LoadBearerSettingL" ); - - User::Leave( KErrNotSupported ); - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::CreateNewServiceRecordL() -// --------------------------------------------------------------------------- -// -void CCmPluginEmbDestination::CreateNewServiceRecordL() - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::CreateNewServiceRecordL" ); - - User::Leave( KErrNotSupported ); - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::CreateNewBearerRecordL() -// --------------------------------------------------------------------------- -// -void CCmPluginEmbDestination::CreateNewBearerRecordL() - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::CreateNewBearerRecordL" ); - - User::Leave( KErrNotSupported ); - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::ServiceRecordIdLC() -// --------------------------------------------------------------------------- -// -void CCmPluginEmbDestination::ServiceRecordIdLC( HBufC* &/*aBearerName*/, - TUint32& /*aRecordId*/) - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::ServiceRecordIdLC" ); - - User::Leave( KErrNotSupported ); - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::BearerRecordIdLC() -// --------------------------------------------------------------------------- -// -void CCmPluginEmbDestination::BearerRecordIdLC( HBufC* &/*aBearerName*/, - TUint32& /*aRecordId*/) - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::BearerRecordIdLC" ); - - User::Leave( KErrNotSupported ); - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::CopyAdditionalDataL -// --------------------------------------------------------------------------- -// -void CCmPluginEmbDestination::CopyAdditionalDataL( CCmPluginBaseEng* /*aDestInst*/ ) const - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::CopyAdditionalDataL" ); - - User::Leave( KErrNotSupported ); - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::CreateCopyL -// --------------------------------------------------------------------------- -// -CCmPluginBaseEng* CCmPluginEmbDestination::CreateCopyL() const - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::CreateCopyL" ); - - User::Leave(KErrNotSupported); - return NULL; - } - -// --------------------------------------------------------------------------- -// CCmPluginEmbDestination::IsLinkedToSnap -// --------------------------------------------------------------------------- -// -TBool CCmPluginEmbDestination::IsLinkedToSnap( TUint32 aSnapId ) - { - LOGGER_ENTERFN( "CCmPluginEmbDestination::IsLinkedToSnap" ); - - return ( aSnapId == iDestination->Id() ); - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginembdestination/src/cmpluginembdestinationproxy.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginembdestination/src/cmpluginembdestinationproxy.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of Embedded Destination plug-in proxy table -* -*/ - -#include -#include - -#include "cmpluginembdestination.h" - -// Exported proxy for instantiation method resolution -// Define the interface UIDs -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KUidEmbeddedDestination, - CCmPluginEmbDestination::NewL) - }; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginlan/data/1020737B.rss --- a/cmmanager/cmmgr/Plugins/cmpluginlan/data/1020737B.rss Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* PacketData PlugIn's resource file -* -* -*/ - - -#include "ecom/registryinfo.rh" - -// Because attribute enums had to be added to namespace CMManager -// it's not possible to included cmpluginlanbasedef.h -// Thus bearer type id had to be redefine here. -#define KUidLanBearerType 0x1020737A - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = 0x1020737B; - interfaces = - { - INTERFACE_INFO - { - interface_uid = 0x10207377; // = KCMPluginInterfaceUid - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KUidLanBearerType; - version_no = 1; - display_name = "Lan"; - default_data = "Lan"; - opaque_data = ""; - } - }; - } - }; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginlan/group/bld.inf --- a/cmmanager/cmmgr/Plugins/cmpluginlan/group/bld.inf Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Build information for the LAN plugin. -* -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -PRJ_MMPFILES -./cmpluginlan.mmp - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginlan/group/cmpluginlan.mmp --- a/cmmanager/cmmgr/Plugins/cmpluginlan/group/cmpluginlan.mmp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Project specification for LAN Plugin. -* -* -*/ - -#include - -TARGET cmpluginlan.dll -UID 0x10009D8D 0x1020737B - -TARGETTYPE PLUGIN - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -SOURCEPATH ../src - -SOURCE cmpluginlanproxy.cpp -SOURCE cmpluginlan.cpp -SOURCE ../../../Framework/Src/cmlogger.cpp - -SOURCEPATH ../data - -START RESOURCE 1020737B.rss -TARGET cmpluginlan.rsc -END - -USERINCLUDE ../../../Framework/Inc - -// Component specific internal headers -USERINCLUDE ../inc - -// ADO specific internal headers -SYSTEMINCLUDE ../../../../../inc - -//Macro to /epoc32 headers -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY ECOM.LIB -LIBRARY cmmanager.lib -LIBRARY COMMSDAT.lib -DEBUGLIBRARY flogger.lib - -// Temporary usega for icons -LIBRARY AknSkins.lib -LIBRARY efsrv.lib \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginlan/inc/cmpluginlan.h --- a/cmmanager/cmmgr/Plugins/cmpluginlan/inc/cmpluginlan.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Declaration of Lan interface implementation -* for "LAN" plugin -* -* -*/ - - -#ifndef LAN_PLUGIN_H -#define LAN_PLUGIN_H - -// INCLUDES - -#include -#include - -#include -#include -#include - - -// FORWARD DECLARATION -class CommsDat::CCDLANServiceRecord; - -// CLASS DECLARATION - -/** -* LAN Plugin IF implementation class -* @since Series60_3.2 -*/ -NONSHARABLE_CLASS(CCmPluginLan) : public CCmPluginLanBase - { - - public: // Constructors and destructor - - /** - * Two phased constructor. Leaves on failure. - * @param - aUrl - * @return The created object. - */ - static CCmPluginLan* NewL( TCmPluginInitParam* aInitParam ); - - /** - * Destructor. - */ - virtual ~CCmPluginLan(); - - virtual CCmPluginBaseEng* CreateInstanceL( TCmPluginInitParam& aInitParam ) const; - - public: // From CCmPluginBaseEng - - /** - * Gets the value for a TInt attribute. - * @param aAttribute Identifies the attribute to be retrived. - * @return contains the requested TInt attribute. - */ - virtual TUint32 GetIntAttributeL( const TUint32 aAttribute ) const; - - /** - * Checks if the plug-in can handle the given AP. - * @param aIapId IAPId of the AP to be checked - * @return ETrue if plug-in can handle the IAP - */ - virtual TBool CanHandleIapIdL( TUint32 aIapId ) const; - - /** - * Checks if the plug-in can handle the given AP. - * @param aIapRecord IAP record to be checked - * @return ETrue if plug-in can handle the IAP - */ - virtual TBool CanHandleIapIdL( CommsDat::CCDIAPRecord* aIapRecord ) const; - - virtual void AdditionalReset(); - - private: // Constructors - - /** - * Constructor. - */ - CCmPluginLan( TCmPluginInitParam* aInitParam ); - - /** - * Second phase constructor. Leaves on failure. - * @param - */ - void ConstructL(); - - private: // Data - - }; - -#endif // LAN_PLUGIN_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginlan/src/cmpluginlan.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginlan/src/cmpluginlan.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,305 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Implementation of Lan Plugin interface implementation -* for Lan Bearer -* -* -*/ - - -// INCLUDE FILES - -#include "cmpluginlan.h" -#include "cmlogger.h" -#include "datamobilitycommsdattypes.h" -#include -#include // For REComSession -#include -#include - -#include // icons -#include - -using namespace CMManager; -using namespace CommsDat; - -// ================= CONSTANTS ======================= -const TUint32 KDefaultPriorityLAN = 0; - -static const TCmAttribConvTable SLanConvTbl[] = - { - { ELanIfNetworks, ELanRangeMax, NULL }, - { ELanIfNetworks, KCDTIdLANIfNetworks, NULL }, - { ELanIpNetMask, KCDTIdLANIpNetMask, &CheckIPv4ValidityL }, - { ELanIpGateway, KCDTIdLANIpGateway, &CheckIPv4ValidityL }, - { ELanIpAddrFromServer, KCDTIdLANIpAddrFromServer, NULL }, - { ELanIpAddr, KCDTIdLANIpAddr, &CheckIPv4ValidityL }, - { ELanIpDNSAddrFromServer, KCDTIdLANIpDNSAddrFromServer, NULL }, - { ELanIpNameServer1, KCDTIdLANIpNameServer1, &CheckIPv4ValidityL }, - { ELanIpNameServer2, KCDTIdLANIpNameServer2, &CheckIPv4ValidityL }, - { ELanIp6DNSAddrFromServer, KCDTIdLANIp6DNSAddrFromServer, NULL }, - { ELanIp6NameServer1, KCDTIdLANIp6NameServer1, &CheckIPv4ValidityL }, - { ELanIp6NameServer2, KCDTIdLANIp6NameServer2, &CheckIPv4ValidityL }, - { ELanIpAddrLeaseValidFrom, KCDTIdLANIpAddrLeaseValidFrom, NULL }, - { ELanIpAddrLeaseValidTo, KCDTIdLANIpAddrLeaseValidTo, NULL }, - { ELanConfigDaemonManagerName, KCDTIdLANConfigDaemonManagerName, NULL }, - { ELanConfigDaemonName, KCDTIdLANConfigDaemonName, NULL }, - { ELanServiceExtensionTableName, KCDTIdLANServiceExtensionTableName, NULL }, - { ELanServiceExtensionTableRecordId, KCDTIdLANServiceExtensionTableRecordId, NULL }, - { 0, 0, NULL } - }; - - -static const TCmCommonAttrConvArrayItem SCommonConvTbl[] = -{ - { ELanIfNetworks, ECmIFNetworks }, - { ELanIpNetMask, ECmIPNetmask }, - { ELanIpGateway, ECmIPGateway }, - { ELanIpAddrFromServer, ECmIPAddFromServer }, - { ELanIpAddr, ECmIPAddress }, - { ELanIpDNSAddrFromServer, ECmIPDNSAddrFromServer }, - { ELanIpNameServer1, ECmIPNameServer1 }, - { ELanIpNameServer2, ECmIPNameServer2 }, - { ELanIp6DNSAddrFromServer, ECmIP6DNSAddrFromServer }, - { ELanIp6NameServer1, ECmIP6NameServer1 }, - { ELanIp6NameServer2, ECmIP6NameServer2 }, - { ELanIpAddrLeaseValidFrom, ECmIPAddrLeaseValidFrom }, - { ELanIpAddrLeaseValidTo, ECmIPAddrLeaseValidTo }, - { ELanConfigDaemonManagerName, ECmConfigDaemonManagerName }, - { ELanConfigDaemonName, ECmConfigDaemonName }, - { 0, 0 } - }; - - -_LIT( KPacketDataFileIcons, "z:cmpluginpacketdata.mbm" ); - - -// ======== LOCAL FUNCTIONS ======== - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------- -// CCmPluginLan::NewOutgoingL() -// --------------------------------------------------------- -// -CCmPluginLan* CCmPluginLan::NewL( TCmPluginInitParam* aInitParam ) - { - CCmPluginLan* self = new( ELeave ) CCmPluginLan( aInitParam ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( /*self*/ ); - - return self; - } - -// ---------------------------------------------------------------------------- -// CCmPluginLan::CreateInstanceL -// ---------------------------------------------------------------------------- -// -CCmPluginBaseEng* CCmPluginLan::CreateInstanceL( TCmPluginInitParam& aInitParam ) const - { - CCmPluginLan* self = new( ELeave ) CCmPluginLan( &aInitParam ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// --------------------------------------------------------- -// CCmPluginLan::~CCmPluginLan() -// --------------------------------------------------------- -// -CCmPluginLan::~CCmPluginLan() - { - AdditionalReset(); - - CLOG_CLOSE; - } - - -// --------------------------------------------------------- -// CCmPluginLan::CCmPluginLan() -// --------------------------------------------------------- -// -CCmPluginLan::CCmPluginLan( TCmPluginInitParam* aInitParam ) - : CCmPluginLanBase( aInitParam ) - { - CLOG_CREATE; - - iBearerType = KUidLanBearerType; - } - - -// --------------------------------------------------------- -// CCmPluginLan::ConstructL() -// --------------------------------------------------------- -// -void CCmPluginLan::ConstructL() - { - CCmPluginLanBase::ConstructL(); - - iBearerRecName = KCDTypeNameLANBearer; - - AddConverstionTableL( (CCDRecordBase**)&iServiceRecord, NULL, SLanConvTbl ); - - AddCommonConversionTableL( SCommonConvTbl ); - } - - -// --------------------------------------------------------- -// CCmPluginLan::GetIntAttributeL() -// --------------------------------------------------------- -// -TUint32 CCmPluginLan::GetIntAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginLanBase::GetIntAttributeL" ); - - TUint32 retVal; - - switch( aAttribute ) - { - // LAN bearer has no icon, but added temporary - // to help work on emulator. - case ECmBearerIcon: - { - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - - TParse mbmFile; - User::LeaveIfError( mbmFile.Set( KPacketDataFileIcons, - &KDC_BITMAP_DIR, NULL ) ); - - - retVal = (TUint32)AknsUtils::CreateGulIconL( - skinInstance, - KAknsIIDQgnPropWmlGprs, - mbmFile.FullName(), - EMbmCmpluginpacketdataQgn_prop_wml_gprs, - EMbmCmpluginpacketdataQgn_prop_wml_gprs_mask ); - } - break; - - // LAN bearer has no icon, but added temporary - // to help work on emulator. - case ECmBearerAvailableIcon: - { - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - - TParse mbmFile; - User::LeaveIfError( mbmFile.Set( KPacketDataFileIcons, &KDC_BITMAP_DIR, NULL ) ); - - - retVal = (TUint32)AknsUtils::CreateGulIconL( - skinInstance, - KAknsIIDQgnPropWmlGprs, - mbmFile.FullName(), - EMbmCmpluginpacketdataQgn_prop_wml_gprs, - EMbmCmpluginpacketdataQgn_prop_wml_gprs_mask ); - } - break; - - case ECmCommsDBBearerType: - { - retVal = KCommDbBearerLAN; - } - break; - - case ECmDefaultUiPriority: - case ECmDefaultPriority: - { - retVal = aAttribute == ECmDefaultPriority ? - GlobalBearerPriority( TPtrC(KCDTypeNameLANService) ) : - GlobalUiBearerPriority( TPtrC(KCDTypeNameLANService) ); - - if( retVal == KDataMobilitySelectionPolicyPriorityWildCard ) - { - retVal = KDefaultPriorityLAN; - } - } - break; - - default: - { - retVal = CCmPluginBaseEng::GetIntAttributeL( aAttribute ); - } - } - - return retVal; - } - -// --------------------------------------------------------- -// CCmPluginLan::CanHandleIapIdL() -// --------------------------------------------------------- -// -TBool CCmPluginLan::CanHandleIapIdL( TUint32 aIapId ) const - { - LOGGER_ENTERFN( "CCmPluginLanBase::CanHandleIapIdL1" ); - CLOG_WRITE_1( "IapId: [%d]", aIapId ); - - TBool retVal( EFalse ); - - CCDIAPRecord *iapRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord)); - - CleanupStack::PushL( iapRecord ); - iapRecord->SetRecordId( aIapId ); - - TRAPD( err, iapRecord->LoadL( Session() )); - - if( !err ) - { - CanHandleIapIdL( iapRecord ); - } - - CleanupStack::PopAndDestroy( iapRecord ); - return retVal; - } - -// --------------------------------------------------------- -// CCmPluginLan::CanHandleIapIdL() -// --------------------------------------------------------- -// -TBool CCmPluginLan::CanHandleIapIdL( CCDIAPRecord *aIapRecord ) const - { - LOGGER_ENTERFN( "CCmPluginLanBase::CanHandleIapIdL2" ); - - CLOG_WRITE_1( "IapId: [%d]", aIapRecord->RecordId() ); - - TBool retVal( EFalse ); - - CLOG_WRITE_2( "IAP record: [%S][%S]", - &FIELD_TO_TDESC(aIapRecord->iServiceType), - &FIELD_TO_TDESC(aIapRecord->iBearerType) - ); - - if( (TPtrC(aIapRecord->iServiceType) == TPtrC(KCDTypeNameLANService) ) && - TPtrC(aIapRecord->iBearerType) == TPtrC(KCDTypeNameLANBearer) ) - { - CLOG_WRITE( "I can." ); - retVal = ETrue; - } - - return retVal; - } - -// --------------------------------------------------------- -// CCmPluginLan::AdditionalReset() -// --------------------------------------------------------- -// -void CCmPluginLan::AdditionalReset() - { - } - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginlan/src/cmpluginlanproxy.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginlan/src/cmpluginlanproxy.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Implementation of Lan Plugin proxy table -* -* -*/ - - -#include "cmpluginlan.h" -#include -#include - -// Exported proxy for instantiation method resolution -// Define the interface UIDs -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KUidLanBearerType, CCmPluginLan::NewL) - }; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/data/1020737C.rss --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/data/1020737C.rss Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for project cmpluginpacketdata -* -*/ - -#include "ecom/registryinfo.rh" - -// Because attribute enums had to be added to namespace CMManager -// it's not possible to included cmpluginpacketdatadef.h. -// Thus bearer type id had to be redefine here. -#define KPacketDataBearerType 0x10207378 - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = 0x1020737C; - interfaces = - { - INTERFACE_INFO - { - interface_uid = 0x10207377; // = KCMPluginInterfaceUid - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KPacketDataBearerType; - version_no = 1; - display_name = "Packet Data"; - default_data = "PacketData"; - opaque_data = ""; - } - }; - } - }; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/data/cmpacketdataui.rss --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/data/cmpacketdataui.rss Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,222 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for project cmpluginpacketdata -* -*/ - - -NAME PDPL - -// INCLUDES -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -// RESOURCE IDENTIFIERS - -RESOURCE RSS_SIGNATURE { } - -RESOURCE TBUF { buf = "cmpacketdataplugin"; } - -// CONSTANTS - -//For Ip address editor -#define IPADDRESS_MIN_FIRST_FIELD_VALUE 0 -#define IPADDRESS_MIN_SECOND_FIELD_VALUE 0 -#define IPADDRESS_MIN_THIRD_FIELD_VALUE 0 -#define IPADDRESS_MIN_FOURTH_FIELD_VALUE 0 -#define IPADDRESS_MAX_FIRST_FIELD_VALUE 255 -#define IPADDRESS_MAX_SECOND_FIELD_VALUE 255 -#define IPADDRESS_MAX_THIRD_FIELD_VALUE 255 -#define IPADDRESS_MAX_FOURTH_FIELD_VALUE 255 - - -// RESOURCE DEFINITIONS - -// --------------------------------------------------------------------------- -// r_gprs_plugin_view_ap_name -// localised string -// --------------------------------------------------------------------------- -RESOURCE TBUF r_gprs_plugin_view_ap_name - { - buf = qtn_set_access_point_name; - } - -// --------------------------------------------------------------------------- -// r_gprs_plugin_sett_val_field_none -// localised string -// --------------------------------------------------------------------------- -RESOURCE TBUF r_gprs_plugin_sett_val_field_none - { - buf = qtn_selec_sett_val_field_none; - } - -// --------------------------------------------------------------------------- -// r_gprs_plugin_view_pdp_type -// localised string -// --------------------------------------------------------------------------- -RESOURCE TBUF r_gprs_plugin_view_pdp_type - { - buf = qtn_set_network_type; - } - -// --------------------------------------------------------------------------- -// r_gprs_plugin_view_pdp_type_ipv4 -// localised string -// --------------------------------------------------------------------------- -RESOURCE TBUF r_gprs_plugin_view_pdp_type_ipv4 - { - buf = qtn_set_nw_type_ipv4; - } - -// --------------------------------------------------------------------------- -// r_gprs_plugin_view_pdp_type_ipv6 -// localised string -// --------------------------------------------------------------------------- -RESOURCE TBUF r_gprs_plugin_view_pdp_type_ipv6 - { - buf = qtn_set_nw_type_ipv6; - } - -// --------------------------------------------------------------------------- -// r_gprs_plugin_apn_prompt -// localised string -// --------------------------------------------------------------------------- -RESOURCE TBUF r_gprs_plugin_apn_prompt - { - buf = qtn_netw_conset_prmpt_packet_data_apn; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_bearer_supported_packet_data -// localised string -// --------------------------------------------------------------------------- -RESOURCE TBUF r_qtn_netw_conset_bearer_supported_packet_data - { - buf = qtn_netw_conset_bearer_supported_packet_data; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_bearer_available_packet_data -// localised string -// --------------------------------------------------------------------------- -RESOURCE TBUF r_qtn_netw_conset_bearer_available_packet_data - { - buf = qtn_netw_conset_bearer_available_packet_data; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_packet_data_available -// localised string -// --------------------------------------------------------------------------- -RESOURCE TBUF r_qtn_netw_conset_packet_data_available - { - buf = qtn_netw_conset_packet_data_available; - } - -// --------------------------------------------------------------------------- -// r_gprs_plugin_view_set_bearer_packet_data -// localised string -// --------------------------------------------------------------------------- -RESOURCE TBUF r_gprs_plugin_view_set_bearer_packet_data - { - buf = qtn_set_bearer_packet_data; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_popup_bearer_packet_data -// localised string -// --------------------------------------------------------------------------- -RESOURCE TBUF r_qtn_netw_conset_popup_bearer_packet_data - { - buf = qtn_netw_conset_popup_bearer_packet_data; - } - -// --------------------------------------------------------------------------- -// r_qtn_set_bearer_packet_data -// localised string -// --------------------------------------------------------------------------- -RESOURCE TBUF r_qtn_set_bearer_packet_data - { - buf = qtn_set_bearer_packet_data; - } - -// --------------------------------------------------------------------------- -// r_setting_app_edwin_gprsap_name -// edwin for packet data access point name setting page -// --------------------------------------------------------------------------- -RESOURCE EDWIN r_setting_app_edwin_gprsap_name - { - width=KGprsApNameWidth; - lines=KGprsApNameLines; - maxlength=KMaxGprsApNameLength; - allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode; - default_input_mode = EAknEditorTextInputMode; - default_case = EAknEditorLowerCase; - avkon_flags = EAknEditorFlagLatinInputModesOnly; - flags = EEikEdwinAutoSelection | EEikEdwinNoLineOrParaBreaks; - } - -// --------------------------------------------------------------------------- -// r_text_setting_page_gprsap_name -// setting page for packet data access point name -// --------------------------------------------------------------------------- -RESOURCE AVKON_SETTING_PAGE r_text_setting_page_gprsap_name - { - number= EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - label= qtn_set_access_point_name; - type = EEikCtEdwin; - editor_resource_id = r_setting_app_edwin_gprsap_name; - } - -// --------------------------------------------------------------------------- -// r_apn_name_query -// -// --------------------------------------------------------------------------- -RESOURCE DIALOG r_apn_name_query - { - flags = EGeneralQueryFlags | EEikDialogFlagNoShadow; - buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_DATA_QUERY - { - layout = EDataLayoutAllowEmptyInput; - control = EDWIN - { - maxlength=KMaxGprsApNameLength; - allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode; - default_input_mode = EAknEditorTextInputMode; - avkon_flags = EAknEditorFlagLatinInputModesOnly; - flags = EEikEdwinNoHorizScrolling; - default_case = EAknEditorLowerCase; - }; - }; - } - }; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/group/bld.inf --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/group/bld.inf Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build information file for project cmpluginpacketdata -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -// export localised loc file -../loc/cmpluginpacketdata.loc MW_LAYER_LOC_EXPORT_PATH(cmpluginpacketdata.loc) - -PRJ_MMPFILES -cmpluginpacketdata.mmp - -PRJ_EXTENSIONS -START EXTENSION s60/mifconv -OPTION TARGETFILE cmpluginpacketdata.mif -OPTION HEADERFILE cmpluginpacketdata.mbg -OPTION SOURCES -c8,1 qgn_prop_wml_gprs\ - -c8,8 qgn_prop_set_conn_bearer_avail_packetdata -END diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/group/cmpluginpacketdata.mmp --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/group/cmpluginpacketdata.mmp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project definition file for project cmpluginpacketdata -* -*/ - -#include -#include - -TARGET cmpluginpacketdata.dll -UID 0x10009D8D 0x1020737C - -TARGETTYPE PLUGIN - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -SOURCEPATH ../src - -SOURCE cmpluginpacketdataproxy.cpp -SOURCE cmpluginpacketdata.cpp -SOURCE ../../../Framework/Src/cmlogger.cpp -SOURCE cmppacketdatasettingsdlg.cpp -SOURCE cmppacketdatasettingsdlgadv.cpp - -SOURCEPATH ../data - -START RESOURCE 1020737C.rss -TARGET cmpluginpacketdata.rsc -END - -START RESOURCE cmpacketdataui.rss -DEPENDS cmmanager.rsg -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - -USERINCLUDE ../../../Framework/Inc -USERINCLUDE ../../../Framework/SrcData -USERINCLUDE ../data - -// Component specific internal headers -USERINCLUDE ../inc - -// ADO specific internal headers -SYSTEMINCLUDE ../../../../../inc - -//Macro to /epoc32 headers -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY ECOM.LIB -LIBRARY cmmanager.lib -LIBRARY COMMSDAT.lib -DEBUGLIBRARY flogger.lib -LIBRARY CommonUI.LIB -LIBRARY CommonEngine.lib -LIBRARY bafl.lib -LIBRARY eikcoctl.lib avkon.lib eikdlg.lib -LIBRARY insock.lib -LIBRARY etel.lib // coverage check -LIBRARY ETELPCKT.lib // coverage check - -LIBRARY eikcore.lib egul.lib -LIBRARY eikctl.lib cone.lib -LIBRARY fbscli.lib efsrv.lib -LIBRARY featmgr.lib -LIBRARY centralrepository.lib - -LIBRARY AknSkins.lib \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/group/pluginpacketdata_icons.mk --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/group/pluginpacketdata_icons.mk Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -# -# Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: icons makefile for project cmpluginpacketdata -# -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z -else -ZDIR=\epoc32\data\z -endif - - -TARGETDIR=$(ZDIR)\resource\apps -ICONTARGETFILENAME=$(TARGETDIR)\cmpluginpacketdata.mif - -HEADERDIR=\epoc32\include -HEADERFILENAME=$(HEADERDIR)\cmpluginpacketdata.mbg - -do_nothing : - @rem do_nothing - -MAKMAKE : do_nothing - -BLD : do_nothing - -CLEAN : do_nothing - -LIB : do_nothing - -CLEANLIB : do_nothing - -# ---------------------------------------------------------------------------- -# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by -# MifConv if the mask detph is defined. -# -# NOTE 2: Usually, source paths should not be included in the bitmap -# definitions. MifConv searches for the icons in all icon directories in a -# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps. -# The directory \s60\icons is included in the search only if the feature flag -# __SCALABLE_ICONS is defined. -# ---------------------------------------------------------------------------- - -RESOURCE : - mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ - /c8,1 qgn_prop_wml_gprs.bmp \ - /c8,8 qgn_prop_set_conn_bearer_avail_packetdata.bmp - -FREEZE : do_nothing - -SAVESPACE : do_nothing - -RELEASABLES : - @echo $(HEADERFILENAME)&& \ - @echo $(ICONTARGETFILENAME) - -FINAL : do_nothing diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/inc/cmpacketdatacommonconstants.h --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/inc/cmpacketdatacommonconstants.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: constants for the packet data plugin -* -*/ - -#ifndef CMPACKETDATACOMMONCONSTANTS_H -#define CMPACKETDATACOMMONCONSTANTS_H - -// CONSTANTS -_LIT( KPluginPacketDataResDirAndFileName, "z:cmpacketdataui.rsc" ); -_LIT( KEmptyAddress, "http://" ); - -#endif // CMPACKETDATACOMMONCONSTANTS_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/inc/cmpluginpacketdata.h --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/inc/cmpluginpacketdata.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,277 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of CCmPluginPacketData. -* -*/ - -#ifndef PACKETDATA_PLUGIN_H -#define PACKETDATA_PLUGIN_H - -#include -#include - -/** -* CCmPluginPacketData dialog class -* @since S60 v3.2 -*/ -NONSHARABLE_CLASS( CCmPluginPacketData ) : public CCmPluginBaseEng - { - - public: // Constructors and destructor - - static CCmPluginPacketData* NewL( TCmPluginInitParam* aInitParam ); - - virtual ~CCmPluginPacketData(); - - virtual CCmPluginBaseEng* CreateInstanceL( TCmPluginInitParam& aInitParam ) const; - - public: // From CCmPluginBaseEng - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - * @param aAttribute - */ - virtual TUint32 GetIntAttributeL( const TUint32 aAttribute ) const; - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - * @param aAttribute - */ - virtual TBool GetBoolAttributeL( const TUint32 aAttribute ) const; - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - * @param aAttribute - */ - virtual HBufC* GetStringAttributeL( const TUint32 aAttribute ) const; - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - * @param aAttribute - * @param aValue - */ - virtual void SetIntAttributeL( const TUint32 aAttribute, - TUint32 aValue ); - - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - * @param aAttribute - * @param aValue - */ - virtual void SetBoolAttributeL( const TUint32 aAttribute, - TBool aValue ); - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - * @param aAttribute - * @param aValue - */ - virtual void SetStringAttributeL( const TUint32 aAttribute, - const TDesC16& aValue ); - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - * @param aIapId - */ - virtual void PrepareToUpdateRecordsL(); - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - * @param aIapId - */ - virtual TBool CanHandleIapIdL( TUint32 aIapId ) const; - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - * @param aIapRecord - */ - virtual TBool CanHandleIapIdL( CommsDat::CCDIAPRecord *aIapRecord ) const; - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - */ - virtual TInt RunSettingsL(); - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - */ - virtual void LoadServiceSettingL(); - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - */ - virtual TBool InitializeWithUiL( TBool aManuallyConfigure ); - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - * @param aServiceName - * @param aRecordId - */ - virtual void ServiceRecordIdLC( HBufC* &aServiceName, - TUint32& aRecordId ); - - /** - * From CCmPluginBaseEng - * see base class - * - * @since S60 3.2 - * @param aBearerName - * @param aRecordId - */ - virtual void BearerRecordIdLC( HBufC* &aBearerName, - TUint32& aRecordId ); - - public: // New functions - - /** - * @param aPdpType PDP type to be set - */ - void SetPDPTypeL( RPacketContext::TProtocolType aPdpType ); - - /** - * @since S60 3.2 - * @return the service record - */ - CommsDat::CCDWCDMAPacketServiceRecord& ServiceRecord() const; - - protected: // From CCmPluginBaseEng - - /** - * From CCmPluginBaseEng - * - * @since S60 3.2 - */ - virtual void AdditionalReset(); - - /** - * From CCmPluginBaseEng - * - * @since S60 5.2 - */ - virtual void CreateAdditionalRecordsL(); - - /** - * From CCmPluginBaseEng - * - * @since S60 5.2 - */ - virtual void DeleteAdditionalRecordsL(); - - /** - * From CCmPluginBaseEng - * - * @since S60 5.2 - */ - virtual void LoadAdditionalRecordsL(); - - /** - * From CCmPluginBaseEng - * - * @since S60 5.2 - */ - virtual void UpdateAdditionalRecordsL(); - - private: // Constructors - - /** - * Constructor - * - * @since S60 3.2 - * @param aInitParam - * @param aOutgoing - */ - CCmPluginPacketData( TCmPluginInitParam* aInitParam, - TBool aOutgoing ); - - /** - * Second phase constructor - * - * @since S60 3.2 - */ - void ConstructL(); - - private: // from CCmPluginBaseEng - - /** - * Second phase constructor - * - * @since S60 3.2 - */ - virtual void CreateNewServiceRecordL(); - - virtual void PrepareToCopyDataL( CCmPluginBaseEng* aDestInst ) const; - - /** - * Sets the daemon name. Starts DHCP if set. - * - * @since S60 3.2 - */ - void SetDaemonNameL(); - - private: - - /** - * @since S60 3.2 - * @return if there is network coverage - */ - TBool CheckNetworkCoverageL() const; - - private: // Data - - TBool iOutgoing; ///< EPacketDataOutGoing - - CommsDat::CCDUmtsR99QoSAndOnTableRecord* iPacketDataQoSRecord; // Owned - }; - -#endif // PACKETDATA_PLUGIN_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/inc/cmppacketdatasettingsdlg.h --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/inc/cmppacketdatasettingsdlg.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declares a settings dialog for a packet data connection -* method plugin -* -*/ - -#ifndef CMPLUGINPACKETDATA_SETTINGS_DLG_H -#define CMPLUGINPACKETDATA_SETTINGS_DLG_H - -// INCLUDES -#include -#include -#include -#include "cmcommsdatnotifier.h" - -// CLASS DECLARATION - -/** - * CmPluginPacketDataSettingsDlg dialog class - * - * Displays the Packet data settings - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CmPluginPacketDataSettingsDlg ) : - public CmPluginBaseSettingsDlg - , public MCmCommsDatWatcher - , public CCmParentViewNotifier - { - public: // Constructors and destructor - - /** - * Two-phase constructor - * - * @since S60 3.2 - * @param aCmPluginBaseEng The connection method to use - * @return instance of the class - */ - static CmPluginPacketDataSettingsDlg* NewL( CCmPluginBaseEng& - aCmPluginBaseEng ); - - /** - * Destructor. - */ - virtual ~CmPluginPacketDataSettingsDlg(); - - public: // From CmPluginBaseSettingsDlg - - /** - * From CmPluginBaseSettingsDlg - * constructor for the dialog - * - * @since S60 3.2 - */ - virtual TInt ConstructAndRunLD( ); - - /** - * From CmPluginBaseSettingsDlg - * Collects the packet data specific setting information for - * displaying - * - * @since S60 3.2 - * @param aItemArray an array of setting information - */ - virtual void UpdateListBoxContentBearerSpecificL( - CDesCArray& aItemArray ); - - /** - * From CmPluginBaseSettingsDlg - * displays the advanced settings dialog - * - * @since S60 3.2 - */ - virtual void RunAdvancedSettingsL(); - - public: // from class MCmCommsDatWatcher - - /** - * Watch changes in CommsDat - */ - void CommsDatChangesL(); - - public: // from class CCmParentViewNotifier - - void NotifyParentView( TInt aValue ); - - protected: - /** From CAknDialog */ - TBool OkToExitL( TInt aButtonId ); - - private: // Constructors - - CmPluginPacketDataSettingsDlg( CCmPluginBaseEng& aCmPluginBaseEng ); - - private: // From CmPluginBaseSettingsDlg - - /** - * From CmPluginBaseSettingsDlg - * Redraws the list box - * - * @since S60 3.2 - */ - virtual void UpdateListBoxContentL(); - - /** - * From CmPluginBaseSettingsDlg - * according to the setting type the correct edit dialog is displayed - * - * @since S60 3.2 - * @param aAttribute - * @param aCommandId - */ - virtual TBool ShowPopupSettingPageL( TUint32 aAttribute, - TInt aCommandId ); - - /** - * From CmPluginBaseSettingsDlg - * Get help contest of the plugin - * - * @since S60 5.0 - */ - virtual void GetHelpContext( TCoeHelpContext& aContext ) const; - - private: // From MEikCommandObserver - - /** - * From MEikCommandObserver - * see base class for description - * - * @since S60 3.2 - * @param aCommandId - */ - virtual void ProcessCommandL( TInt aCommandId ); - - private: // New functions - - /** - * Shows the bool setting page for a certain setting or - * simply changes the setting if ok key was pressed - * @since S60 3.2 - * @param aAttribute The setting to be changed by the setting page - * @param aCommandId Command id, to make difference between ok and change commands - * @return the new setting value - */ - TBool ChangeBoolSettingL( TUint32 aAttribute, TInt aCommandId ); - - void HandleCommsDatChangeL(); - - private: - - TInt iNotifyFromSon; - }; - -#endif // CMPLUGINPACKETDATA_SETTINGS_DLG_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/inc/cmppacketdatasettingsdlgadv.h --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/inc/cmppacketdatasettingsdlgadv.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declares an advanved settings dialog for a packet data -* connection method plugin -* -*/ - -#ifndef CMPLUGINPACKETDATA_SETTINGS_DLG_ADV_H -#define CMPLUGINPACKETDATA_SETTINGS_DLG_ADV_H - -// INCLUDES -#include -#include -#include -#include -#include "cmcommsdatnotifier.h" - -// FORWARD DECLARATIONS -class CCmPluginBaseEng; - -// CLASS DECLARATION - -/** - * CmPluginPacketDataSettingsDlgAdv dialog class - * - * displays the packet data advanced settings dialog - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CmPluginPacketDataSettingsDlgAdv ) : - public CmPluginBaseSettingsDlgAdv , - public MCmCommsDatWatcher - { - public: // Constructors and destructor - - /** - * Two-phase construction - * - * @since S60 3.2 - * @param aCmPluginBaseEng The connection method to use - * @return instance of the class - */ - static CmPluginPacketDataSettingsDlgAdv* NewL( - CCmPluginBaseEng& aCmPluginBaseEng ); - - /** - * Destructor - */ - virtual ~CmPluginPacketDataSettingsDlgAdv(); - - public: // From CmPluginBaseSettingsDlg - - /** - * From CmPluginBaseSettingsDlg - * Collects the packet data specific setting information for - * displaying - * - * @since S60 3.2 - * @param aItemArray an array of setting information - */ - void UpdateListBoxContentBearerSpecificL( CDesCArray& itemArray ); - - /** - * From CmPluginBaseSettingsDlg - * displays the advanced settings dialog - * - * @since S60 3.2 - */ - void RunAdvancedSettingsL() {;} - - public: // from base class - - /** - * From CmPluginBaseSettingsDlg - * Create and launch dialog - * - * @since S60 v3.2 - * @return The code returned by the dialog's ExecuteLD - */ - TInt ConstructAndRunLD(); - - public: - - /** - * Record the object of parent view - */ - void RegisterParentView( CCmParentViewNotifier* aParent ); - - public: // from class MCmCommsDatWatcher - - /** - * Watch changes in CommsDat - */ - void CommsDatChangesL(); - - protected: - /** From CAknDialog */ - TBool OkToExitL( TInt aButtonId ); - - private: - - /** - * C++ constructor - */ - CmPluginPacketDataSettingsDlgAdv( - CCmPluginBaseEng& aCmPluginBaseEng ); - - private: // From CmPluginBaseSettingsDlg - - /** - * From CmPluginBaseSettingsDlg - * according to the setting type the correct edit dialog is displayed - * - * @since S60 3.2 - * @param aAttribute - * @param aCommandId - */ - TBool ShowPopupSettingPageL( TUint32 aAttribute, TInt aCommandId ); - - private: // From MEikCommandObserver - - /** - * From MEikCommandObserver - * see base class for description - * - * @since S60 3.2 - * @param aCommandId - */ - virtual void ProcessCommandL( TInt aCommandId ); - - private: // New functions - - /** - * Shows the setting page for IP DNS address - * - * @since S60 3.2 - */ - void ShowPopupPacketDataIPDNSAddrFromServerL( ); - - /** - * Show the setting page for PDP type - * - * @since S60 3.2 - * @param aAttribute the setting to be changed - */ - void ShowPDPTypeRBPageL( TUint32 aAttribute ); - - private: // Data Members - - /** - * indicates if IPv6 is supported - */ - TBool iIpv6Supported; - - CCmParentViewNotifier* iParent; - }; - -#endif // CMPLUGINPACKETDATA_SETTINGS_DLG_ADV_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/loc/cmpluginpacketdata.loc --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/loc/cmpluginpacketdata.loc Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Localization strings for project cmpluginpacketdata -* -*/ - - -// LOCALISATION STRINGS - -//d: The name of a new, default connection. Max.30 chars, longer ones will be truncated. -//d: Used in Connection method view. -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_access_point_name "Access point name" - -//d: Item text in setting list. Gives the network type -//d: (whether it is IP4 or IP6) -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_network_type "Network type" - -//d: States that the network type is IPv4 -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_nw_type_ipv4 "IPv4" - -//d: States that the network type is IPv6 -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_nw_type_ipv6 "IPv6" - -//d: Connection method list text -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_selec_sett_val_field_none "None" - -//d: Prompt for Access Point Name query window. -//l: popup_query_data_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_prmpt_packet_data_apn "Packet data access point name (APN):" - -//d: Name of packet data bearer type shown in a list of supported bearers. -//l: list_single_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_bearer_supported_packet_data "Packet data" - -//d: First line of a double large graphic style listbox - packet data specific -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_bearer_available_packet_data "Packet data" - -//d: Second line of a double large graphic style listbox - packet data specific -//l: list_double_large_graphic_pane_t2_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_packet_data_available "Available" - -//d: Name of the data bearer displayed in 'data bearer' setting -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_set_bearer_packet_data "Packet data" - -//d: Data bearer of the highlighted connection method. -//l: popup_preview_text_window_t1 -//r: 3.2 -#define qtn_netw_conset_popup_bearer_packet_data "Packet data" diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/src/cmpluginpacketdata.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/src/cmpluginpacketdata.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1212 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Dialog for editing settings for a packet data connection -* -*/ - - -// INCLUDE FILES - -// System -#include -#include -#include // icons -#include -#include -#include -#include -#include // FeatureManager -#include // CRepository -#include // KCRUidCoreApplicationUIs, - -// User -#include "cmpluginpacketdata.h" -#include -#include "cmpacketdatacommonconstants.h" -#include "cmlogger.h" -#include "cmppacketdatasettingsdlg.h" -#include -#include "datamobilitycommsdattypes.h" -#include -#include - -using namespace CMManager; -using namespace CommsDat; - -// ================= CONSTANTS ======================= - -const TUint32 KDefaultPriorityPacketData = 1; - -/// Modem bearer names for GPRS/WCDMA Access Points -_LIT( KModemBearerPacketData, "GPRS Modem" ); -_LIT( KPacketDataFileIcons, "z:cmpluginpacketdata.mbm" ); -_LIT( KDefaultQosDataRecordName, "PRIMARY1" ); -_LIT( KDefaultQosDataRecordNamewithSpace, "PRIMARY1 " ); - -// ================= LOCAL PROTOTYPES ======================= - -/** -* Function to check and set PDP type and IfNetwork. -* @param aThis 'this' pointer of the plugin instance -* @param aAttribute attribute client wants to set -* @param aValue TInt* IPv4 address buffer to be checked -*/ -static TBool SetPDPTypeL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ); - -static const TCmAttribConvTable SPacketDataConvTbl[] = - { - // iAttribId, iCommsDatId, iValidFuncL, - // iTitleId, - // iMaxLength, iAttribFlags, iDefValueResId, iEditorResId, iNotUsed1, iNotUsed2 - { EPacketDataAPName, EGPRSReqTrafficClass-1, NULL, - 0, - 0, 0, 0, NULL, NULL }, - { EPacketDataAPName, KCDTIdAPN, NULL, - R_GPRS_PLUGIN_VIEW_AP_NAME, - KMaxGprsApNameLength, 0, R_GPRS_PLUGIN_SETT_VAL_FIELD_NONE, R_TEXT_SETTING_PAGE_GPRSAP_NAME, NULL, NULL }, - { EPacketDataPDPType, KCDTIdWCDMPDPType, &SetPDPTypeL, - R_GPRS_PLUGIN_VIEW_PDP_TYPE, - 0, 0, 0, NULL, NULL }, - { EPacketDataPDPAddress, KCDTIdWCDMAPDPAddress, NULL }, - { EPacketDataReqPrecedence, KCDTIdReqPrecedence, NULL }, - { EPacketDataReqDelay, KCDTIdReqDelay, NULL }, - { EPacketDataReliability, KCDTIdReqReliability, NULL }, - { EPacketDataPeakThroughput, KCDTIdReqPeakThroughput, NULL }, - { EPacketDataMeanThroughput, KCDTIdReqMeanThroughput, NULL }, - { EPacketDataMinPrecedence, KCDTIdMinPrecedence, NULL }, - { EPacketDataMinDelay, KCDTIdMinDelay, NULL }, - { EPacketDataMinReliability, KCDTIdMinReliability, NULL }, - { EPacketDataMinPeakThroughput, KCDTIdMinPeakThroughput, NULL }, - { EPacketDataMinMeanThroughput, KCDTIdMinMeanThroughput, NULL }, - { EPacketDataDataCompression, KCDTIdWCDMADataCompression, NULL }, - { EPacketDataHeaderCompression, KCDTIdWCDMAHeaderCompression, NULL }, - { EPacketDataUseEdge, KCDTIdWCDMAUseEdge, NULL }, - { EPacketDataAnonymousAccess, KCDTIdWCDMAAnonymousAccess, NULL }, - { EPacketDataIFParams, KCDTIdWCDMAIfParams, NULL }, - { EPacketDataIFNetworks, KCDTIdWCDMAIfNetworks, NULL }, - { EPacketDataIFPromptForAuth, KCDTIdWCDMAIfPromptForAuth, NULL, - R_QTN_SET_PROMPT_PASSWD, - 0, 0, 0, NULL, NULL }, - { EPacketDataIFAuthName, KCDTIdWCDMAIfAuthName, NULL, - R_QTN_SET_AP_USERNAME, - KMaxLoginNameLength, 0, R_QTN_SET_AP_USERNAME_NONE, R_TEXT_SETTING_PAGE_LOGIN_NAME, NULL, NULL }, - { EPacketDataIFAuthPass, KCDTIdWCDMAIfAuthPass, NULL, - R_QTN_SET_AP_PASSWD, - KCmMaxPasswordLength, EConvPassword, R_AVKON_NUMERIC_PASSWORD_BLANKING_TEXT, NULL, NULL }, - { EPacketDataIFAuthRetries, KCDTIdWCDMAIfAuthRetries, NULL }, - { EPacketDataIPNetmask, KCDTIdWCDMAIPNetMask, &CheckIPv4ValidityL }, - { EPacketDataIPGateway, KCDTIdWCDMAIPGateway, &CheckIPv4ValidityL }, - { EPacketDataIPAddrFromServer, KCDTIdWCDMAIPAddrFromServer, NULL }, - { EPacketDataIPAddr, KCDTIdWCDMAIPAddr, &CheckIPv4ValidityL, - R_QTN_SET_IP_ADDRESS, - KIpAddressWidth, EConvIPv4, R_QTN_SET_IP_ADDRESS_DYNAMIC, 0, NULL, NULL }, - { EPacketDataIPDNSAddrFromServer, KCDTIdWCDMAIPDNSAddrFromServer, NULL, - R_QTN_SET_DNS_SERVERS_IP, - 0, 0, 0, 0, NULL, NULL }, - { EPacketDataIPNameServer1, KCDTIdWCDMAIPNameServer1, &CheckIPv4ValidityL, - R_QTN_SET_PRIMARY_DNS, - KMaxIPv4NameServerLength, EConvIPv4, R_QTN_SET_DNS_SERVERS_AUTOMATIC, 0, NULL, NULL }, - { EPacketDataIPNameServer2, KCDTIdWCDMAIPNameServer2, &CheckIPv4ValidityL, - R_QTN_SET_SECONDARY_DNS, - KMaxIPv4NameServerLength, EConvIPv4, R_QTN_SET_DNS_SERVERS_AUTOMATIC, 0, NULL, NULL }, - { EPacketDataIPIP6DNSAddrFromServer, KCDTIdWCDMAIP6DNSAddrFromServer, NULL, - R_QTN_SET_DNS_SERVERS_IP, - 0, 0, 0, NULL, NULL }, - { EPacketDataIPIP6NameServer1, KCDTIdWCDMAIP6NameServer1, &CheckIPv6ValidityL }, - { EPacketDataIPIP6NameServer2, KCDTIdWCDMAIP6NameServer2, &CheckIPv6ValidityL }, - { EPacketDataIPAddrLeaseValidFrom, KCDTIdWCDMAIPAddrLeaseValidFrom, NULL }, - { EPacketDataIPAddrLeaseValidTo, KCDTIdWCDMAIPAddrLeaseValidTo, NULL }, - { EPacketDataConfigDaemonManagerName, KCDTIdWCDMAConfigDaemonManagerName, NULL }, - { EPacketDataConfigDaemonName, KCDTIdWCDMAConfigDaemonName, NULL }, - { EPacketDataEnableLcpExtension, KCDTIdWCDMAEnableLCPExtensions, NULL }, - { EPacketDataDisablePlainTextAuth, KCDTIdWCDMADisablePlainTextAuth, NULL, - R_QTN_SET_PASSWD_AUT, - 0, 0, 0, NULL, NULL }, - { EPacketDataApType, KCDTIdAPType, NULL }, - { EPacketDataQoSWarningTimeOut, KCDTIdQOSWarningTimeOut, NULL }, - { EPacketDataServiceEnableLLMNR, KCDTIdServiceEnableLlmnr, NULL }, - { 0, 0, NULL } -}; - -static const TCmAttribConvTable SQoSDataConvTbl[] = - { - // iAttribId, iCommsDatId, iValidFuncL, - // iTitleId, - // iMaxLength, iAttribFlags, iDefValueResId, iEditorResId, iNotUsed1, iNotUsed2 - { EGPRSReqTrafficClass, EPacketDataRangeMax, NULL }, - { EGPRSReqTrafficClass, KCDTIdWCDMAReqTrafficClass, NULL }, - { EGPRSMinTrafficClass, KCDTIdWCDMAMinTrafficClass, NULL }, - { EGPRSReqDeliveryOrder, KCDTIdWCDMAReqDeliveryOrder, NULL }, - { GPRSMinDeliveryOrder, KCDTIdWCDMAMinDeliveryOrder, NULL }, - { EGPRSReqDeliverErroneousSDU, KCDTIdWCDMAReqDeliverErroneousSDU, NULL }, - { EGPRSMinDeliverErroneousSDU, KCDTIdWCDMAMinDeliverErroneousSDU, NULL }, - { EGPRSReqMaxSDUSize, KCDTIdWCDMAReqMaxSDUSize, NULL }, - { EGPRSMinAcceptableMaxSDUSize, KCDTIdWCDMAMinAcceptableMaxSDUSize, NULL }, - { EGPRSReqMaxUplinkRate, KCDTIdWCDMAReqMaxUplinkRate, NULL }, - { EGPRSReqMinUplinkRate, KCDTIdWCDMAReqMinUplinkRate, NULL }, - { EGPRSReqMaxDownlinkRate, KCDTIdWCDMAReqMaxDownlinkRate, NULL }, - { EGPRSReqMinDownlinkRate, KCDTIdWCDMAReqMinDownlinkRate, NULL }, - { EGPRSReqBER, KCDTIdWCDMAReqBER, NULL }, - { EGPRSMaxBER, KCDTIdWCDMAMaxBER, NULL }, - { EGPRSReqSDUErrorRatio, KCDTIdWCDMAReqSDUErrorRatio, NULL }, - { EGPRSMaxSDUErrorRatio, KCDTIdWCDMAMaxSDUErrorRatio, NULL }, - { EGPRSReqTrafficHandlingPriority, KCDTIdWCDMAReqTrafficHandlingPriority, NULL }, - { EGPRSMinTrafficHandlingPriority, KCDTIdWCDMAMinTrafficHandlingPriority, NULL }, - { EGPRSReqTransferDelay, KCDTIdWCDMAReqTransferDelay, NULL }, - { EGPRSMaxTransferDelay, KCDTIdWCDMAMaxTransferDelay, NULL }, - { EGPRSReqGuaranteedUplinkRate, KCDTIdWCDMAReqGuaranteedUplinkRate, NULL }, - { EGPRSMinGuaranteedUplinkRate, KCDTIdWCDMAMinGuaranteedUplinkRate, NULL }, - { EGPRSReqGuaranteedDownlinkRate, KCDTIdWCDMAReqGuaranteedDownlinkRate, NULL }, - { EGPRSMinGuaranteedDownlinkRate, KCDTIdWCDMAMinGuaranteedDownlinkRate, NULL }, - { EGPRSSignallingIndication, KCDTIdWCDMASignallingIndication, NULL }, - { EGPRS_ImCnSignallingIndication, KCDTIdWCDMAImCmSignallingIndication, NULL }, - { EGPRSSourceStatisticsDescriptor, KCDTIdWCDMASourceStatisticsDescriptor, NULL }, - { 0, 0, NULL } - }; - -static const TCmCommonAttrConvArrayItem SCommonConvTbl[] = -{ - { EPacketDataIFParams, ECmIFParams }, - { EPacketDataIFNetworks, ECmIFNetworks }, - { EPacketDataIFPromptForAuth, ECmIFPromptForAuth }, - { EPacketDataIFAuthName, ECmIFAuthName }, - { EPacketDataIFAuthPass, ECmIFAuthPass }, - { EPacketDataIFAuthRetries, ECmIFAuthRetries }, - { EPacketDataIPNetmask, ECmIPNetmask }, - { EPacketDataIPGateway, ECmIPGateway }, - { EPacketDataIPAddrFromServer, ECmIPAddFromServer }, - { EPacketDataIPAddr, ECmIPAddress }, - { EPacketDataIPDNSAddrFromServer, ECmIPDNSAddrFromServer }, - { EPacketDataIPNameServer1, ECmIPNameServer1 }, - { EPacketDataIPNameServer2, ECmIPNameServer2 }, - { EPacketDataIPIP6DNSAddrFromServer, ECmIP6DNSAddrFromServer }, - { EPacketDataIPIP6NameServer1, ECmIP6NameServer1 }, - { EPacketDataIPIP6NameServer2, ECmIP6NameServer2 }, - { EPacketDataIPAddrLeaseValidFrom, ECmIPAddrLeaseValidFrom }, - { EPacketDataIPAddrLeaseValidTo, ECmIPAddrLeaseValidTo }, - { EPacketDataConfigDaemonManagerName, ECmConfigDaemonManagerName }, - { EPacketDataConfigDaemonName, ECmConfigDaemonName }, - { EPacketDataEnableLcpExtension, ECmEnableLPCExtension }, - { EPacketDataDisablePlainTextAuth, ECmDisablePlainTextAuth }, - { 0, 0 } - }; - -// ======== LOCAL FUNCTIONS ======== - -static TBool SetPDPTypeL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ) - { - (void)aAttribute; - CCmPluginPacketData* myThis = static_cast( aThis ); - - myThis->SetPDPTypeL( (RPacketContext::TProtocolType)(TInt)aValue ); - - return ETrue; - } - -// ======== MEMBER FUNCTIONS ======== - -class CCmPDCoverageCheck : public CActive - { - public: - - CCmPDCoverageCheck(); - ~CCmPDCoverageCheck(); - - TBool IsThereCoverageL(); - - protected: // from CActive - - virtual void DoCancel(); - virtual void RunL(); - - private: - - TBool IsPhoneOfflineL() const; - - private: - - TBool iCoverage; - CActiveSchedulerWait iWait; - RTelServer iServer; - RPhone iPhone; - RPacketService iService; - RPacketService::TRegistrationStatus iNwRegStatus; - }; - -// ---------------------------------------------------------------------------- -// CCmPDCoverageCheck::CCmPDCoverageCheck() -// ---------------------------------------------------------------------------- -// -CCmPDCoverageCheck::CCmPDCoverageCheck() : CActive( EPriorityStandard ) - { - CActiveScheduler::Add( this ); - } - -// ---------------------------------------------------------------------------- -// CCmPDCoverageCheck::~CCmPDCoverageCheck() -// ---------------------------------------------------------------------------- -// -CCmPDCoverageCheck::~CCmPDCoverageCheck() - { - Cancel(); - - iService.Close(); - iPhone.Close(); - iServer.Close(); - } - -// ---------------------------------------------------------------------------- -// CCmPDCoverageCheck::DoCancel -// ---------------------------------------------------------------------------- -// -void CCmPDCoverageCheck::DoCancel() - { - iWait.AsyncStop(); - } - -// ---------------------------------------------------------------------------- -// CCmPDCoverageCheck::RunL -// ---------------------------------------------------------------------------- -// -void CCmPDCoverageCheck::RunL() - { - if( !iStatus.Int() ) - { - CLOG_WRITE_1( "CCmPDCoverageCheck::RunL: iNwRegStatus: [%d]", iNwRegStatus ); - - if ( iNwRegStatus == RPacketService::ERegisteredOnHomeNetwork || - iNwRegStatus == RPacketService::ERegisteredRoaming || - iNwRegStatus == RPacketService::ENotRegisteredButAvailable ) - { - iCoverage = ETrue; - } - iWait.AsyncStop(); - } - else - // something went wrong -> no coverage. - { - CLOG_WRITE_1( "CCmPDCoverageCheck::RunL: FAILED: [%d]", iStatus.Int() ); - iWait.AsyncStop(); - } - } - -// ---------------------------------------------------------------------------- -// CCmPDCoverageCheck::IsThereCoverageL -// ---------------------------------------------------------------------------- -// -TBool CCmPDCoverageCheck::IsThereCoverageL() - { - iCoverage = EFalse; - - if ( !IsPhoneOfflineL() ) - { - User::LeaveIfError( iServer.Connect() ); - CLOG_WRITE( "Server open" ); - - RTelServer::TPhoneInfo info; - User::LeaveIfError( iServer.GetPhoneInfo( 0, info ) ); - CLOG_WRITE( "Phone info ok" ); - - User::LeaveIfError( iPhone.Open(iServer, info.iName ) ); - CLOG_WRITE( "Phone open" ); - - User::LeaveIfError( iService.Open( iPhone ) ); - CLOG_WRITE( "service ok" ); - - iService.GetNtwkRegStatus( iStatus, iNwRegStatus ); - SetActive(); - iWait.Start(); - - User::LeaveIfError( iStatus.Int() ); - } - - return iCoverage; - } - -// ---------------------------------------------------------------------------- -// CCmPDCoverageCheck::IsPhoneOfflineL -// ---------------------------------------------------------------------------- -// -TBool CCmPDCoverageCheck::IsPhoneOfflineL() const - { - if ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) ) - { - CRepository* repository = CRepository::NewLC( KCRUidCoreApplicationUIs ); - TInt connAllowed( ECoreAppUIsNetworkConnectionAllowed ); - - repository->Get( KCoreAppUIsNetworkConnectionAllowed, connAllowed ); - CleanupStack::PopAndDestroy( repository ); - - if ( !connAllowed ) - { - CLOG_WRITE( "Phone is in offline mode." ); - return ETrue; - } - } - - CLOG_WRITE( "Phone is NOT in offline mode." ); - return EFalse; - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::NewOutgoingL -// ---------------------------------------------------------------------------- -// -CCmPluginPacketData* CCmPluginPacketData::NewL( - TCmPluginInitParam* aInitParam ) - { - CCmPluginPacketData* self = new ( ELeave ) CCmPluginPacketData( - aInitParam, ETrue ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::~CCmPluginPacketData -// ---------------------------------------------------------------------------- -// -CCmPluginPacketData::~CCmPluginPacketData() - { - CCmPluginPacketData::AdditionalReset(); - RemoveResourceFile( KPluginPacketDataResDirAndFileName ); - CLOG_CLOSE; - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::CreateInstanceL -// ---------------------------------------------------------------------------- -// -CCmPluginBaseEng* CCmPluginPacketData::CreateInstanceL( TCmPluginInitParam& aInitParam ) const - { - CCmPluginPacketData* self = new( ELeave ) CCmPluginPacketData( &aInitParam, ETrue ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::CCmPluginPacketData -// ---------------------------------------------------------------------------- -// -CCmPluginPacketData::CCmPluginPacketData( TCmPluginInitParam* aInitParam, - TBool aOutgoing ) - : CCmPluginBaseEng( aInitParam ) - , iOutgoing( aOutgoing ) - { - CLOG_CREATE; - - iBearerType = KUidPacketDataBearerType; - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::ConstructL -// ---------------------------------------------------------------------------- -// -void CCmPluginPacketData::ConstructL() - { - CCmPluginBaseEng::ConstructL(); - - AddResourceFileL( KPluginPacketDataResDirAndFileName ); - AddConverstionTableL( (CCDRecordBase**)&iServiceRecord, NULL, SPacketDataConvTbl ); - AddConverstionTableL( (CCDRecordBase**)&iPacketDataQoSRecord, NULL, SQoSDataConvTbl ); - AddCommonConversionTableL( SCommonConvTbl ); - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::GetIntAttributeL() -// ---------------------------------------------------------------------------- -// -TUint32 CCmPluginPacketData::GetIntAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginPacketData::GetIntAttributeL" ); - - TUint32 retVal( 0 ); - - switch( aAttribute ) - { - case ECmBearerIcon: - { - TAknsItemID id; - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - - TParse mbmFile; - User::LeaveIfError( mbmFile.Set( KPacketDataFileIcons, - &KDC_BITMAP_DIR, NULL ) ); - - - retVal = (TUint32)AknsUtils::CreateGulIconL( - skinInstance, - id, - mbmFile.FullName(), - EMbmCmpluginpacketdataQgn_prop_wml_gprs, - EMbmCmpluginpacketdataQgn_prop_wml_gprs_mask ); - } - break; - - case ECmBearerAvailableIcon: - { - TAknsItemID id; - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - - TParse mbmFile; - User::LeaveIfError( mbmFile.Set( KPacketDataFileIcons, &KDC_BITMAP_DIR, NULL ) ); - - retVal = (TUint32)AknsUtils::CreateGulIconL( - skinInstance, - id, - mbmFile.FullName(), - EMbmCmpluginpacketdataQgn_prop_set_conn_bearer_avail_packetdata, - EMbmCmpluginpacketdataQgn_prop_set_conn_bearer_avail_packetdata_mask ); - } - break; - - case ECmCommsDBBearerType: - { - retVal = KCommDbBearerWcdma; - } - break; - - case ECmDefaultUiPriority: - case ECmDefaultPriority: - { - TPtrC buf; - - if( iOutgoing ) - { - buf.Set( KCDTypeNameOutgoingWCDMA ); - } - else - { - buf.Set( KCDTypeNameIncomingWCDMA ); - } - - retVal = aAttribute == ECmDefaultPriority ? - GlobalBearerPriority( buf ) : - GlobalUiBearerPriority( buf ); - - if( retVal == KDataMobilitySelectionPolicyPriorityWildCard ) - { - retVal = KDefaultPriorityPacketData; - } - } - break; - - default: - { - retVal = CCmPluginBaseEng::GetIntAttributeL( aAttribute ); - } - break; - } - - return retVal; - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::GetBoolAttributeL() -// ---------------------------------------------------------------------------- -// -TBool CCmPluginPacketData::GetBoolAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginPacketData::GetBoolAttributeL" ); - - TBool retVal( EFalse ); - - switch( aAttribute ) - { - case EPacketDataOutGoing: - { - retVal = iOutgoing; - } - break; - - case ECmCoverage: - // In default the plugin has no network coverage - { - retVal = CheckNetworkCoverageL(); - } - break; - - case ECmAddToAvailableList: - { - retVal = ETrue; - } - break; - - case ECmBearerHasUi: - { - retVal = ETrue; - } - break; - - default: - { - retVal = CCmPluginBaseEng::GetBoolAttributeL( aAttribute ); - } - } - - return retVal; - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::GetStringAttributeL() -// ---------------------------------------------------------------------------- -// -HBufC* CCmPluginPacketData::GetStringAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginPacketData::GetStringAttributeL" ); - - HBufC* retVal = NULL; - - switch( aAttribute ) - { - case ECmBearerAvailableName: - { - retVal = AllocReadL( R_QTN_NETW_CONSET_BEARER_AVAILABLE_PACKET_DATA ); - } - break; - - case ECmBearerSupportedName: - { - retVal = AllocReadL( R_QTN_NETW_CONSET_BEARER_SUPPORTED_PACKET_DATA ); - } - break; - - case ECmBearerAvailableText: - { - retVal = AllocReadL( R_QTN_NETW_CONSET_PACKET_DATA_AVAILABLE ); - } - break; - - case ECmBearerNamePopupNote: - { - retVal = AllocReadL( R_QTN_NETW_CONSET_POPUP_BEARER_PACKET_DATA ); - } - break; - - case ECmBearerSettingName: - { - retVal = AllocReadL( R_QTN_SET_BEARER_PACKET_DATA ); - } - break; - - default: - { - retVal = CCmPluginBaseEng::GetStringAttributeL( aAttribute ); - } - break; - } - - return retVal; - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::SetIntAttributeL() -// ---------------------------------------------------------------------------- -// -void CCmPluginPacketData::SetIntAttributeL( const TUint32 aAttribute, - TUint32 aValue ) - { - LOGGER_ENTERFN( "CCmPluginPacketData::SetIntAttributeL" ); - - switch( aAttribute ) - { - default: - { - CCmPluginBaseEng::SetIntAttributeL( aAttribute, aValue ); - } - } - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::SetBoolAttributeL() -// ---------------------------------------------------------------------------- -// -void CCmPluginPacketData::SetBoolAttributeL( const TUint32 aAttribute, - TBool aValue ) - { - LOGGER_ENTERFN( "CCmPluginPacketData::SetBoolAttributeL" ); - - switch( aAttribute ) - { - case EPacketDataOutGoing: - { - iOutgoing = aValue; - CreateNewServiceRecordL(); - } - break; - - default: - { - CCmPluginBaseEng::SetBoolAttributeL( aAttribute, aValue ); - } - } - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::SetStringAttributeL() -// ---------------------------------------------------------------------------- -// -void CCmPluginPacketData::SetStringAttributeL( const TUint32 aAttribute, - const TDesC16& aValue ) - { - LOGGER_ENTERFN( "CCmPluginPacketData::SetStringAttributeL" ); - - switch( aAttribute ) - { - default: - { - CCmPluginBaseEng::SetStringAttributeL( aAttribute, aValue ); - } - } - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::PrepareToUpdateRecordsL() -// ---------------------------------------------------------------------------- -// -void CCmPluginPacketData::PrepareToUpdateRecordsL() - { - LOGGER_ENTERFN( "CCmPluginPacketData::PrepareToUpdateRecordsL" ); - - CheckDNSServerAddressL( ETrue, - ServiceRecord().iGPRSIP6NameServer1, - ServiceRecord().iGPRSIP6NameServer2, - ServiceRecord().iGPRSIP6DNSAddrFromServer ); - - CheckDNSServerAddressL( EFalse, - ServiceRecord().iGPRSIPNameServer1, - ServiceRecord().iGPRSIPNameServer2, - ServiceRecord().iGPRSIPDNSAddrFromServer ); - SetDaemonNameL(); - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::CanHandleIapIdL() -// ---------------------------------------------------------------------------- -// -TBool CCmPluginPacketData::CanHandleIapIdL( TUint32 aIapId ) const - { - LOGGER_ENTERFN( "CCmPluginPacketData::CanHandleIapIdL1" ); - CLOG_WRITE_1( "IapId: [%d]", aIapId ); - - TBool retVal( EFalse ); - - CCDIAPRecord *iapRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord)); - - CleanupStack::PushL( iapRecord ); - iapRecord->SetRecordId( aIapId ); - - TRAPD( err, iapRecord->LoadL( Session() )); - - if( !err ) - { - CanHandleIapIdL( iapRecord ); - } - - CleanupStack::PopAndDestroy( iapRecord ); - return retVal; - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::CanHandleIapIdL() -// ---------------------------------------------------------------------------- -// -TBool CCmPluginPacketData::CanHandleIapIdL( CCDIAPRecord *aIapRecord ) const - { - LOGGER_ENTERFN( "CCmPluginPacketData::CanHandleIapIdL2" ); - CLOG_WRITE_1( "IapId: [%d]", aIapRecord->RecordId() ); - - TBool retVal( EFalse ); - - CLOG_WRITE_2( "IAP record: [%S][%S]", - &FIELD_TO_TDESC(aIapRecord->iServiceType), - &FIELD_TO_TDESC(aIapRecord->iBearerType) - ); - - if( (TPtrC(aIapRecord->iServiceType) == TPtrC(KCDTypeNameOutgoingWCDMA) || - TPtrC(aIapRecord->iServiceType) == TPtrC(KCDTypeNameIncomingWCDMA)) && - TPtrC(aIapRecord->iBearerType) == TPtrC(KCDTypeNameModemBearer) ) - { - CLOG_WRITE( "I can." ); - retVal = ETrue; - } - - return retVal; - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::RunSettingsL() -// ---------------------------------------------------------------------------- -// -TInt CCmPluginPacketData::RunSettingsL() - { - CmPluginPacketDataSettingsDlg* settingsDlg = - CmPluginPacketDataSettingsDlg::NewL( *this ); - return settingsDlg->ConstructAndRunLD( ); - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::LoadServiceSettingL() -// ---------------------------------------------------------------------------- -// -void CCmPluginPacketData::LoadServiceSettingL() - { - LOGGER_ENTERFN( "CCmPluginPacketData::LoadServiceSettingL" ); - - if( TPtrC(KCDTypeNameOutgoingWCDMA) == iIapRecord->iServiceType ) - { - iServiceRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdOutgoingGprsRecord)); - iOutgoing = ETrue; - } - else if( TPtrC(KCDTypeNameIncomingWCDMA) == iIapRecord->iServiceType ) - { - iServiceRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdIncomingGprsRecord)); - iOutgoing = EFalse; - } - else - // this IAP service is not supported by this plugin. - { - User::Leave( KErrNotSupported ); - } - - CCmPluginBaseEng::LoadServiceSettingL(); - - CLOG_WRITE_1( "APName: [%S]", &FIELD_TO_TDESC( ServiceRecord().iGPRSAPN ) ); - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::InitializeWithUiL() -// ---------------------------------------------------------------------------- -// -TBool CCmPluginPacketData::InitializeWithUiL( TBool /*aManuallyConfigure*/ ) - { - LOGGER_ENTERFN( "CCmPluginPacketData::InitializeWithUiL" ); - TBool retval = ETrue; // meaning that everything was fine. - - // Add resource file for the duration of this method only. - TParse parser; - User::LeaveIfError( parser.Set( KPluginPacketDataResDirAndFileName, - &KDC_RESOURCE_FILES_DIR, - NULL ) ); - - TFileName resourceFileNameBuf = parser.FullName(); - - RConeResourceLoader resLoader( *CEikonEnv::Static() ) ; - resLoader.OpenL( resourceFileNameBuf ); - CleanupClosePushL( resLoader ); - - // Show dialog - TBuf buf; - CAknTextQueryDialog* dlg = new (ELeave) CAknTextQueryDialog( buf ); - - // Must use PrepareLC instead of ExecuteLD in order for - // MakeLeftSoftkeyVisible() call to work. - dlg->PrepareLC( R_APN_NAME_QUERY ); - - dlg->SetMaxLength( KMaxGprsApNameLength ); - dlg->MakeLeftSoftkeyVisible( ETrue ); // Empty input accepted. - - HBufC* prompt = StringLoader::LoadLC( R_GPRS_PLUGIN_APN_PROMPT ); - dlg->SetPromptL( *prompt ); - CleanupStack::PopAndDestroy( prompt ); - - // Strange, but true: RunLD returns 0 (instead of the actual command id) - // if Cancel button was pressed, thus we have to check against zero here. - if ( dlg->RunLD() ) - { - // Change APN attribute in connection method - SetStringAttributeL( EPacketDataAPName, buf ); - - if( buf.Length() ) - { - SetStringAttributeL( ECmName, buf ); - } - } - else - { - retval = EFalse; // indicating cancellation. - } - - // Clean-up - CleanupStack::PopAndDestroy( &resLoader ); - - return retval; - } - - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::ServiceRecord() -// ---------------------------------------------------------------------------- -// -CCDWCDMAPacketServiceRecord& CCmPluginPacketData::ServiceRecord() const - { - LOGGER_ENTERFN( "CCmPluginPacketData::ServiceRecord" ); - - return *static_cast(iServiceRecord); - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::CreateNewServiceRecordL() -// ---------------------------------------------------------------------------- -// -void CCmPluginPacketData::CreateNewServiceRecordL() - { - LOGGER_ENTERFN( "CCmPluginPacketData::CreateNewServiceRecordL" ); - - delete iServiceRecord; iServiceRecord = NULL; - - if( iOutgoing ) - { - iServiceRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdOutgoingGprsRecord)); - } - else - { - iServiceRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdIncomingGprsRecord)); - } - - ServiceRecord().iGPRSAPN.SetL( KNullDesC ); - ServiceRecord().iGPRSPDPType.SetL( RPacketContext::EPdpTypeIPv4 ); - ServiceRecord().iGPRSReqPrecedence = 0; - ServiceRecord().iGPRSReqDelay = 0; - ServiceRecord().iGPRSReqReliability = 0; - ServiceRecord().iGPRSReqPeakThroughput = 0; - ServiceRecord().iGPRSReqMeanThroughput = 0; - ServiceRecord().iGPRSMinPrecedence = 0; - ServiceRecord().iGPRSMinDelay = 0; - ServiceRecord().iGPRSMinReliability = 0; - ServiceRecord().iGPRSMinPeakThroughput = 0; - ServiceRecord().iGPRSMinMeanThroughput = 0; - ServiceRecord().iGPRSDataCompression = 0; - ServiceRecord().iGPRSHeaderCompression = 0; - ServiceRecord().iGPRSAnonymousAccess = 0; - ServiceRecord().iGPRSIfNetworks.SetL( KDefIspIfNetworksIPv4 ); - ServiceRecord().iGPRSIfPromptForAuth = EFalse; - ServiceRecord().iGPRSIfAuthRetries = 0; - ServiceRecord().iGPRSIPGateway.SetL( KUnspecifiedIPv4 ); - ServiceRecord().iGPRSIPAddrFromServer = ETrue; - ServiceRecord().iGPRSIPAddr.SetL( KUnspecifiedIPv4 ); - ServiceRecord().iGPRSIPDNSAddrFromServer = ETrue; - ServiceRecord().iGPRSIPNameServer1.SetL( KUnspecifiedIPv4 ); - ServiceRecord().iGPRSIPNameServer2.SetL( KUnspecifiedIPv4 ); - ServiceRecord().iGPRSIP6DNSAddrFromServer = ETrue; - ServiceRecord().iGPRSIP6NameServer1.SetL( KDynamicIpv6Address ); - ServiceRecord().iGPRSIP6NameServer2.SetL( KDynamicIpv6Address ); - ServiceRecord().iGPRSEnableLCPExtension = EFalse; - ServiceRecord().iGPRSDisablePlainTextAuth = ETrue; - ServiceRecord().iGPRSAPType = EPacketDataBoth; - ServiceRecord().iGPRSQOSWarningTimeOut = TUint32(-1); - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::ServiceRecordIdLC -// ---------------------------------------------------------------------------- -// -void CCmPluginPacketData::ServiceRecordIdLC( HBufC* &aName, - TUint32& aRecordId ) - { - LOGGER_ENTERFN( "CCmPluginPacketData::ServiceRecordIdLC" ); - - if( iOutgoing ) - { - aName = TPtrC( KCDTypeNameOutgoingWCDMA ).AllocLC(); - } - else - { - aName = TPtrC( KCDTypeNameIncomingWCDMA ).AllocLC(); - } - - aRecordId = iServiceRecord->RecordId(); - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::BearerRecordIdLC() -// ---------------------------------------------------------------------------- -// -void CCmPluginPacketData::BearerRecordIdLC( HBufC* &aBearerName, - TUint32& aRecordId ) - { - LOGGER_ENTERFN( "CCmPluginPacketData::BearerRecordIdLC" ); - - CMDBRecordSet* bearerRS = - new(ELeave) CMDBRecordSet(KCDTIdModemBearerRecord); - CleanupStack::PushL( bearerRS ); - - CCDModemBearerRecord* bearerRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdModemBearerRecord)); - - CleanupStack::PushL( bearerRecord ); - - bearerRecord->iRecordName.SetL( KModemBearerPacketData ); - bearerRS->iRecords.AppendL( bearerRecord ); - CleanupStack::Pop( bearerRecord ); - - if( bearerRS->FindL( Session() ) ) - { - CLOG_WRITE_1( "Bearers: [%d]", bearerRS->iRecords.Count() ); - - bearerRecord = static_cast(bearerRS->iRecords[0]); - aRecordId = bearerRecord->RecordId(); - } - else - // bearer not found -> create dummy values - { - CLOG_WRITE( "No bearer record found" ); - - bearerRecord->SetRecordId( KCDNewRecordRequest ); - bearerRecord->StoreL( Session() ); - - aRecordId = bearerRecord->RecordId(); - } - - CleanupStack::PopAndDestroy( bearerRS ); - - aBearerName = TPtrC(KCDTypeNameModemBearer).AllocLC(); - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::CheckNetworkCoverageL() -// ---------------------------------------------------------------------------- -// -TBool CCmPluginPacketData::CheckNetworkCoverageL() const - { - LOGGER_ENTERFN("CCmPluginPacketData::CheckNetworkCoverageL"); - - TBool retVal( EFalse ); - -#ifdef __WINS__ - retVal = ETrue; -#else - CCmPDCoverageCheck* coverage = new (ELeave) CCmPDCoverageCheck; - CleanupStack::PushL( coverage ); - - retVal = coverage->IsThereCoverageL(); - - CleanupStack::PopAndDestroy( coverage ); - -#endif // __WINS - return retVal; - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::SetPDPTypeL() -// ---------------------------------------------------------------------------- -// -void CCmPluginPacketData::SetPDPTypeL( RPacketContext::TProtocolType aPdpType ) - { - LOGGER_ENTERFN( "CCmPluginPacketData::SetPDPTypeL" ); - - if( aPdpType != RPacketContext::EPdpTypeIPv4 && - aPdpType != RPacketContext::EPdpTypeIPv6 ) - { - User::Leave( KErrArgument ); - } - - if( FeatureSupported( KFeatureIdIPv6 ) && aPdpType == - RPacketContext::EPdpTypeIPv6 ) - { - ServiceRecord().iGPRSPDPType = RPacketContext::EPdpTypeIPv6; - ServiceRecord().iGPRSIfNetworks.SetL( KDefIspIfNetworksIPv6 ); - } - else - { - if( aPdpType == RPacketContext::EPdpTypeIPv6 ) - { - User::Leave( KErrNotSupported ); - } - - ServiceRecord().iGPRSIfNetworks.SetL( KDefIspIfNetworksIPv4 ); - ServiceRecord().iGPRSPDPType = RPacketContext::EPdpTypeIPv4; - } - } - -// ---------------------------------------------------------------------------- -// CCmPluginPacketData::AdditionalReset() -// ---------------------------------------------------------------------------- -// -void CCmPluginPacketData::AdditionalReset() - { - LOGGER_ENTERFN( "CCmPluginPacketData::AdditionalReset" ); - - delete iPacketDataQoSRecord; - iPacketDataQoSRecord = NULL; - } - -// --------------------------------------------------------------------------- -// CCmPluginPacketData::PrepareToCopyDataL -// --------------------------------------------------------------------------- -// -void CCmPluginPacketData::PrepareToCopyDataL( CCmPluginBaseEng* aDestInst ) const - { - LOGGER_ENTERFN( "CCmPluginPacketData::PrepareToCopyDataL" ); - - aDestInst->SetBoolAttributeL( EPacketDataOutGoing, iOutgoing ); - } - - -// --------------------------------------------------------------------------- -// CCmPluginPacketData::SetDaemonNameL -// --------------------------------------------------------------------------- -// -void CCmPluginPacketData::SetDaemonNameL() - { - LOGGER_ENTERFN( "CCmPluginPacketData::SetDaemonNameL" ); - - // use DHCP if we can - TBool ipfromSrv = GetBoolAttributeL( ECmIPAddFromServer ); - if ( ipfromSrv ) - { - SetStringAttributeL( ECmConfigDaemonManagerName, - KDaemonManagerName ); - SetStringAttributeL( ECmConfigDaemonName, - KConfigDaemonName ); - } - else - { - if ( FeatureSupported( KFeatureIdIPv6 ) ) - { - SetStringAttributeL( ECmConfigDaemonManagerName, - KDaemonManagerName ); - SetStringAttributeL( ECmConfigDaemonName, - KConfigDaemonName ); - } - else - { - SetStringAttributeL( ECmConfigDaemonManagerName, - KNullDesC() ); - SetStringAttributeL( ECmConfigDaemonName, - KNullDesC() ); - } - } - } - - -// --------------------------------------------------------------------------- -// CCmPluginPacketData::CreateAdditionalRecordsL -// --------------------------------------------------------------------------- -// -void CCmPluginPacketData::CreateAdditionalRecordsL() - { - LOGGER_ENTERFN( "CCmPluginPacketData::CreateAdditionalRecordsL" ); - - delete iPacketDataQoSRecord; - iPacketDataQoSRecord = NULL; - - iPacketDataQoSRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdUmtsR99QoSAndOnTableRecord)); - - iPacketDataQoSRecord->iGPRSReqTrafficClass = RPacketQoS::ETrafficClassUnspecified; - iPacketDataQoSRecord->iGPRSMinTrafficClass = RPacketQoS::ETrafficClassUnspecified; - iPacketDataQoSRecord->iGPRSReqDeliveryOrder = RPacketQoS::EDeliveryOrderUnspecified; - iPacketDataQoSRecord->iGPRSMinDeliveryOrder = RPacketQoS::EDeliveryOrderUnspecified; - iPacketDataQoSRecord->iGPRSReqDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryUnspecified; - iPacketDataQoSRecord->iGPRSMinDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryUnspecified; - iPacketDataQoSRecord->iGPRSReqMaxSDUSize = 0; - iPacketDataQoSRecord->iGPRSMinAcceptableMaxSDUSize = 0; - iPacketDataQoSRecord->iGPRSReqMaxUplinkRate = 0; - iPacketDataQoSRecord->iGPRSReqMinUplinkRate = 0; - iPacketDataQoSRecord->iGPRSReqMaxDownlinkRate = 0; - iPacketDataQoSRecord->iGPRSReqMinDownlinkRate = 0; - iPacketDataQoSRecord->iGPRSReqBER = RPacketQoS::EBERUnspecified; - iPacketDataQoSRecord->iGPRSMaxBER = RPacketQoS::EBERUnspecified; - iPacketDataQoSRecord->iGPRSReqSDUErrorRatio = RPacketQoS::ESDUErrorRatioUnspecified; - iPacketDataQoSRecord->iGPRSMaxSDUErrorRatio = RPacketQoS::ESDUErrorRatioUnspecified; - iPacketDataQoSRecord->iGPRSReqTrafficHandlingPriority = RPacketQoS::ETrafficPriorityUnspecified; - iPacketDataQoSRecord->iGPRSMinTrafficHandlingPriority = RPacketQoS::ETrafficPriorityUnspecified; - iPacketDataQoSRecord->iGPRSReqTransferDelay = 0; - iPacketDataQoSRecord->iGPRSMaxTransferDelay = 0; - iPacketDataQoSRecord->iGPRSReqGuaranteedUplinkRate = 0; - iPacketDataQoSRecord->iGPRSMinGuaranteedUplinkRate = 0; - iPacketDataQoSRecord->iGPRSReqGuaranteedDownlinkRate = 0; - iPacketDataQoSRecord->iGPRSMinGuaranteedDownlinkRate = 0; - iPacketDataQoSRecord->iGPRSSignallingIndication = EFalse; - iPacketDataQoSRecord->iGPRS_ImCnSignallingIndication = EFalse; - iPacketDataQoSRecord->iGPRSSourceStatisticsDescriptor = RPacketQoS::ESourceStatisticsDescriptorUnknown; - } - -// -------------------------------------------------------------------------- -// CCmPluginPacketData::DeleteAdditionalRecordsL -// -------------------------------------------------------------------------- -// -void CCmPluginPacketData::DeleteAdditionalRecordsL() - { - LOGGER_ENTERFN( "CCmPluginPacketData::DeleteAdditionalRecordsL" ); - - // If packet record is common with other packet iaps, do not delete it! - if ( !TPtrC(iPacketDataQoSRecord->iRecordName).CompareF( KDefaultQosDataRecordName ) - || !TPtrC(iPacketDataQoSRecord->iRecordName).CompareF( KDefaultQosDataRecordNamewithSpace ) ) - { - return; - } - - iPacketDataQoSRecord->DeleteL( Session() ); - } - -// -------------------------------------------------------------------------- -// CCmPluginPacketData::LoadAdditionalRecordsL() -// -------------------------------------------------------------------------- -// -void CCmPluginPacketData::LoadAdditionalRecordsL() - { - LOGGER_ENTERFN( "CCmPluginPacketData::LoadAdditionalRecordsL" ); - - if ( ServiceRecord().iUmtsR99QoSAndOnTable ) - { - iPacketDataQoSRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdUmtsR99QoSAndOnTableRecord)); - - iPacketDataQoSRecord->SetRecordId( ServiceRecord().iUmtsR99QoSAndOnTable ); - - iPacketDataQoSRecord->LoadL( Session() ); - -// AddConverstionTableL( (CCDRecordBase**)&iPacketDataQoSRecord, NULL, SQoSDataConvTbl ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginPacketData::UpdateAdditionalRecordsL -// --------------------------------------------------------------------------- -// -void CCmPluginPacketData::UpdateAdditionalRecordsL() - { - LOGGER_ENTERFN( "CCmPluginPacketData::UpdateAdditionalRecordsL" ); - - if( !iPacketDataQoSRecord->RecordId() ) - { - iPacketDataQoSRecord->SetRecordId( KCDNewRecordRequest ); - iPacketDataQoSRecord->StoreL( Session() ); - } - else - { - iPacketDataQoSRecord->ModifyL( Session() ); - } - // Set service record to point to QoS record if it does not yet - if ( !ServiceRecord().iUmtsR99QoSAndOnTable ) - { - ServiceRecord().iUmtsR99QoSAndOnTable = iPacketDataQoSRecord->RecordId(); - ServiceRecord().ModifyL( Session() ); - } - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/src/cmpluginpacketdataproxy.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/src/cmpluginpacketdataproxy.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of packet data Plugin proxy table -* -*/ - - -#include -#include - -#include "cmpluginpacketdata.h" - -// Exported proxy for instantiation method resolution -// Define the interface UIDs -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KUidPacketDataBearerType, CCmPluginPacketData::NewL) - }; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/src/cmppacketdatasettingsdlg.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/src/cmppacketdatasettingsdlg.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,447 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Dialog for editing packet data settings for a packet data -* connection method -* -*/ - -// INCLUDE FILES - -// System -#include -#include -#include -#include -#include - -// User -#include "cmlogger.h" -#include "cmpacketdatacommonconstants.h" -#include -#include "cmppacketdatasettingsdlg.h" -#include "cmppacketdatasettingsdlgadv.h" -#include "cmpluginpacketdata.h" -#include "cmpluginmenucommands.hrh" -#include -#include -#include "cmmanagerimpl.h" - -using namespace CMManager; - -const TUint32 KPlainAuthSelectionItems[] = - { - R_QTN_SET_PASSWD_AUT_NORMAL, - R_QTN_SET_PASSWD_AUT_SECURE, - 0 - }; - -const TUint32 KPromptForAuthSelectionItems[] = - { - R_QTN_SET_PROMPT_PASSWD_NO, - R_QTN_SET_PROMPT_PASSWD_YES, - 0 - }; - -// ================= MEMBER FUNCTIONS ======================================= - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlg::NewL() -// Two-phase dconstructor, second phase is ConstructAndRunLD -// -------------------------------------------------------------------------- -// -CmPluginPacketDataSettingsDlg* CmPluginPacketDataSettingsDlg::NewL( - CCmPluginBaseEng& aCmPluginBase ) - { - CmPluginPacketDataSettingsDlg* self = - new ( ELeave ) CmPluginPacketDataSettingsDlg( aCmPluginBase ); - return self; - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlg::CmPluginPacketDataSettingsDlg() -// -------------------------------------------------------------------------- -// -CmPluginPacketDataSettingsDlg::CmPluginPacketDataSettingsDlg( - CCmPluginBaseEng& aCmPluginBase ) - : CmPluginBaseSettingsDlg( aCmPluginBase ) - , iNotifyFromSon( KCmNotifiedNone ) - { - - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlg::UpdateListBoxContentL -// -------------------------------------------------------------------------- -// -void CmPluginPacketDataSettingsDlg::UpdateListBoxContentL() - { - CmPluginBaseSettingsDlg::UpdateListBoxContentL(); - } - -//--------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlg::ConstructAndRunLD -// -------------------------------------------------------------------------- -// - -TInt CmPluginPacketDataSettingsDlg::ConstructAndRunLD( ) - { - CleanupStack::PushL( this ); - LoadResourceL( KPluginPacketDataResDirAndFileName ); - CleanupStack::Pop( this ); - - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherRegisterL( this ); - - return CmPluginBaseSettingsDlg::ConstructAndRunLD( ); - } - - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlg::~CmPluginPacketDataSettingsDlg -// Destructor -// -------------------------------------------------------------------------- -// -CmPluginPacketDataSettingsDlg::~CmPluginPacketDataSettingsDlg() - { - iResourceReader.Close(); - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::RunAdvancedSettingsL -// -------------------------------------------------------------------------- -// -void CmPluginPacketDataSettingsDlg::RunAdvancedSettingsL() - { - CmPluginPacketDataSettingsDlgAdv* advDlg = - CmPluginPacketDataSettingsDlgAdv::NewL( iCmPluginBaseEng ); - - // This view may have to un-register as watcher here - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherUnRegister(); - - advDlg->RegisterParentView( this ); - TInt ret = advDlg->ConstructAndRunLD(); - - if( iNotifyFromSon == KCmNotifiedNone ) - { - if( ret == KDialogUserExit ) - { - iExitReason = KDialogUserExit; - TryExitL( iExitReason ); - } - else - { - // Re-register as watcher if advanced view comes back or exists normally - cmMgr.WatcherRegisterL( this ); - } - } - else - { - HandleCommsDatChangeL(); - } - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::UpdateListBoxContentBearerSpecificL -// -------------------------------------------------------------------------- -// -void CmPluginPacketDataSettingsDlg::UpdateListBoxContentBearerSpecificL( - CDesCArray& aItemArray ) - { - LOGGER_ENTERFN( "CmPluginPacketDataSettingsDlg::UpdateListBoxContentBearerSpecificL" ); - - TBool boolSettingVal( EFalse ); // just for helping make code readable - - // DATA BEARER - only for real bearer types - AppendSettingTextsL( aItemArray, ECmBearerSettingName ); - // AP NAME - AppendSettingTextsL( aItemArray, EPacketDataAPName ); - // USER NAME - AppendSettingTextsL( aItemArray, EPacketDataIFAuthName ); - // PROMPT PASSWORD - boolSettingVal = iCmPluginBaseEng.GetBoolAttributeL( - EPacketDataIFPromptForAuth ); - AppendSettingTextsL( aItemArray, EPacketDataIFPromptForAuth, - boolSettingVal ? - R_QTN_SET_PROMPT_PASSWD_YES : - R_QTN_SET_PROMPT_PASSWD_NO ); - // PASSWORD - AppendSettingTextsL( aItemArray, EPacketDataIFAuthPass ); - // PASSWORD AUTHENTICATION - boolSettingVal = iCmPluginBaseEng.GetBoolAttributeL( - EPacketDataDisablePlainTextAuth ); - AppendSettingTextsL( aItemArray, - EPacketDataDisablePlainTextAuth, - boolSettingVal ? - R_QTN_SET_PASSWD_AUT_SECURE : - R_QTN_SET_PASSWD_AUT_NORMAL ); - // HOMEPAGE - AppendSettingTextsL( aItemArray, ECmStartPage ); - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlg::ChangeBoolSettingL -// -------------------------------------------------------------------------- -// -TBool CmPluginPacketDataSettingsDlg::ChangeBoolSettingL( TUint32 aAttribute, - TInt aCommandId ) - { - LOGGER_ENTERFN( "CmPluginPacketDataSettingsDlg::ChangeBoolSettingL" ); - - if ( aCommandId == EPluginBaseCmdChange ) - { - const TUint32* items = NULL; - TInt titleResId(0); - - // Add the list items - switch ( aAttribute ) - { - case EPacketDataDisablePlainTextAuth: - { - titleResId = R_QTN_SET_PASSWD_AUT; - items = KPlainAuthSelectionItems; - break; - } - case EPacketDataIFPromptForAuth: - { - titleResId = R_QTN_SET_PROMPT_PASSWD; - items = KPromptForAuthSelectionItems; - break; - } - default: - { - User::Leave( KErrNotSupported ); - } - } - - TInt selected = iCmPluginBaseEng.GetBoolAttributeL( aAttribute ); - TInt originalValue = selected; - if ( ShowRadioButtonSettingPageL( items, - selected, - titleResId ) && - originalValue != selected ) - { - iCmPluginBaseEng.SetBoolAttributeL( aAttribute, selected ); - UpdateListBoxContentL(); - } - - return selected; - } - else - { - TBool boolFromCM = boolFromCM = - iCmPluginBaseEng.GetBoolAttributeL( aAttribute ); - iCmPluginBaseEng.SetBoolAttributeL( aAttribute, !boolFromCM ); - UpdateListBoxContentL(); - return !boolFromCM; - } - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlg::ShowPopupSettingPageL -// -------------------------------------------------------------------------- -// -TBool CmPluginPacketDataSettingsDlg::ShowPopupSettingPageL( - TUint32 aAttribute, TInt aCommandId ) - { - LOGGER_ENTERFN( "CmPluginPacketDataSettingsDlg::ShowPopupSettingPageL" ); - - TBool retval = EFalse; - switch ( aAttribute ) - { - case EPacketDataIFAuthPass: - { - retval = ShowPopupPasswordSettingPageL( aAttribute ); - break; - } - case EPacketDataDisablePlainTextAuth: - case EPacketDataIFPromptForAuth: - { - ChangeBoolSettingL( aAttribute, aCommandId ); - break; - } - default: - { - CmPluginBaseSettingsDlg::ShowPopupSettingPageL( aAttribute, - aCommandId ); - break; - } - } - return retval; - } - - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlg::ProcessCommandL -// -------------------------------------------------------------------------- -// -void CmPluginPacketDataSettingsDlg::ProcessCommandL( TInt aCommandId ) - { - LOGGER_ENTERFN( "CmPluginPacketDataSettingsDlg::ProcessCommandL" ); - - if ( MenuShowing() ) - { - HideMenu(); - } - - switch ( aCommandId ) - { - case EPluginBaseCmdAdvanced: - { - RunAdvancedSettingsL(); - break; - } - case EPluginBaseCmdChange: // flow to EAknSoftkeyOk - case EAknSoftkeyOk: - { - TInt attrib = iSettingIndex->At( iListbox->CurrentItemIndex() ); - ShowPopupSettingPageL( attrib, aCommandId ); - break; - } - default: - { - CmPluginBaseSettingsDlg::ProcessCommandL( aCommandId ); - break; - } - } - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlg::OkToExitL -// -------------------------------------------------------------------------- -// -TBool CmPluginPacketDataSettingsDlg::OkToExitL( TInt aButtonId ) - { - TBool retval( EFalse ); - - switch ( aButtonId ) - { - case EPluginBaseCmdExit: - case EAknSoftkeyBack: - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherUnRegister(); - } - default: - { - retval = CmPluginBaseSettingsDlg::OkToExitL( aButtonId ); - break; - } - } - - return retval; - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlg::GetHelpContext -// -------------------------------------------------------------------------- -// - -void CmPluginPacketDataSettingsDlg::GetHelpContext( TCoeHelpContext& aContext ) const - { - LOGGER_ENTERFN( "CmPluginPacketDataSettingsDlg::GetHelpContext" ); - - aContext.iMajor = KHelpUidPlugin; - aContext.iContext = KSET_HLP_AP_SETTING_GPRS; - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlg::CommsDatChangesL -// -------------------------------------------------------------------------- -// -void CmPluginPacketDataSettingsDlg::CommsDatChangesL() - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - CCmDestinationImpl* parentDest = iCmPluginBaseEng.ParentDestination(); - - if ( parentDest ) - { - if( !cmMgr.DestinationStillExistedL( parentDest ) ) - { - cmMgr.WatcherUnRegister(); - // If parent destination diappears with some reason - // then the view must exit back to main view for it - // may be danger if going back to parent view - iExitReason = KDialogUserExit; - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - if( !cmMgr.IsIapStillInDestL( parentDest, iCmPluginBaseEng ) ) - { - cmMgr.WatcherUnRegister(); - // In this case, the view can go back to the parent view - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - // We may have to go back to parent view even though this Iap is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - } - else - { - if( !cmMgr.IapStillExistedL( iCmPluginBaseEng ) ) - { - cmMgr.WatcherUnRegister(); - // In this case, the dialog can go back to the parent view - TryExitL( iExitReason ); - return; - } - - // We may have to go back to parent view even though this Iap is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - } - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlg::NotifyParentView -// -------------------------------------------------------------------------- -// -void CmPluginPacketDataSettingsDlg::NotifyParentView( TInt aValue ) - { - iNotifyFromSon = aValue; - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlg::HandleCommsDatChangeL -// -------------------------------------------------------------------------- -// -void CmPluginPacketDataSettingsDlg::HandleCommsDatChangeL() - { - if( iNotifyFromSon == KCmNotifiedIapIsNotInThisDestination || - iNotifyFromSon == KCmNotifiedIapDisappear ) - { - TryExitL( iExitReason ); - } - else if( iNotifyFromSon == KCmNotifiedDestinationDisappear ) - { - iExitReason = KDialogUserExit; - TryExitL( iExitReason ); - } - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginpacketdata/src/cmppacketdatasettingsdlgadv.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginpacketdata/src/cmppacketdatasettingsdlgadv.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,493 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Dialog for setting packet data plugin advanced settings -* -*/ - -// INCLUDE FILES - -#include -#include -#include -#include -#include -#include -#include - -#include -#include "cmppacketdatasettingsdlgadv.h" -#include "cmpacketdatacommonconstants.h" -#include "cmpluginmultilinedialog.h" -#include -#include "cmpluginmenucommands.hrh" -#include "cmpluginpacketdata.h" -#include -#include -#include "cmmanagerimpl.h" - -using namespace CMManager; - -const TUint32 KDNSSelectionItems[] = - { - R_QTN_SET_IP_ADDRESS_DYNAMIC, - R_QTN_SET_IP_WELL_KNOWN, - R_QTN_SET_IP_USER_DEFINED, - 0 - }; - -const TUint32 KPDPSelectionItems[] = - { - R_GPRS_PLUGIN_VIEW_PDP_TYPE_IPV4, - R_GPRS_PLUGIN_VIEW_PDP_TYPE_IPV6, - 0 - }; - -// ================= MEMBER FUNCTIONS ======================================= - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlgAdv::NewL() -// Two-phase dconstructor, second phase is ConstructAndRunLD -// -------------------------------------------------------------------------- -// -CmPluginPacketDataSettingsDlgAdv* CmPluginPacketDataSettingsDlgAdv::NewL( - CCmPluginBaseEng& aCmPluginBase ) - { - CmPluginPacketDataSettingsDlgAdv* self = - new ( ELeave ) CmPluginPacketDataSettingsDlgAdv( aCmPluginBase ); - return self; - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlgAdv::CmPluginPacketDataSettingsDlgAdv() -// -------------------------------------------------------------------------- -// -CmPluginPacketDataSettingsDlgAdv::CmPluginPacketDataSettingsDlgAdv( - CCmPluginBaseEng& aCmPluginBase ) - : CmPluginBaseSettingsDlgAdv( aCmPluginBase ) - , iIpv6Supported( aCmPluginBase.FeatureSupported( KFeatureIdIPv6 ) ) - , iParent( NULL ) - { - iHelpContext = KSET_HLP_AP_SETTING_GPRS_AS; - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlgAdv::~CmPluginPacketDataSettingsDlgAdv -// Destructor -// -------------------------------------------------------------------------- -// -CmPluginPacketDataSettingsDlgAdv::~CmPluginPacketDataSettingsDlgAdv() - { - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlgAdv::ConstructAndRunLD -// -------------------------------------------------------------------------- -// -TInt CmPluginPacketDataSettingsDlgAdv::ConstructAndRunLD() - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherRegisterL( this ); - - return CmPluginBaseSettingsDlgAdv::ConstructAndRunLD(); - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlgAdv::UpdateListBoxContentBearerSpecificL -// -------------------------------------------------------------------------- -// -void CmPluginPacketDataSettingsDlgAdv::UpdateListBoxContentBearerSpecificL( - CDesCArray& aItemArray ) - { - TInt valueResId = 0; - TInt pdpType = RPacketContext::EPdpTypeIPv4; - - // Get the PDP type - EPdpTypeIPv4 by default - if ( iIpv6Supported ) - { - pdpType = iCmPluginBaseEng.GetIntAttributeL( EPacketDataPDPType ); - - // NETWORK (PDP) TYPE - AppendSettingTextsL( aItemArray, - EPacketDataPDPType, - pdpType == RPacketContext::EPdpTypeIPv6 ? - R_GPRS_PLUGIN_VIEW_PDP_TYPE_IPV6 : - R_GPRS_PLUGIN_VIEW_PDP_TYPE_IPV4 ); - } - - if ( pdpType != RPacketContext::EPdpTypeIPv6 ) - { - // IP ADDRESS - AppendSettingTextsL( aItemArray, EPacketDataIPAddr ); - } - - if ( iIpv6Supported ) - { - // DNS SERVERS IP ADDRESS - if ( pdpType == RPacketContext::EPdpTypeIPv6 ) - { - switch ( GetIPv6DNSTypeL( EPacketDataIPIP6NameServer1, - EPacketDataIPIP6NameServer2 ) ) - { - case EIPv6Unspecified: - { - valueResId = R_QTN_SET_IP_ADDRESS_DYNAMIC; - break; - } - case EIPv6WellKnown: - { - valueResId = R_QTN_SET_IP_WELL_KNOWN; - break; - } - case EIPv6UserDefined: - { - valueResId = R_QTN_SET_IP_USER_DEFINED; - break; - } - default: - { - User::Leave( KErrNotSupported ); - break; - } - } - } - else - { - if ( !iCmPluginBaseEng.GetBoolAttributeL( - EPacketDataIPDNSAddrFromServer ) ) - { - valueResId = R_QTN_SET_IP_USER_DEFINED; - } - else - { - valueResId = R_QTN_SET_DNS_SERVERS_AUTOMATIC; - } - } - AppendSettingTextsL( aItemArray, - EPacketDataIPIP6DNSAddrFromServer, - valueResId ); - } - else - { - // PRIMARY NAME SERVER - AppendSettingTextsL( aItemArray, EPacketDataIPNameServer1 ); - AppendSettingTextsL( aItemArray, EPacketDataIPNameServer2 ); - } - - // PROXY SETTINGS - // PROXY SERVER ADDRESS - AppendSettingTextsL( aItemArray, ECmProxyServerName ); - // PROXY PORT NUMBER - AppendSettingTextsL( aItemArray, ECmProxyPortNumber ); - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlgAdv::ShowPopupPacketDataIPDNSAddrFromServerL -// -------------------------------------------------------------------------- -// -void CmPluginPacketDataSettingsDlgAdv:: - ShowPopupPacketDataIPDNSAddrFromServerL() - { - TInt PDPType = iCmPluginBaseEng.GetIntAttributeL( EPacketDataPDPType ); - - if ( PDPType == RPacketContext::EPdpTypeIPv6 ) - { - ShowPopupIPv6DNSEditorL( KDNSSelectionItems, - EPacketDataIPIP6DNSAddrFromServer, - EPacketDataIPIP6NameServer1, - EPacketDataIPIP6NameServer2 ); - } - else //ipv4 - { - ShowPopupIPv4DNSEditorL( EPacketDataIPDNSAddrFromServer, - EPacketDataIPNameServer1, - EPacketDataIPNameServer2 ); - } - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlgAdv::ShowPopupSettingPageL -// -------------------------------------------------------------------------- -// -TBool CmPluginPacketDataSettingsDlgAdv::ShowPopupSettingPageL( - TUint32 aAttribute, TInt aCommandId ) - { - TBool retval = EFalse; - - switch ( aAttribute ) - { - // IPDNS Settings - case EPacketDataIPDNSAddrFromServer: - case EPacketDataIPIP6DNSAddrFromServer: - { - ShowPopupPacketDataIPDNSAddrFromServerL(); - break; - } - case EPacketDataPDPType: - { - if ( aCommandId == EAknSoftkeyOk ) - { - TInt intFromCM = 0; - TRAPD( err, intFromCM = iCmPluginBaseEng.GetIntAttributeL( - aAttribute ) ); - - if ( !err ) - { - intFromCM == RPacketContext::EPdpTypeIPv6 ? - intFromCM = RPacketContext::EPdpTypeIPv4 : - intFromCM = RPacketContext::EPdpTypeIPv6; - } - else - { - User::Leave( KErrNotSupported ); - } - - iCmPluginBaseEng.SetIntAttributeL( aAttribute, intFromCM ); - UpdateListBoxContentL(); - } - else - { - if ( aCommandId == EPluginBaseCmdChange ) - - { - ShowPDPTypeRBPageL( aAttribute ); - } - else - { - TInt pdpType = iCmPluginBaseEng.GetIntAttributeL( EPacketDataPDPType ); - pdpType = pdpType == RPacketContext::EPdpTypeIPv4 ? - RPacketContext::EPdpTypeIPv6 : - RPacketContext::EPdpTypeIPv4; - iCmPluginBaseEng.SetIntAttributeL( aAttribute, pdpType ); - UpdateListBoxContentL(); - } - } - break; - } - // IP Setting Page - case EPacketDataIPNameServer1: - case EPacketDataIPNameServer2: - case EPacketDataIPAddr: - { - ShowPopupIpSettingPageL( aAttribute ); - break; - } - // Text Settings - case ECmProxyServerName: - { - retval = ShowPopupTextSettingPageL( aAttribute ); - break; - } - // Numeric Settings - case ECmProxyPortNumber: - { - if ( ShowPopupPortNumSettingPageL( aAttribute ) ) - { - retval = ETrue; - } - break; - } - default: - { - CmPluginBaseSettingsDlgAdv::ShowPopupSettingPageL( aAttribute, - aCommandId ); - break; - } - } - return retval; - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlgAdv::ProcessCommandL -// -------------------------------------------------------------------------- -// -void CmPluginPacketDataSettingsDlgAdv::ProcessCommandL( TInt aCommandId ) - { - if ( MenuShowing() ) - { - HideMenu(); - } - - switch ( aCommandId ) - { - case EPluginBaseCmdExit: - { - iExitReason = KDialogUserExit; // flow to EAknSoftkeyBack - } - case EAknSoftkeyBack: - { - TryExitL( iExitReason ); - break; - } - case EAknSoftkeyOk: - case EPluginBaseCmdChange: - { - TInt attrib = iSettingIndex->At( iListbox->CurrentItemIndex() ); - ShowPopupSettingPageL( attrib, aCommandId ); - - if ( iHasSettingChanged ) - { - iHasSettingChanged = EFalse; // Don't call UpdateL at this stage - } - break; - } - default: - { - CmPluginBaseSettingsDlgAdv::ProcessCommandL( aCommandId ); - - if ( iHasSettingChanged ) - { - iHasSettingChanged = EFalse; // Don't call UpdateL at this stage - } - break; - } - } - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlgAdv::OkToExitL -// -------------------------------------------------------------------------- -// -TBool CmPluginPacketDataSettingsDlgAdv::OkToExitL( TInt aButtonId ) - { - TBool retval( EFalse ); - switch ( aButtonId ) - { - case EPluginBaseCmdExit: - case EAknSoftkeyBack: - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherUnRegister(); - } - default: - { - retval = CmPluginBaseSettingsDlgAdv::OkToExitL( aButtonId ); - break; - } - } - - return retval; - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlgAdv::ShowPDPTypeRBPageL -// -------------------------------------------------------------------------- -// -void CmPluginPacketDataSettingsDlgAdv::ShowPDPTypeRBPageL( TUint32 aAttribute ) - { - TInt selected = iCmPluginBaseEng.GetIntAttributeL( aAttribute ); - - TInt originalValue = selected; - - if ( ShowRadioButtonSettingPageL( KPDPSelectionItems, - selected, - R_GPRS_PLUGIN_VIEW_PDP_TYPE ) && - originalValue != selected ) - { - iCmPluginBaseEng.SetIntAttributeL( aAttribute , selected ); - UpdateListBoxContentL(); - } - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlgAdv::RegisterParentView -// -------------------------------------------------------------------------- -// -void CmPluginPacketDataSettingsDlgAdv::RegisterParentView( CCmParentViewNotifier* aParent ) - { - iParent = aParent; - } - -// -------------------------------------------------------------------------- -// CmPluginPacketDataSettingsDlgAdv::CommsDatChangesL -// -------------------------------------------------------------------------- -// -void CmPluginPacketDataSettingsDlgAdv::CommsDatChangesL() - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - CCmDestinationImpl* parentDest = iCmPluginBaseEng.ParentDestination(); - - if ( parentDest ) - { - if( !cmMgr.DestinationStillExistedL( parentDest ) ) - { - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedDestinationDisappear ); - } - - cmMgr.WatcherUnRegister(); - // If parent destination is deleted by somebody then the dialog must exit back to main view - iExitReason = KDialogUserExit; - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - if( !cmMgr.IsIapStillInDestL( parentDest, iCmPluginBaseEng ) ) - { - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapIsNotInThisDestination ); - } - - cmMgr.WatcherUnRegister(); - // In this case, the dialog can go back to the parent view - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - // We may have to notify parent view to go back to its parent view even though this Iap is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapDisappear ); - } - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - } - else - { - if( !cmMgr.IapStillExistedL(iCmPluginBaseEng) ) - { - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapDisappear ); - } - - cmMgr.WatcherUnRegister(); - // In this case, the dialog can go back to the parent view - TryExitL( iExitReason ); - return; - } - - // We may have to notify parent view to go back to its parent view even though this Iap is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapDisappear ); - } - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - } - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/data/10281BBE.rss --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/data/10281BBE.rss Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ECom resource descriptor for VPN plug-in -* -*/ - -#include "ecom/registryinfo.rh" - -// Because attribute enums had to be added to namespace CMManager -// it's not possible to included cmpluginvpndef.h. -// Thus bearer type id had to be redefined here. -#define KPluginVPNBearerTypeUid 0x10281BBD - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = 0x10281BBE; - interfaces = - { - INTERFACE_INFO - { - interface_uid = 0x10207377; // = KCMPluginInterfaceUid. Do NOT modify it!!! - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KPluginVPNBearerTypeUid; - version_no = 1; - display_name = "VPN"; - default_data = "VPN"; - opaque_data = ""; - } - }; - } - }; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/data/cmpluginvpnui.rss --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/data/cmpluginvpnui.rss Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,317 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Localisation file for VPN plug-in -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "cmmanager.hrh" - -NAME CMVP - -RESOURCE RSS_SIGNATURE { } - -RESOURCE TBUF { buf = "VPN"; } - -// -------------------------------------------------------------------------- -// r_qtn_netw_conset_bearer_supported_vpn -// localised string -// returned string the attribute: ECmBearerSupportedName -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_bearer_supported_vpn - { - buf = qtn_netw_conset_bearer_supported_vpn; - } - -// -------------------------------------------------------------------------- -// r_qtn_netw_conset_method_name_vpn -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_method_name_vpn - { - buf = qtn_netw_conset_method_name_vpn; - } - -// -------------------------------------------------------------------------- -// r_qtn_vpn_info_vpn_iap_incomplete -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_vpn_info_vpn_iap_incomplete - { - buf = qtn_vpn_info_vpn_iap_incomplete; - } - -// -------------------------------------------------------------------------- -// r_qtn_vpn_sett_vpn_iap_policy_reference -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_vpn_sett_vpn_iap_policy_reference - { - buf = qtn_vpn_sett_vpn_iap_policy_reference; - } - -// -------------------------------------------------------------------------- -// r_qtn_vpn_info_no_policies_installed -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_vpn_info_no_policies_installed - { - buf = qtn_vpn_info_no_policies_installed; - } - -// -------------------------------------------------------------------------- -// r_qtn_vpn_sett_vpn_iap_real_netw_reference -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_vpn_sett_vpn_iap_real_netw_reference - { - buf = qtn_vpn_sett_vpn_iap_real_netw_reference; - } - -// -------------------------------------------------------------------------- -// r_qtn_vpn_sett_vpn_iap_policy_reference_compulsory -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_vpn_sett_vpn_iap_policy_reference_compulsory - { - buf = qtn_vpn_sett_vpn_iap_policy_reference_compulsory; - } - -// -------------------------------------------------------------------------- -// r_qtn_vpn_sett_vpn_iap_policy_reference_compulsory -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_vpn_sett_vpn_iap_real_netw_ref_compulsory - { - buf = qtn_vpn_sett_vpn_iap_real_netw_ref_compulsory; - } - -// -------------------------------------------------------------------------- -// r_qtn_vpn_info_mgmt_ui_not_accessible -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_vpn_info_mgmt_ui_not_accessible - { - buf = qtn_vpn_info_mgmt_ui_not_accessible; - } - - -// -------------------------------------------------------------------------- -// r_qtn_netw_conset_prmpt_vpn_policy -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_prmpt_vpn_policy - { - buf = qtn_netw_conset_prmpt_vpn_policy; - } - -// -------------------------------------------------------------------------- -// r_qtn_netw_conset_prmpt_vpn_real_connection -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_prmpt_vpn_real_connection - { - buf = qtn_netw_conset_prmpt_vpn_real_connection; - } - -// -------------------------------------------------------------------------- -// r_qtn_netw_conset_conn_methods_amount_many -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_conn_methods_amount_many - { - buf = qtn_netw_conset_conn_methods_amount_many; - } - -// -------------------------------------------------------------------------- -// r_qtn_netw_conset_conn_methods_amount_many -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_conn_methods_amount_one - { - buf = qtn_netw_conset_conn_methods_amount_one; - } - -// -------------------------------------------------------------------------- -// r_qtn_netw_conset_vpn_easy_wlan -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_vpn_easy_wlan - { - buf = qtn_netw_conset_vpn_easy_wlan; - } - -// -------------------------------------------------------------------------- -// r_qtn_netw_conset_vpn_easy_wlan_prompt -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_vpn_easy_wlan_prompt - { - buf = qtn_netw_conset_vpn_easy_wlan_prompt; - } - -// -------------------------------------------------------------------------- -// r_qtn_netw_conset_info_no_cm_to_bind_to -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_info_no_cm_to_bind_to - { - buf = qtn_netw_conset_info_no_cm_to_bind_to; - } - -// -------------------------------------------------------------------------- -// r_qtn_vpn_quest_vpn_iap_incomplete_delete -// localised string -// -------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_vpn_quest_vpn_iap_incomplete_delete - { - buf = qtn_vpn_quest_vpn_iap_incomplete_delete; - } - -// ----------------------------------------------------------------------------- -// r_softkeys_options_back__options -// option/options/cancel button set -// ----------------------------------------------------------------------------- -RESOURCE CBA r_softkeys_options_cancel__select - { - buttons = - { - CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_cancel; }, - CBA_BUTTON { id = ECmManagerUiCmdDestSelect;txt = text_softkey_select; } - }; - } - -// -------------------------------------------------------------------------- -// r_vpn_real_cm_selection_list -// real connection selection dialog with destination support -// -------------------------------------------------------------------------- -RESOURCE AVKON_LIST_QUERY r_vpn_real_cm_selection_list - { - flags = EGeneralQueryFlags; - softkeys = r_softkeys_options_cancel__select; - items = - { - AVKON_LIST_QUERY_DLG_LINE - { - control = AVKON_LIST_QUERY_CONTROL - { - listtype = EAknCtDoubleLargeGraphicPopupMenuListBox; - listbox = AVKON_LIST_QUERY_LIST - { - flags = EAknListBoxSelectionList; - }; - heading = qtn_netw_conset_prmpt_vpn_real_connection; - }; - } - }; - } - - -// -------------------------------------------------------------------------- -// r_vpn_real_cm_radio_button_setting_page -// underlying connection _method_ setting page -// -------------------------------------------------------------------------- - -RESOURCE LISTBOX r_vpn_setting_app_listbox - { - flags = EEikListBoxMultipleSelection; - } - -RESOURCE AVKON_SETTING_PAGE r_vpn_real_cm_radio_button_setting_page - { - number = EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT; - type = EAknSetListBox; - editor_resource_id= r_vpn_setting_app_listbox; - } - - -// -------------------------------------------------------------------------- -// Menu bars -// -------------------------------------------------------------------------- -// -// r_vpn_real_cm_selection_menubar -// menubar for the VPN real connection selection dialog -// -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_BAR r_vpn_real_cm_selection_menubar - { - titles = - { - MENU_TITLE - { - menu_pane = r_vpn_real_cm_selection_menu; - txt = "App"; - } - }; - } -// ----------------------------------------------------------------------------- -// -// r_vpn_real_cm_selection_menu -// menu pane for destination list -// -// ----------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_vpn_real_cm_selection_menu - { - items = - { - MENU_ITEM - { - command = ECmManagerUiCmdDestSelect; - txt = qtn_set_cmd_select; - flags = EEikMenuItemAction; - } - ,MENU_ITEM - { - command = ECmManagerUiCmdCMSelect; - txt = qtn_netw_conset_options_select_method; - flags = EEikMenuItemSpecific; - } - ,MENU_ITEM - { - command = EAknCmdHelp; - txt = qtn_options_help; - } - }; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/group/bld.inf --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/group/bld.inf Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build information file for VPN plug-in -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -// export localised loc file -../loc/cmpluginvpn.loc MW_LAYER_LOC_EXPORT_PATH(cmpluginvpn.loc) - -PRJ_MMPFILES -cmpluginvpn.mmp - -PRJ_EXTENSIONS -START EXTENSION s60/mifconv -OPTION TARGETFILE cmpluginvpn.mif -OPTION HEADERFILE cmpluginvpn.mbg -OPTION SOURCES -c8,1 qgn_prop_vpn_access_point -END diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/group/cmpluginvpn.mmp --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/group/cmpluginvpn.mmp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project specification for VPN plug-in -* -*/ - -#include -#include - -TARGET cmpluginvpn.dll -UID 0x10009D8D 0x10281BBE - -TARGETTYPE PLUGIN - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -SOURCEPATH ../src - -SOURCE cmpluginproxyvpn.cpp -SOURCE cmpluginvpn.cpp -SOURCE cmpvpnsettingsdlg.cpp -SOURCE cmpvpnpolicyselectiondlg.cpp -SOURCE cmpvpnnextlayerselectdlg.cpp -SOURCE ../../../Framework/Src/cmlogger.cpp - -SOURCEPATH ../data - -START RESOURCE 10281BBE.rss -TARGET cmpluginvpn.rsc -END - -START RESOURCE cmpluginvpnui.rss -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - -USERINCLUDE ../data -USERINCLUDE ../../../Framework/Inc -USERINCLUDE ../../../Framework/SrcData - -// Component specific internal headers -USERINCLUDE ../inc - -// ADO specific internal headers -SYSTEMINCLUDE ../../../../../inc - -//Macro to /epoc32 headers -MW_LAYER_SYSTEMINCLUDE - -#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -APP_LAYER_SYSTEMINCLUDE -#endif - -LIBRARY hlplch.lib -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY cmmanager.lib -LIBRARY commsdat.lib -LIBRARY aknskins.lib -LIBRARY efsrv.lib -LIBRARY CommonEngine.lib -LIBRARY cone.lib eikcore.lib avkon.lib -LIBRARY eikcoctl.lib eikdlg.lib -LIBRARY bafl.lib -LIBRARY vpnapi.lib -LIBRARY centralrepository.lib -LIBRARY featmgr.lib -LIBRARY cmmanagerdatabase.lib -DEBUGLIBRARY flogger.lib diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/group/cmpluginvpn_icons.mk --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/group/cmpluginvpn_icons.mk Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -# -# Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: Makefile for icons of VPN plug-in -# - -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z -else -ZDIR=\epoc32\data\z -endif - - -TARGETDIR=$(ZDIR)\resource\apps -ICONTARGETFILENAME=$(TARGETDIR)\cmpluginvpn.mif - -HEADERDIR=\epoc32\include -HEADERFILENAME=$(HEADERDIR)\cmpluginvpn.mbg - -do_nothing : - @rem do_nothing - -MAKMAKE : do_nothing - -BLD : do_nothing - -CLEAN : do_nothing - -LIB : do_nothing - -CLEANLIB : do_nothing - -# ---------------------------------------------------------------------------- -# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by -# MifConv if the mask detph is defined. -# -# NOTE 2: Usually, source paths should not be included in the bitmap -# definitions. MifConv searches for the icons in all icon directories in a -# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps. -# The directory \s60\icons is included in the search only if the feature flag -# __SCALABLE_ICONS is defined. -# ---------------------------------------------------------------------------- - -RESOURCE : - mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ - /c8,1 qgn_prop_vpn_access_point.bmp - -FREEZE : do_nothing - -SAVESPACE : do_nothing - -RELEASABLES : - @echo $(HEADERFILENAME)&& \ - @echo $(ICONTARGETFILENAME) - -FINAL : do_nothing diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/inc/cmpluginvpn.h --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/inc/cmpluginvpn.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,313 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: VPN plugin IF implementation class. -* -*/ - -#ifndef VPN_PLUGIN_INCLUDED -#define VPN_PLUGIN_INCLUDED - -#include -#include -#include - -#include - -#include - -using namespace CommsDat; - -class CCDVirtualIAPNextLayerRecord; - -/** - * VPN Plugin IF implementation class - * @since S60 3.2 - */ -NONSHARABLE_CLASS(CCmPluginVpn) : public CCmPluginBaseEng - { - - public: // Constructors and destructor - - /** - * Two phased constructor. Leaves on failure. - * @return The created object. - */ - static CCmPluginVpn* NewL( TCmPluginInitParam* aInitParam ); - - /** - * Destructor. - */ - virtual ~CCmPluginVpn(); - - virtual CCmPluginBaseEng* CreateInstanceL( TCmPluginInitParam& aInitParam ) const; - - public: - - /** - * Gets the value for a TInt attribute. - * @param aAttribute Identifies the attribute to be retrived. - * @param aValue On completion, contains the requested TInt attribute. - * @return None. - */ - virtual TUint32 GetIntAttributeL( const TUint32 aAttribute ) const; - - /** - * Gets the value for a TBool attribute. - * @param aAttribute Identifies the attribute to be retrived. - * @param aValue On completion, contains the requested TBool attribute. - * @return None. - */ - virtual TBool GetBoolAttributeL( const TUint32 aAttribute ) const; - - /** - * Gets the value for a String16 attribute. - * @param aAttribute Identifies the attribute to be retrived. - * @param aValue On completion, contains the requested TDes16 attribute. - * @return None. - */ - virtual HBufC* GetStringAttributeL( const TUint32 aAttribute ) const; - - /** - * Gets the value for a String8 attribute. - * @param aAttribute Identifies the attribute to be retrived. - * @return copy of the requested attribute. Ownership is passed. - */ - virtual HBufC8* GetString8AttributeL( const TUint32 aAttribute ) const; - - /** - * Sets the value for a TInt attribute. - * @param aAttribute Identifies the attribute to be set. - * @param aValue The value to be set. - * @return None. - */ - virtual void SetIntAttributeL( const TUint32 aAttribute, TUint32 aValue ); - - /** - * Sets the value for a TBool attribute. - * @param aAttribute Identifies the attribute to be set. - * @param aValue The value to be set. - * @return None. - */ - virtual void SetBoolAttributeL( const TUint32 aAttribute, TBool aValue ); - - /** - * Sets the value for a String16 attribute. - * @param aAttribute Identifies the attribute to be set. - * @param aValue The value to be set. - * @return None. - */ - virtual void SetStringAttributeL( const TUint32 aAttribute, - const TDesC16& aValue ); - - /** - * Sets the value for a String8 attribute. - * @param aAttribute Identifies the attribute to be set. - * @param aValue The value to be set. - * @return None. - */ - virtual void SetString8AttributeL( const TUint32 aAttribute, - const TDesC8& aValue ); - - - void UpdatePolicyNameL(); - - /** - * Puts the currently available bindable destinations into the - * passed array. The array is emptied before appending the values. - * It contains only real destinations, no uncategorised - * or any other, created ones (Always ask, DefaultConnection, etc) - */ - void BindableDestinationsL( RArray& aDestinationArray ); - - /** - * Change the VPN connection method name when using - * 'Search for WLAN' functionality - */ - HBufC* GenerateVPNPointToWLANNetworkLC(RResourceFile& rf, HBufC*& aName); - - public: // From CCmPluginBaseEng - - /** - * Restore the original value of the attribute from commsdat field. - * Base implementation can be used only with attributes - * stored directly in commsdat. - * @param aAttribute attribute to be restored - */ - virtual void RestoreAttributeL( const TUint32 aAttribute ); - - /** - * Override the load to be able to handle post-processing - * - */ - virtual void LoadL( TUint32 aIapId ); - - virtual TBool CanHandleIapIdL( TUint32 aIapId ) const; - virtual TBool CanHandleIapIdL( CCDIAPRecord *aIapRecord ) const; - - virtual TInt RunSettingsL(); - virtual void LoadServiceSettingL(); - virtual void LoadAdditionalRecordsL(); - - virtual void UpdateAdditionalRecordsL(); - - virtual TBool InitializeWithUiL( TBool aManuallyConfigure ); - - virtual void ServiceRecordIdLC( HBufC* &aServiceName, - TUint32& aRecordId ); - - virtual void BearerRecordIdLC( HBufC* &aBearerName, - TUint32& aRecordId ); - - virtual void PrepareToUpdateRecordsL(); - - virtual TBool IsLinkedToIap( TUint32 aIapId ); - virtual TBool IsLinkedToSnap( TUint32 aSnapId ); - - virtual void CreateNewL(); - - /** - * From CCmPluginBaseEng - * Deletes additional records, in this case, the WLAN records - * - * @since S60 3.2 - */ - void DeleteAdditionalRecordsL(); - - protected: - - virtual void AdditionalReset(); - - private: // Constructors - - /** - * Constructor. - */ - CCmPluginVpn( TCmPluginInitParam* aInitParam ); - - /** - * Second phase constructor. Leaves on failure. - * @param - */ - void ConstructL(); - - private: - - CCDVPNServiceRecord& ServiceRecord() const; - - TBool ServiceRecordExists() const; - - virtual void CreateNewServiceRecordL(); - virtual void CreateAdditionalRecordsL(); - - virtual void UpdateServiceRecordL(); - - /** - * Displays a list of installed VPN policies for user selection - * and updates the setting - * - * @since S60 3.2 - * @return the soft key selection - */ - TBool ShowPolicySelectionDlgL(); - - /** - * Shows a dialog for selecting the underlying connection method - * - * @since S60 3.2 - * @return ETrue if success - */ - TBool ShowRealConnectionSelectionDlgL(); - - /** - * Checks whether there are connection methods or destinations which - * the VPN connection method can bind to - * - * @since S60 3.2 - * @return ETrue found - */ - TBool BindableRealConnectionsExistL(); - - void GenerateDefaultCmNameL(); - - /** - * Returns whether the passed destination can be used as an underlying - * connection method for this particular CM. - * It can be used if it does not points to VPN in any way, directly or - * indirectly, it has at least one, non-virtual CM and - * it does not links back to our parent destination. - * The returned value is a bit field defined in the src file and - * it holds the following informations: - * IsEmpty, ContainsVPN(in any link), LinksBackToPArentDest and - * HasNonVirtualCM to be able to decide if it is suitable. - * Used only internally. - */ - TUint32 CanDestUsedAsUnderlyingConnectionL( TUint32 aDestinationId ); - - - /** - * Checks whether the destination/CM passed to it has a VPN connection - * up-stream (there is a path from a VPN to this item through indirections). - * - * @param aId The id of the destination/connmethod in question. - * @param aIsDestination ETrue if the passed id is to be considered - * that of a destination, EFalse otherwise. - * @return ETrue if this entity is pointed to (in/directly) by a VPN. - */ - TBool HasUpstreamVpnL( TUint32 aId, TBool aIsDestination ); - - /** - * Checks and converts the id of the destination if needed - * - * @param aDestination the id of the destination - * @since S60 5.2 - * @return the correct id of the destination - * or leaves with the error code KErrArgument - */ - TInt CheckValidityAndConvertDestinationIdL( TUint32 aDestinationId ); - - /** - * Retrieves default APs from the Tier Record of given identifier. - * - * @param aTierIdentifier identifier for tier record. - * @since S60 5.2 - * @return an elementid id of the default AP record in tier record. - */ - const TMDBElementId DefaultAPRecordL( const TInt aTierIdentifier = KAfInet ); - - public: - /** - * Scans aDests for destinations that may be valid parents - * for this plugin and removes those that may not. - * @param aDests The array of destination IDs to be filtered. - */ - virtual void FilterPossibleParentsL( RArray& aDests ); - - // finds the parent destination of the connmethod with the given ID - TUint32 FindParentDestinationL( TUint32 aCmId ); - - private: // Data - - CCmPluginBaseEng* iRealCM; - CCDVirtualIAPNextLayerRecord* iVirtualRecord; - TMDBElementId iVirtualTableId; - HBufC* iPolicyName; - - /** - * An array of the bindable destinations, - * including (if supported) the uncategorised destation and easy wlan - */ - RArray iBindableMethods; - }; - -#endif // VPN_PLUGIN_INCLUDED diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/inc/cmpvpnnextlayerselectdlg.h --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/inc/cmpvpnnextlayerselectdlg.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,252 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Popup for selecting the underlying connection method or -* destination for a VPN connection method -* -*/ - -#ifndef CMPVPN_NEXT_LAYER_SELECT_DLG_H -#define CMPVPN_NEXT_LAYER_SELECT_DLG_H - -#include -#include // CAknListQueryDialog - -#include // resource reader - -class CEikonEnv; -class CCmPluginBaseEng; -class CCmManagerImpl; -class CGulIcon; - - - -/** - * CmPluginVpnNextLayerSelectDlg dialog class - * - * - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CmPluginVpnNextLayerSelectDlg ) : public CAknListQueryDialog - { - public: // Constructors and destructor - - static CmPluginVpnNextLayerSelectDlg* NewL( - CCmPluginBaseEng& aCmPluginBaseEng, - RArray& aBindableMethods, - TBool& aSnapSelected, - TUint32& aNextLayerId ); - - /** - * Destructor. - */ - virtual ~CmPluginVpnNextLayerSelectDlg(); - - - private: // Constructor - - /** - * Constructor. - */ - CmPluginVpnNextLayerSelectDlg( CCmPluginBaseEng& aCmPluginBaseEng, - RArray& aBindableMethods, - TBool& aSnapSelected, - TUint32& aNextLayerId, - TInt aDummyIndex ); - - /** - * Second phase constructor. Leaves on failure. - */ - void ConstructL(); - - public: // new - - static TInt CancelAsynchronouslyL( TAny* aObject ); - - - protected: // From CAknListQueryDialog - - /** - * @see CAknListQueryDialog - */ - virtual void PreLayoutDynInitL(); - - /** - * @see CAknListQueryDialog - */ - TBool OkToExitL( TInt aButtonId ); - - public: // From CAknListQueryDialog - - /** - * @see CAknListQueryDialog - */ - void ProcessCommandL( TInt aCommandId ); - - /** - * @see CAknListQueryDialog - */ - void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); - - /** - * @see CAknListQueryDialog - */ - void HandleListBoxEventL( CEikListBox* aListBox, - TListBoxEvent aEventType ); - - - public: // From CCoeControl - - /** - * Returns the help context - * From CCoeControl - * - * @since S60 3.2 - * @param aContext the returned help context - */ - void GetHelpContext( TCoeHelpContext& aContext ) const; - - /** - * From CCoeControl - * - * @since S60 3.2 - * @param aKeyEvent The key event. - * @param aType Key event type. - * @return key response (was the key event consumed?). - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ); - - - private: // new functions - - /* - * Load the given resource file - * - * @since S60 3.2 - * @param aResFileName - */ - void LoadResourceL( const TDesC& aResFileName ); - - /* - * Formats the texts for the list items using given resources - * - * @param aFirstLineResId the resource Id for the first line - * @param aSecondLineResId the resource Id for the second line - * @param aIconIndex the icon's index value - * @return the formatted text - */ - HBufC* FormatListItemTextsLC( TInt aFirstLineResId, - TInt aSecondLineResId, - TInt aIconIndex ); - - /** - */ - HBufC* FormatListItemTextsLC( TInt aFirstLineResId, - const TDesC& aSecondLineText, - TInt aIconIndex ); - - /** - */ - HBufC* FormatListItemTextsLC( const TDesC& aFirstLineResId, - const TDesC& aSecondLineText, - TInt aIconIndex ); - - /** - */ - HBufC* FormatListItemTextsL( const TDesC& aFirstLineText, - const TDesC& aSecondLineText, - TInt aIconIndex ); - - /** - * Displays a radio button selection dialog to select the - * underlying connection method - * - * @since S60 3.2 - * @param aDestinationId the destination id to search - * @param aCmId the selection as a return value - * @return ETrue if selection made EFalse if cancelled - */ - TBool ShowCMSelectionDlgL( TUint32 aDestinationId, - TUint32& aCmId ); - - void SetTextsAndIconsL(); - - void AppendDestinationTextsL( CCmDestinationImpl& aDestination, - TInt aNumCms, - CDesCArray& aItems, - CArrayPtr& aIcons ); - - void AppendUncatDestinationL( CDesCArray& aItems, - CArrayPtr& aIcons ); - - void AppendEasyWlanL( CDesCArray& aItems, - CArrayPtr& aIcons ); - - - private: // data members - - /** - * Eikon environment - */ - CEikonEnv& iMyEikonEnv; - - /** - * base class not owned - */ - CCmPluginBaseEng& iCmPluginBaseEng; - - /** - * Result of selection: ETrue if a SNAP was selected - */ - TBool& iSnapSelected; - - /** - * Result of selection: The ID of the connection method or SNAP - */ - TUint32& iNextLayerId; - - /** - * Resource reader - */ - RConeResourceLoader iResourceReader; - - /** - * An array containing all of the destination's ids - */ - RArray& iDestinations; - - /** - * The id of EasyWlan ( zero if none ) - */ - TUint32 iEasyWlanId; - - /** - * access to the cmmanager - */ - CCmManagerImpl& iCmManager; // not owned - - /** - * Flag to determine if there are uncategorised connection methods - */ - TBool iUncatItems; - - /** - * One shot active object for asynchronous exiting with Cancel - */ - CAsyncCallBack* iAsyncCancel; - - - }; -#endif // CMPVPN_NEXT_LAYER_SELECT_DLG_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/inc/cmpvpnpolicyselectiondlg.h --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/inc/cmpvpnpolicyselectiondlg.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Displays a selection list of VPN policies -* -*/ - -#ifndef CMPLUGINVPN_POLICYSELECTION_DLG_H -#define CMPLUGINVPN_POLICYSELECTION_DLG_H - -// includes -#include -#include -#include - -// forward declarations -class CCmPluginBaseEng; - -/** - * CmPluginPacketDataSettingsDlg dialog class - * - * - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CmPluginVpnPolicySelectionDlg ) : public CBase - { - public: // Constructors and destructor - - static CmPluginVpnPolicySelectionDlg* NewL( - CCmPluginBaseEng& aCmPluginBaseEng ); - - /** - * Destructor. - */ - virtual ~CmPluginVpnPolicySelectionDlg(); - - public: // New functions - - /** - * Shows the VPN policies in and a popup list and if a selection is - * made, EVpnServicePolicyName is set - * - * @since S60 3.2 - * @return ETrue if a selection was made - */ - TBool ShowPolicySelectionListL(); - - /** - * Shows the VPN policies in and a radio button list and if a selection is - * made, EVpnServicePolicyName is set - * - * @since S60 3.2 - * @return ETrue if a selection was made - */ - TBool ShowPolicySelectionDlgL(); - - private: // Constructor - - /** - * Constructor. - */ - CmPluginVpnPolicySelectionDlg( CCmPluginBaseEng& aCmPluginBaseEng ); - - /** - * Second phase constructor. Leaves on failure. - */ - void ConstructL(); - - private: // New functions - - /** - * Loads a resource file. - * - * @since S60 3.2 - * @param aResFileName the resource file name. - */ - void LoadResourceL( const TDesC& aResFileName ); - - /** - * Pop-up note that VPN client is inaccessible - * - * @since S60 3.2 - */ - void VpnClientInaccessibleL(); - - private: // data members - - /** - * base class reference, NOT OWNED - */ - CCmPluginBaseEng& iCmPluginBaseEng; - - /** - * resource reader - */ - RConeResourceLoader iResourceReader; - - /** - * VPN server - */ - RVpnServ iVpnServ; - - /** - * array of VPN policies - OWNED - */ - CArrayFixFlat* iPolicyInfoList; - - /** - * flag for when vpn is not accessible. used to make sure the - * dialog indicating it is inaccessible is not displayed both - * on connect and close - */ - TBool iVpnClientUnaccessible; - - /** - * the number of VPN policies - */ - TInt iNumPolicies; - }; - -#endif // CMPLUGINVPN_POLICYSELECTION_DLG_H \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/inc/cmpvpnsettingsdlg.h --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/inc/cmpvpnsettingsdlg.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declares a settings dialog for a VPN connection -* method plugin -* -*/ - -#ifndef CMPLUGINVPN_SETTINGS_DLG_H -#define CMPLUGINVPN_SETTINGS_DLG_H - -// INCLUDES -#include -#include -#include -#include "cmcommsdatnotifier.h" - -// CLASS DECLARATION - -/** - * CmPluginVpnSettingsDlg dialog class - * - * Displays the VPN data settings - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CmPluginVpnSettingsDlg ) : public CmPluginBaseSettingsDlg - , public MCmCommsDatWatcher - { - public: // Constructors and destructor - - /** - * Two-phase constructor - * - * @since S60 3.2 - * @param aCmPluginBaseEng The connection method to use - * @return instance of the class - */ - static CmPluginVpnSettingsDlg* NewL( CCmPluginBaseEng& - aCmPluginBaseEng ); - - /** - * Destructor. - */ - virtual ~CmPluginVpnSettingsDlg(); - - public: // From CmPluginBaseSettingsDlg - - - /** - * From CmPluginBaseSettingsDlg - * constructor for the dialog - * - * @since S60 3.2 - */ - virtual TInt ConstructAndRunLD(); - - /** - * From CmPluginBaseSettingsDlg - * Collects the VPN specific setting information for - * displaying - * - * @since S60 3.2 - * @param aItemArray an array of setting information - */ - virtual void UpdateListBoxContentBearerSpecificL( - CDesCArray& aItemArray ); - - /** - * From CmPluginBaseSettingsDlg - * displays the advanced settings dialog - * - * @since S60 3.2 - */ - virtual void RunAdvancedSettingsL(); - - public: // from class MCmCommsDatWatcher - - /** - * Watch changes in CommsDat - */ - void CommsDatChangesL(); - - protected: // From MEikMenuObserver - - /** - * From MEikMenuObserver - * displays the options menu - * - * @param aResourceId the options menu to use - * @param aMenuPane a pointer to the menu pane control - * @since S60 3.2 - */ - virtual void DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ) ; - - /** From CAknDialog */ - TBool OkToExitL( TInt aButtonId ); - - private: // Constructors - - CmPluginVpnSettingsDlg( CCmPluginBaseEng& aCmPluginBaseEng ); - - private: // From CmPluginBaseSettingsDlg - - /** - * From CmPluginBaseSettingsDlg - * according to the setting type the correct edit dialog is displayed - * - * @since S60 3.2 - * @param aAttribute - * @param aCommandId - */ - virtual TBool ShowPopupSettingPageL( TUint32 aAttribute, - TInt aCommandId ); - - /** - * From CmPluginBaseSettingsDlg - * Get help contest of the plugin - * - * @since S60 5.0 - */ - virtual void GetHelpContext( TCoeHelpContext& aContext ) const; - - private: // New functions - - /** - * Displays a radio button dialog for user selection of connection - * methods (filters out VPN connection method) takes responsibility - * for updating the setting value - * - * @since S60 3.2 - * @returns ETrue if update was made - */ - TBool ShowIapSelectionSettingPageL(); - - private: // From MEikCommandObserver - - /** - * From MEikCommandObserver - * see base class for description - * - * @since S60 3.2 - * @param aCommandId - */ - virtual void ProcessCommandL( TInt aCommandId ); - - - /** - * Checks whether the compulsory fields have been filled or not. - * - * @since S60 3.2 - * @return Whether the compulsory fields have been filled or not. - */ - TBool CompulsoryFilledL(); - - }; - -#endif // CMPLUGINVPN_SETTINGS_DLG_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/inc/cmvpncommonconstants.h --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/inc/cmvpncommonconstants.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: constants for the VPN plugin -* -*/ - -#ifndef CMVPNCOMMONCONSTANTS_H -#define CMVPNCOMMONCONSTANTS_H - -// CONSTANTS -_LIT( KPluginVPNResDirAndFileName, "z:cmpluginvpnui.rsc" ); - -// Do not change this default to other value because proxy number is using this value as default port number -const TInt KVpnProxyPortNumberDefault = 0; - -#endif // CMVPNCOMMONCONSTANTS_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/loc/cmpluginvpn.loc --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/loc/cmpluginvpn.loc Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for project VPN Plugin -* -*/ - -// LOCALISATION STRINGS - -//d: First line of a double large graphic style listbox - VPN specific -//l: list_single_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_bearer_supported_vpn "VPN" - -//d: The name for the newly created connection method -//l: list_double_graphic_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_method_name_vpn "VPN over ’%U’" - - -//d: Note displayed upon opening the VPN connection method settings -//d: if the VPN connection method is invalid -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_vpn_info_vpn_iap_incomplete "VPN access point is incomplete. Try reconfiguring the access point." - -//d: VPN policy setting -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_vpn_sett_vpn_iap_policy_reference "VPN policy" - -//d: Possible value for VPN policy setting -//l: list_set_graphic_pane_t1 -//w: -//r: 5.1 -// -#define qtn_vpn_sett_vpn_iap_policy_reference_compulsory "Must be defined" - -//d: Information note indicatinf that no VPN policies are installed and that -//d: one is needed if a VPN connection method is to be used -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_vpn_info_no_policies_installed "No VPN policies installed. Please install a policy via VPN policies view." - -//d: Internet access point setting -//l: list_setting_pane_t1 -//w: -//r: 3.2 -// -#define qtn_vpn_sett_vpn_iap_real_netw_reference "Network connection" - -//d: Setting value text in internet access point settings view -//l: list_set_graphic_pane_t1 -//w: -//r: 5.1 -// -#define qtn_vpn_sett_vpn_iap_real_netw_ref_compulsory "Must be defined" - -//d: Note displayed to indicate that the VPN client is not available -//d: and new VPN connection methods cannot be added. This may be -//d: due to the VPN client residing on a disconnected memory card -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_vpn_info_mgmt_ui_not_accessible "Unable to access VPN data. Memory card might not be accessible." - -//d: Title of Select VPN Policy list query. -//l: heading_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_prmpt_vpn_policy "Select VPN policy:" - -//d: Title of Select VPN real connection selection query list box -//l: heading_pane_t1 -//w: -//r: 3.2 -// -#define qtn_netw_conset_prmpt_vpn_real_connection "Select connection:" - -//d: Primary item in 'Select VPN real connection selection query' -//d: for selecting a WLAN network as an underlying VPN connection method -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_vpn_easy_wlan "WLAN network" - -//d: Secondary item in the 'Select VPN real connection selection query' -//d: paired with the WLAN network primary item -//l: list_double_large_graphic_pane_t2_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_vpn_easy_wlan_prompt "Prompt for WLAN" - -//d: Destination list text, notes the number of connections methods -//d: belonging to the destination -//l: list_double_large_graphic_pane_t2_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_conn_methods_amount_many "%N connection methods" - -//d: Destination list text. Notes that the destination has one -//d: connection method -//l: list_double_large_graphic_pane_t2_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_conn_methods_amount_one "1 connection method" - -//d: Note shown when attempting to create a VPN access point using the wizard. -//d: Shown if there are no valid underlying connection methods to select. -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_netw_conset_info_no_cm_to_bind_to "Unable to add. No valid destinations or connection methods to be used exist." - -//d: Query displayed when an incomplete VPN connection method is tried to be saved -//d: Operation is confirmed with this confirmation query. -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_vpn_quest_vpn_iap_incomplete_delete "Incomplete VPN access point details. Exit without saving?" - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/src/cmpluginproxyvpn.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/src/cmpluginproxyvpn.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: VPN plug-in's ECom proxy descriptor. -* -*/ - -#include "cmpluginvpn.h" -#include -#include - -// Exported proxy for instantiation method resolution -// Define the interface UIDs -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KPluginVPNBearerTypeUid, CCmPluginVpn::NewL) - }; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/src/cmpluginvpn.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/src/cmpluginvpn.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2090 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: VPN plug-in IF implementation class. -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// #include -#include -#include -#include -#include -#include - -#include -#include - -#include "cmlogger.h" -#include "cmmanagerimpl.h" -#include "cmdestinationimpl.h" -#include "cmvpncommonconstants.h" -#include -#include "cmpluginvpn.h" -#include "cmpvpnsettingsdlg.h" -#include "cmpvpnpolicyselectiondlg.h" -#include "cmpvpnnextlayerselectdlg.h" - -using namespace CMManager; - -_LIT( KPluginVpnFileIcons, "z:cmpluginvpn.mbm" ); -//_LIT(KListItemFormat, "%d\t%S\t%S"); - -static const TCmAttribConvTable SVpnConvTbl[] = - { - { EVpnServicePolicyName, EPluginVpnAttribRangeMax, NULL }, - { EVpnServicePolicy, KCDTIdVPNPolicyName, NULL, - R_QTN_VPN_SETT_VPN_IAP_POLICY_REFERENCE, - 0, EConvCompulsory, R_QTN_VPN_SETT_VPN_IAP_POLICY_REFERENCE_COMPULSORY, 0, NULL, NULL }, - { EVpnServicePolicyName, 0, NULL, - R_QTN_VPN_SETT_VPN_IAP_POLICY_REFERENCE, - 0, EConvCompulsory, R_QTN_VPN_SETT_VPN_IAP_POLICY_REFERENCE_COMPULSORY, 0, NULL, NULL }, - { EVpnIapId, KCDTIdVPNIAPRecord, NULL }, - { EVpnNetworkId, KCDTIdVPNNetwork, &ReadOnlyAttributeL }, - { 0, 0, NULL } - }; - -static const TCmAttribConvTable SVpnVirtualIAPNextLayerConvTbl[] = - { - { ECmNextLayerIapId, ECmNextLayerSNAPId+1, NULL }, - { ECmNextLayerIapId, KCDTIdVirtualNextLayerIAP, NULL }, - { ECmNextLayerSNAPId, KCDTIdVirtualNextLayerSNAP, NULL }, - { 0, 0, NULL } - }; - -_LIT( KVpnVirtualBearerName, "vpnbearer" ); -_LIT( KVpnVirtualBearerAgent, "vpnconnagt.agt" ); -_LIT( KVpnVirtualBearerNif, "tunnelnif" ); - -// constants needed for the virtualbearer table -const TInt KNoTimeout = -1; -const TUint32 KLastSessionTimeout = 3; - - -const TUint32 KContainsVpn = 0x01; -const TUint32 KLinksBackToParent = 0x02; -const TUint32 KEmptyDest = 0x04; -const TUint32 KNoNonVirtuals = 0x08; - -const TUint32 KBindDenied = KLinksBackToParent | KContainsVpn; - -// -------------------------------------------------------------------------- -// CCmPluginVpn::NewL() -// -------------------------------------------------------------------------- -// -CCmPluginVpn* CCmPluginVpn::NewL( TCmPluginInitParam* aInitParam ) - { - - CRepository* repository = CRepository::NewLC(KCRUidCommunicationSettings); - - TInt vpnSupported; - repository->Get(KSettingsVPNSupported, vpnSupported); - - CleanupStack::PopAndDestroy(repository); - - if( !vpnSupported ) - { - User::Leave( KErrNotSupported ); - } - - CCmPluginVpn* self = new( ELeave ) CCmPluginVpn( aInitParam ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::~CCmPluginVpn() -// -------------------------------------------------------------------------- -// -CCmPluginVpn::~CCmPluginVpn() - { - CCmPluginVpn::AdditionalReset(); - - RemoveResourceFile( KPluginVPNResDirAndFileName ); - - iBindableMethods.Reset(); - iBindableMethods.Close(); - delete iPolicyName; - CLOG_CLOSE; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::CreateInstanceL -// -------------------------------------------------------------------------- -// -CCmPluginBaseEng* CCmPluginVpn::CreateInstanceL( TCmPluginInitParam& aInitParam ) const - { - CCmPluginVpn* self = new( ELeave ) CCmPluginVpn( &aInitParam ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::CCmPluginVpn() -// -------------------------------------------------------------------------- -// -CCmPluginVpn::CCmPluginVpn( TCmPluginInitParam* aInitParam ) - : CCmPluginBaseEng( aInitParam ) - , iBindableMethods( KCmArraySmallGranularity ) - { - CLOG_CREATE; - iBearerType = KPluginVPNBearerTypeUid; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::ConstructL() -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::ConstructL() - { - CCmPluginBaseEng::ConstructL(); - - TRAP_IGNORE( iVirtualTableId = - CCDVirtualIAPNextLayerRecord::TableIdL( Session() ) ); - if( !iVirtualTableId ) - { - iVirtualTableId = CCDVirtualIAPNextLayerRecord::CreateTableL( Session() ); - } - - AddResourceFileL( KPluginVPNResDirAndFileName ); - - AddConverstionTableL( (CCDRecordBase**)&iServiceRecord, NULL, SVpnConvTbl ); - - iPolicyName = KNullDesC().AllocL(); - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::GetIntAttributeL() -// -------------------------------------------------------------------------- -// -TUint32 CCmPluginVpn::GetIntAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginVpn::GetIntAttributeL" ); - - TUint32 retVal( 0 ); - - switch( aAttribute ) - { - case ECmBearerIcon: - { - TAknsItemID id; - - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - - TParse mbmFile; - User::LeaveIfError( mbmFile.Set( KPluginVpnFileIcons, - &KDC_BITMAP_DIR, - NULL ) ); - - retVal = (TUint32)AknsUtils::CreateGulIconL( - skinInstance, - id, - mbmFile.FullName(), - EMbmCmpluginvpnQgn_prop_vpn_access_point, - EMbmCmpluginvpnQgn_prop_vpn_access_point_mask ); - } - break; - - case ECmCommsDBBearerType: - { - retVal = KCommDbBearerVirtual; - } - break; - - case ECmDefaultUiPriority: - case ECmDefaultPriority: - { - retVal = aAttribute == ECmDefaultPriority ? - GlobalBearerPriority( TPtrC(KCDTypeNameVPNService) ) : - GlobalUiBearerPriority( TPtrC(KCDTypeNameVPNService) ); - } - break; - - case EVpnIapId: - { - if( !ServiceRecordExists() ) - { - User::Leave( KErrNotSupported ); - } - - retVal = ServiceRecord().iServiceIAP; - } - break; - case EVpnNetworkId: - { - if( !ServiceRecordExists() ) - { - User::Leave( KErrNotSupported ); - } - - retVal = ServiceRecord().iServiceNetwork; - } - break; - case ECmNextLayerIapId: - { - retVal = iVirtualRecord->iNextLayerIAP; - } - break; - case ECmNextLayerSNAPId: - { - retVal = iVirtualRecord->iNextLayerSNAP; - } - break; - case ECmIapId: - case ECmId: - case ECmWapId: - case ECmIapServiceId: - case ECmInvalidAttribute: - case ECmLoadResult: - case ECmBearerType: - case ECmSeamlessnessLevel: - case ECmElementID: - case ECmNetworkId: - case ECmProxyPortNumber: - case ECmExtensionLevel: - case ECmWapIPWSPOption: - case ECmWapIPProxyPort: - case ECmNamingMethod: - { - retVal = CCmPluginBaseEng::GetIntAttributeL( aAttribute ); - } - break; - - default: - { - User::Leave( KErrNotSupported ); - } - } - - return retVal; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::GetBoolAttributeL() -// -------------------------------------------------------------------------- -// -TBool CCmPluginVpn::GetBoolAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginVpn::GetBoolAttributeL" ); - - TBool retVal( EFalse ); - - switch( aAttribute ) - { - case ECmAddToAvailableList: - { - retVal = EFalse; - } - break; - - case ECmChargeCardUsageEnabled: - { - retVal = EFalse; - } - break; - case ECmBearerHasUi: - { - retVal = ETrue; - break; - } - case ECmCoverage: - case ECmDestination: - case ECmIPv6Supported: - case ECmHidden: - case ECmProtected: - case ECmMetaHighlight: - case ECmMetaHiddenAgent: - case ECmProxyUsageEnabled: - case ECmConnected: - case ECmIsLinked: - case ECmWapIPSecurity: - { - retVal = CCmPluginBaseEng::GetBoolAttributeL( aAttribute ); - } - break; - case ECmVirtual: - { - return ETrue; - } - default: - { - User::Leave( KErrNotSupported ); - - } - } - - return retVal; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::GetStringAttributeL() -// -------------------------------------------------------------------------- -// -HBufC* CCmPluginVpn::GetStringAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginVpn::GetStringAttributeL" ); - - HBufC* retVal = NULL; - - switch( aAttribute ) - { - case ECmBearerSupportedName: - { - retVal = AllocReadL( R_QTN_NETW_CONSET_BEARER_SUPPORTED_VPN ); - } - break; - - case EVpnServicePolicyName: - { - if( !ServiceRecordExists() ) - { - User::Leave( KErrNotSupported ); - } - else - { - CCmPluginVpn* tmp = const_cast< CCmPluginVpn * >( this ); - tmp->UpdatePolicyNameL(); - } - retVal = iPolicyName->AllocL(); - break; - } - case EVpnServicePolicy: - { - if( !ServiceRecordExists() ) - { - User::Leave( KErrNotSupported ); - } - - if( !ServiceRecord().iServicePolicy.IsNull() ) - { - retVal = ServiceRecord().iServicePolicy.GetL().AllocL(); - } - else - { - retVal = KNullDesC().AllocL(); - } - } - break; - - case ECmName: - case ECmProxyServerName: - case ECmProxyProtocolName: - case ECmProxyExceptions: - case ECmWapIPGatewayAddress: - case ECmWapIPProxyLoginName: - case ECmWapIPProxyLoginPass: - case ECmStartPage: - { - retVal = CCmPluginBaseEng::GetStringAttributeL( aAttribute ); - } - break; - - default: - { - User::Leave( KErrNotSupported ); - } - break; - } - - return retVal; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::GetString8AttributeL() -// -------------------------------------------------------------------------- -// -HBufC8* CCmPluginVpn::GetString8AttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginVpn::GetString8AttributeL" ); - - HBufC8* retVal = NULL; - - switch( aAttribute ) - { - default: - { - User::Leave( KErrNotSupported ); - } - break; - } - - return retVal; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::SetIntAttributeL() -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::SetIntAttributeL( const TUint32 aAttribute, - TUint32 aValue ) - { - LOGGER_ENTERFN( "CCmPluginVpn::SetIntAttributeL" ); - - switch( aAttribute ) - { - case ECmNextLayerIapId: - case EVpnIapId: - { - CheckRecordIdValidityL( this, EVpnIapId, &aValue ); - - // ServiceRecord.iServiceIAP should be 0 according to - // DM CommsDat Contents v1.4, but for now it is made - // backward compatible - if( !ServiceRecordExists() ) - { - User::Leave( KErrNotSupported ); - } - - ServiceRecord().iServiceIAP = aValue; - ServiceRecord().iServiceNetwork = 0; - ServiceRecord().iServiceSNAP = 0; - iVirtualRecord->iNextLayerIAP = aValue; - iVirtualRecord->iNextLayerSNAP = 0; - } - break; - - case EVpnNetworkId: - case ECmNextLayerSNAPId: - { - // To keep backwards compability, keep these 2 attributes - // (EVpnNetworkId & ECmNextLayerSNAPId) together even though - // network id and destination id are no longer exactly the same. - if( !ServiceRecordExists() ) - { - User::Leave( KErrNotSupported ); - } - - TInt destinationId( 0 ); - destinationId = CheckValidityAndConvertDestinationIdL( aValue ); - TMDBElementId defaultAP = DefaultAPRecordL(); - - ServiceRecord().iServiceIAP = 0; - ServiceRecord().iServiceNetwork = 0; - ServiceRecord().iServiceSNAP = defaultAP; - iVirtualRecord->iNextLayerIAP = 0; - iVirtualRecord->iNextLayerSNAP = destinationId; - } - break; - - case ECmSeamlessnessLevel: - case ECmProxyPortNumber: - case ECmNamingMethod: - case ECmWapIPWSPOption: - case ECmWapIPProxyPort: - { - CCmPluginBaseEng::SetIntAttributeL( aAttribute, aValue ); - } - break; - - default: - { - User::Leave( KErrNotSupported ); - } - break; - } - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::SetBoolAttributeL() -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::SetBoolAttributeL( const TUint32 aAttribute, - TBool aValue ) - { - LOGGER_ENTERFN( "CCmPluginVpn::SetBoolAttributeL" ); - - switch( aAttribute ) - { - case ECmChargeCardUsageEnabled: - { - User::Leave( KErrNotSupported ); - } - break; - - case ECmHidden: - case ECmProtected: - case ECmMetaHighlight: - case ECmMetaHiddenAgent: - case ECmProxyUsageEnabled: - case ECmWapIPSecurity: - { - CCmPluginBaseEng::SetBoolAttributeL( aAttribute, aValue ); - } - break; - - default: - { - User::Leave( KErrNotSupported ); - } - break; - } - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::SetStringAttributeL() -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::SetStringAttributeL( const TUint32 aAttribute, - const TDesC16& aValue ) - { - LOGGER_ENTERFN( "CCmPluginVpn::SetStringAttributeL" ); - - switch( aAttribute ) - { - case EVpnServicePolicyName: - { - HBufC* tmp = aValue.AllocLC(); - delete iPolicyName; - iPolicyName = tmp; - CleanupStack::Pop( tmp ); - break; - } - case EVpnServicePolicy: - { - if( !ServiceRecordExists() ) - { - User::Leave( KErrNotSupported ); - } - - CLOG_WRITE_1( "New policy set:[%S]", &aValue ); - ServiceRecord().iServicePolicy.SetL( aValue ); - } - break; - case ECmProxyServerName: - { - CCmPluginBaseEng::SetStringAttributeL( aAttribute, aValue ); - if( !aValue.Length() || !iProxyRecord->iPortNumber ) - { - iProxyRecord->iPortNumber = KVpnProxyPortNumberDefault; - } - } - break; - - case ECmName: - case ECmProxyProtocolName: - case ECmProxyExceptions: - case ECmWapIPGatewayAddress: - case ECmWapIPProxyLoginName: - case ECmWapIPProxyLoginPass: - case ECmStartPage: - { - CCmPluginBaseEng::SetStringAttributeL( aAttribute, aValue ); - } - break; - - default: - { - User::Leave( KErrNotSupported ); - } - break; - } - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::SetString8AttributeL() -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::SetString8AttributeL( const TUint32 aAttribute, - const TDesC8& /*aValue*/ ) - { - LOGGER_ENTERFN( "CCmPluginVpn::SetString8AttributeL" ); - - switch( aAttribute ) - { - default: - { - User::Leave( KErrNotSupported ); - } - break; - } - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::CanHandleIapIdL() -// -------------------------------------------------------------------------- -// -TBool CCmPluginVpn::CanHandleIapIdL( TUint32 aIapId ) const - { - LOGGER_ENTERFN( "CCmPluginVpn::CanHandleIapIdL1" ); - TBool retVal( EFalse ); - - CCDIAPRecord *iapRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord)); - - CleanupStack::PushL( iapRecord ); - iapRecord->SetRecordId( aIapId ); - - TRAPD( err, iapRecord->LoadL( Session() )); - - if( !err ) - { - CanHandleIapIdL( iapRecord ); - } - - CleanupStack::PopAndDestroy( iapRecord ); - return retVal; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::CanHandleIapIdL() -// -------------------------------------------------------------------------- -// -TBool CCmPluginVpn::CanHandleIapIdL( CCDIAPRecord *aIapRecord ) const - { - LOGGER_ENTERFN( "CCmPluginVpn::CanHandleIapIdL" ); - - TBool retVal( EFalse ); - - if( TPtrC(aIapRecord->iServiceType) == TPtrC(KCDTypeNameVPNService) || - TPtrC(aIapRecord->iBearerType) == TPtrC(KCDTypeNameVirtualBearer) ) - { - retVal = ETrue; - } - - return retVal; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::RunSettingsL() -// -------------------------------------------------------------------------- -// -TInt CCmPluginVpn::RunSettingsL() - { - LOGGER_ENTERFN( "CCmPluginVpn::RunSettingsL" ); - CmPluginVpnSettingsDlg* dlg = CmPluginVpnSettingsDlg::NewL( *this ); - - return dlg->ConstructAndRunLD(); - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::LoadServiceSettingL() -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::LoadServiceSettingL() - { - LOGGER_ENTERFN( "CCmPluginVpn::LoadServiceSettingL" ); - - if( TPtrC(KCDTypeNameVPNService) == iIapRecord->iServiceType ) - { - iServiceRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdVPNServiceRecord)); - } - else - // this IAP service is not supported by this plugin. - { - User::Leave( KErrNotSupported ); - } - - - CCmPluginBaseEng::LoadServiceSettingL(); - } - - -// -------------------------------------------------------------------------- -// CCmPluginVpn::LoadAdditionalRecordsL() -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::LoadAdditionalRecordsL() - { - LOGGER_ENTERFN( "CCmPluginVpn::LoadAdditionalRecordsL" ); - - iVirtualRecord = new (ELeave) CCDVirtualIAPNextLayerRecord( iVirtualTableId ); - - CMDBRecordSet* virtualRS = - new(ELeave) CMDBRecordSet( iVirtualTableId ); - CleanupStack::PushL( virtualRS ); - - CCDVirtualIAPNextLayerRecord* record = - new (ELeave) CCDVirtualIAPNextLayerRecord( iVirtualTableId ); - - record->iIAP = iIapId; - CleanupStack::PushL( record ); - virtualRS->iRecords.AppendL( record ); - CleanupStack::Pop( record ); - record = NULL; - - if( virtualRS->FindL( Session() ) ) - { - iVirtualRecord->SetRecordId( (*virtualRS)[0]->RecordId() ); - - iVirtualRecord->LoadL( Session() ); - - CLOG_WRITE_3( "Next layer: IAP[%d], NextSNAP[%d], NextIAP[%d]", - TUint( iVirtualRecord->iIAP ), - TUint( iVirtualRecord->iNextLayerSNAP ), - TUint( iVirtualRecord->iNextLayerIAP ) ); - } - else - { - CLOG_WRITE( "Virtual records not found" ); - } - - CleanupStack::PopAndDestroy( virtualRS ); - AddConverstionTableL( (CCDRecordBase**)&iVirtualRecord, NULL, SVpnVirtualIAPNextLayerConvTbl ); - - if (iIapRecord->iRecordName.GetL() == KNullDesC) - { - //now we have next layer info, so generate default cm name if name is empty (new cm) - GenerateDefaultCmNameL(); - } - - if ( !iProxyRecord->iPortNumber ) - { - iProxyRecord->iPortNumber = KVpnProxyPortNumberDefault; - } - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::InitializeWithUiL() -// -------------------------------------------------------------------------- -// -TBool CCmPluginVpn::InitializeWithUiL( TBool /*aManuallyConfigure*/ ) - { - LOGGER_ENTERFN( "CCmPluginVpn::InitializeWithUiL" ); - TInt retVal( EFalse ); - - // Compile a list of bindable methods, issue a warning if none found - if ( BindableRealConnectionsExistL() ) - { - // check if the intended destination is not available for VPN, - // or, if the destination has not been set yet, whether there is - // at least one suitable destination to place it in - TBool validParent = EFalse; - - if ( iParentDest ) - { - // parent destination is known - // check if it is not linked by any other VPN - validParent = !HasUpstreamVpnL( iParentDest, ETrue ); - } - else - { - // parent destination is not known yet - // check if there is any destination into which this VPN could be put - - // trigger the recalculation - RArray parents ( CmMgr().DestinationCountL() ); - CleanupClosePushL( parents ); - - CmMgr().AllDestinationsL( parents ); - - FilterPossibleParentsL( parents ); - - // if there is only one such destination, we should filter out - // that one from the underlying candidates - if ( parents.Count() == 1 ) - { - TInt destIndex = iBindableMethods.Find( parents[0] ); - if ( destIndex != KErrNotFound ) - { - // got it, now remove - iBindableMethods.Remove( destIndex ); - } - - if ( iBindableMethods.Count() ) - { - // if there are still some methods to bind to, - // mark the destination as valid - validParent = ETrue; - } - - } - else - { - validParent = ( parents.Count() > 0 ); - } - - CleanupStack::PopAndDestroy( &parents ); - } - - if ( !validParent ) - { - TCmCommonUi::ShowNoteL( R_CMWIZARD_NO_VPN_STACKING, - TCmCommonUi::ECmErrorNote ); - - return retVal; - } - - - // Check VPN policies installed on the device - if ( ShowPolicySelectionDlgL() ) - { - retVal = ShowRealConnectionSelectionDlgL(); - - if ( retVal ) - { - if ( iIapRecord->iRecordName.GetL() == KNullDesC ) - { - // now we have next layer info, so generate default cm name - GenerateDefaultCmNameL(); - } - - } - } - } - else - { - HBufC* buf = AllocReadL( R_QTN_NETW_CONSET_INFO_NO_CM_TO_BIND_TO ); - TPtr ptr ( buf->Des() ); - CleanupStack::PushL( buf ); - TCmCommonUi::ShowNoteL( ptr, TCmCommonUi::ECmErrorNote ); - CleanupStack::PopAndDestroy( buf ); - } - - return retVal; - } - - -// -------------------------------------------------------------------------- -// CCmPluginVpn::ServiceRecord() -// -------------------------------------------------------------------------- -// -CCDVPNServiceRecord& CCmPluginVpn::ServiceRecord() const - { - LOGGER_ENTERFN( "CCmPluginVpn::ServiceRecord" ); - return *static_cast( iServiceRecord ); - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::ServiceRecordExists() -// -------------------------------------------------------------------------- -// -TBool CCmPluginVpn::ServiceRecordExists() const - { - if ( !iServiceRecord ) - { - return EFalse; - } - return ETrue; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::CreateNewServiceRecordL() -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::CreateNewServiceRecordL() - { - LOGGER_ENTERFN( "CCmPluginVpn::CreateNewServiceRecordL" ); - - delete iServiceRecord; iServiceRecord = NULL; - - iServiceRecord = static_cast - (CCDRecordBase::RecordFactoryL( KCDTIdVPNServiceRecord )); - - CLOG_WRITE("New service record, policy emptied"); - ServiceRecord().iServicePolicy.SetL( KNullDesC ); - ServiceRecord().iServiceIAP = 0; - ServiceRecord().iServiceNetwork = 0; - ServiceRecord().iServiceSNAP = 0; - - - iProxyRecord->iPortNumber = KVpnProxyPortNumberDefault; - - SetIntAttributeL( ECmSeamlessnessLevel, ESeamlessnessShowprogress ); - } - -// --------------------------------------------------------------------------- -// CCmPluginVpn::CreateAdditionalRecordsL -// --------------------------------------------------------------------------- -// -void CCmPluginVpn::CreateAdditionalRecordsL() - { - LOGGER_ENTERFN( "CCmPluginVpn::CreateAdditionalRecordsL" ); - - delete iVirtualRecord; - iVirtualRecord = NULL; - - iVirtualRecord = new (ELeave) CCDVirtualIAPNextLayerRecord( iVirtualTableId ); - } - -// --------------------------------------------------------------------------- -// CCmPluginVpn::UpdateServiceRecordL -// --------------------------------------------------------------------------- -// -void CCmPluginVpn::UpdateServiceRecordL() - { - LOGGER_ENTERFN( "CCmPluginVpn::UpdateServiceRecordL" ); - - CCmPluginBaseEng::UpdateServiceRecordL(); - } - -// --------------------------------------------------------------------------- -// CCmPluginVpn::UpdateAdditionalRecordsL -// --------------------------------------------------------------------------- -// -void CCmPluginVpn::UpdateAdditionalRecordsL() - { - LOGGER_ENTERFN( "CCmPluginVpn::UpdateAdditionalRecordsL" ); - - CheckIfNameModifiedL( iVirtualRecord ); - - if( !iVirtualRecord->RecordId() ) - { - iVirtualRecord->SetRecordId( KCDNewRecordRequest ); - - iVirtualRecord->iIAP = iIapId; - iVirtualRecord->StoreL( Session() ); - } - else - { - iVirtualRecord->ModifyL( Session() ); - } - } - -// --------------------------------------------------------------------------- -// CCmPluginVpn::ServiceRecordIdLC -// --------------------------------------------------------------------------- -// -void CCmPluginVpn::ServiceRecordIdLC( HBufC* &aName, - TUint32& aRecordId ) - { - LOGGER_ENTERFN( "CCmPluginVpn::ServiceRecordIdLC" ); - - aName = TPtrC( KCDTypeNameVPNService ).AllocLC(); - aRecordId = iServiceRecord->RecordId(); - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::BearerRecordIdLC() -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::BearerRecordIdLC( HBufC* &aBearerName, - TUint32& aRecordId ) - { - LOGGER_ENTERFN( "CCmPluginVpn::BearerRecordIdLC" ); - - CMDBRecordSet* bearersRS = - new(ELeave) CMDBRecordSet - (KCDTIdVirtualBearerRecord); - CleanupStack::PushL( bearersRS ); - - // Now try to find the linked proxy record - // create new record - CCDVirtualBearerRecord* bearerRecord = - static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdVirtualBearerRecord)); - - CleanupStack::PushL( bearerRecord ); - - bearerRecord->iBearerAgent.SetL( KVpnVirtualBearerAgent ); - - bearersRS->iRecords.AppendL( bearerRecord ); - - CleanupStack::Pop( bearerRecord ); - bearerRecord = NULL; - - CLOG_WRITE_1( "Looking for bearer: [%d]", TUint32(iIapRecord->iService) ); - - if ( !bearersRS->FindL( Session() ) ) - // No bearer record found -> create a default one. - { - bearerRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdVirtualBearerRecord)); - CleanupStack::PushL(bearerRecord); - - bearerRecord->iRecordName.SetL( KVpnVirtualBearerName ); - bearerRecord->iBearerAgent.SetL( KVpnVirtualBearerAgent ); - bearerRecord->iVirtualBearerNifName.SetL(KVpnVirtualBearerNif); - bearerRecord->iLastSocketActivityTimeout = (TUint32)KNoTimeout; - bearerRecord->iLastSessionClosedTimeout = KLastSessionTimeout; - bearerRecord->iLastSocketClosedTimeout = (TUint32)KNoTimeout; - - bearerRecord->SetRecordId( KCDNewRecordRequest ); - bearerRecord->StoreL( Session() ); - - aRecordId = bearerRecord->RecordId(); - - CleanupStack::PopAndDestroy(bearerRecord); - } - else - { - aRecordId = (*bearersRS)[0]->RecordId(); - } - - CleanupStack::PopAndDestroy( bearersRS ); - - aBearerName = TPtrC( KCDTypeNameVirtualBearer ).AllocLC(); - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::AdditionalReset() -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::AdditionalReset() - { - LOGGER_ENTERFN( "CCmPluginVpn::AdditionalReset" ); - - delete iNetworkRecord; - iNetworkRecord = NULL; - - delete iVirtualRecord; - iVirtualRecord = NULL; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::PrepareToUpdateRecordsL() -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::PrepareToUpdateRecordsL() - { - LOGGER_ENTERFN( "CCmPluginVpn::PrepareToUpdateRecordsL" ); - // Check here if every data of the connection method is valid - // before records were saved to CommsDat. - // Set incorrect attribute id in iInvalidAttribute and leave - // with KErrArgument. - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::ShowPolicySelectionDlgL -// -------------------------------------------------------------------------- -// -TBool CCmPluginVpn::ShowPolicySelectionDlgL() - { - LOGGER_ENTERFN( "CCmPluginVpn::ShowPolicySelectionDlgL" ); - - TBool retVal ( EFalse ); - - CmPluginVpnPolicySelectionDlg* dlg = - CmPluginVpnPolicySelectionDlg::NewL( *this ); - CleanupStack::PushL( dlg ); - retVal = dlg->ShowPolicySelectionListL(); - CleanupStack::PopAndDestroy(); - - return retVal; - } - - -// -------------------------------------------------------------------------- -// CCmPluginVpn::BindableRealConnectionsExistL -// -------------------------------------------------------------------------- -// -TBool CCmPluginVpn::BindableRealConnectionsExistL() - { - LOGGER_ENTERFN( "CCmPluginVpn::BindableRealConnectionsExistL" ); - - TBool retVal ( EFalse ); - - iBindableMethods.Close(); - - // Compile and array of destination IDs which the VPN CM can be bound to - // includes Uncategorised destination and Easy WLAN if valid - CmMgr().AllDestinationsL( iBindableMethods ); - - // Filter out invalid methods - for ( TInt i = 0; i < iBindableMethods.Count(); i++ ) - { - TUint32 bindresult = - CanDestUsedAsUnderlyingConnectionL( iBindableMethods[i] ); - - if ( bindresult & (KBindDenied | KNoNonVirtuals | KEmptyDest ) ) - { - iBindableMethods.Remove( i ); - i--; - } - } - - // If there are destination IDs which the VPN CM can be bound to. - if( iBindableMethods.Count() ) - { - retVal = ETrue; - } - - // 2. Are there uncategorised connection methods which aren't virtual? - RArray cmArray ( KCmArrayMediumGranularity ); - CleanupClosePushL( cmArray ); - CmMgr().ConnectionMethodL( cmArray, EFalse ); - - for ( TInt k = 0; k < cmArray.Count(); k++ ) - { - TInt bearerType (0); - TRAPD( err, bearerType = CmMgr().GetConnectionMethodInfoIntL( - cmArray[k], ECmBearerType );); - - //if no plugin is found to handle the bearertype, GetConnectionMethodInfoIntL leaves with KErrNotSupported - if ( err == KErrNotSupported ) - { - //continue with the next element in the array - continue; - } - - // uncategorised contains a non-virtual connection method - if ( !CmMgr().GetBearerInfoBoolL( bearerType, ECmVirtual ) ) - { - retVal = ETrue; - iBindableMethods.Append( KDestItemUncategorized ); - break; - } - } - CleanupStack::PopAndDestroy( &cmArray ); - - // 3. Is Easy WLAN available? - if ( FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ) ) - { - // easy wlan is available - if ( CmMgr().EasyWlanIdL() ) - { - iBindableMethods.Append( KDestItemEasyWlan ); - retVal = ETrue; - } - } - - return retVal; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::ShowRealConnectionSelectionDlgL -// -------------------------------------------------------------------------- -// -TBool CCmPluginVpn::ShowRealConnectionSelectionDlgL() - { - LOGGER_ENTERFN( "CCmPluginVpn::ShowRealConnectionSelectionDlgL" ); - TBool retVal ( EFalse ); - - TBool snapSelected ( EFalse ); - TUint32 nextLayerId ( 0 ); - - CmPluginVpnNextLayerSelectDlg* dlg = - CmPluginVpnNextLayerSelectDlg::NewL( *this, - iBindableMethods, - snapSelected, - nextLayerId ); - if ( dlg->ExecuteLD( R_VPN_REAL_CM_SELECTION_LIST ) ) - { - // Handle results - retVal = ETrue; - } - - return retVal; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::IsLinkedToIap -// -------------------------------------------------------------------------- -// -TBool CCmPluginVpn::IsLinkedToIap( TUint32 aIapId ) - { - LOGGER_ENTERFN( "CCmPluginVpn::IsLinkedToIap" ); - - return ( ServiceRecord().iServiceIAP == aIapId ); - } - - -// -------------------------------------------------------------------------- -// CCmPluginVpn::IsLinkedToSnap -// -------------------------------------------------------------------------- -// -TBool CCmPluginVpn::IsLinkedToSnap( TUint32 aSnapId ) - { - LOGGER_ENTERFN( "CCmPluginVpn::IsLinkedToSnap" ); - - return ( iVirtualRecord->iNextLayerSNAP == aSnapId ); - } - - -// --------------------------------------------------------------------------- -// CCmPluginVpn::RestoreAttributeL -// --------------------------------------------------------------------------- -// -void CCmPluginVpn::RestoreAttributeL( const TUint32 aAttribute ) - { - LOGGER_ENTERFN( "CCmPluginVpn::RestoreAttributeL" ); - - if ( aAttribute == EVpnServicePolicyName ) - { - // also restore policy name - RVpnServ ps; - CleanupClosePushL( ps ); - - TInt err = ps.Connect(); - - if ( !err ) - { - if( !ServiceRecordExists() ) - { - User::Leave( KErrNotSupported ); - } - - CCDVPNServiceRecord *r = &(ServiceRecord()); - TVpnPolicyName pId( r->iServicePolicy ); - - TInt policyCount(0); - err = ps.EnumeratePolicies(policyCount); - if ( !err && policyCount) - { - CArrayFixFlat* policyList; - policyList = new (ELeave) CArrayFixFlat(policyCount); - CleanupStack::PushL(policyList); - - err = ps.GetPolicyInfoList(policyList); - - TBool found(EFalse); - - if ( err == KErrNone ) - { - for (TInt i(0); iCount(); ++i) - { - if (pId.Compare((*policyList)[i].iId) == 0 ) - { - SetStringAttributeL( EVpnServicePolicyName, - (*policyList)[i].iName ); - found = ETrue; - break; - } - } - } - - if ( err || (!found) ) - { - CLOG_WRITE_1("Error when restoring policy attribute, [%d]", err ); - // the set policies are not installed, - // or we can not access vpn client: - // Must be defined qtn_selec_setting_compulsory is displayed - // for the invalid settings. - // reset policy to compulsory - SetStringAttributeL( EVpnServicePolicyName, - KNullDesC() ); - SetStringAttributeL( EVpnServicePolicy, - KNullDesC() ); - } - CleanupStack::PopAndDestroy(policyList); - } - } - CleanupStack::PopAndDestroy(); // ps.Close - } - // Type of EVpnIapId is ELink. This is plugin specified type. - // So, it should be handled here. - else if( aAttribute == EVpnIapId ) - { - if( !ServiceRecordExists() ) - { - User::Leave( KErrNotSupported ); - } - - ServiceRecord().iServiceIAP = 0; - iVirtualRecord->iNextLayerIAP = 0; - iVirtualRecord->iNextLayerSNAP = 0; - } - else - { - CCmPluginBaseEng::RestoreAttributeL( aAttribute ); - } - } - - - -// -------------------------------------------------------------------------- -// CCmPluginVpn::GenerateDefaultCmNameL -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::GenerateDefaultCmNameL() - { - LOGGER_ENTERFN( "CCmPluginVpn::GenerateDefaultCmNameL" ); - - //create default string - RFs fs; - CleanupClosePushL( fs ); - User::LeaveIfError( fs.Connect() ); - - // There may not be a UI context yet.... - TFileName resourceFile; - _LIT( KDriveZ, "z:" ); - resourceFile.Append( KDriveZ ); - resourceFile.Append( KDC_RESOURCE_FILES_DIR ); - _LIT( KCmmResFileName, "cmpluginvpnui.rsc" ); - resourceFile.Append( KCmmResFileName ); - BaflUtils::NearestLanguageFile( fs, resourceFile ); - - RResourceFile rf; - CleanupClosePushL( rf ); - rf.OpenL( fs, resourceFile ); - rf.ConfirmSignatureL( 0 ); - HBufC8* readBuffer = rf.AllocReadLC( R_QTN_NETW_CONSET_METHOD_NAME_VPN ); - const TPtrC16 ptrReadBuffer( (TText16*) readBuffer->Ptr(), - ( readBuffer->Length() + 1 ) >> 1 ); - HBufC16* textBuffer=HBufC16::NewL( ptrReadBuffer.Length() ); - CleanupStack::PushL( textBuffer ); - *textBuffer=ptrReadBuffer; - - // Find %U and replace it with %S - TPtr sourceString = textBuffer->Des(); - _LIT(KPercentS,"%S"); - _LIT(KPercentU,"%U"); - TInt puPos = sourceString.Find(KPercentU); - if ( puPos >= 0 ) - { - sourceString.Replace( puPos, - static_cast(KPercentS).Length(), KPercentS ); - } - - // Check if there is a length defined in copy of the recourse string e.g. "VPN(%U[08])" - // If it's found convert it to integer and remove it from the string. - TInt maxDataLength( 0 ); - TInt perceLength = static_cast(KPercentS).Length(); - if ( sourceString[puPos+perceLength] == '[' ) - { - // Key includes max datalength - maxDataLength = 10*( sourceString[puPos+perceLength+1]-'0' ) - + ( sourceString[puPos+perceLength+2]-'0' ); - sourceString.Delete(puPos+perceLength,4); - } - - // Get the IAP name which the VPM Connection Method points to - HBufC* refName = NULL; - - if( !ServiceRecordExists() ) - { - User::Leave( KErrNotSupported ); - } - - if ( ServiceRecord().iServiceIAP ) - { - // ask for the bearer type - TUint32 bearerType = CmMgr().GetConnectionMethodInfoIntL( - ServiceRecord().iServiceIAP, ECmBearerType ); - - if ( iCmMgr.EasyWlanIdL() && bearerType == KUidWlanBearerType ) - { - refName = GenerateVPNPointToWLANNetworkLC(rf, refName); - } - else - { - refName = iCmMgr.GetConnectionMethodInfoStringL( - ServiceRecord().iServiceIAP, - ECmName ); - CleanupStack::PushL( refName ); - } - } - else - { - CCmDestinationImpl* dest = iCmMgr.DestinationL( - iVirtualRecord->iNextLayerSNAP ); - CleanupStack::PushL( dest ); - refName = dest->NameLC(); - CleanupStack::Pop( refName ); - CleanupStack::PopAndDestroy( dest ); - CleanupStack::PushL( refName ); - } - - TPtr16 refNamePtr = refName->Des(); - // If there was a length definition e.g. [08]--> length is 8 the CM or - // Destination name must be cut to length - 1 and copy the ellipsis(shown as - // "...") to the end. - if( maxDataLength > 0 && refName->Length() > maxDataLength ) - { - refNamePtr.Delete( maxDataLength-1, refName->Length()-maxDataLength+1); - TText ellipsis(KEllipsis); - refNamePtr.Insert( maxDataLength-1, TPtrC(&ellipsis,1) ); - } - - if ( maxDataLength == 0 ) - { - // Length not defined in resource string so set it to refName length - maxDataLength = refNamePtr.Length(); - } - - HBufC* cmName = HBufC::NewL( sourceString.Length() + maxDataLength ); - CleanupStack::PushL( cmName ); - cmName->Des().Format(sourceString, &refNamePtr); - SetStringAttributeL( ECmName, *cmName ); - CleanupStack::PopAndDestroy( cmName ); - CleanupStack::PopAndDestroy( refName ); - CleanupStack::PopAndDestroy( textBuffer ); - CleanupStack::PopAndDestroy( readBuffer ); - CleanupStack::PopAndDestroy( &rf ); - CleanupStack::PopAndDestroy( &fs ); - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::GenerateDefaultCmNameL -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::CreateNewL() - { - CCmPluginBaseEng::CreateNewL(); - - iIapRecord->iRecordName.SetL( KNullDesC ); - } - - - -// -------------------------------------------------------------------------- -// CCmPluginVpn::LoadL -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::LoadL( TUint32 aIapId ) - { - CCmPluginBaseEng::LoadL( aIapId ); - if ( iServiceRecord ) - { -// UpdatePolicyNameL(); - } - } - - -// -------------------------------------------------------------------------- -// CCmPluginVpn::UpdatePolicyNameL -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::UpdatePolicyNameL() - { - LOGGER_ENTERFN( "CCmPluginVpn::UpdatePolicyNameL" ); - // now get policy name from ID - - RVpnServ ps; - CleanupClosePushL( ps ); - TInt err = ps.Connect(); - - CLOG_WRITE_1( "Connected to VPN server, err [%d]", err ); - - if (! err ) - { - if( !ServiceRecordExists() ) - { - User::Leave( KErrNotSupported ); - } - - CCDVPNServiceRecord *r = &(ServiceRecord()); - TVpnPolicyName pId( r->iServicePolicy ); - TInt policyCount(0); - err = ps.EnumeratePolicies(policyCount); - if ( !err && policyCount) - { - CArrayFixFlat* policyList; - policyList = new (ELeave) CArrayFixFlat(policyCount); - CleanupStack::PushL(policyList); - - err = ps.GetPolicyInfoList(policyList); - if ( err ) - { - // the set policies are not installed, - // Must be defined qtn_selec_setting_compulsory is displayed - // for the invalid settings. - // reset policy to compulsory - SetStringAttributeL( EVpnServicePolicyName, - KNullDesC() ); - SetStringAttributeL( EVpnServicePolicy, - KNullDesC() ); - } - else - { - for (TInt i(0); iCount(); ++i) - { - if (pId.Compare((*policyList)[i].iId) == 0 ) - { - SetStringAttributeL( EVpnServicePolicyName, - (*policyList)[i].iName ); - break; - } - } - } - CleanupStack::PopAndDestroy(policyList); - } - } - CleanupStack::PopAndDestroy(); // ps.close - } - - -// -------------------------------------------------------------------------- -// CCmPluginVpn::CanDestUsedAsUnderlyingConnectionL -// -------------------------------------------------------------------------- -// -TUint32 CCmPluginVpn::CanDestUsedAsUnderlyingConnectionL( TUint32 aDestinationId ) - { - LOGGER_ENTERFN( "CCmPluginVpn::CanDestUsedAsUnderlyingConnectionL" ); - - TUint32 retval(KEmptyDest); - - TBool hasNonVirtualCm(EFalse); - - CCmDestinationImpl* dest = CmMgr().DestinationL( aDestinationId ); - CleanupStack::PushL( dest ); - - // is this our parent destination (if there is one) - CCmDestinationImpl* parentDest = ParentDestination(); - if ( parentDest ) - { - if ( dest->Id() == parentDest->Id() ) - { - retval |= KLinksBackToParent; - } - } - delete parentDest; - if ( !( retval & KBindDenied ) ) - { - // filter out: - // empty destinations - // destinations containing VPN in or linked in - // destinations containing emb. dest. if the linked dest is empty - - // so if we found a VPN inside, or a VPN linked through an amb. dest, - // than it should be filtered out. - // it also should be filtered out if it links back - // to our parent dest. in any way... - - TInt count = dest->ConnectionMethodCount(); - - if ( count ) - { - // has at least one CM - retval &= ~KEmptyDest; - for ( TInt j = 0; j < dest->ConnectionMethodCount(); j++ ) - { - CCmPluginBase* cm = dest->GetConnectionMethodL( j ); - CleanupStack::PushL( cm ); - TUint32 cmId = cm->GetIntAttributeL( ECmId ); - - TInt bearerType = CmMgr().GetConnectionMethodInfoIntL( - cmId, ECmBearerType ); - if ( !CmMgr().GetBearerInfoBoolL( bearerType, ECmVirtual ) ) - { - // found a non-virtual connection method - hasNonVirtualCm = ETrue; - } - else - { - // now we have to check if it is an emb.dest., if it is, - // check if the referenced destination is not empty, - // it has at least one, non-virtual CM, - // OR it has another emb.dest., then recurse it... - if ( CmMgr().GetBearerInfoBoolL( bearerType, ECmDestination ) ) - { // it is an emb. destination - // get the emb. destination - CCmDestinationImpl* embdest = cm->Destination(); - TUint32 emdestId = embdest->Id(); - // check if the embeded destination can be used - TUint32 res = CanDestUsedAsUnderlyingConnectionL( emdestId ); - if ( res & KBindDenied ) - { - // emb. dest. can not be used - retval |= (res & KBindDenied ); - } - else - { - // if binding is not denied, still what to do with - // KEmptyDest & KNoNonVirtuals? - // if it does not return KNoNonVirtuals, then it - // has at least one, non-virt. CM - if ( res & KNoNonVirtuals ) - { - // if we already have a non-virt, then it is no - // problem, no need to change hasNonVirtualCm - // as it starts from EFalse. - } - else - { - // if it is not empty, than - // it has at least one, non-virt. CM, so: - if ( !( res & KEmptyDest ) ) - { - hasNonVirtualCm = ETrue; - } - } - // if it is an empty dest., then: - // if we still have the base as empty, then - // there is nothing to do. - // if the base is non-empty, again, nothing to do - if ( !(res & KEmptyDest ) ) - { - // not empty dest, so set base - // value to reflect it - hasNonVirtualCm = ETrue; - } - } - } - else - { - // virtual, but not emb. dest - // check if it is VPN - // if it is VPN, - if ( bearerType == KPluginVPNBearerTypeUid ) - { - retval |= KContainsVpn; - } - } - } - CleanupStack::Pop( cm ); - cm = NULL; // not owned - if ( retval & KBindDenied ) - { // binding is already denied, we can break... - break; - } - } - if ( !hasNonVirtualCm ) - { - retval |= KNoNonVirtuals; - } - } - else - { - retval |= KEmptyDest; - } - } - CleanupStack::PopAndDestroy( dest ); - - return retval; - } - - - -// -------------------------------------------------------------------------- -// CCmPluginVpn::BindableDestinationsL -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::BindableDestinationsL( RArray& aDestinationArray ) - { - LOGGER_ENTERFN( "CCmPluginVpn::BindableDestinationsL" ); - TUint32 upLimit = KCmDefaultDestinationAPTagId + 0xff; - - aDestinationArray.Close(); - if ( BindableRealConnectionsExistL() ) - { - for (TInt i=0; i KCmDefaultDestinationAPTagId && iBindableMethods[i] <= upLimit) ) - { - aDestinationArray.AppendL( iBindableMethods[i] ); - } - } - } - } - - -// -------------------------------------------------------------------------- -// CCmPluginVpn::HasUpstreamVpnL -// -------------------------------------------------------------------------- -// -TBool CCmPluginVpn::HasUpstreamVpnL( TUint32 aId, TBool aIsDestination ) - { - LOGGER_ENTERFN( "CCmPluginVpn::HasUpstreamVpnL" ); - - // the function returns true if: - // - the destination given is referenced by a CM which is either VPN or - // has an upstream VPN - // - the CM given is linked by a VPN or the CM or its destination have - // an upstream VPN - TBool hasUpstreamVpn( EFalse ); - - // array of destinations - RArray destArray( CmMgr().DestinationCountL() ); - CleanupClosePushL( destArray ); - - // get all destinations - CmMgr().AllDestinationsL( destArray ); - - CLOG_WRITE( "CCmPluginVpn::HasUpstreamVpnL checking destinations..." ); - - for ( TInt i = 0; !hasUpstreamVpn && i < destArray.Count(); ++i ) - { - if ( aIsDestination && destArray[i] == aId ) - { - // connection methods cannot link to their parent destination - // so we can skip this round - continue; - } - - CCmDestinationImpl* dest = CmMgr().DestinationL( destArray[i] ); - CleanupStack::PushL( dest ); - - // check out all CM's from destinations - TInt cmCount = dest->ConnectionMethodCount(); - - for ( TInt j = 0; j < cmCount; ++j ) - { - // instantiate a connmethod - CCmPluginBase* cm = dest->GetConnectionMethodL( j ); - CleanupStack::PushL( cm ); - - TUint32 cmId = cm->GetIntAttributeL( ECmId ); - - // ask for the bearer type - TUint32 bearerType = CmMgr().GetConnectionMethodInfoIntL( - cmId, ECmBearerType ); - - // is it virtual? if not, there's nothing to do - if ( CmMgr().GetBearerInfoBoolL( bearerType, ECmVirtual ) ) - { - // it is virtual - - if ( CmMgr().GetBearerInfoBoolL( bearerType, ECmDestination ) ) - { - // what's more, it is an embedded destination - if ( aIsDestination && cm->IsLinkedToSnap( aId ) ) - { - hasUpstreamVpn = - HasUpstreamVpnL( cmId, EFalse ) || - HasUpstreamVpnL( dest->Id(), ETrue ); - } - } - else - { - // it is not an emb.dest. - if ( aIsDestination ) - { - // does it link to this destination? - if ( cm->IsLinkedToSnap( aId ) ) - { - hasUpstreamVpn = - ( bearerType == KPluginVPNBearerTypeUid ) || - HasUpstreamVpnL( cmId, EFalse ) || - HasUpstreamVpnL( dest->Id(), ETrue ); - } - } - else - { - CCmPluginBase* targetCm = - CmMgr().GetConnectionMethodL( aId ); - CleanupStack::PushL( targetCm ); - - // does it link to this CM or to its destination? - if ( cm->IsLinkedToIap( aId ) ) - { - hasUpstreamVpn = - ( bearerType == KPluginVPNBearerTypeUid ) || - HasUpstreamVpnL( cmId, EFalse ); - } -/************** after cmmanager fix ************** - CCmDestinationImpl* parentDest = targetCm->ParentDestination(); - else if ( parentDest && - cm->IsLinkedToSnap( - parentDest->Id() ) ) - { - hasUpstreamVpn = - ( bearerType == KPluginVPNBearerTypeUid ) || - HasUpstreamVpnL( cmId, EFalse ) || - HasUpstreamVpnL( dest->Id(), ETrue ); - } - delete parentDest; -***************************************************/ - else - { - TUint32 parent( 0 ); - parent = FindParentDestinationL( aId ); - - if ( parent && cm->IsLinkedToSnap( parent ) ) - { - hasUpstreamVpn = - ( bearerType == KPluginVPNBearerTypeUid ) || - HasUpstreamVpnL( cmId, EFalse ) || - HasUpstreamVpnL( dest->Id(), ETrue ); - } - - } - - CleanupStack::PopAndDestroy( targetCm ); - } - - } // if !emb.dest. - - } // if virtual - - CleanupStack::Pop( cm ); - } // for j - - CleanupStack::PopAndDestroy( dest ); - } // for i - - CleanupStack::PopAndDestroy( &destArray ); - - - // if we already know the answer, jump out here - if (hasUpstreamVpn) - { - return hasUpstreamVpn; - } - - - CLOG_WRITE( "CCmPluginVpn::HasUpstreamVpnL checking uncategorized group..." ); - - // we have to check the uncategorized, too - - RArray cmArray ( KCmArrayMediumGranularity ); - CleanupClosePushL( cmArray ); - - CmMgr().ConnectionMethodL( cmArray ); - - // search for virtual CM's - for ( TInt k = 0; !hasUpstreamVpn && k < cmArray.Count(); ++k ) - { - TInt bearerType = CmMgr().GetConnectionMethodInfoIntL( cmArray[k], - ECmBearerType ); - - if ( CmMgr().GetBearerInfoBoolL( bearerType, ECmVirtual ) ) - { - // if virtual, does it link to this destination? - - CCmPluginBase* cm = CmMgr().GetConnectionMethodL( cmArray[k] ); - CleanupStack::PushL( cm ); - - TUint32 cmId = cm->GetIntAttributeL( ECmId ); - - if ( aIsDestination ) - { - // does it link to this destination? - if ( cm->IsLinkedToSnap( aId ) ) - { - hasUpstreamVpn = - ( bearerType == KPluginVPNBearerTypeUid ) || - HasUpstreamVpnL( cmId, EFalse ); - } - } - else - { - // does it link to this CM? - if ( cm->IsLinkedToIap( aId ) ) - { - hasUpstreamVpn = - ( bearerType == KPluginVPNBearerTypeUid ) || - HasUpstreamVpnL( cmId, EFalse ); - } - - } - - CleanupStack::PopAndDestroy( cm ); - } // if virtual - - } // for k - - - CleanupStack::PopAndDestroy( &cmArray ); - - return hasUpstreamVpn; - } - - - -// -------------------------------------------------------------------------- -// CCmPluginVpn::FilterPossibleParentsL -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::FilterPossibleParentsL( RArray& aDests ) - { - LOGGER_ENTERFN( "CCmPluginVpn::FilterPossibleParentsL" ); - - // check if there is any destination into which this VPN could be put - - // Filter out invalid destinations - for ( TInt i = 0; i < aDests.Count(); ++i ) - { - if ( HasUpstreamVpnL( aDests[i], ETrue ) ) - { - aDests.Remove( i ); - --i; - } - } - - // also filter out the underlying connection's destination - if ( aDests.Count() ) - { - // still have work to do - TUint32 destId = 0; - - if ( iVirtualRecord->iNextLayerSNAP ) - { - // the VPN links to a destination - destId = iVirtualRecord->iNextLayerSNAP; - } - else if ( iVirtualRecord->iNextLayerIAP ) - { - // the VPN links to a connmethod, find out parent destination id - -/********** after CmManager fix *********************** - CCmPluginBase* cm = CmMgr().GetConnectionMethodL( - iVirtualRecord->iNextLayerIAP ); - - CCmDestinationImpl* parentDest = cm->ParentDestination(); - if ( parentDest ) - { - // take the id only if cm has a parent - destId = parentDest->Id(); - } - - delete cm; - delete parentDest; -*******************************************************/ - destId = FindParentDestinationL( iVirtualRecord->iNextLayerIAP ); - } - - - // now search for the id - if ( destId ) - { - TInt index = aDests.Find( destId ); - if ( index != KErrNotFound ) - { - // got it, remove - aDests.Remove( index ); - } - } - - } // if aDests.Count - - - } - - -TUint32 CCmPluginVpn::FindParentDestinationL( TUint32 aCmId ) - { - LOGGER_ENTERFN( "CCmPluginVpn::FindParentDestinationL" ); - - TBool found = EFalse; - TUint32 targetDestId( 0 ); - - RArray destinations( CmMgr().DestinationCountL() ); - - CmMgr().AllDestinationsL( destinations ); - CleanupClosePushL( destinations ); - - for ( TInt i = 0; i < destinations.Count() && !found; i++ ) - { - CCmDestinationImpl* dest = - CmMgr().DestinationL( destinations[i] ); - CleanupStack::PushL( dest ); - - TInt cmCount = dest->ConnectionMethodCount(); - - for ( TInt j = 0; j < cmCount && !found; j++ ) - { - // instantiate a connmethod - CCmPluginBase* cm = dest->GetConnectionMethodL( j ); - CleanupStack::PushL( cm ); - TUint32 cmId = cm->GetIntAttributeL( ECmId ); - - if ( cmId == aCmId) - { - targetDestId = destinations[i]; - found = ETrue; - } - - CleanupStack::Pop( cm ); - } - - CleanupStack::PopAndDestroy( dest ); - } - - CleanupStack::PopAndDestroy( &destinations ); - - return targetDestId; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::DeleteAdditionalRecordsL -// -------------------------------------------------------------------------- -// -void CCmPluginVpn::DeleteAdditionalRecordsL() - { - LOGGER_ENTERFN( "CCmPluginVpn::DeleteAdditionalRecordsL" ); - - // Virtual record must be deleted - iVirtualRecord->DeleteL( Session() ); - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::GenerateVPNPointToEasyWLANLC -// -------------------------------------------------------------------------- -// -HBufC* CCmPluginVpn::GenerateVPNPointToWLANNetworkLC(RResourceFile& rf, HBufC*& aName) - { - LOGGER_ENTERFN( "CCmPluginVpn::GenerateVPNPointToWLANNetworkLC" ); - aName = NULL; - - HBufC8* readBuffer2 = rf.AllocReadLC( R_QTN_NETW_CONSET_VPN_EASY_WLAN ); - const TPtrC16 ptrReadBuffer2( (TText16*) readBuffer2->Ptr(), - ( readBuffer2->Length() + 1 ) >> 1 ); - aName = HBufC16::NewL( ptrReadBuffer2.Length() ); - *aName = ptrReadBuffer2; - - CleanupStack::PopAndDestroy( readBuffer2 ); - CleanupStack::PushL( aName ); - - return aName; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::CheckValidityAndConvertDestinationIdL -// -------------------------------------------------------------------------- -// -TInt CCmPluginVpn::CheckValidityAndConvertDestinationIdL( TUint32 aDestId ) - { - TInt id( 0 ); - - if ( aDestId > 0 && aDestId < 255 ) - { - id = aDestId + KCmDefaultDestinationAPTagId; - } - else if ( aDestId > KCmDefaultDestinationAPTagId - && ( aDestId < ( KCmDefaultDestinationAPTagId+255 ) ) ) - { - id = aDestId; - } - else - { - User::Leave( KErrArgument ); - } - - return id; - } - -// -------------------------------------------------------------------------- -// CCmPluginVpn::DefaultAPRecordL -// -------------------------------------------------------------------------- -// -const TMDBElementId CCmPluginVpn::DefaultAPRecordL( const TInt aTierIdentifier ) - { - LOGGER_ENTERFN( "CCmPluginVpn::DefaultAPRecordL" ); - // Resolve the Default SNAP AP elementid - // - CCDTierRecord* tierRecord = static_cast( - CCDRecordBase::RecordFactoryL( KCDTIdTierRecord ) ); - - CleanupStack::PushL( tierRecord ); - - // Find the correct tier table based on given identifier. - // - tierRecord->iRecordTag = aTierIdentifier; - if ( !tierRecord->FindL( Session() ) ) - { - User::Leave( KErrCorrupt ); - } - - // Find out the default AP for IP connections. - // - TMDBElementId defaultAP = tierRecord->iDefaultAccessPoint; - - // Cleanup tier record. - // - CleanupStack::PopAndDestroy( tierRecord ); - - return defaultAP; - } - -// eof diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/src/cmpvpnnextlayerselectdlg.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/src/cmpvpnnextlayerselectdlg.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,804 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Popup for selecting the underlying connection method or -* destination for a VPN connection method -* -*/ - - -// includes -#include // arrays -#include // icons -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // CEikFormattedCellListBox -#include -#include -#include - -#include -#include - -#include "cmlogger.h" -#include "cmdestinationimpl.h" -#include "cmmanagerimpl.h" -#include "cmpvpnnextlayerselectdlg.h" -#include "cmvpncommonconstants.h" -#include -#include - -using namespace CMManager; -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::NewL -// -------------------------------------------------------------------------- -// -CmPluginVpnNextLayerSelectDlg* CmPluginVpnNextLayerSelectDlg::NewL( - CCmPluginBaseEng& aCmPluginBaseEng, - RArray& aBindableMethods, - TBool& aSnapSelected, - TUint32& aNextLayerId ) - { - CmPluginVpnNextLayerSelectDlg* self = - new ( ELeave ) CmPluginVpnNextLayerSelectDlg( aCmPluginBaseEng, - aBindableMethods, - aSnapSelected, - aNextLayerId, - 0 ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::CmPluginVpnNextLayerSelectDlg -// -------------------------------------------------------------------------- -// -CmPluginVpnNextLayerSelectDlg::CmPluginVpnNextLayerSelectDlg( - CCmPluginBaseEng& aCmPluginBaseEng, - RArray& aBindableMethods, - TBool& aSnapSelected, - TUint32& aNextLayerId, - TInt aDummyIndex ) - : CAknListQueryDialog( &aDummyIndex ) - , iMyEikonEnv( *CEikonEnv::Static() ) - , iCmPluginBaseEng( aCmPluginBaseEng ) - , iSnapSelected( aSnapSelected ) - , iNextLayerId( aNextLayerId ) - , iResourceReader( *CCoeEnv::Static() ) - , iDestinations( aBindableMethods ) - , iEasyWlanId(0) - , iCmManager( iCmPluginBaseEng.CmMgr() ) - , iUncatItems( EFalse ) - { - ; - } - - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::~CmPluginVpnPolicySelectionDlg -// -------------------------------------------------------------------------- -// -CmPluginVpnNextLayerSelectDlg::~CmPluginVpnNextLayerSelectDlg() - { - if ( iAsyncCancel ) - { - delete iAsyncCancel; - iAsyncCancel = NULL; - } - - iResourceReader.Close(); - } - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::ConstructL -// -------------------------------------------------------------------------- -// -void CmPluginVpnNextLayerSelectDlg::ConstructL() - { - LoadResourceL( KPluginVPNResDirAndFileName ); - - // get the EasyWlan id if it's supported - if ( FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ) ) - { - iEasyWlanId = iCmManager.EasyWlanIdL(); - } - } - -// --------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::CancelAsynchronouslyL -// --------------------------------------------------------------------------- -TInt CmPluginVpnNextLayerSelectDlg::CancelAsynchronouslyL( TAny* aObject ) - { - CmPluginVpnNextLayerSelectDlg* myself = - static_cast< CmPluginVpnNextLayerSelectDlg* >( aObject ); - - myself->TryExitL( EAknSoftkeyCancel ); - return 0; - } - -// ---------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::PreLayoutDynInitL -// ---------------------------------------------------------------------------- -// -void CmPluginVpnNextLayerSelectDlg::PreLayoutDynInitL() - { - CAknDialog::ConstructL( R_VPN_REAL_CM_SELECTION_MENUBAR ); - - // Let the base class do its job first - CAknListQueryDialog::PreLayoutDynInitL(); - - SetTextsAndIconsL(); - } - -// ---------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::OkToExitL -// ---------------------------------------------------------------------------- -// -TBool CmPluginVpnNextLayerSelectDlg::OkToExitL( TInt aButtonId ) - { - TBool result = EFalse; - - if ( aButtonId == EAknSoftkeyDone || aButtonId == EAknSoftkeyOk ) - { - result = ETrue; - } - else if ( aButtonId == EAknSoftkeySelect ) - { - ProcessCommandL( ECmManagerUiCmdDestSelect ); - } - else if ( aButtonId == EAknSoftkeyOptions ) - { - ProcessCommandL( EAknSoftkeyOptions ); - } - else if ( aButtonId == EAknSoftkeyBack || aButtonId == EAknSoftkeyCancel ) - { - result = ETrue; - } - else - { - - } - - return result; - } - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::SetTextsAndIconsL -// -------------------------------------------------------------------------- -// -void CmPluginVpnNextLayerSelectDlg::SetTextsAndIconsL() - { - LOGGER_ENTERFN( "CmPluginVpnNextLayerSelectDlg::SetTextsAndIconsL" ); - - // Item text array - CDesCArray* itemArray = - new ( ELeave ) CDesCArrayFlat( KCmArrayMediumGranularity ); - CleanupStack::PushL( itemArray ); - SetItemTextArray( itemArray ); // ownership taken - SetOwnershipType( ELbmOwnsItemArray ); - CleanupStack::Pop( itemArray ); // as ownership is taken - - // Icon array - CArrayPtr* icons = - new ( ELeave ) CArrayPtrFlat( KCmArrayMediumGranularity ); - CleanupStack::PushL( icons ); - SetIconArrayL( icons ); - // ownership taken by SetIconArrayL! - CleanupStack::Pop( icons ); // as ownership is taken - - // Step through the Destinations - do not show: - // Parent Destinations or Destinations with no non-virtual CMs - // Show Uncategorised if valid and EasyWlan if supported - TInt destCount = iDestinations.Count(); - for ( TInt i = 0; i < destCount; i++ ) - { - switch ( iDestinations[i] ) - { - case KDestItemUncategorized: - { - // Append 'Uncategorised' if necessary - AppendUncatDestinationL( *itemArray, *icons ); - break; - } - case KDestItemEasyWlan: - { - // Append 'EasyWlan' if supported - TRAPD( err, AppendEasyWlanL( *itemArray, *icons ) ); - if ( err != KErrNotSupported ) - { - User::LeaveIfError( err ); - } - break; - } - // normal destination - default: - { - CCmDestinationImpl* dest = - iCmManager.DestinationL( iDestinations[i] ); - CleanupStack::PushL( dest ); - TInt numCms = dest->ConnectionMethodCount(); - AppendDestinationTextsL( *dest,numCms, *itemArray, *icons ); - CleanupStack::PopAndDestroy( dest ); - break; - } - } - } - } - - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::AppendDestinationsTextsL -// -------------------------------------------------------------------------- -// -void CmPluginVpnNextLayerSelectDlg::AppendDestinationTextsL( - CCmDestinationImpl& aDestination, - TInt aNumCms, - CDesCArray& aItems, - CArrayPtr& aIcons ) - { - LOGGER_ENTERFN( "CmPluginVpnNextLayerSelectDlg::AppendDestinationL" ); - // icon - CGulIcon* icon = ( CGulIcon* ) aDestination.IconL(); - CleanupStack::PushL( icon ); - aIcons.AppendL( icon ); - TInt iconIndex = aIcons.Count() - 1; - CleanupStack::Pop( icon ); // icon array took over ownership - - // compile the list item - HBufC* firstLine = aDestination.NameLC(); - HBufC* secondLine; - - if ( aNumCms == 1 ) - { - secondLine = StringLoader::LoadLC( - R_CMMANAGERUI_CONN_METHODS_AMOUNT_ONE ); - } - else - { - secondLine = StringLoader::LoadLC( - R_CMMANAGERUI_CONN_METHODS_AMOUNT_MANY, - aNumCms ); - } - - HBufC* item = FormatListItemTextsLC( *firstLine, - *secondLine, - iconIndex ); - aItems.AppendL( *item ); - - CleanupStack::PopAndDestroy( item ); - CleanupStack::PopAndDestroy( secondLine ); - CleanupStack::PopAndDestroy( firstLine ); - } - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::AppendUncatDestinationL -// -------------------------------------------------------------------------- -// -void CmPluginVpnNextLayerSelectDlg::AppendUncatDestinationL( - CDesCArray& aItems, - CArrayPtr& aIcons ) - { - LOGGER_ENTERFN( "CmPluginVpnNextLayerSelectDlg::AppendUncatDestinationL" ); - - TParse mbmFile; - User::LeaveIfError( mbmFile.Set( KManagerIconFilename, - &KDC_APP_BITMAP_DIR, - NULL ) ); - - // icon - CGulIcon* icon = AknsUtils::CreateGulIconL( - AknsUtils::SkinInstance(), - KAknsIIDQgnPropSetConnDestUncategorized, - mbmFile.FullName(), - EMbmCmmanagerQgn_prop_set_conn_dest_uncategorized, - EMbmCmmanagerQgn_prop_set_conn_dest_uncategorized_mask ); - CleanupStack::PushL( icon ); - aIcons.AppendL( icon ); - CleanupStack::Pop( icon ); // icon array took over ownership - TInt iconIndex = aIcons.Count() - 1; - - // remove virtual CMs - RArray uncatCms ( KCmArraySmallGranularity ); - iCmManager.ConnectionMethodL( uncatCms ); - CleanupClosePushL( uncatCms ); - - for ( TInt i = 0; i < uncatCms.Count(); i++ ) - { - TInt bearerType = iCmManager.GetConnectionMethodInfoIntL( - uncatCms[i], ECmBearerType ); - - if ( iCmManager.GetBearerInfoBoolL( bearerType, ECmVirtual ) ) - { - uncatCms.Remove(i); - i--; - } - } - - // second line text - HBufC* secondLine; - if ( uncatCms.Count() == 1 ) - { - secondLine = StringLoader::LoadLC( - R_CMMANAGERUI_CONN_METHODS_AMOUNT_ONE ); - } - else - { - secondLine = StringLoader::LoadLC( - R_CMMANAGERUI_CONN_METHODS_AMOUNT_MANY, - uncatCms.Count() ); - } - - // compile the texts - HBufC* item = FormatListItemTextsLC( R_CMMANAGERUI_DEST_UNCATEGORIZED, - *secondLine, - iconIndex ); - aItems.AppendL( *item ); - - CleanupStack::PopAndDestroy( item ); - CleanupStack::PopAndDestroy( secondLine ); - CleanupStack::PopAndDestroy( &uncatCms ); - } - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::AppendEasyWlanL -// -------------------------------------------------------------------------- -// -void CmPluginVpnNextLayerSelectDlg::AppendEasyWlanL( - CDesCArray& aItems, - CArrayPtr& aIcons ) - { - LOGGER_ENTERFN( "CmPluginVpnNextLayerSelectDlg::AppendEasyWlanL" ); - - // icon - CCmPluginBase* cm = iCmManager.GetConnectionMethodL( iEasyWlanId ); - CleanupStack::PushL( cm ); - CGulIcon* icon = ( CGulIcon* ) cm->GetIntAttributeL( ECmBearerIcon ); - CleanupStack::PushL( icon ); - aIcons.AppendL( icon ); // ownership passed to array - TInt iconIndex = aIcons.Count() - 1; - CleanupStack::Pop( icon ); - CleanupStack::PopAndDestroy( cm ); - - // compile the texts - HBufC* easyWlan = FormatListItemTextsLC( - R_QTN_NETW_CONSET_VPN_EASY_WLAN, - R_QTN_NETW_CONSET_VPN_EASY_WLAN_PROMPT, - iconIndex ); - aItems.AppendL( *easyWlan ); - - CleanupStack::PopAndDestroy( easyWlan ); - } - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::DynInitMenuPaneL -// -------------------------------------------------------------------------- -// -void CmPluginVpnNextLayerSelectDlg::DynInitMenuPaneL( - TInt aResourceId, CEikMenuPane* aMenuPane ) - { - if ( aResourceId == R_VPN_REAL_CM_SELECTION_MENU ) - { - if (!iCmManager.IsHelpOn()) - { - aMenuPane->DeleteMenuItem( EAknCmdHelp ); - } - TUint32 highlighted = iDestinations[ ListBox()->CurrentItemIndex() ]; - - switch ( highlighted ) - { - case KDestItemUncategorized: - { - aMenuPane->SetItemDimmed( ECmManagerUiCmdDestSelect, ETrue ); - break; - } - case KDestItemEasyWlan: - { - aMenuPane->SetItemDimmed( ECmManagerUiCmdCMSelect, ETrue ); - break; - } - default: - { - break; - } - } - } - } - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::ProcessCommandL -// -------------------------------------------------------------------------- -// -void CmPluginVpnNextLayerSelectDlg::ProcessCommandL( TInt aCommandId ) - { - if ( MenuShowing() ) - { - HideMenu(); - } - switch ( aCommandId ) - { - case EAknSoftkeyOptions: - { - DisplayMenuL(); - break; - } - case ECmManagerUiCmdDestSelect: - { - TUint32 destId = iDestinations[ ListBox()->CurrentItemIndex() ]; - - if ( destId != KDestItemUncategorized ) - { - TUint32 attribute = ECmNextLayerSNAPId; - - // EasyWlan was selected - if ( destId == KDestItemEasyWlan ) - { - attribute = ECmNextLayerIapId; - destId = iEasyWlanId; - } - iCmPluginBaseEng.SetIntAttributeL( attribute, destId ); - - // We cannot use TryExitL here, since if the pointer event - // handling is ongoing, i.e., we got here from this class's - // HandleListBoxEventL, there will be a KERN-EXEC 3 panic. - // Calling base class HandleListBoxEventL will exit the - // dialog asynchronously with return value ETrue. - CAknListQueryDialog::HandleListBoxEventL( ListBox(), - EEventItemSingleClicked ); - break; - } - - // For uncategorised destinations, flow through to ECmManagerUiCmdCMSelect - } - case ECmManagerUiCmdCMSelect: - { - // select a connection method from the highlighted destination - TUint32 destId = iDestinations[ ListBox()->CurrentItemIndex() ]; - TUint32 cmId (0); - if ( ShowCMSelectionDlgL( destId, cmId ) ) - { - iCmPluginBaseEng.SetIntAttributeL( ECmNextLayerIapId, cmId ); - - // We cannot use TryExitL here, since if the pointer event - // handling is ongoing, i.e., we got here from this class's - // HandleListBoxEventL, there will be a KERN-EXEC 3 panic. - // Calling base class HandleListBoxEventL will exit the - // dialog asynchronously with return value ETrue. - CAknListQueryDialog::HandleListBoxEventL( ListBox(), - EEventItemSingleClicked ); - } - else - { - // We need to exit asynchronously, in case we ended up here - // from HandleListBoxEventL. The callback function will exit - // the dialog with return value EFalse. - TCallBack cb( CancelAsynchronouslyL, this ); - iAsyncCancel = new( ELeave ) CAsyncCallBack( cb, CActive::EPriorityHigh ); - iAsyncCancel->CallBack(); - } - break; - } - case EAknCmdHelp: - { - HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), - iEikonEnv->EikAppUi()->AppHelpContextL() ); - } - break; - case EAknSoftkeyBack: - { - TryExitL( EAknSoftkeyBack ); - break; - } - default: - { - CAknListQueryDialog::ProcessCommandL( aCommandId ); - break; - } - } - } - -// --------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::OfferKeyEventL -// --------------------------------------------------------------------------- -// -TKeyResponse CmPluginVpnNextLayerSelectDlg::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - TKeyResponse retVal ( EKeyWasNotConsumed ); - TUint highlighted = iDestinations[ ListBox()->CurrentItemIndex() ]; - - switch ( aKeyEvent.iScanCode ) - { - case EStdKeyDownArrow: - case EStdKeyUpArrow: - { - // If focus is on the 'uncategorised' destination, - // change the soft key to 'Open' - if ( highlighted == KDestItemUncategorized ) - { - ButtonGroupContainer().SetCommandL( - ECmManagerUiCmdDestSelect, - *( StringLoader::LoadLC( R_QTN_MSK_OPEN ) ) - ); - ButtonGroupContainer().DrawDeferred(); - CleanupStack::PopAndDestroy(); - } - else - { - ButtonGroupContainer().SetCommandL( - ECmManagerUiCmdDestSelect, - *( StringLoader::LoadLC( R_QTN_MSK_SELECT ) ) - ); - ButtonGroupContainer().DrawDeferred(); - CleanupStack::PopAndDestroy(); - } - break; - } - case EStdKeyNo: - { - TryExitL( EAknSoftkeyCancel ); - return EKeyWasConsumed; - } - default: - { - // If focus is on the 'uncategorised' destination, - // change the soft key to 'Open' - if ( highlighted == KDestItemUncategorized ) - { - ButtonGroupContainer().SetCommandL( - ECmManagerUiCmdDestSelect, - *( StringLoader::LoadLC( R_QTN_MSK_OPEN ) ) - ); - ButtonGroupContainer().DrawDeferred(); - CleanupStack::PopAndDestroy(); - } - - if ( aKeyEvent.iCode == EKeyEscape ) - { - TryExitL( EAknSoftkeyCancel ); - return EKeyWasConsumed; - } - } - } - retVal = ListBox()->OfferKeyEventL( aKeyEvent, aType ); - - return retVal; - } - - -// --------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::HandleListBoxEventL -// --------------------------------------------------------------------------- -void CmPluginVpnNextLayerSelectDlg::HandleListBoxEventL( CEikListBox* /*aListBox*/, - TListBoxEvent aEventType ) - { - switch ( aEventType ) - { - case EEventEnterKeyPressed: - case EEventItemSingleClicked: - { - ProcessCommandL( ECmManagerUiCmdDestSelect ); - - break; - } - default: - { - break; - }; - }; - } - - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::LoadResourceL -// -------------------------------------------------------------------------- -// -void CmPluginVpnNextLayerSelectDlg::LoadResourceL( - const TDesC& aResFileName ) - { - LOGGER_ENTERFN( "CmPluginVpnNextLayerSelectDlg::LoadResourceL" ); - TInt err ( KErrNone ); - - // Add resource file. - TParse* fp = new ( ELeave ) TParse(); - err = fp->Set( aResFileName, - &KDC_RESOURCE_FILES_DIR, - NULL ); - if ( err ) - { - User::Leave( err ); - } - - TFileName resourceFileNameBuf = fp->FullName(); - delete fp; - - iResourceReader.OpenL( resourceFileNameBuf ); - } - - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::FormatListItemTextsLC -// -------------------------------------------------------------------------- -// -HBufC* CmPluginVpnNextLayerSelectDlg::FormatListItemTextsLC( - TInt aFirstLineResId, - TInt aSecondLineResId, - TInt aIconIndex ) - { - HBufC* firstLine = StringLoader::LoadLC( aFirstLineResId ); - HBufC* secondLine = StringLoader::LoadLC( aSecondLineResId ); - - HBufC* retVal = FormatListItemTextsL( *firstLine, - *secondLine, - aIconIndex ); - CleanupStack::PopAndDestroy( secondLine ); - CleanupStack::PopAndDestroy( firstLine ); - CleanupStack::PushL( retVal ); - return retVal; - } - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::FormatListItemTextsLC -// -------------------------------------------------------------------------- -// -HBufC* CmPluginVpnNextLayerSelectDlg::FormatListItemTextsLC( - const TDesC& aFirstLine, - const TDesC& aSecondLine, - TInt aIconIndex ) - { - HBufC* retVal = FormatListItemTextsL( aFirstLine, - aSecondLine, - aIconIndex ); - CleanupStack::PushL( retVal ); - return retVal; - } - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::FormatListItemTextsLC -// -------------------------------------------------------------------------- -// -HBufC* CmPluginVpnNextLayerSelectDlg::FormatListItemTextsLC( - TInt aFirstLineResId, - const TDesC& aSecondLine, - TInt aIconIndex ) - { - // Load the first string - HBufC* firstLine = StringLoader::LoadLC( aFirstLineResId ); - - HBufC* retVal = FormatListItemTextsL( *firstLine, - aSecondLine, - aIconIndex ); - CleanupStack::PopAndDestroy( firstLine ); - CleanupStack::PushL( retVal ); - return retVal; - } - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::FormatListItemTextsL -// -------------------------------------------------------------------------- -// -HBufC* CmPluginVpnNextLayerSelectDlg::FormatListItemTextsL( - const TDesC& aFirstLine, - const TDesC& aSecondLine, - TInt aIconIndex ) - { - HBufC* retVal = HBufC::NewL( aFirstLine.Length() + - aSecondLine.Length() + - KNumberOfStaticCharsIn2LineFormattedString ); - - TPtr ptr ( retVal->Des() ); - ptr.AppendNum( aIconIndex ); - ptr.Append( TChar( KSettingsListBoxItemPrefix ) ); - ptr.Append( aFirstLine ); - ptr.Append( TChar( KSettingsListBoxItemPrefix ) ); - ptr.Append( aSecondLine ); - - return retVal; - } - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::ShowCMSelectionDlgL -// -------------------------------------------------------------------------- -// -TBool CmPluginVpnNextLayerSelectDlg::ShowCMSelectionDlgL( - TUint32 aDestinationId, - TUint32& aCmId ) - { - LOGGER_ENTERFN( "CmPluginVpnNextLayerSelectDlg::ShowCMSelectionDlgL" ); - TBool retVal ( EFalse ); - - // Collect item texts - CDesCArrayFlat* items = - new ( ELeave ) CDesCArrayFlat( KCmArraySmallGranularity ); - CleanupStack::PushL( items ); - - RPointerArray cmDataArray ( KCmArrayMediumGranularity ); - iCmManager.CreateFlatCMListLC( aDestinationId , cmDataArray ); - CleanupStack::Pop( &cmDataArray ); - CCmManagerImpl::CleanupResetAndDestroyPushL(cmDataArray); - iCmManager.FilterOutVirtualsL( cmDataArray ); - - - // after it, get the names for each element - // and finally make up the real items array. - - // Get the names of the connection methods - // virtuals are already filtered out, - TInt count = cmDataArray.Count(); - for ( TInt i = 0; i < count; i++ ) - { - HBufC* cmName = - iCmManager.GetConnectionMethodInfoStringL( cmDataArray[i]->GetIntAttributeL( ECmId ), - ECmName ); - CleanupStack::PushL( cmName ); - - // append the name to the string - items->AppendL( *cmName ); - - CleanupStack::PopAndDestroy( cmName ); - } - - // Display the radio button page - TInt selected ( 0 ); - TInt resId( R_VPN_REAL_CM_RADIO_BUTTON_SETTING_PAGE ); - - CAknRadioButtonSettingPage* dlg = - new ( ELeave ) CAknRadioButtonSettingPage( - resId, - selected, - items ); - CleanupStack::PushL( dlg ); - dlg->SetSettingTextL( - *StringLoader::LoadLC( R_CMWIZARD_SELECT_CONN_METHOD ) ); - CleanupStack::PopAndDestroy(); - CleanupStack::Pop( dlg ); - - TInt result = 0; - TRAPD( err, result = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ); - - User::LeaveIfError( err ); - - if ( result ) - - { - // store result - aCmId = cmDataArray[ selected ]->GetIntAttributeL( ECmId ); - retVal = ETrue; - } - - CleanupStack::PopAndDestroy( &cmDataArray ); - CleanupStack::PopAndDestroy( items ); - return retVal; - } - - -// -------------------------------------------------------------------------- -// CmPluginVpnNextLayerSelectDlg::GetHelpContext -// -------------------------------------------------------------------------- -// -void CmPluginVpnNextLayerSelectDlg::GetHelpContext( - TCoeHelpContext& aContext ) const - { - aContext.iMajor = KHelpUidPlugin; - aContext.iContext = KSET_HLP_VPN_DEST_ASSOC_VIEW; - } - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/src/cmpvpnpolicyselectiondlg.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/src/cmpvpnpolicyselectiondlg.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,339 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Displays a radio button selection list of VPN policies -* -*/ - - -// includes -#include -// #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cmlogger.h" -#include "cmpvpnpolicyselectiondlg.h" -#include "cmvpncommonconstants.h" -#include -#include - -using namespace CMManager; - -// ---------------------------------------------------------------------------- -// CmPluginVpnPolicySelectionDlg::NewL -// ---------------------------------------------------------------------------- -// -CmPluginVpnPolicySelectionDlg* CmPluginVpnPolicySelectionDlg::NewL( - CCmPluginBaseEng& aCmPluginBaseEng ) - { - CmPluginVpnPolicySelectionDlg* self = - new ( ELeave ) CmPluginVpnPolicySelectionDlg( aCmPluginBaseEng ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ---------------------------------------------------------------------------- -// CmPluginVpnPolicySelectionDlg::~CmPluginVpnPolicySelectionDlg -// ---------------------------------------------------------------------------- -// -CmPluginVpnPolicySelectionDlg::~CmPluginVpnPolicySelectionDlg() - { - - iVpnServ.Close(); - - delete iPolicyInfoList; - - iResourceReader.Close(); - } - -// ---------------------------------------------------------------------------- -// CmPluginVpnPolicySelectionDlg::CmPluginVpnPolicySelectionDlg -// ---------------------------------------------------------------------------- -// -CmPluginVpnPolicySelectionDlg::CmPluginVpnPolicySelectionDlg( - CCmPluginBaseEng& aCmPluginBaseEng ) - : iCmPluginBaseEng( aCmPluginBaseEng ) - , iResourceReader( *CCoeEnv::Static() ) - , iVpnClientUnaccessible ( EFalse ) - { - } - -// ---------------------------------------------------------------------------- -// CmPluginVpnPolicySelectionDlg::ConstructL -// ---------------------------------------------------------------------------- -// -void CmPluginVpnPolicySelectionDlg::ConstructL() - { - LoadResourceL( KPluginVPNResDirAndFileName ); - - // Get the policies - iPolicyInfoList = - new (ELeave) CArrayFixFlat( KCmArrayMediumGranularity ); - - TInt err( iVpnServ.Connect() ); - - // Vpn client is inaccessible - if ( err ) - { - VpnClientInaccessibleL(); - } - else - { - iVpnServ.GetPolicyInfoList( iPolicyInfoList ); - iVpnServ.EnumeratePolicies( iNumPolicies ); - } - } - -// ---------------------------------------------------------------------------- -// CmPluginVpnPolicySelectionDlg::LoadResourceL -// ---------------------------------------------------------------------------- -// -void CmPluginVpnPolicySelectionDlg::LoadResourceL( const TDesC& aResFileName ) - { - TInt err( KErrNone ); - - // Add resource file. - TParse* fp = new ( ELeave ) TParse(); - err = fp->Set( aResFileName, - &KDC_RESOURCE_FILES_DIR, - NULL ); - if ( err ) - { - User::Leave( err ); - } - - TFileName resourceFileNameBuf = fp->FullName(); - delete fp; - - iResourceReader.OpenL( resourceFileNameBuf ); - } - -// ---------------------------------------------------------------------------- -// CmPluginVpnPolicySelectionDlg::ShowPolicySelectionListL -// ---------------------------------------------------------------------------- -// -TBool CmPluginVpnPolicySelectionDlg::ShowPolicySelectionListL() - { - LOGGER_ENTERFN( "CmPluginVpnPolicySelectionDlg::ShowPolicySelectionListL" ); - TBool retVal ( EFalse ); - - CEikTextListBox* list = new ( ELeave ) CAknSinglePopupMenuStyleListBox; - CleanupStack::PushL( list ); - - // Create popup list - CAknPopupList* popupList = CAknPopupList::NewL( - list, - R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, - AknPopupLayouts::EMenuWindow); - CleanupStack::PushL( popupList ); - - // initialise listbox. - list->ConstructL(popupList, CEikListBox::ELeftDownInViewRect); - list->CreateScrollBarFrameL( ETrue ); - list->ScrollBarFrame()->SetScrollBarVisibilityL( - CEikScrollBarFrame::EOff, - CEikScrollBarFrame::EAuto); - - - MDesCArray* itemList = list->Model()->ItemTextArray(); - CDesCArray* items = ( CDesCArray* ) itemList; - - // collect the item texts - if ( iNumPolicies ) - { - for ( TInt i = 0; i < iNumPolicies; i++ ) - { - HBufC* polName = ( iPolicyInfoList->At(i) ).iName.AllocLC(); - items->AppendL( *polName ); - CleanupStack::PopAndDestroy( polName ); - } - - // title - HBufC* title = StringLoader::LoadLC( R_QTN_NETW_CONSET_PRMPT_VPN_POLICY ); - popupList->SetTitleL( *title ); - CleanupStack::PopAndDestroy( title ); - - // dislay dialog - CleanupStack::Pop( popupList ); - if ( popupList->ExecuteLD() ) - { - TInt ix = list->CurrentItemIndex(); - - // Set VPN Policy to be used - HBufC* polName = ( iPolicyInfoList->At(ix) ).iName.AllocLC(); - HBufC* polId = ( iPolicyInfoList->At(ix) ).iId.AllocLC(); - - CLOG_WRITE_2( "New policy settings:[%S], [%S]", polName, polId ); - - iCmPluginBaseEng.SetStringAttributeL( EVpnServicePolicyName, *polName ); - iCmPluginBaseEng.SetStringAttributeL( EVpnServicePolicy, *polId ); - CleanupStack::PopAndDestroy( polId ); - CleanupStack::PopAndDestroy( polName ); - - retVal = ETrue; - } - } - else - { - if (!iVpnClientUnaccessible) - { - // display error note - HBufC* text = StringLoader::LoadLC( R_QTN_VPN_INFO_NO_POLICIES_INSTALLED ); - TCmCommonUi::ShowNoteL( *text, TCmCommonUi::ECmInfoNote ); - CleanupStack::PopAndDestroy( text ); - } - CleanupStack::PopAndDestroy( popupList ); - } - - - CleanupStack::PopAndDestroy( list ); - return retVal; - } - - -// ---------------------------------------------------------------------------- -// CmPluginVpnPolicySelectionDlg::ShowPolicySelectionDlgL -// ---------------------------------------------------------------------------- -// -TBool CmPluginVpnPolicySelectionDlg::ShowPolicySelectionDlgL() - { - LOGGER_ENTERFN( "CmPluginVpnPolicySelectionDlg::ShowPolicySelectionDlgL" ); - TBool retVal ( EFalse ); - - TInt selection(0); - - // Compile the list items - CDesCArrayFlat* items = - new ( ELeave ) CDesCArrayFlat( KCmArraySmallGranularity ); - CleanupStack::PushL( items ); - - TInt vpnerr; - vpnerr = iVpnServ.EnumeratePolicies( iNumPolicies ); - - if ( vpnerr ) - { - VpnClientInaccessibleL(); - } - else - { - if ( iNumPolicies ) - { - vpnerr = iVpnServ.GetPolicyInfoList( iPolicyInfoList ); - if ( vpnerr == 0 ) - { - for ( TInt i = 0; i < iNumPolicies; i++ ) - { - HBufC* policyName = - ( iPolicyInfoList->At(i) ).iName.AllocLC(); - - - // indicate if this policy is the one in the settings - HBufC* val = iCmPluginBaseEng.GetStringAttributeL( - EVpnServicePolicyName ); - - if ( !( val->Compare( policyName->Des() ) ) ) - { - selection = i; - } - delete val; - - items->AppendL( *policyName ); - CleanupStack::PopAndDestroy( policyName ); - } - // Create the dialog - CAknRadioButtonSettingPage* dlg = - new ( ELeave ) CAknRadioButtonSettingPage( - R_RADIO_BUTTON_SETTING_PAGE_OK_CANCEL, - selection, - items ); - CleanupStack::PushL( dlg ); - - // set title - HBufC* title = StringLoader::LoadLC( - R_QTN_VPN_SETT_VPN_IAP_POLICY_REFERENCE ); - dlg->SetSettingTextL( *title ); - CleanupStack::PopAndDestroy( title ); - - // display dialog - CleanupStack::Pop(); - if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) - { - HBufC* polId = - ( iPolicyInfoList->At( selection ) ).iId.AllocLC(); - HBufC* polName = - ( iPolicyInfoList->At( selection ) ).iName.AllocLC(); - iCmPluginBaseEng.SetStringAttributeL( EVpnServicePolicyName, - *polName ); - - CLOG_WRITE_2( "New policy settings:[%S], [%S]", polName, polId ); - - iCmPluginBaseEng.SetStringAttributeL( EVpnServicePolicy, - *polId ); - CleanupStack::PopAndDestroy( polName ); - CleanupStack::PopAndDestroy( polId ); - retVal = ETrue; - } - } - } - else - { - // note: no VPN policies installed, reset policy to compulsory - CLOG_WRITE("No policy installed, reset policies"); - - HBufC* text = StringLoader::LoadLC( - R_QTN_VPN_INFO_NO_POLICIES_INSTALLED ); - TCmCommonUi::ShowNoteL( *text, TCmCommonUi::ECmInfoNote ); - CleanupStack::PopAndDestroy( text ); - vpnerr = -1; - } - } - - if ( vpnerr ) - { - // note: no VPN policies installed or any other vpn error, - // reset policy to compulsory - CLOG_WRITE("Reset policies"); - - iCmPluginBaseEng.SetStringAttributeL( EVpnServicePolicyName, - KNullDesC() ); - iCmPluginBaseEng.SetStringAttributeL( EVpnServicePolicy, - KNullDesC() ); - - } - - CleanupStack::PopAndDestroy( items ); - return retVal; - } - - -// ---------------------------------------------------------------------------- -// CmPluginVpnPolicySelectionDlg::VpnClientInaccessibleL -// ---------------------------------------------------------------------------- -// -void CmPluginVpnPolicySelectionDlg::VpnClientInaccessibleL() - { - LOGGER_ENTERFN( "CmPluginVpnPolicySelectionDlg::VpnClientInaccessibleL" ); - HBufC* text = StringLoader::LoadLC( R_QTN_VPN_INFO_MGMT_UI_NOT_ACCESSIBLE ); - TCmCommonUi::ShowNoteL( *text, TCmCommonUi::ECmInfoNote ); - CleanupStack::PopAndDestroy( text ); - iVpnClientUnaccessible = ETrue; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginvpn/src/cmpvpnsettingsdlg.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginvpn/src/cmpvpnsettingsdlg.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,614 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Dialog for editing VPN settings for a VPN -* connection method -* -*/ - -// INCLUDE FILES -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cmlogger.h" -#include "cmmanagerimpl.h" -#include "cmpluginvpn.h" -#include "cmpvpnsettingsdlg.h" -#include "cmvpncommonconstants.h" -#include -#include "cmpvpnpolicyselectiondlg.h" -#include -#include -#include "cmconnsettingsuiimpl.h" -#include "cmdestinationimpl.h" -#include "cmmanagerimpl.h" - -using namespace CMManager; - - -// ================= MEMBER FUNCTIONS ======================================= - -// -------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::NewL() -// Two-phase dconstructor, second phase is ConstructAndRunLD -// -------------------------------------------------------------------------- -// -CmPluginVpnSettingsDlg* CmPluginVpnSettingsDlg::NewL( - CCmPluginBaseEng& aCmPluginBase ) - { - CmPluginVpnSettingsDlg* self = - new ( ELeave ) CmPluginVpnSettingsDlg( aCmPluginBase ); - return self; - } - -// -------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::CmPluginVpnSettingsDlg() -// -------------------------------------------------------------------------- -// -CmPluginVpnSettingsDlg::CmPluginVpnSettingsDlg( - CCmPluginBaseEng& aCmPluginBase ) - : CmPluginBaseSettingsDlg( aCmPluginBase ) - { - - } - -//--------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::ConstructAndRunLD -// -------------------------------------------------------------------------- -// -TInt CmPluginVpnSettingsDlg::ConstructAndRunLD( ) - { - LOGGER_ENTERFN( "CmPluginVpnSettingsDlg::ConstructAndRunLD" ); - CleanupStack::PushL( this ); - LoadResourceL( KPluginVPNResDirAndFileName ); - - // check if VPN is available, as if not, we can not show the details... - RVpnServ ps; - CleanupClosePushL( ps ); - TInt err = ps.Connect(); - if ( err ) - { - // show note - HBufC* text = StringLoader::LoadLC( - R_QTN_VPN_INFO_MGMT_UI_NOT_ACCESSIBLE ); - TCmCommonUi::ShowNoteL( *text, TCmCommonUi::ECmInfoNote ); - CleanupStack::PopAndDestroy( text ); - User::Leave( KLeaveWithoutAlert ); - } - CleanupStack::PopAndDestroy(); // ps.close - - // check for compulsory fields missing & display note about it - // information note VPN access point is incomplete. Try reconfiguring - // the access point. §qtn.vpn.info.vpn.iap.incomplete§ is displayed and - // Must be defined qtn_selec_setting_compulsory is displayed - // for the invalid settings. - if ( !CompulsoryFilledL() ) - { - // show note - HBufC* text = StringLoader::LoadLC( - R_QTN_VPN_INFO_VPN_IAP_INCOMPLETE ); - TCmCommonUi::ShowNoteL( *text, TCmCommonUi::ECmInfoNote ); - CleanupStack::PopAndDestroy( text ); - } - - CleanupStack::Pop( this ); - - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherRegisterL( this ); - - return CmPluginBaseSettingsDlg::ConstructAndRunLD( ); - } - -// -------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::~CmPluginVpnSettingsDlg -// Destructor -// -------------------------------------------------------------------------- -// -CmPluginVpnSettingsDlg::~CmPluginVpnSettingsDlg() - { - iResourceReader.Close(); - } - -// -------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::UpdateListBoxContentBearerSpecificL -// -------------------------------------------------------------------------- -// -void CmPluginVpnSettingsDlg::UpdateListBoxContentBearerSpecificL( - CDesCArray& aItemArray ) - { - LOGGER_ENTERFN( "CmPluginVpnSettingsDlg::UpdateListBoxContentBearerSpecificL" ); - HBufC* value = NULL; - - // VPN policy - Compulsory field - AppendSettingTextsL( aItemArray, EVpnServicePolicyName ); - - TUint32 iapId = iCmPluginBaseEng.GetIntAttributeL( EVpnIapId ); - TUint32 destId = iCmPluginBaseEng.GetIntAttributeL( ECmNextLayerSNAPId ); - - CCmDestinationImpl* dest = NULL; - - // The underlying CM is a Destination - if ( destId ) - { - dest = iCmPluginBaseEng.CmMgr().DestinationL( destId ); - CleanupStack::PushL( dest ); -// CleanupReleasePushL( dest ); - value = dest->NameLC(); - } - // The underlying CM is a CM - else if ( iapId ) - { - value = iCmPluginBaseEng.CmMgr().GetConnectionMethodInfoStringL( - iapId, ECmName ); - CleanupStack::PushL( value ); - } - else - { - // Must be defined - value = StringLoader::LoadLC( R_QTN_VPN_SETT_VPN_IAP_REAL_NETW_REF_COMPULSORY ); - } - - AppendSettingTextsL( aItemArray, - ECmNextLayerIapId, - R_QTN_VPN_SETT_VPN_IAP_REAL_NETW_REFERENCE, - *value, - ETrue ); - CleanupStack::PopAndDestroy( value ); - - if ( destId ) - { - CleanupStack::PopAndDestroy( dest ); - } - - // Proxy server address - AppendSettingTextsL( aItemArray, ECmProxyServerName ); - // Proxy port number - AppendSettingTextsL( aItemArray, ECmProxyPortNumber ); - - } - - -// -------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::RunAdvancedSettingsL -// -------------------------------------------------------------------------- -// -void CmPluginVpnSettingsDlg::RunAdvancedSettingsL() - { - /* empty functionality */ - } - -// -------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::DynInitMenuPaneL -// -------------------------------------------------------------------------- -// -void CmPluginVpnSettingsDlg::DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - if ( aResourceId == R_PLUGIN_BASE_MENU ) - { - aMenuPane->SetItemDimmed( EPluginBaseCmdAdvanced, ETrue ); - } - } - -// -------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::ShowPopupSettingPageL -// -------------------------------------------------------------------------- -// -TBool CmPluginVpnSettingsDlg::ShowPopupSettingPageL( TUint32 aAttribute, - TInt aCommandId ) - { - LOGGER_ENTERFN( "CmPluginVpnSettingsDlg::ShowPopupSettingPageL" ); - TBool retVal = EFalse; - switch ( aAttribute ) - { - case EVpnServicePolicyName: - { - CmPluginVpnPolicySelectionDlg* dlg = - CmPluginVpnPolicySelectionDlg::NewL( iCmPluginBaseEng ); - CleanupStack::PushL( dlg ); - retVal = dlg->ShowPolicySelectionDlgL(); - UpdateListBoxContentL(); - CleanupStack::PopAndDestroy(); - break; - } - case ECmProxyServerName: - { - retVal = ShowPopupTextSettingPageL( aAttribute ); - break; - } - case EVpnIapId: - case ECmNextLayerIapId: - { - ShowIapSelectionSettingPageL(); - break; - } - case ECmProxyPortNumber: - { - HBufC* proxyName = iCmPluginBaseEng.GetStringAttributeL( ECmProxyServerName ); - if( !proxyName ) - { - break; - } - CleanupStack::PushL( proxyName ); - if( proxyName->Length() ) - { // Port number is allowed to set after proxy address is set. - retVal = ShowPopupPortNumSettingPageL( aAttribute ); - } - CleanupStack::PopAndDestroy(); // proxyName - break; - } - default: - { - CmPluginBaseSettingsDlg::ShowPopupSettingPageL( aAttribute, - aCommandId ); - break; - } - } - return retVal; - } - -// -------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::ShowIapSelectionSettingPageL -// -------------------------------------------------------------------------- -// -TBool CmPluginVpnSettingsDlg::ShowIapSelectionSettingPageL() - { - LOGGER_ENTERFN( "CmPluginVpnSettingsDlg::ShowIapSelectionSettingPageL" ); - TBool retVal( EFalse ); - - CCmConnSettingsUiImpl* settings = - CCmConnSettingsUiImpl::NewL(); - CleanupStack::PushL( settings ); - settings->EnableEasyWlan( ETrue ); - settings->EnableEmptyDestinations( EFalse ); - settings->EnableVirtualCMs( EFalse ); - - CCmDestinationImpl* d = iCmPluginBaseEng.ParentDestination(); - if ( d ) - { - settings->SetDestinationToOmit( d->Id() ); -// settings->EnableUncat( ETrue ); - } - else - { -// settings->EnableUncat( EFalse ); - } - delete d; - settings->EnableUncat( ETrue ); - - CCmPluginVpn* plugin = static_cast - ( &iCmPluginBaseEng ); - - RArray cmArray ( KCmArrayMediumGranularity ); - CleanupClosePushL( cmArray ); - - plugin->BindableDestinationsL( cmArray ); - - settings->SetDestinationArrayToUseL( cmArray ); - - TCmSettingSelection selection; - - // Get the underlying CM - selection.iId = iCmPluginBaseEng.GetIntAttributeL( ECmNextLayerIapId ); - - if ( selection.iId ) - { - selection.iResult = EConnectionMethod; - } - // The underlying CM is a destination - else - { - selection.iResult = EDestination; - selection.iId = iCmPluginBaseEng.GetIntAttributeL( ECmNextLayerSNAPId ); - } - - TBearerFilterArray aFilterArray; - if ( settings->RunApplicationSettingsL( selection, - EShowDestinations | - EShowConnectionMethods , - aFilterArray ) ) - { - switch ( selection.iResult ) - { - case EDestination: - { - iCmPluginBaseEng.SetIntAttributeL( ECmNextLayerSNAPId, selection.iId ); - break; - } - case EConnectionMethod: - { - - iCmPluginBaseEng.SetIntAttributeL( ECmNextLayerIapId, selection.iId ); - break; - } - default: - { - User::Leave( KErrNotSupported ); - } - } - UpdateListBoxContentL(); - - // update the title pane with the new name - HBufC* newCmName = iCmPluginBaseEng.GetStringAttributeL( ECmName ); - CleanupStack::PushL( newCmName ); - iTitlePane->SetTextL( *newCmName ); - CleanupStack::PopAndDestroy( newCmName ); - - retVal = ETrue; - } - CleanupStack::PopAndDestroy( &cmArray ); - CleanupStack::PopAndDestroy( settings ); - return retVal; - } - -// -------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::ProcessCommandL -// -------------------------------------------------------------------------- -// -void CmPluginVpnSettingsDlg::ProcessCommandL( TInt aCommandId ) - { - if ( MenuShowing() ) - { - HideMenu(); - } - - switch ( aCommandId ) - { - case EAknSoftkeyOk: - case EPluginBaseCmdChange: - { - ShowPopupSettingPageL( - iSettingIndex->At( iListbox->CurrentItemIndex() ), - aCommandId ); - break; - } - case EVpnIapId: - case ECmNextLayerIapId: - case ECmProxyServerName: - case ECmProxyPortNumber: - { - TInt attrib = iSettingIndex->At( iListbox->CurrentItemIndex() ); - ShowPopupSettingPageL( attrib, aCommandId ); - break; - } - case EVpnServicePolicyName: - { - CmPluginVpnPolicySelectionDlg* dlg = - CmPluginVpnPolicySelectionDlg::NewL( iCmPluginBaseEng ); - CleanupStack::PushL( dlg ); - if ( dlg->ShowPolicySelectionDlgL() ) - { - // update the setting - UpdateListBoxContentL(); - } - // we might need to update even if not accepted - - CleanupStack::PopAndDestroy(); - break; - } - default: - { - CmPluginBaseSettingsDlg::ProcessCommandL( aCommandId ); - break; - } - } - } - - -// -------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::CompulsoryFilledL -// -------------------------------------------------------------------------- -// -TBool CmPluginVpnSettingsDlg::CompulsoryFilledL() - { - LOGGER_ENTERFN( "CmPluginVpnSettingsDlg::CompulsoryFilledL" ); - - TBool retval = ETrue; - // compulsory settings are ECmName, EVpnIapId, EVpnServicePolicy - - // check name first - HBufC* name = iCmPluginBaseEng.GetStringAttributeL( ECmName ); - if ( ( name->Compare( KNullDesC() ) ) == 0 ) - { - retval = EFalse; - } - delete name; - - // check VPN IAP ID - TUint32 iapid = iCmPluginBaseEng.GetIntAttributeL( EVpnIapId ); - if ( !iapid ) - { - TUint32 nextiapid = iCmPluginBaseEng.GetIntAttributeL( ECmNextLayerIapId ); - TUint32 snapid = iCmPluginBaseEng.GetIntAttributeL( ECmNextLayerSNAPId ); - if ( !(nextiapid ^ snapid) ) - { - retval = EFalse; - } - } - - // check policy - HBufC* polId = iCmPluginBaseEng.GetStringAttributeL( EVpnServicePolicy ); - if ( ( polId->Compare( KNullDesC() ) ) == 0 ) - { - retval = EFalse; - } - delete polId; - - // check policy name - HBufC* polname = iCmPluginBaseEng.GetStringAttributeL( EVpnServicePolicyName ); - if ( ( polname->Compare( KNullDesC() ) ) == 0 ) - { - retval = EFalse; - } - delete polname; - - return retval; - } - - -// -------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::OkToExitL -// Good to know : EAknSoftkeyCancel is never called, because -// EEikDialogFlagNotifyEsc flag is not set in the resource. -// -------------------------------------------------------------------------- -// -TBool CmPluginVpnSettingsDlg::OkToExitL( TInt aButtonId ) - { - // Translate the button presses into commands for the appui & current - // view to handle - TBool retval( EFalse ); - - switch ( aButtonId ) - { - case EAknSoftkeyBack: - { - if ( CompulsoryFilledL() ) - { - if( iIsPossibleToSaveSetting && iHasSettingChanged ) - { - iCmPluginBaseEng.UpdateL(); - iHasSettingChanged = EFalse; - } - retval = ETrue; - - iCmPluginBaseEng.CmMgr().WatcherUnRegister(); - } - else - { - // If there are compulsory fields empty, a confirmation query - // Incomplete VPN access point details. Exit without saving? - // §qtn.vpn.quest.vpn.iap.incomplete.delete§ is displayed. - // show note that compulsory settings are not filled - TInt res = TCmCommonUi::ShowConfirmationQueryL( - R_QTN_VPN_QUEST_VPN_IAP_INCOMPLETE_DELETE ); - if ( res ) - { // quit without save - retval = ETrue; - TUint32 id = iCmPluginBaseEng.GetIntAttributeL( ECmId ); - iCmPluginBaseEng.RestoreAttributeL( ECmName ); - iCmPluginBaseEng.RestoreAttributeL( EVpnServicePolicyName ); - // EVpnServicePolicy has been restored when EVpnServicePolicyName - // is restored. - //iCmPluginBaseEng.RestoreAttributeL( EVpnServicePolicy ); - iCmPluginBaseEng.RestoreAttributeL( EVpnIapId ); - iCmPluginBaseEng.RestoreAttributeL( ECmNextLayerIapId ); - iCmPluginBaseEng.RestoreAttributeL( ECmNextLayerSNAPId ); - iCmPluginBaseEng.RestoreAttributeL( ECmProxyServerName ); - iCmPluginBaseEng.RestoreAttributeL( ECmProxyPortNumber ); - - iCmPluginBaseEng.CmMgr().WatcherUnRegister(); - } - else - { // do not save, reconfigure - retval = EFalse; - } - } - break; - } - default: - { - if( aButtonId == EPluginBaseCmdExit ) - { - iCmPluginBaseEng.CmMgr().WatcherUnRegister(); - } - - retval = CmPluginBaseSettingsDlg::OkToExitL( aButtonId ); - break; - } - } - - return retval; - } - -// -------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::GetHelpContext -// -------------------------------------------------------------------------- -// - -void CmPluginVpnSettingsDlg::GetHelpContext( TCoeHelpContext& aContext ) const - { - LOGGER_ENTERFN( "CmPluginVpnSettingsDlg::GetHelpContext" ); - aContext.iMajor = KHelpUidPlugin; - aContext.iContext = KSET_HLP_VPN_AP_SETTINGS_VIEW; - } - -// -------------------------------------------------------------------------- -// CmPluginVpnSettingsDlg::CommsDatChangesL -// -------------------------------------------------------------------------- -// -void CmPluginVpnSettingsDlg::CommsDatChangesL() - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - CCmDestinationImpl* parentDest = iCmPluginBaseEng.ParentDestination(); - - if ( parentDest ) - { - if( !cmMgr.DestinationStillExistedL( parentDest ) ) - { - cmMgr.WatcherUnRegister(); - // If parent destination diappears with some reason - // then the view must exit back to main view for it - // may be danger if going back to parent view - iExitReason = KDialogUserExit; - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - if( !cmMgr.IsIapStillInDestL( parentDest, iCmPluginBaseEng ) ) - { - cmMgr.WatcherUnRegister(); - // In this case, the view can go back to the parent view - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - // We may have to go back to parent view even though this Iap is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - } - else - { - if( !cmMgr.IapStillExistedL( iCmPluginBaseEng ) ) - { - cmMgr.WatcherUnRegister(); - // In this case, the dialog can go back to the parent view - TryExitL( iExitReason ); - return; - } - - // We may have to go back to parent view even though this Iap is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - } - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/data/10281BB2.rss --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/data/10281BB2.rss Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for project cmpluginwlan -* -*/ - -#include "ecom/registryinfo.rh" - -// Because attribute enums had to be added to namespace CMManager -// it's not possible to included cmpluginwlandef.h -// Thus bearer type id had to be redefine here. -#define KUidWlanBearerType 0x10281BB1 - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = 0x10281BB2; - interfaces = - { - INTERFACE_INFO - { - interface_uid = 0x10207377; // = KCMPluginInterfaceUid - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KUidWlanBearerType; - version_no = 1; - display_name = "Wlan"; - default_data = "Wlan"; - opaque_data = ""; - } - }; - } - }; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/data/cmwlanui.rss --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/data/cmwlanui.rss Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,641 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for project cmpluginwlan -* -*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -NAME WLPL - -RESOURCE RSS_SIGNATURE { } - -RESOURCE TBUF { buf = "cmwlanplugin"; } - - -// LOCALISED STRINGS - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_bearer_supported_wlan -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_bearer_supported_wlan - { - buf = qtn_netw_conset_bearer_supported_wlan; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_bearer_available_wlan -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_bearer_available_wlan - { - buf = qtn_netw_conset_bearer_available_wlan; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_one_wlan_nw_available -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_one_wlan_nw_available - { - buf = qtn_netw_conset_one_wlan_nw_available; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_many_wlan_nw_available -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_many_wlan_nw_available - { - buf = qtn_netw_conset_many_wlan_nw_available; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_network_name -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_network_name - { - buf = qtn_wlan_sett_network_name; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_prmpt_network_name -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_prmpt_network_name - { - buf = qtn_wlan_prmpt_network_name; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_hidden_network -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_hidden_network - { - buf = qtn_wlan_sett_hidden_network; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_network_mode -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_network_mode - { - buf = qtn_wlan_sett_network_mode; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_security_mode -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_security_mode - { - buf = qtn_wlan_sett_security_mode; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_security_settings -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_security_settings - { - buf = qtn_wlan_sett_security_settings; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_hidden_network_no -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_hidden_network_no - { - buf = qtn_wlan_sett_hidden_network_no; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_hidden_network_yes -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_hidden_network_yes - { - buf = qtn_wlan_sett_hidden_network_yes; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_network_mode_infra -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_network_mode_infra - { - buf = qtn_wlan_sett_network_mode_infra; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_prmpt_wlan_nw_mode_and_status -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_prmpt_wlan_nw_mode_and_status - { - buf = qtn_netw_conset_prmpt_wlan_nw_mode_and_status; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_network_mode_infra_public -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_network_mode_infra_public - { - buf = qtn_wlan_network_mode_infra_public; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_network_mode_infra_hidden -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_network_mode_infra_hidden - { - buf = qtn_wlan_network_mode_infra_hidden; - } - - // --------------------------------------------------------------------------- -// r_qtn_wlan_network_mode_adhoc_public -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_network_mode_adhoc_public - { - buf = qtn_wlan_network_mode_adhoc_public; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_network_mode_adhoc_hidden -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_network_mode_adhoc_hidden - { - buf = qtn_wlan_network_mode_adhoc_hidden; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_prmpt_wlan_nw_security_mode -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_prmpt_wlan_nw_security_mode - { - buf = qtn_netw_conset_prmpt_wlan_nw_security_mode; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_wlan_security_mode_open -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_wlan_security_mode_open - { - buf = qtn_netw_conset_wlan_security_mode_open; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_wlan_security_mode_wep -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_wlan_security_mode_wep - { - buf = qtn_netw_conset_wlan_security_mode_wep; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_wlan_security_mode_802_1x -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_wlan_security_mode_802_1x - { - buf = qtn_netw_conset_wlan_security_mode_802_1x; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_wlan_security_mode_wpa -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_wlan_security_mode_wpa - { - buf = qtn_netw_conset_wlan_security_mode_wpa; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_security_mode_open -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_security_mode_open - { - buf = qtn_wlan_sett_security_mode_open; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_security_mode_wep -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_security_mode_wep - { - buf = qtn_wlan_sett_security_mode_wep; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_security_mode_802_1x -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_security_mode_802_1x - { - buf = qtn_wlan_sett_security_mode_802_1x; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_wlan_sett_security_mode_wpa -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_wlan_sett_security_mode_wpa - { - buf = qtn_netw_conset_wlan_sett_security_mode_wpa; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_security_mode_wapi -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_security_mode_wapi - { - buf = qtn_wlan_sett_security_mode_wapi; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_prmpt_wlan_wpa_mode -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_prmpt_wlan_wpa_mode - { - buf = qtn_netw_conset_prmpt_wlan_wpa_mode; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_prmpt_wpa_mode_eap -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_prmpt_wpa_mode_eap - { - buf = qtn_netw_conset_prmpt_wpa_mode_eap; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_prmpt_wpa_mode_psk -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_prmpt_wpa_mode_psk - { - buf = qtn_netw_conset_prmpt_wpa_mode_psk; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_info_eap_settings_default -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_info_eap_settings_default - { - buf = qtn_netw_conset_info_eap_settings_default; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_security_mode_wpa -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_security_mode_wpa - { - buf = qtn_wlan_sett_security_mode_wpa; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_network_name_user_defined -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_network_name_user_defined - { - buf = qtn_wlan_sett_network_name_user_defined; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_network_name_scan -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_network_name_scan - { - buf = qtn_wlan_sett_network_name_scan; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_network_mode_adhoc -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_network_mode_adhoc - { - buf = qtn_wlan_sett_network_mode_adhoc; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_adhoc_channel -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_adhoc_channel - { - buf = qtn_wlan_sett_adhoc_channel; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_prmpt_adhoc_channel -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_prmpt_adhoc_channel - { - buf = qtn_wlan_prmpt_adhoc_channel; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_adhoc_channel_automatic -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_adhoc_channel_automatic - { - buf = qtn_wlan_sett_adhoc_channel_automatic; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_adhoc_channel_user_defined -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_adhoc_channel_user_defined - { - buf = qtn_wlan_sett_adhoc_channel_user_defined; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_info_no_security_settings -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_info_no_security_settings - { - buf = qtn_wlan_info_no_security_settings; - } - -// --------------------------------------------------------------------------- -// r_qtn_netw_conset_popup_bearer_wlan -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_netw_conset_popup_bearer_wlan - { - buf = qtn_netw_conset_popup_bearer_wlan; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_quest_nw_name_not_defined -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_quest_nw_name_not_defined - { - buf = qtn_wlan_quest_nw_name_not_defined; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_quest_security_settings_empty -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_quest_security_settings_empty - { - buf = qtn_wlan_quest_security_settings_empty; - } - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_bearer_wlan -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_bearer_wlan - { - buf = qtn_wlan_sett_bearer_wlan; - } - - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_ssid_roaming -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_ssid_roaming - { - buf = qtn_wlan_sett_ssid_roaming; - } - - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_ssid_roaming_enabled -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_ssid_roaming_enabled - { - buf = qtn_wlan_sett_ssid_roaming_enabled; - } - - -// --------------------------------------------------------------------------- -// r_qtn_wlan_sett_ssid_roaming_disabled -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_wlan_sett_ssid_roaming_disabled - { - buf = qtn_wlan_sett_ssid_roaming_disabled; - } - -// --------------------------------------------------------------------------- -// qtn_wlan_info_no_networks_found; -// localised string -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_info_no_networks_found - { - buf = qtn_wlan_info_no_networks_found; - } - -// --------------------------------------------------------------------------- -// r_setting_app_edwin_netw_name -// edwin for network name setting page -// --------------------------------------------------------------------------- -// -RESOURCE EDWIN r_setting_app_edwin_netw_name - { - width = KNetworkNameWidth; - lines = KNetworkNameLines; - maxlength = KMaxNetworkNameLength; - allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode; - default_input_mode = EAknEditorTextInputMode; - flags = EEikEdwinAutoSelection | EEikEdwinNoLineOrParaBreaks; - } - - -// --------------------------------------------------------------------------- -// r_text_setting_page_netw_name -// setting page for network name -// --------------------------------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_text_setting_page_netw_name - { - number = EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - label = qtn_wlan_sett_network_name; - type = EEikCtEdwin; - editor_resource_id = r_setting_app_edwin_netw_name; - } - -// --------------------------------------------------------------------------- -// r_text_setting_page_gw_addr -// setting page for WAP gateway address -// --------------------------------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_text_setting_page_gw_addr - { - number = EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - label= qtn_netw_sett_default_gateway; - type = EAknCtIpFieldEditor; - editor_resource_id = R_SETTING_APP_IP_EDITOR; - } - -// --------------------------------------------------------------------------- -// r_text_setting_page_subnet_addr -// setting page for subnet mask setting -// --------------------------------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_text_setting_page_subnet_addr - { - number = EAknSettingPageNoOrdinalDisplayed; - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - label = qtn_netw_sett_subnet_mask; - type = EAknCtIpFieldEditor; - editor_resource_id = R_SETTING_APP_IP_EDITOR; - } - -// -------------------------------------------------------------------------- -// r_numeric_query -// number query -// -------------------------------------------------------------------------- -// -RESOURCE DIALOG r_numeric_query - { - flags = EGeneralQueryFlags | EEikDialogFlagNoShadow; - buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - items= - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_DATA_QUERY - { - layout = EStaticSizeDataLayout; - control = EDWIN - { - flags = EEikEdwinNoHorizScrolling; - default_input_mode = EAknEditorNumericInputMode; - }; - }; - } - }; - } - - -RESOURCE DIALOG r_searching_wlan_wait_note - { - flags = EAknWaitNoteFlags; - buttons=R_AVKON_SOFTKEYS_EMPTY; - items= - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control= AVKON_NOTE - { - layout = EWaitLayout; - singular_label = qtn_wlan_wait_searching_networks; - imagefile = AVKON_ICON_FILE; - imageid = EMbmAvkonQgn_note_progress; - imagemask = EMbmAvkonQgn_note_progress_mask; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/group/bld.inf --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/group/bld.inf Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Build information for the WLAN plugin. -* -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -// export localised loc file -../loc/cmpluginwlan.loc MW_LAYER_LOC_EXPORT_PATH(cmpluginwlan.loc) - -PRJ_MMPFILES -cmpluginwlan.mmp - -PRJ_EXTENSIONS -START EXTENSION s60/mifconv -OPTION TARGETFILE cmpluginwlan.mif -OPTION HEADERFILE cmpluginwlan.mbg -OPTION SOURCES -c8,1 qgn_prop_wlan_bearer\ - -c8,8 qgn_prop_set_conn_bearer_avail_wlan\ - -c8,1 qgn_prop_set_conn_wlan_easy -END diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/group/cmpluginwlan.mmp --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/group/cmpluginwlan.mmp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Project specification for LAN Plugin. -* -* -*/ - -#include -#include - -TARGET cmpluginwlan.dll -UID 0x10009D8D 0x10281BB2 - -TARGETTYPE PLUGIN - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -SOURCEPATH ../src - -SOURCE cmpluginwlanproxy.cpp -SOURCE cmpluginwlan.cpp -SOURCE cmpluginwlandata.cpp -SOURCE cmpluginwlandataarray.cpp -SOURCE ../../../Framework/Src/cmlogger.cpp -SOURCE cmpwlansettingsdlg.cpp -SOURCE cmpwlansettingsdlgadv.cpp -SOURCE cmpwlansettingsdlgipv4.cpp -SOURCE cmpwlansettingsdlgipv6.cpp -SOURCE cmwlancoveragecheck.cpp -SOURCE cmpwlanactivewaiter.cpp - -SOURCEPATH ../data - -START RESOURCE 10281BB2.rss -TARGET cmpluginwlan.rsc -END - -START RESOURCE cmwlanui.rss -DEPENDS cmmanager.rsg -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - -USERINCLUDE ../../../Framework/Inc - -// Component specific internal headers -USERINCLUDE ../inc - -// ADO specific internal headers -SYSTEMINCLUDE ../../../../../inc - -//Macro to /epoc32 headers -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY efsrv.lib -LIBRARY ECOM.LIB -LIBRARY cmmanager.lib -LIBRARY COMMSDAT.lib -LIBRARY WEPSecuritySettingsUi.lib -LIBRARY WPASecuritySettingsUi.lib -LIBRARY wapisecuritysettingsui.lib -LIBRARY AknSkins.lib -LIBRARY ConnectionUiUtilities.lib -LIBRARY cmmanagerdatabase.lib - -DEBUGLIBRARY flogger.lib - -LIBRARY CommonUI.LIB -LIBRARY CommonEngine.lib -LIBRARY bafl.lib -LIBRARY eikcoctl.lib avkon.lib eikdlg.lib -LIBRARY insock.lib -LIBRARY FeatMgr.lib - -LIBRARY eikcore.lib egul.lib -LIBRARY eikctl.lib cone.lib -LIBRARY fbscli.lib -LIBRARY AknCapServerClient.lib -LIBRARY aknnotify.lib - -LIBRARY wifiprotplugin.lib - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/group/pluginwlan_icons.mk --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/group/pluginwlan_icons.mk Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -# -# Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: Makefile for icons of ApSettingsHandlerUi -# - -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z -else -ZDIR=\epoc32\data\z -endif - - -TARGETDIR=$(ZDIR)\resource\apps -ICONTARGETFILENAME=$(TARGETDIR)\cmpluginwlan.mif - -HEADERDIR=\epoc32\include -HEADERFILENAME=$(HEADERDIR)\cmpluginwlan.mbg - -do_nothing : - @rem do_nothing - -MAKMAKE : do_nothing - -BLD : do_nothing - -CLEAN : do_nothing - -LIB : do_nothing - -CLEANLIB : do_nothing - -# ---------------------------------------------------------------------------- -# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by -# MifConv if the mask detph is defined. -# -# NOTE 2: Usually, source paths should not be included in the bitmap -# definitions. MifConv searches for the icons in all icon directories in a -# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps. -# The directory \s60\icons is included in the search only if the feature flag -# __SCALABLE_ICONS is defined. -# ---------------------------------------------------------------------------- - -RESOURCE : - mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ - /c8,1 qgn_prop_wlan_bearer.bmp \ - /c8,8 qgn_prop_set_conn_bearer_avail_wlan.bmp \ - /c8,1 qgn_prop_set_conn_wlan_easy.bmp - -FREEZE : do_nothing - -SAVESPACE : do_nothing - -RELEASABLES : - @echo $(HEADERFILENAME)&& \ - @echo $(ICONTARGETFILENAME) - -FINAL : do_nothing diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpluginwlan.h --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpluginwlan.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,617 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of WLAN interface implementation for WLAN plugin -* -*/ - -#ifndef WLAN_PLUGIN_H -#define WLAN_PLUGIN_H - -// INCLUDES -#include -#include -#include -#include -#include -#include -#include -#include - -// FORWARD DECLARATION -class CCDWlanServiceRecord; -class CWEPSecuritySettings; -class CWEPSecuritySettingsUi; -class CWPASecuritySettings; -class CWPASecuritySettingsUi; -class RConeResourceLoader; -class CConnectionUiUtilities; -class CCmPluginWlanDataArray; -class CAknWaitDialog; - -class CWAPISecuritySettings; -class CWAPISecuritySettingsUi; - -/** - * WPA Mode - */ -enum TWpaMode - { - EWpaModeUndefined = -1, - EWpaModeEap, - EWpaModePreSharedKey - }; - -/** - * WLAN Plugin IF implementation class - * - * ?more_complete_description - * - * @since S60 3.2 - */ -NONSHARABLE_CLASS( CCmPluginWlan ) : public CCmPluginLanBase - { - - public: // Constructors and destructor - - /** - * Two phased constructor - * - * @since S60 3.2 - * @param aInitParam - * @return The created object. - */ - static CCmPluginWlan* NewL( TCmPluginInitParam* aInitParam ); - - /** - * Destructor. - */ - virtual ~CCmPluginWlan(); - - virtual CCmPluginBaseEng* CreateInstanceL( TCmPluginInitParam& aInitParam ) const; - - public: // from base class - - /** - * From CCmPluginBaseEng - * Gets the value for a TUint32 attribute - * - * @since S60 3.2 - * @param aAttribute Identifies the attribute to be retrived - * @return the requested TUint32 value - */ - TUint32 GetIntAttributeL( const TUint32 aAttribute ) const; - - /** - * From CCmPluginBaseEng - * Gets the value for a TBool attribute - * - * @since S60 3.2 - * @param aAttribute Identifies the attribute to be retrived - * @return the requested TBool value - */ - TBool GetBoolAttributeL( const TUint32 aAttribute ) const; - - /** - * From CCmPluginBaseEng - * Gets the value for a TDes16 attribute - * - * @since S60 3.2 - * @param aAttribute Identifies the attribute to be retrived - * @return the requested string value - */ - HBufC* GetStringAttributeL( const TUint32 aAttribute ) const; - - /** - * From CCmPluginBaseEng - * Sets the value for a TInt attribute - * - * @since S60 3.2 - * @param aAttribute Identifies the attribute to be set. - * @param aValue The value to be set - */ - void SetIntAttributeL( const TUint32 aAttribute, TUint32 aValue ); - - /** - * * From CCmPluginBaseEng - * Sets the value for a TBool attribute - * - * @since S60 3.2 - * @param aAttribute Identifies the attribute to be set. - * @param aValue The value to be set - */ - void SetBoolAttributeL( const TUint32 aAttribute, TBool aValue ); - - /** - * From CCmPluginBaseEng - * Sets the value for a TDesC attribute - * - * @since S60 3.2 - * @param aAttribute Identifies the attribute to be set. - * @param aValue The value to be set - */ - void SetStringAttributeL( const TUint32 aAttribute, const TDesC16& aValue ); - - /** - * From CCmPluginBaseEng - * Checks if the plug-in can handle the given AP. - * - * @since S60 3.2 - * @param aIapId - * @return ETrue if plug-in can handle the IAP - */ - TBool CanHandleIapIdL( TUint32 aIapId ) const; - - /** - * From CCmPluginBaseEng - * Checks if the plug-in can handle the given AP - * - * @since S60 3.2 - * @param aIapRecord IAP record to be checked - * @return ETrue if plug-in can handle the IAP - */ - TBool CanHandleIapIdL( CommsDat::CCDIAPRecord *aIapRecord ) const; - - /** - * From CCmPluginBaseEng - * Launches the WLAN settings dialog - * - * @since S60 3.2 - * @return soft key selection - */ - TInt RunSettingsL(); - - /** - * From CCmPluginBaseEng - * see base class definition - * - * @since S60 3.2 - */ - TBool InitializeWithUiL( TBool aManuallyConfigure ); - - /** - * From CCmPluginBaseEng - * see base class definition - * - * @since S60 3.2 - */ - void LoadServiceSettingL(); - - /** - * From CCmPluginBaseEng - * see base class definition - * - * @since S60 3.2 - */ - void AdditionalReset(); - - public: // New functions - /** - * Edits the security settings for the current connection method - * - * @since S60 3.2 - * @param aEikonEnv Eikon environment to use - * @return exit reason - */ - TInt EditSecuritySettingsL( CEikonEnv& aEikonEnv ); - - /** - * Returns the security settings validity for the current connection method - * - * @since S60 3.2 - * @return Validity of the current security settings - */ - TBool AreSecuritySettingsValidL(); - - /** - * Loads the security settings for the current connection method - * - * @since S60 3.2 - */ - void LoadSecuritySettingsL(); - - protected: - - /** - * From CCmPluginBaseEng - * see base class definition - * - * @since S60 3.2 - */ - virtual void BearerRecordIdLC( HBufC* &aBearerName, - TUint32& aRecordId ); - - - /** - * Copy data of the connection method that is not - * added to the conversion table. (e.g. bearer specific - * flags) - * - * @param aDestInst copy attributes into this plugin instance - */ - void CopyAdditionalDataL( CCmPluginBaseEng& aDestInst ) const; - - - private: // construction - - /** - * Constructor - * - * @since S60 3.2 - */ - CCmPluginWlan( TCmPluginInitParam* aInitParam ); - - /** - * Second phase constructor - * - * @since S60 3.2 - */ - void ConstructL(); - - private: // from base class - - /** - * From CCmPluginBaseEng - * Updates additional records, in this case, the WLAN records. - * - * @since S60 3.2 - */ - void UpdateAdditionalRecordsL(); - - /** - * From CCmPluginBaseEng - * Deletes additional records, in this case, the WLAN records - * - * @since S60 3.2 - */ - void DeleteAdditionalRecordsL(); - - /** - * From CCmPluginBaseEng - * Loads additional records, in this case, the WLAN records - * - * @since S60 3.2 - */ - void LoadAdditionalRecordsL(); - - /** - * From CCmPluginBaseEng - * Creates a new service record for this bearer - * - * @since S60 3.2 - */ - void CreateNewServiceRecordL(); - - /** - * From CCmPluginBaseEng - * Creates the WLAN service record used by this WLAN - * - * @since S60 3.2 - */ - - void CreateWlanServiceRecordL(); - - /** - * From CCmPluginBaseEng - */ - virtual void PrepareToUpdateRecordsL(); - - /** - * Appends uids of connection methods - which were also created during connection method - * creation - to the array given as parameter - * @param aIapIds the array the additonal cm uids are appended to - */ - virtual void GetAdditionalUids( RArray& aIapIds ); - - private: // new functions - - /** - * Updates the security settings for the current WLAN connection method - * - * @since S60 3.2 - */ - void UpdateSecuritySettingsL(); - - /** - * Allocates a string specified by aResId and replaces %N in the - * resource with aInt - * - * @since S60 3.2 - * @param aResId Resource ID to be read from resource file. - * @param aInt Integer that will replace %N in the string. - * @return String read from resource file, specified by aResId, - * containing aInt. - */ - HBufC* ReadResourceL( TInt aResId, TInt aInt ) const; - - /** - * The UI for manually configuring a WLAN connection method - * - * @since S60 3.2 - * @return ETrue if the configuration was successful - */ - TBool ManuallyConfigureL(); - - /** - * Continuing with Manual configuration from step 4 - * called from ManuallyConfigureL or AutomaticallyConfigureL in case the - * specicfied network was not found (reverting to fully manual setup) - * - * @since S60 3.2 - * @param TBool aAskNWModeAndSec if set to ETrue, NW mode and Security - * mode dialogs are shown. If EFalse, these values are taken from - * the corresponding parameters of this function - * @param TWlanNetMode& aNwMode NW mode used if aAskNWModeAndSec is EFalse - * @param TWlanConnectionExtentedSecurityMode& aSecurityMode - * Security mode used if aAskNWModeAndSec is EFalse - * @param TWpaMode& aWpaMode WPA mode - * @return ETrue if the configuration was successful - */ - TBool ProceedWithManualL( TBool aAskNWModeAndSec, - CMManager::TWlanNetMode aNwMode = CMManager::EInfra, - TWlanConnectionExtentedSecurityMode aSecurityMode = EWlanConnectionExtentedSecurityModeOpen, - TWpaMode aWpaMode = EWpaModeUndefined ); - /** - * The UI for automatically configuring a WLAN connection method - * - * @since S60 3.2 - * @return ETrue if the configuration was successful - */ - TBool AutomaticallyConfigureL(); - - /* - * Loads a specific resource, leaves the resource loader on the - * cleanup stack - * - * @since S60 3.2 - * @param aResourceLoader - */ - void LoadResourceLC( RConeResourceLoader& aResourceLoader ) const; - - /* - * Prompt for the Network Name of the new WLAN connection method - * sets the network name and SSID settings - * - * @since S60 3.2 - * @param - * @return ETrue if a selection was made, EFalse if cancelled - */ - TBool ShowNWNameQueryL( TDes& aName ); - - /* - * Scans for a WLAN network by a given SSID - * initially makes a broadcast scan and if not found a direct scan. - * Sets the scan ssid setting - * - * @since S60 3.2 - * @param aSsid the SSID to scan for - * @return ETrue if a network has been found with the SSID - */ - TBool ScanForWlanNwL( TWlanSsid& aSsid, - CMManager::TWlanNetMode& aNetworkMode, - TWlanConnectionExtentedSecurityMode& aSecurityMode, - TBool& aProtectedSetupSupported ); - - /* - * Selection list for Network Mode - * - * @since S60 3.2 - * @param aNWMode (return value) network mode selected - * @return ETrue if a selection was made, EFalse if cancelled - */ - TBool SelectNWModeL( CMManager::TWlanNetMode& aNWMode ); - - /* - * Displays a user selection dialog of Security Modes - * - * @since S60 3.2 - * @param aNwMode which network mode was selected - * @param aSecurityMode returns the selection - * @return ETrue if a selection was made, EFalse if cancelled - */ - TBool ShowNWSecurityDlgL( CMManager::TWlanNetMode aNwMode, - TWlanConnectionExtentedSecurityMode& aSecurityMode ); - - /* - * Triggers the WEP key input query - * - * @since S60 3.2 - * @return ETrue if a selection was made, EFalse if cancelled - */ - TBool EnterWEPKeyL(); - - /* - * Triggers the pre-shared key for WPA WLAN query - * - * @since S60 3.2 - * @return ETrue if a selection was made, EFalse if cancelled - */ - TBool EnterWpaPreSharedKeyL(); - - /* - * Shows the WPA/WPA2 mode dialog - * - * @since S60 3.2 - * @param aWpaMode return value - * @return ETrue if selection made - */ - TBool SelectWpaModeDialogL( TWpaMode& aWpaMode ); - - /** - * Reloads internal security settings modules according to the changes - * @since S60 3.2 - */ - void UpdateSecurityModeL(); - - - /** - * Called from another CM-s CopyAdditionalDataL, on the passed - * copied CM, and marks this as a copy of the original CM which - * has an IAP ID of aBaseIapID - * - * @since S60 3.2 - */ - void SetAsCopyOf( TUint32 aBaseIapID ); - - /** - * Deletes the security settings related to this connection method. - * - * @since S60 3.2 - */ - void DeleteSecuritySettingsL(); - - - /** - * Set the EWlanIpDNSAddrFromServer according to the - * current name server values. - * - * @since S60 3.2 - */ - void SetDnsIpFromServerL(); - - - /** - * Set the EWlanIp6DNSAddrFromServer according to the - * current name server values. - * - * @since S60 3.2 - */ - void SetDns6IpFromServerL(); - - - /** - * Checks for coveradge and number of WLAN connections available - * @since S60 3.2 - * @return The number of available WLAN network connections - */ - TInt CheckNetworkCoverageL() const; - - - /** - * Converts security mode from TWlanConnectionSecurityMode to - * TWlanSecMode - * @since S60 3.2 - * @return The security mode as TWlanSecMode - */ - CMManager::TWlanSecMode ConvertConnectionSecurityModeToSecModeL( - TWlanConnectionExtentedSecurityMode aSecurityMode ); - - - /** - * Converts security mode from TWlanSecMode to - * TWlanConnectionSecurityMode - * @since S60 3.2 - * @return The security mode as TWlanConnectionSecurityMode - */ - TWlanConnectionExtentedSecurityMode ConvertSecModeToConnectionSecurityModeL( - CMManager::TWlanSecMode aSecMode ); - - /** - * Destroy wait dialog - */ - void DestroyWaitDialog(); - - - /** - * Sets the daemon name. Starts DHCP if set. - * - * @since S60 3.2 - */ - void SetDaemonNameL(); - - - /** - * Converts the possible WLAN connection states from TWlanConnectionMode - * to TWlanNetMode. - * @since S60 3.2 - * @return The WLAN connection mode as TWlanNetMode - */ - CMManager::TWlanNetMode ConvertWLANConnectionStatesL( - TWlanConnectionMode aConnectionMode ); - - WiFiProt::TWiFiReturn ProtectedSetupL(TWlanSsid& aSsid ); - - /* - * Triggers the pre-shared key for WAPI WLAN query - * - * @since S60 5.1 - * @return ETrue if a selection was made, EFalse if cancelled - */ - TBool EnterWAPIPreSharedKeyL(); - - private: // Data - - /** - * WLan service record - * Own - */ - CCDWlanServiceRecord* iWlanServiceRecord; // owned - - /** - * WLAN table id - */ - CommsDat::TMDBElementId iWlanTableId; - - /** - * WEP settings data - * Own - */ - CWEPSecuritySettings* iWepSecSettings; - - /** - * WPA settings data - * Own - */ - CWPASecuritySettings* iWpaSecSettings; - - /** - * Number of networks - */ - TInt iWlanNetworks; - - /** - * Connection UI utilities pointer - * Own - */ - CConnectionUiUtilities* iConnUiUtils; // owned - - /** - * Signals that this connection method is a copy of another WLAN CM. - */ - TBool iIsCopy; - - /** - * The IAP ID of the CM from which this copy had been made. - */ - TUint32 iCopiedFromIapId; - - /** - * "Searching WLAN networks" wait dialog. - */ - CAknWaitDialog* iWaitDialog; - - RArray iAdditionalCmsCreated; - - /** - * Asked from the Feature manager at the constructor phase - */ - TBool iIsWAPISupported; - - /** - * WAPI settings data - * Own - */ - CWAPISecuritySettings* iWAPISecSettings; - }; - -#endif // WLAN_PLUGIN_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpluginwlandata.h --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpluginwlandata.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of WLAN data holder for WLAN plugin -* -*/ - -#ifndef WLAN_DATA_H -#define WLAN_DATA_H - -// INCLUDES -#include - - -/** -* Possible values of SignalStrength of a network -*/ -enum TSignalStrength - { - ESignalStrengthMax = 60, - ESignalStrengthGood = 74, - ESignalStrengthLow = 87, - ESignalStrengthMin = 100 - }; - -// FORWARD DECLARATION -/* -class CCDWlanServiceRecord; -class CWEPSecuritySettings; -class CWEPSecuritySettingsUi; -class CWPASecuritySettings; -class CWPASecuritySettingsUi; -class RConeResourceLoader; -class CConnectionUiUtilities; -*/ - - -/** - * WLAN Plugin data holder class - * - * ?more_complete_description - * - * @since S60 3.2 - */ -NONSHARABLE_CLASS( CCmPluginWlanData ) : public CBase - { - - public: // Constructors and destructor - - /** - * Two-phased constructor. Leaves on failure, places instance - * on cleanup stack. - * - * @since S60 3.2 - * @return The constructed CCmPluginWlanData. - */ - static CCmPluginWlanData* NewLC(); - - /** - * Destructor - * - * @since S60 3.2 - */ - virtual ~CCmPluginWlanData(); - - protected: - /** - * Constructor - * - * @since S60 3.2 - */ - CCmPluginWlanData(); - - - /** - * Second-phase constructor. - * - * @since S60 3.2 - */ - void ConstructL(); - - - - public: // New functions - - /** - * Gives back the name of network (SSID) - * - * @since S60 3.2 - * @return the name of network - */ -// HBufC* GetNameLC() const; - - /** - * Gives back current SignalStrength - * - * @since S60 3.2 - * @return iSignalStrength - */ -// TSignalStrength GetSignalStrength() const; - - - public: // Data - - /** - * The name of network (from SSID) - */ - HBufC* iNetworkName; - - /** - * Signale strength of network - */ - TSignalStrength iSignalStrength; - - }; - -#endif // WLAN_DATA_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpluginwlandataarray.h --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpluginwlandataarray.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of WLAN data holder array for WLAN plugin -* -*/ - -#ifndef WLAN_DATA_ARRAY_H -#define WLAN_DATA_ARRAY_H - -// INCLUDES -#include - -class CCmPluginWlanData; - -/** - * WLAN Plugin data holder class - * A list of CCmPluginWlanData-s pointers; items are owned. - * - * ?more_complete_description - * - * @since S60 3.2 - */ -NONSHARABLE_CLASS( CCmPluginWlanDataArray ) : public CArrayPtrFlat - { - - public: // Constructors and destructor - - /** - * C++ default constructor. - */ - CCmPluginWlanDataArray(); - - /** - * Destructor. Items in the list are destroyed. - */ - virtual ~CCmPluginWlanDataArray(); - - }; - -#endif // WLAN_DATA_ARRAY_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpwlanactivewaiter.h --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpwlanactivewaiter.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of CCmPluginWlanActiveWaiter -* -*/ - - - -#ifndef __WLAN_PLUGIN_ACTIVE_WAITER_H__ -#define __WLAN_PLUGIN_ACTIVE_WAITER_H__ - -// INCLUDES -#include - -/** - * CCmPluginWlanActiveWaiter class, - * an active object to replace User::WaitForRequest - * - * Usage: - * CCmPluginWlanActiveWaiter* waiter = CCmPluginWlanActiveWaiter::NewL(); - * CleanupStack::PushL( waiter ); - * server.AsyncFunction( waiter->iStatus ); - * if ( waiter->WaitForRequest() == KErrNone ) - * { - * // handle success - * } - * else - * { - * // handle failure - * } - * CleanupStack::PopAndDestroy( waiter ); - * - */ -NONSHARABLE_CLASS( CCmPluginWlanActiveWaiter ) : public CActive - { - public: - /** - * NewL function - * @param aPlugin a pointer to notifier plugin - */ - static CCmPluginWlanActiveWaiter* NewL( ); - - /** - * Destructor - */ - virtual ~CCmPluginWlanActiveWaiter(); - - /** - * Waits for it's TRequestStatus to be completed - * @return Error code returned from server after request is - * completed - */ - TInt WaitForRequest( ); - - protected: - /** - * ConstructL - */ - void ConstructL(); - - /** - * Constructor - * @param aPlugin a pointer to notifier plugin - */ - CCmPluginWlanActiveWaiter(); - - /** - * DoCancel from CActive - */ - virtual void DoCancel(); - - /** - * RunL from CActive - */ - virtual void RunL(); - - protected: - CActiveSchedulerWait iWait; - }; - -#endif // __WLAN_PLUGIN_ACTIVE_WAITER_H__ - -// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpwlansettingsdlg.h --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpwlansettingsdlg.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,196 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declares dialog for a wlan cm plugin view/edit -* -*/ - -#ifndef CMPLUGINWLAN_SETTINGS_DLG_H -#define CMPLUGINWLAN_SETTINGS_DLG_H - -// INCLUDES -#include -#include -#include "cmcommsdatnotifier.h" - -// FORWARD DECLARATIONS -class CCmPluginBaseEng; - -// CLASS DECLARATION -/** -* CmPluginWlanSettingsDlg dialog class -* -*/ -NONSHARABLE_CLASS( CmPluginWlanSettingsDlg ) : public CmPluginBaseSettingsDlg - , public MCmCommsDatWatcher - , public CCmParentViewNotifier - { - public: // Constructors and destructor - - /** - * Two-phase construction - * - * @since S60 3.2 - * @param aCmPluginBaseEng The connection method object to use - */ - static CmPluginWlanSettingsDlg* NewL( - CCmPluginBaseEng& aCmPluginBaseEng ); - - /** - * Destructor. - */ - ~CmPluginWlanSettingsDlg(); - - public: // from base class - - /** - * From CmPluginBaseSettingsDlg - * Create and launch dialog - * - * @since S60 3.2 - * @return The code returned by the dialog's ExecuteLD - */ - TInt ConstructAndRunLD( ); - - /** - * From CmPluginBaseSettingsDlg - * Updates bearer specific listbox contents - * - * @since S60 3.2 - * @param aItemArray item array containing the setting texts - */ - void UpdateListBoxContentBearerSpecificL( CDesCArray& itemArray ); - - public: // from class MCmCommsDatWatcher - - /** - * Watch changes in CommsDat - */ - void CommsDatChangesL(); - - public: // from class CCmParentViewNotifier - - void NotifyParentView( TInt aValue ); - - private: - - /** - * C++ constructor - * - * @since S60 3.2 - */ - CmPluginWlanSettingsDlg( CCmPluginBaseEng& aCmPluginBaseEng ); - - - protected: - /** From CAknDialog */ - TBool OkToExitL( TInt aButtonId ); - - private: // from base class - - /** - * From MEikCommandObserver - * see base class for description - * - * @since S60 3.2 - * @param aCommandId - */ - void ProcessCommandL( TInt aCommandId ) ; - - // From CmPluginBaseSettingsDlg - - /** - * From CmPluginBaseSettingsDlg - * Determines which type of setting page should be shown - * - * @param aAttribute The setting to be changed by the setting page - * @param aCommandId The command the attribute is changed with (ok/change key pressed) - * @return the soft key selection - */ - TBool ShowPopupSettingPageL ( TUint32 aAttribute, TInt aCommandId ); - - /** - * From CmPluginBaseSettingsDlg - * launches the advances settings dialog - * - * @since S60 3.2 - */ - virtual void RunAdvancedSettingsL(); - - /** - * From CmPluginBaseSettingsDlg - * Get help contest of the plugin - * - * @since S60 5.0 - */ - virtual void GetHelpContext( TCoeHelpContext& aContext ) const; - - private: // New functions - - /** - * Shows the bool setting page for a certain setting or - * simply changes the setting if ok key was pressed - * - * @since S60 3.2 - * @param aAttribute The setting to be changed by the setting page - * @param aCommandId Command id, to make difference between ok and change commands - */ - void ChangeBoolSettingL( TUint32 aAttribute, TInt aCommandId ); - - /** - * displays security setting page - * - * @since S60 3.2 - */ - void ShowSecurityModeRBPageL(); - - /** - * Shows network mode setting page - * - * @since S60 3.2 - */ - void ShowNetworkModeRBPageL(); - - /** - * Show the setting page for the WLAN Network Name settings - * - * @since S60 3.2 - */ - void ShowWlanNWNamePageL(); - - /** - * Exits plugin settings if compulsory values are filled - * - * @since S60 3.2 - * @param aConfirm ask user confirmation or not - */ - void ExitSettingsL( TBool aConfirm ); - - void HandleCommsDatChangeL(); - private: - TBool iSecDialExit; - - TInt iNotifyFromAdv; - - }; - - -/** WLAN Network name setting items - zero indexed for the ui */ -enum TWlanNwName - { - EWlanNwNameUserDefined = 0, // radio button page commands - EWlanNwNameScan - }; - -#endif // CMPLUGINWLAN_SETTINGS_DLG_H - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpwlansettingsdlgadv.h --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpwlansettingsdlgadv.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: declares dialog for wlan cm plugin advanced view/edit. -* -*/ - -#ifndef CMPLUGINWLANADV_SETTINGS_DLG_ADV_H -#define CMPLUGINWLANADV_SETTINGS_DLG_ADV_H - -// INCLUDES -#include -#include -#include -#include "cmcommsdatnotifier.h" - -// FORWARD DECLARATIONS -class CCmPluginBaseEng; - -/** - * CmPluginWlanSettingsDlgAdv dialog class - * - * shows the advanced WLAN settings - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CmPluginWlanSettingsDlgAdv ) : - public CmPluginBaseSettingsDlgAdv , - public MCmCommsDatWatcher , - public CCmParentViewNotifier - { - public: // Constructors and destructor - - /** - * Two-phase construction - * - * @since S60 v3.2 - * @param aCmPluginBaseEng - */ - static CmPluginWlanSettingsDlgAdv* NewL( - CCmPluginBaseEng& aCmPluginBaseEng ); - /** - * Destructor. - */ - ~CmPluginWlanSettingsDlgAdv(); - - public: // from base class - - /** - * From CmPluginBaseSettingsDlg - * Create and launch dialog - * - * @since S60 v3.2 - * @return The code returned by the dialog's ExecuteLD - */ - TInt ConstructAndRunLD(); - - /** - * From CmPluginBaseSettingsDlg - * Updates bearer specific listbox contents - * - * @since S60 v3.2 - * @param aItemArray item array containing the setting texts - */ - void UpdateListBoxContentBearerSpecificL( CDesCArray& itemArray ); - - public: - - /** - * Record the object of parent view - */ - void RegisterParentView( CCmParentViewNotifier* aParent ); - - public: // from class MCmCommsDatWatcher - - /** - * Watch changes in CommsDat - */ - void CommsDatChangesL(); - - public: // from class CCmParentViewNotifier - - void NotifyParentView( TInt aValue ); - - private: // construction - - /** - * C++ constructor - */ - CmPluginWlanSettingsDlgAdv( CCmPluginBaseEng& aCmPluginBaseEng ); - - protected: - /** From CAknDialog */ - TBool OkToExitL( TInt aButtonId ); - - private: // From MEikCommandObserver - - /** - * From MEikCommandObserver - * see base class for description - * - * @since S60 3.2 - * @param aCommandId - */ - void ProcessCommandL( TInt aCommandId ); - - private: // From CmPluginBaseSettingsDlg - - /** - * From CmPluginBaseSettingsDlg - * Determines which type of setting page should be shown - * - * @param aAttribute The setting to be changed by the setting page - * @param aCommandId The command the attribute is changed with (ok/change key pressed) - * @return the soft key selection - */ - TBool ShowPopupSettingPageL( TUint32 aAttribute, TInt aCommandId ); - - TBool ShowIpv4SettingPageL(); - - TBool ShowIpv6SettingPageL(); - - /** - * Shows a radio button page for selecting the ad-hoc channel setting value - * If 'User defined' is selected a numeric query dialog is displayed for entering the - * channel number - * - * @since S60 3.2 - * @return ETrue if the setting value has been changed - */ - TBool ShowAdhocChannelSettingPageL(); - - /** - * From CmPluginBaseSettingsDlg - * Collects the packet data specific setting information for - * displaying - * - * @since S60 3.2 - * @param aItemArray an array of setting information - */ - TBool UpdateListBoxContentBearerSpecificL( TUint32 aAttribute ); - - void HandleCommsDatChangeL(); - - private: // data - - /** - * IPv6 supported indicator - */ - TBool iIpv6Supported; - - CCmParentViewNotifier* iParent; - TInt iNotifyFromIp; - }; - -/** menu commands for IPv setting pages */ -enum TWlanIpvMenuCommands - { - ESettingPageCmdIpv4, - ESettingPageCmdIpv6 - }; - -/** Adhoc channel setting values */ -enum TAdhocChannel - { - EAdhocAutomatic = 0, //radio button page commands - EAdhocUserDefined - }; - -#endif // CMPLUGINWLANADV_SETTINGS_DLG_ADV_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpwlansettingsdlgipv4.h --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpwlansettingsdlgipv4.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declares dialog for wlan cm plugin ipv4 settings view/edit -* -*/ - -#ifndef CMPLUGINWLANIPV4_SETTINGS_DLG_H -#define CMPLUGINWLANIPV4_SETTINGS_DLG_H - -// INCLUDES -#include -#include -#include "cmcommsdatnotifier.h" - -// FORWARD DECLARATIONS -class CCmPluginBaseEng; - -/** - * CmPluginWlanSettingsDlgIpv4 dialog class - * - * shows settings for WLAN IPv4 - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CmPluginWlanSettingsDlgIpv4 ) : - public CmPluginBaseSettingsDlgIp , - public MCmCommsDatWatcher - { - public: // Constructors and destructor - - /** - * Two-phase construction - * @since S60 v3.2 - * @param aCmPluginBaseEng - */ - static CmPluginWlanSettingsDlgIpv4* NewL( - CCmPluginBaseEng& aCmPluginBaseEng ); - - /** - * Destructor. - */ - ~CmPluginWlanSettingsDlgIpv4(); - - public: // from base class - - /** - * From CmPluginBaseSettingsDlg - * Create and launch dialog - * - * @since S60 v3.2 - * @return The code returned by the dialog's ExecuteLD - */ - TInt ConstructAndRunLD(); - - /** - * From CmPluginBaseSettingsDlg - * Updates bearer specific listbox contents - * - * @since S60 v3.2 - * @param aItemArray item array containing the setting texts - */ - void UpdateListBoxContentBearerSpecificL( CDesCArray& itemArray ); - - public: - - /** - * Record the object of parent view - */ - void RegisterParentView( CCmParentViewNotifier* aParent ); - - public: // from class MCmCommsDatWatcher - - /** - * Watch changes in CommsDat - */ - void CommsDatChangesL(); - - protected: - - /** From CAknDialog */ - TBool OkToExitL( TInt aButtonId ); - - private: // construction - - /** - * C++ constructor - */ - CmPluginWlanSettingsDlgIpv4( CCmPluginBaseEng& aCmPluginBaseEng ); - - private: // From MEikCommandObserver - - /** - * From MEikCommandObserver - * see base class for description - * - * @since S60 3.2 - * @param aCommandId - */ - void ProcessCommandL( TInt aCommandId ); - - private: // From CmPluginBaseSettingsDlg - - /** - * From CmPluginBaseSettingsDlg - * Determines which type of setting page should be shown - * - * @param aAttribute The setting to be changed by the setting page - * @param aCommandId The command the attribute is changed with (ok/change key pressed) - * @return the soft key selection - */ - TBool ShowPopupSettingPageL ( TUint32 aAttribute, TInt aCommandId ); - - /** - * From CmPluginBaseSettingsDlg - * Collects the packet data specific setting information for - * displaying - * - * @since S60 3.2 - * @param aItemArray an array of setting information - */ - TBool UpdateListBoxContentBearerSpecificL( TUint32 aAttribute ); - - private: // New functions - - /** - * Checks the temp attributes, saves them if necessary, - * prompts user if there are incomplete values - * - * @since S60 v3.2 - * @return ETrue if success - */ - TBool ValidateAttribsL(); - - /** - * Text intialisation - * - * @since S60 v3.2 - */ - void InitTextsL(); - - private: - - CCmParentViewNotifier* iParent; - }; - -#endif // CMPLUGINWLANIPV4_SETTINGS_DLG_ADV_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpwlansettingsdlgipv6.h --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmpwlansettingsdlgipv6.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declares dialog for wlan cm plugin ipv6 settings view/edit -* -*/ - -#ifndef CMPLUGINWLANIPV6_SETTINGS_DLG_H -#define CMPLUGINWLANIPV6_SETTINGS_DLG_H - -// INCLUDES -#include -#include -#include "cmcommsdatnotifier.h" - -// FORWARD DECLARATIONS -class CCmPluginBaseEng; - -/** - * CmPluginWlanSettingsDlgIpv6 dialog class - * - * shows settings for WLAN IPv6 - * - * @since S60 v3.2 - */ -NONSHARABLE_CLASS( CmPluginWlanSettingsDlgIpv6 ) : - public CmPluginBaseSettingsDlgIp , - public MCmCommsDatWatcher - { - public: // Constructors and destructor - - /** - * Two-phase construction. - * @param aCmPluginBaseEng wlan plugin to edit - */ - static CmPluginWlanSettingsDlgIpv6* NewL( - CCmPluginBaseEng& aCmPluginBaseEng ); - - /** - * Destructor. - */ - ~CmPluginWlanSettingsDlgIpv6(); - - public: // from base class - - /** - * From CmPluginBaseSettingsDlg - * Create and launch dialog - * - * @since S60 v3.2 - * @return The code returned by the dialog's ExecuteLD - */ - TInt ConstructAndRunLD(); - - public: // From CmPluginBaseSettingsDlg - - /** - * From CmPluginBaseSettingsDlg - * Updates bearer specific listbox contents - * - * @since S60 v3.2 - * @param aItemArray item array containing the setting texts - */ - void UpdateListBoxContentBearerSpecificL( CDesCArray& itemArray ); - - public: - - /** - * Record the object of parent view - */ - void RegisterParentView( CCmParentViewNotifier* aParent ); - - public: // from class MCmCommsDatWatcher - - /** - * Watch changes in CommsDat - */ - void CommsDatChangesL(); - - protected: - - /** From CAknDialog */ - TBool OkToExitL( TInt aButtonId ); - - private: // construction - - CmPluginWlanSettingsDlgIpv6( CCmPluginBaseEng& aCmPluginBaseEng ); - - private: // From MEikCommandObserver - - /** - * From MEikCommandObserver - * see base class for description - * - * @since S60 3.2 - * @param aCommandId - */ - void ProcessCommandL( TInt aCommandId ); - - private: // From CmPluginBaseSettingsDlg - - /** - * From CmPluginBaseSettingsDlg - * Determines which type of setting page should be shown - * - * @param aAttribute The setting to be changed by the setting page - * @param aCommandId The command the attribute is changed with (ok/change key pressed) - * @return the soft key selection - */ - TBool ShowPopupSettingPageL ( TUint32 aAttribute, TInt aCommandId ); - - /** - * From CmPluginBaseSettingsDlg - * Collects the packet data specific setting information for - * displaying - * - * @since S60 3.2 - * @param aItemArray an array of setting information - */ - TBool UpdateListBoxContentBearerSpecificL( TUint32 aAttribute ); - - private: // new functions - - /** - * Text intialisation - * - * @since S60 v3.2 - */ - void InitTextsL(); - - private: - - CCmParentViewNotifier* iParent; - - TBool iIspossibleExit; - TBool iExitImediate; - }; - -/** IPv6 types */ -enum TIpv6DNSTypes - { - EIpv6DNSDynamic = 0, //radio button page commands - EIpv6DNSWellKnown, - EIpv6DNSUserDefined - }; - - -#endif // CMPLUGINWLANIPV6_SETTINGS_DLG_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmwlancommonconstants.h --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmwlancommonconstants.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: commonly used constants for the WLAN plugin -* -*/ - -#ifndef CMWLANCOMMONCONSTANTS_H -#define CMWLANCOMMONCONSTANTS_H - -// CONSTANTS -_LIT( KPluginWlanResDirAndFileName, "z:cmwlanui.rsc" ); -_LIT( KEmptyAddress, "http://" ); - -/// 'Dynamic' IP address to use in comparisons -_LIT( KDynIpAddress, "0.0.0.0" ); - -_LIT( KDynIpv6Address, "0:0:0:0:0:0:0:0" ); - -const TInt KCmArrayGranularity = 10; -const TInt KCmAdhocChannelMaxLength = 2; -const TInt KCmAdhocChannelMinValue = 1; -const TInt KCmAdhocChannelDefaultValue = 7; -const TInt KCmAdhocChannelMaxValue = 11; -const TInt KCmWlanNWNameMaxLength = 32; - -#endif // CMWLANCOMMONCONSTANTS_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmwlancoveragecheck.h --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/inc/cmwlancoveragecheck.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of WLAN Coverage Check class -* -*/ - -#ifndef CMWLANCOVERAGECHECK_H -#define CMWLANCOVERAGECHECK_H - -// INCLUDES -#include -#include - - -// FORWARD DECLARATION -class CCmPluginWlanDataArray; - -using namespace CMManager; - -/** - * WLAN Coverage Check - * - * ?more_complete_description - * - * @since S60 3.2 - */ -class CCmWlanCoverageCheck : public CActive - { - enum EWlanCoverageState - { - EServiceStatus, - EScanning, - EDone, - }; - - public: - - CCmWlanCoverageCheck(); - ~CCmWlanCoverageCheck(); - - TInt GetCoverageL(); - - TBool ScanForPromptedSsidL( TWlanSsid aEnteredSsid, TBool aBroadcast, - TWlanNetMode& aNetworkMode, - TWlanConnectionExtentedSecurityMode& aSecurityMode, - TBool& aProtectedSetupSupported ); - - /** - * Returns whether the passed ssid and length results in a hidden or - * a non-hidden ssid. - * - * @since S60 3.2 - * @param aSsidLength The length of the ssid - * @param aSsid The ssid - * @return ETrue if the ssid is hidden. - */ - TBool IsHiddenSsid( TUint aSsidLength, const TUint8* aSsid ) const; - - /** - * Adds the passed WLAN network data to the container array - * if it is not already there, and sets the highest signal - * strength if it is already in the array. - * - * @since S60 3.2 - * @param aArray The array to be checked - * @param aRXLevel The signal level of this WLAN - * @param aNetworkName The network name (SSID) of this WLAN. - */ - void AddToArrayIfNeededL( - CCmPluginWlanDataArray& aArray, - TInt aRXLevel, - TDesC& aNetworkName ) const; - - - protected: // from CActive - - virtual void DoCancel(); - virtual void RunL(); - - private: - - TUint32 iProgState; - TInt iCoverage; - CActiveSchedulerWait iWait; - }; - - -#endif // CMWLANCOVERAGECHECK_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/loc/cmpluginwlan.loc --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/loc/cmpluginwlan.loc Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,389 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Localization strings for project cmpluginwlan -* -*/ - - -// LOCALISATION STRINGS - -//d: Name of wlan bearer type shown in a list of supported bearers. -//l: list_single_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_bearer_supported_wlan "Wireless LAN" - -//d: First line of a double large graphic style listbox - wlan specific -//l: list_double_large_graphic_pane_t1_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_bearer_available_wlan "Wireless LAN" - -//d: Second line of a double large graphic style listbox - wlan specific -//l: list_double_large_graphic_pane_t2_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_one_wlan_nw_available "1 network available" - -//d: Second line of a double large graphic style listbox - wlan specific -//l: list_double_large_graphic_pane_t2_cp2 -//w: -//r: 3.2 -// -#define qtn_netw_conset_many_wlan_nw_available "%N networks available" - -// Setting list items - -//d:Item text in setting list. "The WLAN network name" -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_network_name "WLAN network name" - - -//d: Text shown in a text query dialog for the WLAN network name setting -//d: user defined value -//l: heading_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_prmpt_network_name "WLAN network name:" - -//d:Item text in setting list "Network status" -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_hidden_network "Network status" - -//d:Item text in setting list "WLAN network mode" -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_network_mode "WLAN network mode" - -//d:Item text in setting list "WLAN security mode" -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_security_mode "WLAN security mode" - -//d:Item text in setting list "WLAN security settings" -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_security_settings "WLAN security settings" - -// Setting list options and/or default values - -//d:Defines if the WLAN network name (SSID) is not hidden -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_hidden_network_no "Public" - -//d:Defines if the WLAN network name (SSID) is hidden (Default) -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_hidden_network_yes "Hidden" - -//d:Default value for WLAN network mode -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_network_mode_infra "Infrastructure" - -//d: Title of the Network mode dialog -//d: in the manual configuration of a new WLAN connection method -//l: heading_pane_t1 -//w: -//r:3.2 -// -#define qtn_netw_conset_prmpt_wlan_nw_mode_and_status "Network mode and status:" - -//d:Network mode selection list, sets the network mode setting -//d:to 'infrastructure' and network status to 'Public' -//l:list_single_pane_t1_cp2 -//w: -//r:3.2 -// -#define qtn_wlan_network_mode_infra_public "Infrastructure (public)" - -//d:Network mode selection list, sets the network mode setting -//d:to 'infrastructure' and network status to 'hidden' -//l:list_single_pane_t1_cp2 -//w: -//r:3.2 -// -#define qtn_wlan_network_mode_infra_hidden "Infrastructure (hidden)" - -//d:Network mode selection list, sets the network mode setting -//d:to 'Ad-hoc' and network status to 'Public' -//l:list_single_pane_t1_cp2 -//w: -//r:3.2 -// -#define qtn_wlan_network_mode_adhoc_public "Ad-hoc (public)" - -//d:Network mode selection list, sets the network mode setting -//d:to 'Ad-hoc' and network status to 'Hidden' -//l:list_single_pane_t1_cp2 -//w: -//r:3.2 -// -#define qtn_wlan_network_mode_adhoc_hidden "Ad-hoc (hidden)" - -//d:Default value for WLAN security mode -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_security_mode_open "Open network" - -//d:Security settings mode "WEP" -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_security_mode_wep "WEP" - -//d:Security settings mode "802.1x" -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_security_mode_802_1x "802.1x" - -//d:Security settings mode "WPA/WPA2" -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_security_mode_wpa "WPA/WPA2" - -//d:Security settings mode "WAPI" -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_security_mode_wapi "WAPI" - -//d: Title of the Security Mode selection dialog -//d: in the manual configuration of a new WLAN connection method -//l: heading_pane_t1 -//w: -//r:3.2 -// -#define qtn_netw_conset_prmpt_wlan_nw_security_mode "Security Mode:" - -//d:Default value for WLAN security mode -//l:list_single_pane_t1_cp2 -//w: -//r:3.2 -// -#define qtn_netw_conset_wlan_security_mode_open "Open network" - -//d:Security settings mode "WEP" -//l:list_single_pane_t1_cp2 -//w: -//r:3.2 -// -#define qtn_netw_conset_wlan_security_mode_wep "WEP" - -//d:Security settings mode "802.1x" -//l:list_single_pane_t1_cp2 -//w: -//r:3.2 -// -#define qtn_netw_conset_wlan_security_mode_802_1x "802.1x" - -//d:Security settings mode "WPA/WPA2" -//l:list_single_pane_t1_cp2 -//w: -//r:3.2 -// -#define qtn_netw_conset_wlan_security_mode_wpa "WPA/WPA2" - -//d: Title of the WPA/WPA2 mode selection dialog in the manual -//d: configuration of a new WLAN connection method -//l: heading_pane_t1 -//w: -//r:3.2 -// -#define qtn_netw_conset_prmpt_wlan_wpa_mode "WPA/WPA2 mode:" - -//d:EAP item in the WPA/WPA2 mode selection dialog -//l:list_single_pane_t1_cp2 -//w: -//r:3.2 -// -#define qtn_netw_conset_prmpt_wpa_mode_eap "EAP" - -//d:Pre-shared item item in the WPA/WPA2 mode selection dialog -//l:list_single_pane_t1_cp2 -//w: -//r:3.2 -// -#define qtn_netw_conset_prmpt_wpa_mode_psk "Pre-shared key" - -//d: Note to indicate to user that the default EAP values have -//d: been set and advanced values can be edited in the -//d: security settings of the connection method -//l: popup_note_window -//w: -//r:3.2 -// -#define qtn_netw_conset_info_eap_settings_default "Default EAP values set. Configure advanced settings by editing the method." - -//d:Specifies that the WLAN network name is user defined -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_network_name_user_defined "User defined" - - -//d:Specifies that the WLAN network name is selected from a scanned list -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_network_name_scan "Scan for networks" - - -//d:Specifies that the network mode is Ad-hoc -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_network_mode_adhoc "Ad-hoc" - -//d:Setting item text for Ad-hoc channel. -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_adhoc_channel "Ad-hoc channel" - -//d:Title in a numeric query dialog for the ad-hoc channel setting value -//l: popup_query_data_window -//w: -//r:3.2 -// -#define qtn_wlan_prmpt_adhoc_channel "Ad-hoc channel:" - -//d:Defines the ad-hoc channel to be automatic -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_adhoc_channel_automatic "Automatic" - - -//d:Defines the ad-hoc channel to be user defined -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_adhoc_channel_user_defined "User defined" - -//d: wlan plugin info note text shown when user tries to edit -//d: security settings for open network -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_wlan_info_no_security_settings "No security settings for ’Open network’" - -//d: Data bearer of the highlighted connection method. -//l: popup_preview_text_window_t1 -//w: -//r: 3.2 -#define qtn_netw_conset_popup_bearer_wlan "Wireless LAN" - -//d: Connection method settings query text -//d: displayed when network name is not defined -//d: and user presses 'back' from settings view -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_wlan_quest_nw_name_not_defined "Incomplete details. WLAN network name must be defined. Delete access point?" - -//d: Connection method settings query text -//d: displayed when security settings are empty -//d: and user presses 'back' from settings view -//l: popup_note_window -//w: -//r: 3.2 -// -#define qtn_wlan_quest_security_settings_empty "Security settings for the selected security mode are incomplete. Delete access point?" - -//d: Name of the data bearer used when accessing external network. -//l: list_set_graphic_pane_t1 -//w: -//r: 3.2 -#define qtn_wlan_sett_bearer_wlan "Wireless LAN" - - -//d:Item text in setting list "WLAN base station selection" -//l:list_setting_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_ssid_roaming "WLAN base station selection" - - -//d:Value for WLAN base station selection, allows roaming -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_ssid_roaming_enabled "Roam to best" - - -//d:Value for WLAN base station selection, disallows roaming -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_wlan_sett_ssid_roaming_disabled "Stay in first" - - -//d:Wait note during scanning of wlan networks -//l:popup_note_wait_window -//w: -//r:3.2 -// -#define qtn_wlan_wait_searching_networks "Searching WLAN networks" - - -//d:"Search for WLAN" - information note -//l:popup_note_window -//w: -//r:3.0 -// -#define qtn_wlan_info_no_networks_found "No WLAN networks found" - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpluginwlan.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpluginwlan.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2879 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of WLAN Plugin interface implementation -* for WLAN Bearer -* -*/ - - -#include -#include // For REComSession -#include // for TParse -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "cmwlancommonconstants.h" -#include "cmpluginwlan.h" -#include "cmwlancoveragecheck.h" -#include "cmlogger.h" -#include "cmpwlansettingsdlg.h" -#include -#include -#include "cmmanagerimpl.h" -#include "cmpwlanactivewaiter.h" - -#include - -using namespace CMManager; - -#include "wapisecuritysettingsui.h" - -// CONSTANTS -const TUint32 KDefaultPriorityWLan = 0; - -const TInt KWlanSingleNetwork = 1; // Number of WLAN networks is 1 -const TInt KWlanMaxKeyLength = 64; -const TInt KWlanLastSocketActivityTimeout = -1; -const TInt KWlanLastSessionClosedTimeout = 1; -const TInt KWlanLastSocketClosedTimeout = -1; -const TUint32 KEndOfArray = KMaxTUint; - -// Daemon manager name for Easy WLAN IAP -_LIT( KHotspotDaemonManagerName, "NetCfgExtnHotSpot" ); -_LIT( KEasyWlanName, "Easy WLAN" ); - -// Modem bearer names for WLAN connection methods -_LIT( KModemBearerWLAN, "WLANBearer" ); - -_LIT( KWlanFileIcons, "z:cmpluginwlan.mbm" ); -_LIT( KWlanBearerName, "WLANBearer" ); -_LIT( KWlanBearerAgent, "wlanagt.agt" ); -_LIT( KWlanBearerNif, "wlannif" ); - -_LIT( KWlanLDDName, "not used" ); -_LIT( KWlanPDDName, "not used" ); - -static const TCmAttribConvTable SWlanConvTbl[] = - { - // iAttribId, iCommsDatId, iValidFuncL, - // iTitleId, - // iMaxLength, iAttribFlags, iDefValueResId, iEditorResId, iNotUsed1, iNotUsed2 - { EWlanServiceId, EWlanRangeMax, NULL }, - { EWlanServiceId, KCDTIdWlanServiceId, NULL }, - { EWlanConnectionMode, KCDTIdWlanConnMode, NULL, - R_QTN_WLAN_SETT_NETWORK_MODE, - }, - { EWlanSSID, KCDTIdWlanSSID, NULL, - R_QTN_WLAN_SETT_NETWORK_NAME, - KCmWlanNWNameMaxLength, EConvCompulsory | EConvNoZeroLength, R_QTN_SELEC_SETTING_COMPULSORY, R_TEXT_SETTING_PAGE_NETW_NAME, NULL, NULL }, - { EWlanUsedSSID, KCDTIdWlanUsedSSID, NULL }, - { EWlanSecurityMode, KCDTIdWlanSecMode, NULL, - R_QTN_WLAN_SETT_SECURITY_MODE, - 0, 0, 0, 0, NULL, NULL }, - { EWlanAuthenticationMode, KCDTIdWlanAuthMode, NULL }, - { EWlanScanSSID, KCDTIdWlanScanSSID, NULL, - R_QTN_WLAN_SETT_HIDDEN_NETWORK, - 0, 0, 0, 0, NULL, NULL }, - { EWlanChannelID, KCDTIdWlanChannelID, NULL, - R_QTN_WLAN_SETT_ADHOC_CHANNEL, - KCmAdhocChannelMaxLength, EConvNumber, R_QTN_WLAN_SETT_ADHOC_CHANNEL_AUTOMATIC, 0, NULL, NULL }, - { EWlanAllowSSIDRoaming, KCDTIdWlanAllowSSIDRoaming, NULL, - R_QTN_WLAN_SETT_SSID_ROAMING, - 0, 0, 0, 0, NULL, NULL }, - { 0,0 } - }; - - -static const TCmCommonAttrConvArrayItem SCommonConvTbl[] = -{ - { EWlanIfNetworks, ECmIFNetworks }, - { EWlanIpNetMask, ECmIPNetmask }, - { EWlanIpGateway, ECmIPGateway }, - { EWlanIpAddrFromServer, ECmIPAddFromServer }, - { EWlanIpAddr, ECmIPAddress }, - { EWlanIpDNSAddrFromServer, ECmIPDNSAddrFromServer }, - { EWlanIpNameServer1, ECmIPNameServer1 }, - { EWlanIpNameServer2, ECmIPNameServer2 }, - { EWlanIp6DNSAddrFromServer, ECmIP6DNSAddrFromServer }, - { EWlanIp6NameServer1, ECmIP6NameServer1 }, - { EWlanIp6NameServer2, ECmIP6NameServer2 }, - { EWlanIpAddrLeaseValidFrom, ECmIPAddrLeaseValidFrom }, - { EWlanIpAddrLeaseValidTo, ECmIPAddrLeaseValidTo }, - { EWlanConfigDaemonManagerName, ECmConfigDaemonManagerName }, - { EWlanConfigDaemonName, ECmConfigDaemonName }, - { 0, 0 } - }; - - -/** - * struct for security mode conversion table - */ -typedef struct - { - TUint32 iSecurityMode; - TUint32 iNWModeSelectionDlgIndex; - TUint32 iRBSettingPageIndex; - TUint32 iResId; - } TCmSecurityModeConvTable; - -/** - * Conversion table for the correct positioning of WLAN security types - * in WLAN UI components - */ -const TCmSecurityModeConvTable KWlanSecurityModeConvTable[] = - { - { EWlanSecModeOpen, 0, 0, R_QTN_NETW_CONSET_WLAN_SECURITY_MODE_OPEN }, - { EWlanSecModeWep, 1, 1, R_QTN_NETW_CONSET_WLAN_SECURITY_MODE_WEP }, - { EWlanSecMode802_1x, 2, 2, R_QTN_NETW_CONSET_WLAN_SECURITY_MODE_802_1X }, - { EWlanSecModeWpa, 3, 3, R_QTN_NETW_CONSET_WLAN_SECURITY_MODE_WPA }, - // { EWlanSecModeWpa2, 3, 3, R_QTN_NETW_CONSET_WLAN_SECURITY_MODE_WPA2 }, - { EWlanSecModeWAPI, 4, 4, R_QTN_WLAN_SETT_SECURITY_MODE_WAPI }, - { KEndOfArray, KEndOfArray, KEndOfArray, KEndOfArray } - }; - -/** - * struct for the network mode conversion table - */ -typedef struct - { - TUint32 iNwMode; - TBool iHidden; - TUint32 iResId; - } TCmNetworkModeConvTable; - -/** - * Conversion table for the correct positioning of WLAN network modes - */ -const TCmNetworkModeConvTable KWlanNetworkModeConvTable[] = - { - { EInfra, EFalse, R_QTN_WLAN_NETWORK_MODE_INFRA_PUBLIC }, // Infrastructure (public) - { EInfra, ETrue, R_QTN_WLAN_NETWORK_MODE_INFRA_HIDDEN }, // Infrastructure (hidden) - { EAdhoc, EFalse, R_QTN_WLAN_NETWORK_MODE_ADHOC_PUBLIC }, // Ad-hoc (public) -// { EAdhoc, ETrue, R_QTN_WLAN_NETWORK_MODE_ADHOC_HIDDEN }, // Ad-hoc (hidden) - { KEndOfArray, EFalse, KEndOfArray } - }; - -// ======================= MEMBER FUNCTIONS ================================= - -// -------------------------------------------------------------------------- -// CCmPluginWlan::NewL -// -------------------------------------------------------------------------- -// -CCmPluginWlan* CCmPluginWlan::NewL( TCmPluginInitParam* aInitParam ) - { - if ( !FeatureSupported( KFeatureIdProtocolWlan ) ) - { - User::Leave( KErrNotSupported ); - } - - CCmPluginWlan* self = new( ELeave ) CCmPluginWlan( aInitParam ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// -------------------------------------------------------------------------- -// CCmPluginWlan::~CCmPluginWlan -// -------------------------------------------------------------------------- -// -CCmPluginWlan::~CCmPluginWlan() - { - AdditionalReset(); - DestroyWaitDialog(); - RemoveResourceFile( KPluginWlanResDirAndFileName ); - delete iConnUiUtils; iConnUiUtils = NULL; - - iAdditionalCmsCreated.Close(); - - CLOG_CLOSE; - } - -// -------------------------------------------------------------------------- -// CCmPluginWlan::CreateInstanceL -// -------------------------------------------------------------------------- -// -CCmPluginBaseEng* CCmPluginWlan::CreateInstanceL( TCmPluginInitParam& aInitParam ) const - { - CCmPluginWlan* self = new( ELeave ) CCmPluginWlan( &aInitParam ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// -------------------------------------------------------------------------- -// CCmPluginWlan::CCmPluginWlan -// -------------------------------------------------------------------------- -// -CCmPluginWlan::CCmPluginWlan( TCmPluginInitParam* aInitParam ) - : CCmPluginLanBase( aInitParam ) - { - CLOG_CREATE; - iWlanTableId = 0; - iBearerType = KUidWlanBearerType; - } - -// -------------------------------------------------------------------------- -// CCmPluginWlan::ConstructL -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::ConstructL() - { - LOGGER_ENTERFN( "CCmPluginWlan::ConstructL" ); - - CCmPluginLanBase::ConstructL(); - - iBearerRecName = KModemBearerWLAN; - - // get WLAN table id - TRAP_IGNORE( iWlanTableId = CCDWlanServiceRecord::TableIdL( Session() ) ); - - if( !iWlanTableId ) - { - iWlanTableId = CCDWlanServiceRecord::CreateTableL( Session() ); - - TMDBElementId tableId = 0; - - TRAP_IGNORE( tableId = CCDWlanDeviceSettingsRecord::TableIdL( Session() ) ); - if( !tableId ) - { - CCDWlanDeviceSettingsRecord::CreateTableL( Session() ); - } - - TRAP_IGNORE( tableId = CCDWLANSecSSIDTable::TableIdL( Session() ) ); - if( !tableId ) - { - CCDWLANSecSSIDTable::CreateTableL( Session() ); - } - - TRAP_IGNORE( tableId = CCDDestNWTable::TableIdL( Session() ) ); - if( !tableId ) - { - CCDDestNWTable::CreateTableL( Session() ); - } - } - - AddResourceFileL( KPluginWlanResDirAndFileName ); - - AddConverstionTableL( ( CCDRecordBase** )&iWlanServiceRecord, - NULL, - SWlanConvTbl ); - AddCommonConversionTableL( SCommonConvTbl ); - - iIsWAPISupported = FeatureManager::FeatureSupported( KFeatureIdFfWlanWapi ); - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::GetIntAttributeL -// -------------------------------------------------------------------------- -// -TUint32 CCmPluginWlan::GetIntAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginWlan::GetIntAttributeL" ); - - TInt retval; - switch ( aAttribute ) - { - case ECmExtensionLevel: - { - retval = CCmPluginLanBase::GetIntAttributeL( aAttribute ); - retval++; - break; - } - case ECmBearerIcon: - { - TAknsItemID id; - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - - TParse mbmFile; - User::LeaveIfError( mbmFile.Set( KWlanFileIcons, - &KDC_BITMAP_DIR, - NULL ) ); - - // default - WLAN icon - TInt icon = EMbmCmpluginwlanQgn_prop_wlan_bearer; - TInt mask = EMbmCmpluginwlanQgn_prop_wlan_bearer_mask; - - // Easy WLAN icon - TUint32 easyWlanId = iCmMgr.EasyWlanIdL(); - if ( easyWlanId && GetIntAttributeL( ECmId ) == easyWlanId ) - { - icon = EMbmCmpluginwlanQgn_prop_set_conn_wlan_easy; - mask = EMbmCmpluginwlanQgn_prop_set_conn_wlan_easy_mask; - } - - retval = (TUint32)AknsUtils::CreateGulIconL( - skinInstance, - id, - mbmFile.FullName(), - icon, - mask ); - break; - } - case ECmBearerAvailableIcon: - { - TAknsItemID id; - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - - TParse mbmFile; - User::LeaveIfError( mbmFile.Set( KWlanFileIcons, - &KDC_BITMAP_DIR, - NULL ) ); - - retval = (TUint32)AknsUtils::CreateGulIconL( - skinInstance, - id, - mbmFile.FullName(), - EMbmCmpluginwlanQgn_prop_set_conn_bearer_avail_wlan, - EMbmCmpluginwlanQgn_prop_set_conn_bearer_avail_wlan_mask ); - break; - } - case ECmCommsDBBearerType: - { - retval = KCommDbBearerWLAN; - break; - } - - case ECmDefaultUiPriority: - { - retval = GlobalUiBearerPriority( TPtrC(KCDTypeNameWLANServiceExt) ); - - if( retval == KDataMobilitySelectionPolicyPriorityWildCard ) - { - retval = KDefaultPriorityWLan; - } - } - break; - case ECmDefaultPriority: - { - retval = GlobalBearerPriority( TPtrC(KCDTypeNameWLANServiceExt) ); - - if( retval == KDataMobilitySelectionPolicyPriorityWildCard ) - { - retval = KDefaultPriorityWLan; - } - } - break; - case EWlanServiceId: - { - if ( iWlanServiceRecord ) - { - retval = iWlanServiceRecord->RecordId(); - break; - } - } - default: - { - retval = CCmPluginBaseEng::GetIntAttributeL( aAttribute ); - break; - } - } - return retval; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::GetBoolAttributeL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::GetBoolAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginWlan::GetBoolAttributeL" ); - - TBool retval( EFalse ); - - switch ( aAttribute ) - { - case ECmCoverage: - { -#ifndef __WINS__ - TInt& networks = CONST_CAST( TInt&, iWlanNetworks ); - networks = 0; - - networks = CheckNetworkCoverageL(); - - // If there's at least one WLAN network around, then there IS - // coverage. - retval = ( networks ? ETrue : EFalse ); -#else - - TInt& networks = CONST_CAST( TInt&, iWlanNetworks ); - ////networks = 0; - ////retval = EFalse; - - networks = 1; - retval = ETrue; - - - -#endif - } - break; - - case ECmAddToAvailableList: - { - retval = ETrue; - } - break; - - case ECmBearerHasUi: - { - retval = ETrue; - } - break; - - default: - { - retval = CCmPluginBaseEng::GetBoolAttributeL( aAttribute ); - break; - } - } - return retval; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::GetStringAttributeL -// -------------------------------------------------------------------------- -// -HBufC* CCmPluginWlan::GetStringAttributeL( const TUint32 aAttribute ) const - { - LOGGER_ENTERFN( "CCmPluginWlan::GetStringAttributeL" ); - - HBufC* retVal = NULL; - - switch( aAttribute ) - { - case ECmBearerAvailableName: - { - retVal = AllocReadL( R_QTN_NETW_CONSET_BEARER_AVAILABLE_WLAN ); - } - break; - - case ECmBearerAvailableText: - { - if ( CEikonEnv::Static() ) - { - if ( iWlanNetworks == KWlanSingleNetwork ) - { - retVal = AllocReadL( - R_QTN_NETW_CONSET_ONE_WLAN_NW_AVAILABLE ); - } - else - { - retVal = ReadResourceL( - R_QTN_NETW_CONSET_MANY_WLAN_NW_AVAILABLE, - iWlanNetworks ); - } - } - else - { // ReadResourceL does not work without a valid EikonEnv, so - // to have a consistent behaviour when there is one or more - // wlan networks for ECmBearerAvailableText, we always - // leave when called without valid EikonEnv - User::Leave( KErrNotSupported ); - } - } - break; - - case ECmBearerSupportedName: - { - retVal = AllocReadL( R_QTN_NETW_CONSET_BEARER_SUPPORTED_WLAN ); - } - break; - - case ECmBearerNamePopupNote: - { - retVal = AllocReadL( R_QTN_NETW_CONSET_POPUP_BEARER_WLAN ); - } - break; - - case ECmBearerSettingName: - { - retVal = AllocReadL( R_QTN_WLAN_SETT_BEARER_WLAN ); - } - break; - - default: - { - retVal = CCmPluginBaseEng::GetStringAttributeL( aAttribute ); - } - break; - } - return retVal; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::SetIntAttributeL -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::SetIntAttributeL( const TUint32 aAttribute, - TUint32 aValue ) - { - LOGGER_ENTERFN( "CCmPluginWlan::SetIntAttributeL" ); - - CCmPluginBaseEng::SetIntAttributeL( aAttribute, aValue ); - if ( aAttribute == EWlanSecurityMode ) - { - UpdateSecurityModeL(); - } - } - - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::SetBoolAttributeL -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::SetBoolAttributeL( const TUint32 aAttribute, - TBool aValue ) - { - LOGGER_ENTERFN( "CCmPluginWlan::SetBoolAttributeL" ); - - CCmPluginBaseEng::SetBoolAttributeL( aAttribute, aValue ); - } - - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::SetStringAttributeL -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::SetStringAttributeL( const TUint32 aAttribute, - const TDesC16& aValue ) - { - LOGGER_ENTERFN( "CCmPluginWlan::SetStringAttributeL" ); - - switch( aAttribute ) - { - case ECmName: - { - CCmPluginLanBase::SetStringAttributeL( aAttribute, aValue ); - break; - } - case EWlanIpNameServer1: - case EWlanIpNameServer2: - { - // when setting nameservers, must set EWlanIpDNSAddrFromServer - // according to current nameserver settings - CCmPluginBaseEng::SetStringAttributeL( aAttribute, aValue ); - break; - } - case EWlanIp6NameServer1: - case EWlanIp6NameServer2: - { - // when setting nameservers, must set EWlanIpDNSAddrFromServer - // according to current nameserver settings - CCmPluginBaseEng::SetStringAttributeL( aAttribute, aValue ); - break; - } - default: - { - CCmPluginBaseEng::SetStringAttributeL( aAttribute, aValue ); - break; - } - } - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::UpdateAdditionalRecordsL -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::UpdateAdditionalRecordsL() - { - LOGGER_ENTERFN( "CCmPluginWlan::UpdateAdditionalRecordsL" ); - - CheckIfNameModifiedL( iWlanServiceRecord ); - - iWlanServiceRecord->iWlanServiceId.SetL( iIapRecord->iService ); - - if ( !iWlanServiceRecord->RecordId() ) - { - iWlanServiceRecord->SetRecordId( KCDNewRecordRequest ); - iWlanServiceRecord->StoreL( Session() ); - } - else - { - iWlanServiceRecord->ModifyL( Session() ); - } - UpdateSecuritySettingsL(); - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::CanHandleIapIdL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::CanHandleIapIdL( TUint32 aIapId ) const - { - LOGGER_ENTERFN( "CCmPluginWlan::CanHandleIapIdL1" ); - CLOG_WRITE_1( "IapId: [%d]", aIapId ); - - TBool retVal( EFalse ); - - CCDIAPRecord *iapRecord = static_cast - ( CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord) ); - - CleanupStack::PushL( iapRecord ); - iapRecord->SetRecordId( aIapId ); - - TRAPD( err, iapRecord->LoadL( Session() ) ); - - if( !err ) - { - CanHandleIapIdL( iapRecord ); - } - - CleanupStack::PopAndDestroy( iapRecord ); - return retVal; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::CanHandleIapIdL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::CanHandleIapIdL( CCDIAPRecord *aIapRecord ) const - { - LOGGER_ENTERFN( "CCmPluginWlan::CanHandleIapIdL2" ); - - CLOG_WRITE_1( "IapId: [%d]", aIapRecord->RecordId() ); - - - TBool retVal( EFalse ); - - CLOG_WRITE_2( "IAP record: [%S][%S]", - &FIELD_TO_TDESC( aIapRecord->iServiceType ), - &FIELD_TO_TDESC( aIapRecord->iBearerType ) - ); - - if( (TPtrC(aIapRecord->iServiceType) == TPtrC(KCDTypeNameLANService) ) && - TPtrC(aIapRecord->iBearerType) == TPtrC(KCDTypeNameLANBearer) ) - { - // check if there is a WLAN record with - // an iServiceId == iIapRecord->iService; - CCDWlanServiceRecord* tmprec = new ( ELeave ) - CCDWlanServiceRecord ( iWlanTableId ); - CleanupStack::PushL( tmprec ); - - TInt service = aIapRecord->iService; - - tmprec->iWlanServiceId.SetL( (TUint32)service ); - if ( tmprec->FindL( Session() ) ) - { - // we found at least one WLAN using this IAP, - retVal = ETrue; - tmprec->LoadL( Session() ); - CLOG_WRITE( "I can." ); - } - else - { - // not found -> not our - CLOG_WRITE_1( "Wlan with Service ID: [%d] NOT found ", - service ); - } - CleanupStack::PopAndDestroy(tmprec); - } - return retVal; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::DeleteAdditionalRecordsL -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::DeleteAdditionalRecordsL() - { - LOGGER_ENTERFN( "CCmPluginWlan::DeleteAdditionalRecordsL" ); - - // as base class deletes service record, in this case LAN, - // only WLAN related stuff needs to be deleted - // also security settings, too! - DeleteSecuritySettingsL(); - iWlanServiceRecord->DeleteL( Session() ); - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::RunSettingsL -// -------------------------------------------------------------------------- -// -TInt CCmPluginWlan::RunSettingsL() - { - LOGGER_ENTERFN( "CCmPluginWlan::RunSettingsL" ); - - CmPluginWlanSettingsDlg* cmDlg = CmPluginWlanSettingsDlg::NewL( *this ); - return cmDlg->ConstructAndRunLD( ); - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::LoadServiceSettingL -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::LoadServiceSettingL() - { - LOGGER_ENTERFN( "CCmPluginWlan::LoadServiceSettingL" ); - - if( TPtrC(KCDTypeNameLANService) == iIapRecord->iServiceType ) - { - iServiceRecord = static_cast - (CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord)); - iServiceRecord->SetRecordId( iIapRecord->iService ); - CLOG_WRITE_1( "ID: [%d]", iServiceRecord->RecordId() ); - iServiceRecord->LoadL(Session()); - } - else - // this IAP service is not supported by this plugin. - { - User::Leave( KErrNotSupported ); - } - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::LoadAdditionalRecordsL -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::LoadAdditionalRecordsL() - { - LOGGER_ENTERFN( "CCmPluginWlan::LoadAdditionalRecordsL" ); - - if (!iWlanServiceRecord) - { - iWlanServiceRecord = - new ( ELeave ) CCDWlanServiceRecord ( iWlanTableId ); - } - iWlanServiceRecord->SetRecordId( 0 ); - - iWlanServiceRecord->iWlanServiceId.SetL( ( TUint32 ) - ( iIapRecord->iService ) ); - - if ( iWlanServiceRecord->FindL( Session() ) ) - { - iWlanServiceRecord->LoadL( Session() ); - LoadSecuritySettingsL(); - } - else - { - // not found -> error - CLOG_WRITE_1( "Wlan with Service ID: [%d] NOT found ", - iServiceRecord->RecordId() ); - User::Leave(KErrNotFound); - } - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::CreateNewServiceRecordL -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::CreateNewServiceRecordL() - { - LOGGER_ENTERFN( "CCmPluginWlan::CreateNewServiceRecordL" ); - - // create base (LAN) service record: - CCmPluginLanBase::CreateNewServiceRecordL(); - CCDLANServiceRecord* tmp = - static_cast(iServiceRecord); - if( FeatureSupported( KFeatureIdIPv6 ) ) - { - tmp->iIfNetworks.SetL( KDefIspIfNetworksIPv4IPv6 ); - } - else - { - tmp->iIfNetworks.SetL( KDefIspIfNetworksIPv4 ); - } - - // create WLAN service record: - CreateWlanServiceRecordL(); - - // In case of WLan 'show progress' is the default value - SetIntAttributeL( ECmSeamlessnessLevel, ESeamlessnessShowprogress ); - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::CreateWlanServiceRecordL -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::CreateWlanServiceRecordL() - { - LOGGER_ENTERFN( "CCmPluginWlan::CreateWlanServiceRecordL" ); - - delete iWlanServiceRecord; - iWlanServiceRecord = NULL; - - iWlanServiceRecord = new ( ELeave ) CCDWlanServiceRecord ( iWlanTableId ); - iWlanServiceRecord->SetRecordId( KCDNewRecordRequest ); - - iWlanServiceRecord->iRecordTag.SetL( 1 ); - iWlanServiceRecord->iRecordName.SetL( iIapRecord->iRecordName ); - iWlanServiceRecord->iWlanConnMode.SetL( EInfra ); - iWlanServiceRecord->iWlanSecMode.SetL( EWlanSecModeOpen ); - iWlanServiceRecord->iWlanScanSSID.SetL( EFalse ); - } - - -// ---------------------------------------------------------------------------- -// CCmPluginWlan::PrepareToUpdateRecordsL() -// ---------------------------------------------------------------------------- -// -void CCmPluginWlan::PrepareToUpdateRecordsL() - { - CCDLANServiceRecord* tmprec = static_cast(iServiceRecord); - - CheckDNSServerAddressL( ETrue, - tmprec->iIp6NameServer1, - tmprec->iIp6NameServer2, - tmprec->iIp6DnsAddrFromServer ); - - CheckDNSServerAddressL( EFalse, - tmprec->iIpNameServer1, - tmprec->iIpNameServer2, - tmprec->iIpDnsAddrFromServer ); - SetDaemonNameL(); - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::LoadSecuritySettingsL -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::LoadSecuritySettingsL() - { - LOGGER_ENTERFN( "CCmPluginWlan::LoadSecuritySettingsL" ); - - TUint32 secmode = iWlanServiceRecord->iWlanSecMode; - TUint32 iapid = iIapRecord->iService; - - switch ( secmode ) - { - case EWlanSecModeOpen: - { - break; - } - case EWlanSecModeWep: - { - if ( !iWepSecSettings ) - { - iWepSecSettings = CWEPSecuritySettings::NewL(); - } - iWepSecSettings->LoadL( iapid, Session() ); - break; - } - case EWlanSecMode802_1x: - { - if ( !iWpaSecSettings ) - { - iWpaSecSettings = - CWPASecuritySettings::NewL( ESecurityMode8021x ); - } - iWpaSecSettings->LoadL( iapid, Session() ); - break; - } - case EWlanSecModeWpa: - case EWlanSecModeWpa2: - { - if ( !iWpaSecSettings ) - { - iWpaSecSettings = - CWPASecuritySettings::NewL( ESecurityModeWpa ); - } - iWpaSecSettings->LoadL( iapid, Session() ); - break; - } - case EWlanSecModeWAPI: - { - if ( iIsWAPISupported ) - { - if ( !iWAPISecSettings ) - { - iWAPISecSettings = CWAPISecuritySettings::NewL(); - } - iWAPISecSettings->LoadL( iIapRecord->RecordId(), Session() ); - } - else - { - User::Leave( KErrCorrupt ); - } - break; - } - default: - { - User::Leave( KErrNotSupported ); - // do nothing in urel - break; - } - } - } - - -// ---------------------------------------------------------------------------- -// CCmPluginWlan::EditSecuritySettingsL -// ---------------------------------------------------------------------------- -// -TInt CCmPluginWlan::EditSecuritySettingsL( CEikonEnv& aEikonEnv ) - { - LOGGER_ENTERFN( "CCmPluginWlan::EditSecuritySettingsL" ); - - TInt ret = KErrNotFound; - - TUint32 secmode = iWlanServiceRecord->iWlanSecMode; - - HBufC* title = GetStringAttributeL(ECmName); - CleanupStack::PushL( title ); - switch ( secmode ) - { - case EWlanSecModeOpen: - { - break; - } - case EWlanSecModeWep: - { - CWEPSecuritySettingsUi* ui = - CWEPSecuritySettingsUi::NewL(aEikonEnv); - CleanupStack::PushL( ui ); - if ( !iWepSecSettings ) - { - iWepSecSettings = CWEPSecuritySettings::NewL(); - } - ret = iWepSecSettings->EditL( *ui, *title ); - CleanupStack::PopAndDestroy( ui ); - break; - } - case EWlanSecMode802_1x: - { - CWPASecuritySettingsUi* ui = - CWPASecuritySettingsUi::NewL(aEikonEnv); - CleanupStack::PushL(ui); - if ( !iWpaSecSettings ) - { - iWpaSecSettings = - CWPASecuritySettings::NewL( ESecurityMode8021x ); - } - ret = iWpaSecSettings->EditL( *ui, *title ); - CleanupStack::PopAndDestroy( ui ); - break; - } - case EWlanSecModeWpa: - case EWlanSecModeWpa2: - { - CWPASecuritySettingsUi* ui = - CWPASecuritySettingsUi::NewL(aEikonEnv); - CleanupStack::PushL( ui ); - if ( !iWpaSecSettings ) - { - iWpaSecSettings = - CWPASecuritySettings::NewL( ESecurityModeWpa ); - } - ret = iWpaSecSettings->EditL( *ui, *title ); - CleanupStack::PopAndDestroy( ui ); - break; - } - case EWlanSecModeWAPI: - { - if ( iIsWAPISupported ) - { - CWAPISecuritySettingsUi* ui = - CWAPISecuritySettingsUi::NewL( aEikonEnv ); - CleanupStack::PushL( ui ); - if ( !iWAPISecSettings ) - { - iWAPISecSettings = CWAPISecuritySettings::NewL(); - } - ret = iWAPISecSettings->EditL( *ui, *title ); - CleanupStack::PopAndDestroy( ui ); - } - else - { - User::Leave( KErrCorrupt ); - } - break; - } - default: - { - // do nothing in urel - break; - } - } - CleanupStack::PopAndDestroy( title ); - return ret; - } - -// -------------------------------------------------------------------------- -// CCmPluginWlan::AreSecuritySettingsValidL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::AreSecuritySettingsValidL() - { - LOGGER_ENTERFN( "CCmPluginWlan::AreSecuritySettingsValidL" ); - - TBool ret = EFalse; - - TUint32 secmode = iWlanServiceRecord->iWlanSecMode; - - switch ( secmode ) - { - case EWlanSecModeOpen: - { - break; - } - case EWlanSecModeWep: - { - if ( !iWepSecSettings ) - { - iWepSecSettings = CWEPSecuritySettings::NewL(); - } - ret = iWepSecSettings->IsValid(); - break; - } - case EWlanSecMode802_1x: - { - if ( !iWpaSecSettings ) - { - iWpaSecSettings = - CWPASecuritySettings::NewL( ESecurityMode8021x ); - } - ret = iWpaSecSettings->IsValid(); - break; - } - case EWlanSecModeWpa: - case EWlanSecModeWpa2: - { - if ( !iWpaSecSettings ) - { - iWpaSecSettings = - CWPASecuritySettings::NewL( ESecurityModeWpa ); - } - ret = iWpaSecSettings->IsValid(); - break; - } - case EWlanSecModeWAPI: - { - if ( iIsWAPISupported ) - { - if ( !iWAPISecSettings ) - { - iWAPISecSettings = CWAPISecuritySettings::NewL(); - } - ret = iWAPISecSettings->IsValid(); - } - else - { - User::Leave( KErrCorrupt ); - } - break; - } - default: - { - // do nothing in urel - break; - } - } - return ret; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::UpdateSecuritySettingsL() -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::UpdateSecuritySettingsL() - { - LOGGER_ENTERFN( "CCmPluginWlan::UpdateSecuritySettingsL" ); - - TUint32 oldwlaniapid(0); - TUint32 wlaniapid = iIapRecord->iService; - - TUint32 secmode = iWlanServiceRecord->iWlanSecMode; - CLOG_WRITE_1( "Sec mode: [%d]", secmode ); - - TTypeOfSaving savetype( ESavingBrandNewAP ); - - if (iWlanServiceRecord->RecordId()) - { - savetype = ESavingEditedAP; - oldwlaniapid = wlaniapid; - } - - if ( iIsCopy ) - { - oldwlaniapid = iCopiedFromIapId; - savetype = ESavingNewAPAsACopy; - - switch ( secmode ) - { - case EWlanSecModeOpen: - { - break; - } - case EWlanSecModeWep: - { - // this is a brand new copy of another CM - // we have to load the settings for the old wlan - // and save with the new one. - // first delete possibly existing other settings - if ( iWepSecSettings ) - { - delete iWepSecSettings; - iWepSecSettings = NULL; - } - break; - } - case EWlanSecMode802_1x: - { - // this is a brand new copy of another CM - // we have to load the settings for the old wlan - // and save with the new one. - // first delete possibly existing other settings - if ( iWpaSecSettings ) - { - delete iWpaSecSettings; - iWpaSecSettings = NULL; - } - break; - } - case EWlanSecModeWpa: - case EWlanSecModeWpa2: - { - // this is a brand new copy of another CM - // we have to load the settings for the old wlan - // and save with the new one. - // first delete possibly existing other settings - if ( iWpaSecSettings ) - { - delete iWpaSecSettings; - iWpaSecSettings = NULL; - } - break; - } - case EWlanSecModeWAPI: - { - if ( iIsWAPISupported ) - { - if ( iWAPISecSettings ) - { - delete iWAPISecSettings; - iWAPISecSettings = NULL; - } - } - else - { - User::Leave( KErrCorrupt ); - } - break; - } - default: - { - CLOG_WRITE( "Unknown secmode" ); - // do nothing in urel - break; - } - } - } - // now save, & load if still needed - switch ( secmode ) - { - case EWlanSecModeOpen: - { - // Extra fileds are deleted from WLANServiceTable - // when security mode is changed from WPA to Open - if ( iWpaSecSettings ) - { - iWpaSecSettings->DeleteL( wlaniapid ); - } - break; - } - case EWlanSecModeWep: - { - // Extra fileds are deleted from WLANServiceTable - // when security mode is changed from WPA to WEP - if ( iWpaSecSettings ) - { - iWpaSecSettings->DeleteL( wlaniapid ); - } - - // we have to try to save if: - // 1. it is a changed AP, it is possible that only - // sec. settings have been changed. - // In this case, iWepSecSettings might be NULL!! - // 2. it's sec. settings had been edited - - if ( !iWepSecSettings ) - { - iWepSecSettings = CWEPSecuritySettings::NewL(); - iWepSecSettings->LoadL( oldwlaniapid, Session() ); - } - // save WEP settings, too, into same transaction... - iWepSecSettings->SaveL( wlaniapid, Session() ); - break; - } - case EWlanSecMode802_1x: - { - if ( !iWpaSecSettings ) - { - iWpaSecSettings = - CWPASecuritySettings::NewL( ESecurityMode8021x ); - iWpaSecSettings->LoadL( oldwlaniapid, Session() ); - } - // save WPA settings, too, into same transaction... - iWpaSecSettings->SaveL( wlaniapid, Session(), savetype, oldwlaniapid ); - break; - } - case EWlanSecModeWpa: - case EWlanSecModeWpa2: - { - if ( !iWpaSecSettings ) - { - iWpaSecSettings = - CWPASecuritySettings::NewL( ESecurityModeWpa ); - iWpaSecSettings->LoadL( oldwlaniapid, Session() ); - } - - // save WPA settings, too, into same transaction... - iWpaSecSettings->SaveL( wlaniapid, Session(), savetype, oldwlaniapid ); - break; - } - case EWlanSecModeWAPI: - { - if ( iIsWAPISupported ) - { - if ( !iWAPISecSettings ) - { - iWAPISecSettings = CWAPISecuritySettings::NewL(); - iWAPISecSettings->LoadL( iIapRecord->RecordId(), Session() ); - } - // save WAPI settings - TRAPD( err, iWAPISecSettings->SaveL( iIapRecord->RecordId(), Session() ) ); - if ( err ) - { - if ( err != KErrArgument ) - { - User::Leave( err ); - } - } - } - else - { - User::Leave( KErrCorrupt ); - } - break; - } - default: - { - CLOG_WRITE( "Unknown secmode" ); - // do nothing in urel - break; - } - } - // clean up copy flags - if ( iIsCopy ) - { - iIsCopy = EFalse; - iCopiedFromIapId = 0; - } - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::AdditionalReset() -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::AdditionalReset() - { - LOGGER_ENTERFN( "CCmPluginWlan::AdditionalReset" ); - - delete iWlanServiceRecord; - iWlanServiceRecord = NULL; - - delete iWepSecSettings; - iWepSecSettings = NULL; - - delete iWpaSecSettings; - iWpaSecSettings = NULL; - - if ( iIsWAPISupported ) - { - delete iWAPISecSettings; - iWAPISecSettings = NULL; - } - } - -// -------------------------------------------------------------------------- -// CCmPluginWlan::BearerRecordIdLC() -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::BearerRecordIdLC( HBufC* &aBearerName, - TUint32& aRecordId ) - { - LOGGER_ENTERFN( "CCmPluginWlan::BearerRecordIdLC" ); - - CCDLANBearerRecord* tmprec = static_cast - ( CCDRecordBase::RecordFactoryL( KCDTIdLANBearerRecord ) ); - CleanupStack::PushL( tmprec ); - - tmprec->iRecordName.SetL( TPtrC( iBearerRecName ) ); - if ( !tmprec->FindL( Session() ) ) - { // bearer not found -> create dummy values - CLOG_WRITE( "No bearer found" ); - - tmprec->SetRecordId( KCDNewRecordRequest ); - - tmprec->iBearerAgent.SetL( KWlanBearerAgent ); - tmprec->iRecordName.SetL( KWlanBearerName ); - tmprec->iLanBearerNifName.SetL( KWlanBearerNif ); - tmprec->iLanBearerLddName.SetL( KWlanLDDName ); - tmprec->iLanBearerPddName.SetL( KWlanPDDName ); - tmprec->iLastSocketActivityTimeout.SetL( - ( TUint32 )KWlanLastSocketActivityTimeout ); - tmprec->iLastSessionClosedTimeout.SetL( - (TUint32 )KWlanLastSessionClosedTimeout ); - tmprec->iLastSocketClosedTimeout.SetL( - ( TUint32 )KWlanLastSocketClosedTimeout ); - tmprec->StoreL( Session() ); - } - - aRecordId = tmprec->RecordId(); - - CLOG_WRITE_2( "Name: [%S], id: [%d]", - &tmprec->iRecordName.GetL(), - aRecordId ); - - CleanupStack::PopAndDestroy( tmprec ); - - aBearerName = TPtrC(KCDTypeNameLANBearer).AllocLC(); - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::ReadResourceL() -// -------------------------------------------------------------------------- -// -HBufC* CCmPluginWlan::ReadResourceL( TInt aResId, TInt aInt ) const - { - LOGGER_ENTERFN( "CCmPluginWlan::ReadResourceL" ); - - HBufC* retval = NULL; - - RConeResourceLoader resourceLoader( *CEikonEnv::Static() ); - LoadResourceLC( resourceLoader ); - retval = StringLoader::LoadL( aResId, aInt ); - - // Clean-up - CleanupStack::PopAndDestroy(); - - return retval; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::LoadResourceL() -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::LoadResourceLC( - RConeResourceLoader& aResourceLoader ) const - { - LOGGER_ENTERFN( "CCmPluginWlan::LoadResourceLC" ); - - // Add resource file. - TParse fp; - User::LeaveIfError( fp.Set( KPluginWlanResDirAndFileName, - &KDC_RESOURCE_FILES_DIR, - NULL ) ); - TFileName resourceFileNameBuf = fp.FullName(); - - CleanupClosePushL( aResourceLoader ); - aResourceLoader.OpenL( resourceFileNameBuf ); - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::InitializeWithUiL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::InitializeWithUiL( TBool aManuallyConfigure ) - { - LOGGER_ENTERFN( "CCmPluginWlan::InitializeWithUiL" ); - - TBool retVal ( EFalse ); - RConeResourceLoader resourceLoader( *CEikonEnv::Static() ); - LoadResourceLC( resourceLoader ); - if ( aManuallyConfigure ) - { - retVal = ManuallyConfigureL(); - } - else - { - retVal = AutomaticallyConfigureL(); - } - // Clean-up - CleanupStack::PopAndDestroy(); - return retVal; - } - -// -------------------------------------------------------------------------- -// CCmPluginWlan::ProtectedSetupL -// -------------------------------------------------------------------------- -// -WiFiProt::TWiFiReturn CCmPluginWlan::ProtectedSetupL( TWlanSsid& aSsid ) - { - RCmManagerExt packedCmManager; - iCmMgr.WrapCmManager( packedCmManager ); - CWifiProtUiInProcess* wifi = CWifiProtUiInProcess::NewL( - &packedCmManager ); - CleanupStack::PushL( wifi ); - WiFiProt::TWiFiReturn wifiret = wifi->StartFromUiL( aSsid, EFalse, iAdditionalCmsCreated); - CleanupStack::PopAndDestroy( wifi ); - switch ( wifiret ) - { - case WiFiProt::EWiFiCancel: - { - break; - } - case WiFiProt::EWiFiOK: - { - if (iAdditionalCmsCreated.Count()) - { - // Loading the first item in the array - // to the actual plugin - Reset(); - AdditionalReset(); - LoadL( iAdditionalCmsCreated[0] ); - iAdditionalCmsCreated.Remove(0); - } - else - {//no settings configured, do the same as cancel case - return WiFiProt::EWiFiCancel; - } - - break; - } - case WiFiProt::EWifiNoAuto: - { - break; - } - default: - { - User::Leave( KErrNotSupported ); - break; - } - } - return wifiret; - } - -// -------------------------------------------------------------------------- -// CCmPluginWlan::AutomaticallyConfigureL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::AutomaticallyConfigureL() - { - LOGGER_ENTERFN( "CCmPluginWlan::AutomaticallyConfigureL" ); - - TBool retval ( ETrue ); - - if ( !iConnUiUtils ) - { - iConnUiUtils = CConnectionUiUtilities::NewL(); - } - - // Let's search for a WLAN network - TWlanSsid ssid; - TWlanConnectionMode connectionMode; - TWlanConnectionExtentedSecurityMode securityMode; - - TUint32 secmode( EWlanSecModeOpen ); - - // Fortunately user will not see WLAN networks with empty ssid in the list - // shown by next call. - CCmPluginWlanActiveWaiter* waiter = CCmPluginWlanActiveWaiter::NewL(); - CleanupStack::PushL( waiter ); - - TBool isProtectedSetupSupported; - iConnUiUtils->SearchWLANNetworkAsync( waiter->iStatus, ssid, connectionMode, securityMode, isProtectedSetupSupported ); - - TInt searchWlanReturn = waiter->WaitForRequest(); - CleanupStack::PopAndDestroy( waiter ); - - if ( searchWlanReturn == KErrNone) - { - if ( isProtectedSetupSupported ) - { - TBool wifiret = ProtectedSetupL( ssid ); - switch ( wifiret ) - { - case WiFiProt::EWiFiCancel: //cancel pressed, cancel process - { - return EFalse; - //break; - } - case WiFiProt::EWiFiOK: //settings configured already, we can return - { - return ETrue; - //break; - } - case WiFiProt::EWifiNoAuto://proceed with normal setup - { - break; - } - default: - { - User::Leave( KErrNotSupported ); - break; - } - } - } - switch( securityMode ) - { - case EWlanConnectionExtentedSecurityModeOpen: - { - secmode = EWlanSecModeOpen; - } - break; - - case EWlanConnectionExtentedSecurityModeWepOpen: - case EWlanConnectionExtentedSecurityModeWepShared: - { - secmode = EWlanSecModeWep; - } - break; - - case EWlanConnectionExtentedSecurityMode802d1x: - { - secmode = EWlanSecMode802_1x; - } - break; - - case EWlanConnectionExtentedSecurityModeWpa: - case EWlanConnectionExtentedSecurityModeWpaPsk: - { - secmode = EWlanSecModeWpa; - } - break; - - case EWlanConnectionExtentedSecurityModeWpa2: - case EWlanConnectionExtentedSecurityModeWpa2Psk: - { - secmode = EWlanSecModeWpa2; - } - break; - case EWlanConnectionExtentedSecurityModeWapi: - case EWlanConnectionExtentedSecurityModeWapiPsk: - { - if ( iIsWAPISupported ) - { - secmode = EWlanSecModeWAPI; - } - else - { - User::Leave( KErrCorrupt ); - } - } - break; - default: - { - User::Leave( KErrNotSupported ); - } - } - - // Let's check the security mode and if it's other than "none", then - // ask for the key. - HBufC* key = HBufC::NewLC( KWlanMaxKeyLength ); // security key - TPtr keyPtr( key->Des() ); - TBool wepKeyInAsciiFormat; - switch( securityMode ) - { - case EWlanConnectionExtentedSecurityModeWepOpen: - case EWlanConnectionExtentedSecurityModeWepShared: - { - retval = iConnUiUtils->EasyWepDlg( &keyPtr, wepKeyInAsciiFormat ); - break; - } - case EWlanConnectionExtentedSecurityModeWpaPsk: - case EWlanConnectionExtentedSecurityModeWpa2Psk: - { - retval = iConnUiUtils->EasyWpaDlg( &keyPtr ); - break; - } - case EWlanConnectionExtentedSecurityModeWapiPsk: - { - retval = iConnUiUtils->EasyWapiDlg( &keyPtr ); - break; - } - case EWlanConnectionExtentedSecurityModeOpen: - case EWlanConnectionExtentedSecurityMode802d1x: - case EWlanConnectionExtentedSecurityModeWpa: - case EWlanConnectionExtentedSecurityModeWpa2: - case EWlanConnectionExtentedSecurityModeWapi: - default: - { - break; - } - } - - // If retval is not ETrue here, then most probably the user has - // cancelled the password dialog ==> she has cancelled the whole - // process. - if ( retval ) - { - // We have to convert the 8-bit SSID to 16-bit for CommsDat. - HBufC* ssid16 = HBufC::NewLC( ssid.Length() ); - TPtr ssid16Ptr( ssid16->Des() ); - ssid16Ptr.Copy( ssid ); - - SetStringAttributeL( ECmName, *ssid16 ); - SetStringAttributeL( EWlanSSID, *ssid16 ); - // ConvertWLANConnectionStatesL( )converts WLAN connection state - // (TWlanConnectionMode) into EInfra or EAdhoc (TWlanNetMode) - SetIntAttributeL( EWlanConnectionMode, - (TUint32) ConvertWLANConnectionStatesL( connectionMode ) ); - SetIntAttributeL( EWlanSecurityMode, secmode ); - - // Check if the network is hidden - TBool hidden( EFalse ); - - // These values we already have so we are not interested of - // them - TWlanNetMode tempNetworkMode; - TWlanConnectionExtentedSecurityMode tempSecurityMode; - - TBool tempProtectedSetupSupported; - - TInt retVal( KErrNone ); - - CCmWlanCoverageCheck* coverage = new( ELeave )CCmWlanCoverageCheck; - CleanupStack::PushL( coverage ); - - // We need to catch leave value of Wlan scanning - TRAPD( err, retVal = coverage->ScanForPromptedSsidL( ssid, ETrue, - tempNetworkMode, - tempSecurityMode, - tempProtectedSetupSupported ) ); - if ( !retVal || err != KErrNone) - { - TRAPD( err, retVal = coverage->ScanForPromptedSsidL( ssid, - EFalse, - tempNetworkMode, - tempSecurityMode, - tempProtectedSetupSupported ) ); - if ( err == KErrNone && retVal ) - { - hidden = ETrue; - } - else // direct scan is ok, but network could not found with given ssid - { - CleanupStack::PopAndDestroy( coverage ); // coverage - CleanupStack::PopAndDestroy( ssid16 ); - CleanupStack::PopAndDestroy( key ); - - TCmCommonUi::ShowNoteL( R_QTN_NETW_QUEST_IAP_INCOMPLETE_DELETE, TCmCommonUi::ECmOkNote ); - return EFalse; - } - } - - CleanupStack::PopAndDestroy( coverage ); // coverage - - SetBoolAttributeL( EWlanScanSSID, hidden ); - CLOG_WRITE_1( "Is hidden[%d]", (TInt) hidden ); - - // We have to store the security key as well. - if ( securityMode == EWlanConnectionExtentedSecurityModeWepOpen ) - { - if ( !iWepSecSettings ) - { - iWepSecSettings = CWEPSecuritySettings::NewL(); - } - iWepSecSettings->SetKeyDataL( 0, *key, - wepKeyInAsciiFormat ); - // Note that the key will NOT be persisted at this very - // point, but only after SaveL, which will be called - // later on. - } - else if ( securityMode == EWlanConnectionExtentedSecurityModeWpaPsk - || securityMode == EWlanConnectionExtentedSecurityModeWpa2Psk ) - { - if ( !iWpaSecSettings ) - { - iWpaSecSettings = CWPASecuritySettings::NewL( ESecurityModeWpa ); - } - iWpaSecSettings->SetWPAPreSharedKey( *key ); - - // Note that the key will NOT be persisted at this very - // point, but only after SaveL, which will be called - // later on. - } - else if ( securityMode == EWlanConnectionExtentedSecurityModeWapiPsk ) - { - if ( !iWAPISecSettings ) - { - iWAPISecSettings = CWAPISecuritySettings::NewL(); - } - - iWAPISecSettings->SetPreSharedKeyL( CWAPISecuritySettings::EWapiKeyAscii, *key ); - // Note that the key will NOT be persisted at this very - // point, but only after SaveL, which will be called - // later on. - } - - CLOG_WRITE( "InitializeWithUiL stored everything successfully" ); - - CleanupStack::PopAndDestroy( ssid16 ); - } - CleanupStack::PopAndDestroy( key ); - } - else - { - if ( searchWlanReturn == KErrNotFound ) - { - // no Wlan network found, continuing process... - HBufC* ssid16 = HBufC::NewLC( ssid.Length() ); - TPtr ssid16Ptr( ssid16->Des() ); - ssid16Ptr.Copy( ssid ); - // write ssid and go on... - SetStringAttributeL( ECmName, *ssid16 ); - SetStringAttributeL( EWlanSSID, *ssid16 ); - CleanupStack::PopAndDestroy( ssid16 ); - retval = ProceedWithManualL( ETrue ); // revert to fully manual... - } - else - { - retval = EFalse; - } - } - return retval; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::ManuallyConfigureL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::ManuallyConfigureL() - { - LOGGER_ENTERFN( "CCmPluginWlan::ManuallyConfigureL" ); - - TBool proceed ( EFalse ); - TBool askNWModeAndSec ( EFalse ); - - // Step 1 - WLAN Network Name query (SSID) - // sets: ECmName, EWlanSSID - RBuf nwName; - nwName.CreateL( KCmWlanNWNameMaxLength ); - CleanupClosePushL( nwName ); - - proceed = ShowNWNameQueryL( nwName ); - - TWlanConnectionExtentedSecurityMode securityMode = - EWlanConnectionExtentedSecurityModeOpen; - - TWpaMode wpaMode = EWpaModeUndefined; - - if ( proceed ) - { - TWlanNetMode nwMode( EInfra ); - - // Step 2 - SSID scan ( first broadcast, then direct ) - // sets: EWlanConnectionMode - // EWlanScanSSID - // EWlanSecurityMode - - TWlanSsid ssid; - ssid.Copy( nwName ); - - TBool protectedSetupSupported = EFalse; - if ( ScanForWlanNwL( ssid, nwMode, securityMode, protectedSetupSupported ) ) - { - if ( protectedSetupSupported ) - { - TBool wifiret = ProtectedSetupL( ssid ); - switch ( wifiret ) - { - case WiFiProt::EWiFiCancel: //cancel pressed, cancel process - { - CleanupStack::PopAndDestroy( &nwName ); //cleanup and return - return EFalse; - //break; - } - case WiFiProt::EWiFiOK: - { - CleanupStack::PopAndDestroy( &nwName );//cleanup and return - //UpdateSecuritySettingsL(); - return ETrue; - //break; - } - case WiFiProt::EWifiNoAuto://proceed with normal setup - { - break; - } - default: - { - User::Leave( KErrNotSupported ); - break; - } - } - } - - if ( securityMode == EWlanConnectionExtentedSecurityModeWpaPsk - || securityMode == EWlanConnectionExtentedSecurityModeWpa2Psk ) - { - wpaMode = EWpaModePreSharedKey; - } - else if ( securityMode == EWlanConnectionExtentedSecurityModeWpa - || securityMode == EWlanConnectionExtentedSecurityMode802d1x - || securityMode == EWlanConnectionExtentedSecurityModeWpa2 ) - { - wpaMode = EWpaModeEap; - } - } - else - { - askNWModeAndSec = ETrue; - } - proceed = ProceedWithManualL ( askNWModeAndSec, nwMode, securityMode, wpaMode ); - } - CleanupStack::PopAndDestroy( &nwName ); - - return proceed; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::ProceedWithManualL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::ProceedWithManualL( TBool aAskNWModeAndSec, - TWlanNetMode aNwMode, - TWlanConnectionExtentedSecurityMode aSecurityMode, - TWpaMode aWpaMode ) - { - LOGGER_ENTERFN( "CCmPluginWlan::ProceedWithManualL" ); - - TInt proceed = ETrue; - if ( aAskNWModeAndSec ) - { - // Step 3 - Network Mode - // sets: EWlanConnectionMode - // EWlanScanSSID - proceed = SelectNWModeL( aNwMode ); - - // Step 4 - Network security - // sets: EWlanSecurityMode - // Open - finished - // WEP - go to step 5 - // WPA/802.1x - go to step 6 - // WAPI - go to step 9 - if ( proceed ) - { - proceed = ShowNWSecurityDlgL( aNwMode, aSecurityMode ); - } - } - - // Security settings - Steps 5-8 - if ( proceed && aSecurityMode != EWlanConnectionExtentedSecurityModeOpen ) - { - switch ( aSecurityMode ) - { - // Step 5 - Enter WEP key - // sets: wep key - // finished - case EWlanConnectionExtentedSecurityModeWepOpen: - case EWlanConnectionExtentedSecurityModeWepShared: - { - proceed = EnterWEPKeyL(); - break; - } - // Step 6 - WPA/WPA2 mode - // sets: wpa/802.1x keys - // Pre-shared - go to step 7 - // EAP - go to step 8 - case EWlanConnectionExtentedSecurityMode802d1x: - TCmCommonUi::ShowNoteL( *( StringLoader::LoadLC( - R_QTN_NETW_CONSET_INFO_EAP_SETTINGS_DEFAULT ) ), - TCmCommonUi::ECmInfoNote ); - CleanupStack::PopAndDestroy(); - break; - - case EWlanConnectionExtentedSecurityModeWpa: - case EWlanConnectionExtentedSecurityModeWpaPsk: - case EWlanConnectionExtentedSecurityModeWpa2: - case EWlanConnectionExtentedSecurityModeWpa2Psk: - { - if ( aWpaMode == EWpaModeUndefined ) - { - proceed = SelectWpaModeDialogL( aWpaMode ); - } - - if ( proceed ) - { - // Step 7 - Pre-shared key - // sets: pre-shared key - // finished - if ( aWpaMode == EWpaModePreSharedKey ) - { - proceed = EnterWpaPreSharedKeyL(); - } - // Step 8 - EAP selection note - else - { - TCmCommonUi::ShowNoteL( *( StringLoader::LoadLC( - R_QTN_NETW_CONSET_INFO_EAP_SETTINGS_DEFAULT ) ), - TCmCommonUi::ECmInfoNote ); - CleanupStack::PopAndDestroy(); - } - } - break; - } - // Step 9 - case EWlanConnectionExtentedSecurityModeWapi: - case EWlanConnectionExtentedSecurityModeWapiPsk: - { - if ( iIsWAPISupported ) - { - if ( aSecurityMode == EWlanConnectionExtentedSecurityModeWapiPsk ) - { - proceed = EnterWAPIPreSharedKeyL(); - } - } - else - { - User::Leave( KErrCorrupt ); - } - break; - } - default: - { - User::Leave( KErrNotSupported ); - break; - } - } - } - - // Store all the unsaved settings - /* if ( proceed ) - { - UpdateSecuritySettingsL(); - }*/ - return proceed; - } - -// -------------------------------------------------------------------------- -// CCmPluginWlan::ShowNWNameQueryL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::ShowNWNameQueryL( TDes& aNwName ) - { - LOGGER_ENTERFN( "CCmPluginWlan::ShowNWNameQueryL" ); - - TBool retVal ( EFalse ); - - retVal = TCmCommonUi::ShowConfirmationQueryWithInputL( - R_QTN_WLAN_PRMPT_NETWORK_NAME, - aNwName ); - if ( retVal ) - { - SetStringAttributeL( ECmName, aNwName ); - SetStringAttributeL( EWlanSSID, aNwName ); - - retVal = ETrue; - } - return retVal; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::ScanForWlanNwL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::ScanForWlanNwL( -#ifdef __WINS__ - TWlanSsid& /*aSsid*/, TWlanNetMode& /*aNetworkMode*/, - TWlanConnectionExtentedSecurityMode& /*aSecurityMode*/, - TBool& /*aProtectedSetupSupported*/ ) -#else - TWlanSsid& aSsid, TWlanNetMode& aNetworkMode, - TWlanConnectionExtentedSecurityMode& aSecurityMode, - TBool& aProtectedSetupSupported ) -#endif // __WINS__ - { - LOGGER_ENTERFN( "CCmPluginWlan::ScanForWlanNwL" ); - - TBool retVal ( EFalse ); - - DestroyWaitDialog(); - - iWaitDialog = new( ELeave )CAknWaitDialog - ( REINTERPRET_CAST( CEikDialog**, &iWaitDialog ), ETrue ); - iWaitDialog->ExecuteLD( R_SEARCHING_WLAN_WAIT_NOTE ); - -#ifndef __WINS__ - TBool hidden ( EFalse ); - - CCmWlanCoverageCheck* coverage = new( ELeave )CCmWlanCoverageCheck; - CleanupStack::PushL( coverage ); - - CLOG_WRITE( "Coverage created, calling ScanForPromptedSsidL, broadcast" ); - retVal = coverage->ScanForPromptedSsidL( aSsid, ETrue, aNetworkMode, - aSecurityMode, - aProtectedSetupSupported ); - CLOG_WRITE( "ScanForPromptedSsidL returned" ); - - if ( !retVal ) - { - CLOG_WRITE( "Calling ScanForPromptedSsidL, direct" ); - retVal = coverage->ScanForPromptedSsidL( aSsid, EFalse, aNetworkMode, - aSecurityMode, - aProtectedSetupSupported ); - CLOG_WRITE( "ScanForPromptedSsidL returned" ); - - if ( retVal ) - { - hidden = ETrue; - } - } - - CleanupStack::PopAndDestroy( coverage ); - - if ( retVal ) - { - CLOG_WRITE( "Ssid has been found" ); - - // Network mode - SetIntAttributeL( EWlanConnectionMode, aNetworkMode ); - // Security mode - SetIntAttributeL( EWlanSecurityMode, - ConvertConnectionSecurityModeToSecModeL( - aSecurityMode ) ); - // Hidden - SetBoolAttributeL( EWlanScanSSID, hidden ); - } - else -#else // __WINS - if ( !retVal ) -#endif // __WINS - { - HBufC* stringLabel = StringLoader::LoadLC( - R_INFO_NO_NETWORKS_FOUND ); - - CAknGlobalNote * note = CAknGlobalNote::NewL(); - CleanupStack::PushL(note); - note->ShowNoteL(EAknGlobalInformationNote, *stringLabel); - CleanupStack::PopAndDestroy(note); - CleanupStack::PopAndDestroy( stringLabel ); - } - - - DestroyWaitDialog(); - - return retVal; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::SelectNWModeL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::SelectNWModeL( TWlanNetMode& aNwMode ) - { - LOGGER_ENTERFN( "CCmPluginWlan::SelectNWModeL" ); - - TBool retVal ( EFalse ); - - // Title - HBufC* title = StringLoader::LoadLC( - R_QTN_NETW_CONSET_PRMPT_WLAN_NW_MODE_AND_STATUS ); - TPtr ptrTitle ( title->Des() ); - - // Items - CDesCArrayFlat* items = - new ( ELeave ) CDesCArrayFlat( KCmArrayMediumGranularity ); - CleanupStack::PushL( items ); - - TInt i = 0; - while ( KWlanNetworkModeConvTable[i].iResId != KEndOfArray ) - { - items->AppendL( - *StringLoader::LoadLC( KWlanNetworkModeConvTable[i].iResId ) ); - CleanupStack::PopAndDestroy(); - i++; - } - - // Show the dialog - TInt selection(0); - if ( TCmCommonUi::ShowPopupListL( ptrTitle , - items, - NULL, - R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, - selection ) ) - { - // result: - i = 0; - - aNwMode = - ( TWlanNetMode ) KWlanNetworkModeConvTable[selection].iNwMode; - - // Network mode - SetIntAttributeL( EWlanConnectionMode, aNwMode ); - - // Network status - SetBoolAttributeL( EWlanScanSSID, - KWlanNetworkModeConvTable[selection].iHidden ); - - retVal = ETrue; - } - - CleanupStack::Pop( items ); - CleanupStack::PopAndDestroy( title ); - return retVal; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::ShowNWSecurityDlgL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::ShowNWSecurityDlgL( TWlanNetMode aNwMode, - TWlanConnectionExtentedSecurityMode& aSecurityMode ) - { - LOGGER_ENTERFN( "CCmPluginWlan::ShowNWSecurityDlgL" ); - - TBool retVal ( EFalse ); - - // Collect NW Security Mode items - CDesCArrayFlat* items = - new ( ELeave ) CDesCArrayFlat( KCmArrayMediumGranularity ); - - TInt i = 0; - while ( KWlanSecurityModeConvTable[i].iResId != KEndOfArray ) - { - TWlanSecMode secMode = - ( TWlanSecMode ) KWlanSecurityModeConvTable[i].iSecurityMode; - - if ( ( secMode == EWlanSecModeOpen || secMode == EWlanSecModeWep ) - || aNwMode == EInfra ) - { - items->AppendL( *StringLoader::LoadLC( - KWlanSecurityModeConvTable[i].iResId ) ); - CleanupStack::PopAndDestroy(); - } - i++; - // don't show WAPI if it's not supported - if ( !iIsWAPISupported ) - { - if ( KWlanSecurityModeConvTable[i].iSecurityMode == EWlanSecModeWAPI ) - { - break; - } - } - } - - // Title - HBufC* title = StringLoader::LoadLC( - R_QTN_NETW_CONSET_PRMPT_WLAN_NW_SECURITY_MODE ); - TPtr ptrTitle ( title->Des() ); - - TInt selection = 0; - - // Show the dialog - if ( TCmCommonUi::ShowPopupListL( ptrTitle , - items, - NULL, - R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, - selection ) ) - { - // result: - aSecurityMode = - ConvertSecModeToConnectionSecurityModeL( ( TWlanSecMode ) - KWlanSecurityModeConvTable[selection].iSecurityMode ); - SetIntAttributeL( EWlanSecurityMode, - KWlanSecurityModeConvTable[selection].iSecurityMode ); - retVal = ETrue; - } - CleanupStack::PopAndDestroy( title ); - return retVal; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::EnterWEPKeyL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::EnterWEPKeyL() - { - LOGGER_ENTERFN( "CCmPluginWlan::EnterWEPKeyL" ); - - TBool retVal ( EFalse ); - - // Security key - HBufC* key = HBufC::NewLC( KWlanMaxKeyLength ); - TPtr keyPtr( key->Des() ); - TBool wepKeyInAsciiFormat ( EFalse ); - - if ( !iConnUiUtils ) - { - iConnUiUtils = CConnectionUiUtilities::NewL(); - } - - if ( iConnUiUtils->EasyWepDlg( &keyPtr, wepKeyInAsciiFormat ) ) - { - if ( !iWepSecSettings ) - { - iWepSecSettings = CWEPSecuritySettings::NewL(); - } - iWepSecSettings->SetKeyDataL( 0, - *key, - wepKeyInAsciiFormat ); - retVal = ETrue; - } - CleanupStack::PopAndDestroy( key ); - return retVal; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::EnterWpaPreSharedKeyL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::EnterWpaPreSharedKeyL() - { - LOGGER_ENTERFN( "CCmPluginWlan::EnterWpaPreSharedKeyL" ); - - TBool retVal ( EFalse ); - - HBufC* key = HBufC::NewLC( KWlanMaxKeyLength ); - TPtr keyPtr( key->Des() ); - - if ( !iConnUiUtils ) - { - iConnUiUtils = CConnectionUiUtilities::NewL(); - } - - if ( iConnUiUtils->EasyWpaDlg( &keyPtr ) ) - { - if ( !iWpaSecSettings ) - { - iWpaSecSettings = CWPASecuritySettings::NewL( ESecurityModeWpa ); - } - iWpaSecSettings->SetWPAPreSharedKey( *key ); - retVal = ETrue; - } - CleanupStack::PopAndDestroy( key ); - return retVal; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::SelectWpaModeDialogL -// -------------------------------------------------------------------------- -// -TBool CCmPluginWlan::SelectWpaModeDialogL( TWpaMode& aWpaMode ) - { - LOGGER_ENTERFN( "CCmPluginWlan::SelectWpaModeDialogL" ); - - TBool retVal ( EFalse ); - - // Collect NW Security Mode items - CDesCArrayFlat* items = - new ( ELeave ) CDesCArrayFlat( KCmArrayMediumGranularity ); - - // Title - HBufC* title = - StringLoader::LoadLC( R_QTN_NETW_CONSET_PRMPT_WLAN_WPA_MODE ); - TPtr ptrTitle ( title->Des() ); - - TInt selection = 0; - - // EWpaModeEap - items->AppendL( *StringLoader::LoadLC( - R_QTN_NETW_CONSET_PRMPT_WPA_MODE_EAP ) ); - CleanupStack::PopAndDestroy(); - - // EWpaModePreSharedKey - items->AppendL( *StringLoader::LoadLC( - R_QTN_NETW_CONSET_PRMPT_WPA_MODE_PSK ) ); - CleanupStack::PopAndDestroy(); - - // Show the dialog - if( TCmCommonUi::ShowPopupListL( ptrTitle, - items, - NULL, - R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, - selection ) ) - { - aWpaMode = ( TWpaMode ) selection; - retVal = ETrue; - } - - CleanupStack::PopAndDestroy( title ); - - return retVal; - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::UpdateSecurityModeL -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::UpdateSecurityModeL( ) - { - LOGGER_ENTERFN( "CCmPluginWlan::UpdateSecurityModeL" ); - - TUint32 secmode = GetIntAttributeL( EWlanSecurityMode ); - - TUint32 wlaniapid = iIapRecord->iService; - - switch ( secmode ) - { - case EWlanSecModeOpen: - { - break; - } - case EWlanSecModeWep: - { - if ( iWepSecSettings ) - { - delete iWepSecSettings; - iWepSecSettings = NULL; - } - iWepSecSettings = CWEPSecuritySettings::NewL(); - iWepSecSettings->LoadL( wlaniapid, Session() ); - break; - } - case EWlanSecMode802_1x: - { - if ( iWpaSecSettings ) - { - delete iWpaSecSettings; - iWpaSecSettings = NULL; - } - iWpaSecSettings = - CWPASecuritySettings::NewL( ESecurityMode8021x ); - iWpaSecSettings->LoadL( wlaniapid, Session() ); - break; - } - case EWlanSecModeWpa: - case EWlanSecModeWpa2: - { - if ( iWpaSecSettings ) - { - delete iWpaSecSettings; - iWpaSecSettings = NULL; - } - iWpaSecSettings = - CWPASecuritySettings::NewL( ESecurityModeWpa ); - iWpaSecSettings->LoadL( wlaniapid, Session() ); - break; - } - case EWlanSecModeWAPI: - { - if ( iIsWAPISupported ) - { - if ( iWAPISecSettings ) - { - delete iWAPISecSettings; - iWAPISecSettings = NULL; - } - iWAPISecSettings = CWAPISecuritySettings::NewL(); - if ( iIapRecord->RecordId() ) - { - iWAPISecSettings->LoadL( iIapRecord->RecordId(), Session() ); - } - } - else - { - User::Leave( KErrCorrupt ); - } - break; - } - default: - { - User::Leave( KErrNotSupported ); - break; - } - } - } - -// -------------------------------------------------------------------------- -// CCmPluginWlan::CopyAdditionalDataL -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::CopyAdditionalDataL( CCmPluginBaseEng& aDestInst ) const - { - LOGGER_ENTERFN( "CCmPluginWlan::CopyAdditionalDataL" ); - - STATIC_CAST( CCmPluginWlan*, &aDestInst )-> - SetAsCopyOf( iIapRecord->iService ); - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::SetAsCopyOf -// -------------------------------------------------------------------------- -// -void CCmPluginWlan::SetAsCopyOf( TUint32 aBaseIapID ) - { - LOGGER_ENTERFN( "CCmPluginWlan::SetAsCopyOf" ); - - iIsCopy = ETrue; - - iCopiedFromIapId = aBaseIapID; - } - -// --------------------------------------------------------- -// CCmPluginWlan::DeleteSecuritySettingsL -// --------------------------------------------------------- -// -void CCmPluginWlan::DeleteSecuritySettingsL() - { - LOGGER_ENTERFN( "CCmPluginWlan::DeleteSecuritySettingsL" ); - - TUint32 wlaniapid = iIapRecord->iService; - - // check security mode and existence of sec.settings - if (iWlanServiceRecord->RecordId() ) - {// ha sat least WLAN service record, may start to wonder... - // wlan service record will be deleted separatelly! - // get current security mode - TUint32 secmode = iWlanServiceRecord->iWlanSecMode; - - switch ( secmode ) - { - case EWlanSecModeOpen: - case EWlanSecModeWep: - { - // nothing to do here - break; - } - case EWlanSecMode802_1x: - { - if ( !iWpaSecSettings ) - { - iWpaSecSettings = - CWPASecuritySettings::NewL( ESecurityMode8021x ); - } - iWpaSecSettings->DeleteL( wlaniapid ); - break; - } - case EWlanSecModeWpa: - case EWlanSecModeWpa2: - { - if ( !iWpaSecSettings ) - { - iWpaSecSettings = - CWPASecuritySettings::NewL( ESecurityModeWpa ); - } - iWpaSecSettings->DeleteL( wlaniapid ); - break; - } - case EWlanSecModeWAPI: - if ( iIsWAPISupported ) - { - if ( !iWAPISecSettings ) - { - iWAPISecSettings = CWAPISecuritySettings::NewL(); - } - TUint32 serviceId = iWlanServiceRecord->RecordId(); - iWAPISecSettings->DeleteAPSpecificDataL( serviceId ); - } - else - { - User::Leave( KErrCorrupt ); - } - break; - default: - { - User::Leave( KErrNotSupported ); - // do nothing in urel - break; - } - } - } - // if there is no wlan service record, - // then there can be no security settings, skipping... - } - - -// --------------------------------------------------------- -// CCmPluginWlan::SetDnsIpFromServer -// --------------------------------------------------------- -// -void CCmPluginWlan::SetDnsIpFromServerL() - { - LOGGER_ENTERFN( "CCmPluginWlan::SetDnsIpFromServer" ); - - HBufC* ip1 = GetStringAttributeL( EWlanIpNameServer1 ); - CleanupStack::PushL( ip1 ); - - HBufC* ip2 = GetStringAttributeL( EWlanIpNameServer2 ); - CleanupStack::PushL( ip2 ); - - - if ( ( ip1->Compare( KDynIpAddress ) == 0 ) && - ( ip2->Compare( KDynIpAddress ) == 0 ) ) - { - SetBoolAttributeL( EWlanIpDNSAddrFromServer, ETrue ); - } - else - { - SetBoolAttributeL( EWlanIpDNSAddrFromServer, EFalse ); - } - CleanupStack::PopAndDestroy( 2,ip1 ); - } - - -// --------------------------------------------------------- -// CCmPluginWlan::SetDns6IpFromServer -// --------------------------------------------------------- -// -void CCmPluginWlan::SetDns6IpFromServerL() - { - LOGGER_ENTERFN( "CCmPluginWlan::SetDns6IpFromServer" ); - - HBufC* ip1 = GetStringAttributeL( EWlanIp6NameServer1 ); - CleanupStack::PushL( ip1 ); - - HBufC* ip2 = GetStringAttributeL( EWlanIp6NameServer2 ); - CleanupStack::PushL( ip2 ); - - if ( ( ip1->Compare( KDynIpv6Address ) == 0 ) && - ( ip2->Compare( KDynIpv6Address ) == 0 ) ) - { - SetBoolAttributeL( EWlanIp6DNSAddrFromServer, ETrue ); - } - else - { - SetBoolAttributeL( EWlanIp6DNSAddrFromServer, EFalse ); - } - CleanupStack::PopAndDestroy( 2,ip1 ); - } - - -// ---------------------------------------------------------------------------- -// CCmPluginWlan::CheckNetworkCoverageL() -// ---------------------------------------------------------------------------- -// -TInt CCmPluginWlan::CheckNetworkCoverageL() const - { - LOGGER_ENTERFN("CCmPluginWlan::CheckNetworkCoverageL"); - - TInt retVal( 0 ); - -#ifdef __WINS__ - retVal = 1; -#else - CCmWlanCoverageCheck* coverage = new (ELeave) CCmWlanCoverageCheck; - CleanupStack::PushL( coverage ); - - CLOG_WRITE( "Coverage created, calling GetCoverageL" ); - retVal = coverage->GetCoverageL(); - CLOG_WRITE( "GetCoverageL returned" ); - - CleanupStack::PopAndDestroy( coverage ); -#endif // __WINS - return retVal; - } - - -// ---------------------------------------------------------------------------- -// CCmPluginWlan::ConvertConnectionSecurityModeToSecModeL() -// ---------------------------------------------------------------------------- -// -TWlanSecMode CCmPluginWlan::ConvertConnectionSecurityModeToSecModeL( - TWlanConnectionExtentedSecurityMode aSecurityMode ) - { - LOGGER_ENTERFN( "CCmPluginWlan::ConvertConnectionSecurityModeToSecModeL " ); - - switch( aSecurityMode ) - { - case EWlanConnectionExtentedSecurityModeOpen: - { - return EWlanSecModeOpen; - } - - case EWlanConnectionExtentedSecurityModeWepOpen: - case EWlanConnectionExtentedSecurityModeWepShared: - { - return EWlanSecModeWep; - } - - case EWlanConnectionExtentedSecurityMode802d1x: - { - return EWlanSecMode802_1x; - } - - case EWlanConnectionExtentedSecurityModeWpa: - case EWlanConnectionExtentedSecurityModeWpaPsk: - case EWlanConnectionExtentedSecurityModeWpa2: - case EWlanConnectionExtentedSecurityModeWpa2Psk: - { - return EWlanSecModeWpa; - } - case EWlanConnectionExtentedSecurityModeWapi: - case EWlanConnectionExtentedSecurityModeWapiPsk: - { - if ( iIsWAPISupported ) - { - return EWlanSecModeWAPI; - } - else - { - User::Leave( KErrCorrupt ); - } - } - default: - { - User::Leave( KErrNotSupported ); - } - } - - return EWlanSecModeOpen; - } - - -// ---------------------------------------------------------------------------- -// CCmPluginWlan::ConvertSecModeToConnectionSecurityModeL() -// ---------------------------------------------------------------------------- -// -TWlanConnectionExtentedSecurityMode - CCmPluginWlan::ConvertSecModeToConnectionSecurityModeL( - TWlanSecMode aSecMode ) - { - LOGGER_ENTERFN( "CCmPluginWlan::ConvertSecModeToConnectionSecurityModeL " ); - - switch( aSecMode ) - { - case EWlanSecModeOpen: - { - return EWlanConnectionExtentedSecurityModeOpen; - } - - case EWlanSecModeWep: - { - return EWlanConnectionExtentedSecurityModeWepOpen; - } - - case EWlanSecMode802_1x: - { - return EWlanConnectionExtentedSecurityMode802d1x; - } - - case EWlanSecModeWpa: - case EWlanSecModeWpa2: - { - return EWlanConnectionExtentedSecurityModeWpa; - } - case EWlanSecModeWAPI: - { - if ( iIsWAPISupported ) - { - return EWlanConnectionExtentedSecurityModeWapi; - } - else - { - User::Leave( KErrCorrupt ); - } - } - - default: - { - User::Leave( KErrNotSupported ); - } - } - - return EWlanConnectionExtentedSecurityModeOpen; - } - - -// --------------------------------------------------------- -// CCmPluginWlan::DestroyWaitDialog() -// --------------------------------------------------------- -// -void CCmPluginWlan::DestroyWaitDialog() - { - LOGGER_ENTERFN( "CCmPluginWlan::DestroyWaitDialog " ); - - delete iWaitDialog; - iWaitDialog = NULL; - } - -// --------------------------------------------------------------------------- -// CCmPluginWlan::SetDaemonNameL -// --------------------------------------------------------------------------- -// -void CCmPluginWlan::SetDaemonNameL() - { - LOGGER_ENTERFN( "CCmPluginWlan::SetDaemonNameL" ); - - // we have to check first that these values has not been - // set(or changed) by any 3rd party sw to ensure that - // we don't break their settings - HBufC* daemonName = GetStringAttributeL( ECmConfigDaemonManagerName ); - if ( daemonName ) - { - if ( daemonName->Compare( KDaemonManagerName ) != 0 ) - { - delete daemonName; - return; - } - delete daemonName; - } - - // check if Easy WLAN IAP since it has different config daemon - // manager name - HBufC* iapName = GetStringAttributeL( ECmName ); - if ( iapName ) - { - CleanupStack::PushL( iapName ); - if ( iapName->Compare( KEasyWlanName ) == 0 ) - { - SetStringAttributeL( ECmConfigDaemonManagerName, - KHotspotDaemonManagerName ); - SetStringAttributeL( ECmConfigDaemonName, - KConfigDaemonName ); - CleanupStack::PopAndDestroy( iapName ); - return; - } - CleanupStack::PopAndDestroy( iapName ); - } - - // use DHCP if we can - TBool ipfromSrv = GetBoolAttributeL( ECmIPAddFromServer ); - if ( ipfromSrv ) - { - SetStringAttributeL( ECmConfigDaemonManagerName, - KDaemonManagerName ); - SetStringAttributeL( ECmConfigDaemonName, - KConfigDaemonName ); - } - else - { - if ( FeatureSupported( KFeatureIdIPv6 ) ) - { - SetStringAttributeL( ECmConfigDaemonManagerName, - KDaemonManagerName ); - SetStringAttributeL( ECmConfigDaemonName, - KConfigDaemonName ); - } - else - { - SetStringAttributeL( ECmConfigDaemonManagerName, - KNullDesC() ); - SetStringAttributeL( ECmConfigDaemonName, - KNullDesC() ); - } - } - } - - -// -------------------------------------------------------------------------- -// CCmPluginWlan::ConvertWLANConnectionStatesL -// -------------------------------------------------------------------------- -// -TWlanNetMode CCmPluginWlan::ConvertWLANConnectionStatesL( - TWlanConnectionMode aConnectionMode ) - { - LOGGER_ENTERFN( "CCmPluginWlan::ConvertWLANConnectionStatesL " ); - - switch ( aConnectionMode ) - { - /** Values for possible WLAN connection states. */ - /** Connection to an infrastructure network is active. */ - case EWlanConnectionModeInfrastructure: - { - return EInfra; - } - /** Connection to an ad-hoc network is active. */ - case EWlanConnectionModeAdhoc: - { - return EAdhoc; - } - default: - /** - * The connection mode. This can be either Ad-hoc or infrastructure. - * TWlanNetMode enum is to be used. - * ( TUint32 - default: EInfra ) - */ - { - return EInfra; - } - } - } - -// --------------------------------------------------------------------------- -// CCmPluginWlan::GetAdditionalUids -// --------------------------------------------------------------------------- -// -void CCmPluginWlan::GetAdditionalUids( RArray& aIapIds ) - { - for (TInt i = 0; iDes() ); - - if ( !iConnUiUtils ) - { - iConnUiUtils = CConnectionUiUtilities::NewL(); - } - - if ( iConnUiUtils->EasyWapiDlg( &keyPtr ) ) - { - if ( !iWAPISecSettings ) - { - iWAPISecSettings = CWAPISecuritySettings::NewL(); - } - iWAPISecSettings->SetPreSharedKeyL( CWAPISecuritySettings::EWapiKeyAscii, *key ); - retVal = ETrue; - } - CleanupStack::PopAndDestroy( key ); - - return retVal; - } - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpluginwlandata.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpluginwlandata.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of WLan network data holder class -* -*/ - -#include -#include "cmpluginwlandata.h" -#include "cmlogger.h" - - - - -// -------------------------------------------------------------------------- -// CCmPluginWlanData::NewLC -// -------------------------------------------------------------------------- -// -CCmPluginWlanData* CCmPluginWlanData::NewLC() - { - CCmPluginWlanData* self = new( ELeave ) CCmPluginWlanData(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - - -// -------------------------------------------------------------------------- -// CCmPluginWlanData::~CCmPluginWlanData -// -------------------------------------------------------------------------- -// -CCmPluginWlanData::~CCmPluginWlanData() - { - LOGGER_ENTERFN( "CCmPluginWlanData::~CCmPluginWlanData" ); - - delete iNetworkName; - iNetworkName = NULL; - CLOG_CLOSE; - } - - - - -// -------------------------------------------------------------------------- -// CCmPluginWlanData::CCmPluginWlanData -// -------------------------------------------------------------------------- -// -CCmPluginWlanData::CCmPluginWlanData() - { - CLOG_CREATE; - } - - - - -// -------------------------------------------------------------------------- -// CCmPluginWlanData::ConstructL -// -------------------------------------------------------------------------- -// -void CCmPluginWlanData::ConstructL() - { - LOGGER_ENTERFN( "CCmPluginWlanData::ConstructL" ); - - iNetworkName = NULL; - } - - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpluginwlandataarray.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpluginwlandataarray.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of WLan network data holder class -* -*/ - - -// INCLUDE FILES - -#include "cmpluginwlandata.h" -#include "cmpluginwlandataarray.h" - - -// CONSTANTS - -LOCAL_D const TInt KGranularity = 4; ///< Granularity of the list. - -// ================= MEMBER FUNCTIONS ======================= - -// C++ default constructor can NOT contain any code that -// might leave. -// -// --------------------------------------------------------- -// CCmPluginWlanDataArray::CCmPluginWlanDataArray -// --------------------------------------------------------- -// -CCmPluginWlanDataArray::CCmPluginWlanDataArray() -: CArrayPtrFlat( KGranularity ) - { - } - -// Destructor -// --------------------------------------------------------- -// CCmPluginWlanDataArray::~CCmPluginWlanDataArray -// --------------------------------------------------------- -// -CCmPluginWlanDataArray::~CCmPluginWlanDataArray() - { - - ResetAndDestroy(); - - } - - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpluginwlanproxy.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpluginwlanproxy.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of WLan Plugin proxy table -* -*/ - -#include "cmpluginwlan.h" -#include -#include - -// Exported proxy for instantiation method resolution -// Define the interface UIDs -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KUidWlanBearerType, CCmPluginWlan::NewL ) - }; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( - TInt& aTableCount ) - { - aTableCount = sizeof( ImplementationTable ) / - sizeof( TImplementationProxy ); - - return ImplementationTable; - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpwlanactivewaiter.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpwlanactivewaiter.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CCmPluginWlanActiveWaiter. -* -*/ - - -// INCLUDE FILES -#include "cmpwlanactivewaiter.h" - - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// CCmPluginWlanActiveWaiter* CCmPluginWlanActiveWaiter::NewL() -// --------------------------------------------------------- -// -CCmPluginWlanActiveWaiter* CCmPluginWlanActiveWaiter::NewL( ) - { - CCmPluginWlanActiveWaiter* self = - new ( ELeave ) CCmPluginWlanActiveWaiter( ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// --------------------------------------------------------- -// CCmPluginWlanActiveWaiter::ConstructL() -// --------------------------------------------------------- -// -void CCmPluginWlanActiveWaiter::ConstructL() - { - CActiveScheduler::Add( this ); - } - - -// --------------------------------------------------------- -// CCmPluginWlanActiveWaiter::CCmPluginWlanActiveWaiter() -// --------------------------------------------------------- -// -CCmPluginWlanActiveWaiter::CCmPluginWlanActiveWaiter( ) -: CActive( KErrNone ) - { - } - - -// --------------------------------------------------------- -// CCmPluginWlanActiveWaiter::~CCmPluginWlanActiveWaiter() -// --------------------------------------------------------- -// -CCmPluginWlanActiveWaiter::~CCmPluginWlanActiveWaiter() - { - Cancel(); - } - - -// --------------------------------------------------------- -// CCmPluginWlanActiveWaiter::DoCancel() -// --------------------------------------------------------- -// -void CCmPluginWlanActiveWaiter::DoCancel() - { - } - - -// --------------------------------------------------------- -// CCmPluginWlanActiveWaiter::RunL() -// --------------------------------------------------------- -// -void CCmPluginWlanActiveWaiter::RunL() - { - if ( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - } - -// --------------------------------------------------------- -// CCmPluginWlanActiveWaiter::WaitForRequest() -// --------------------------------------------------------- -// -TInt CCmPluginWlanActiveWaiter::WaitForRequest() - { - SetActive(); - iWait.Start(); - return iStatus.Int(); - } -// End of File - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpwlansettingsdlg.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpwlansettingsdlg.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,958 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Dialog for editing wlan settings for a wlan connection method -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cmlogger.h" -#include "cmwlancommonconstants.h" -#include "cmpwlansettingsdlg.h" -#include "cmpwlansettingsdlgadv.h" -#include -#include "cmpluginwlan.h" -#include "cmpluginmenucommands.hrh" -#include -#include -#include "cmmanagerimpl.h" - -using namespace CMManager; - -const TUint32 KScanSSIDSelectionItems[] = - { - R_QTN_WLAN_SETT_HIDDEN_NETWORK_NO, - R_QTN_WLAN_SETT_HIDDEN_NETWORK_YES, - 0 - }; - -const TUint32 KSecModeRBSelectionItems[] = - { - R_QTN_WLAN_SETT_SECURITY_MODE_OPEN, - R_QTN_WLAN_SETT_SECURITY_MODE_WEP, - 0 - }; - -const TUint32 KSecModeRBIRSelectionItems[] = - { - R_QTN_WLAN_SETT_SECURITY_MODE_OPEN, - R_QTN_WLAN_SETT_SECURITY_MODE_WEP, - R_QTN_WLAN_SETT_SECURITY_MODE_802_1X, - R_QTN_WLAN_SETT_SECURITY_MODE_WPA, - 0 - }; - -const TUint32 KSecModeRBIRSelectionItemsWAPI[] = - { - R_QTN_WLAN_SETT_SECURITY_MODE_OPEN, - R_QTN_WLAN_SETT_SECURITY_MODE_WEP, - R_QTN_WLAN_SETT_SECURITY_MODE_802_1X, - R_QTN_WLAN_SETT_SECURITY_MODE_WPA, - R_QTN_WLAN_SETT_SECURITY_MODE_WAPI, - 0 - }; - -const TUint32 KNetworkRBSelectionItems[] = - { - R_QTN_WLAN_SETT_NETWORK_MODE_INFRA, - R_QTN_WLAN_SETT_NETWORK_MODE_ADHOC, - 0 - }; - -const TUint32 KNWNameSelectionItems[] = - { - R_QTN_WLAN_SETT_NETWORK_NAME_USER_DEFINED, - R_QTN_WLAN_SETT_NETWORK_NAME_SCAN, - 0 - }; - -// ================= MEMBER FUNCTIONS ======================================= - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::NewL() -// -------------------------------------------------------------------------- -// -CmPluginWlanSettingsDlg* CmPluginWlanSettingsDlg::NewL( - CCmPluginBaseEng& aCmPluginBase ) - { - CmPluginWlanSettingsDlg* self = - new (ELeave) CmPluginWlanSettingsDlg( aCmPluginBase ); - return self; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::CmPluginWlanSettingsDlg() -// -------------------------------------------------------------------------- -// -CmPluginWlanSettingsDlg::CmPluginWlanSettingsDlg( - CCmPluginBaseEng& aCmPluginBase ) - : CmPluginBaseSettingsDlg( aCmPluginBase ) - , iNotifyFromAdv( KCmNotifiedNone ) - { - - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::ConstructAndRunLD -// -------------------------------------------------------------------------- -// -TInt CmPluginWlanSettingsDlg::ConstructAndRunLD( ) - { - LoadResourceL( KPluginWlanResDirAndFileName ); - - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherRegisterL( this ); - - return CmPluginBaseSettingsDlg::ConstructAndRunLD( ); - } - -// --------------------------------------------------------- -// CmPluginWlanSettingsDlg::~CmPluginWlanSettingsDlg -// Destructor -// --------------------------------------------------------- -// -CmPluginWlanSettingsDlg::~CmPluginWlanSettingsDlg() - { - iResourceReader.Close(); - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::RunAdvancedSettingsL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlg::RunAdvancedSettingsL() - { - CmPluginWlanSettingsDlgAdv* AdvDlg = - CmPluginWlanSettingsDlgAdv::NewL( iCmPluginBaseEng ); - - if (!iHasSettingChanged) - { - iHasSettingChanged = ETrue; - } - - // This view may have to un-register as watcher here - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherUnRegister(); - - AdvDlg->RegisterParentView( this ); - TInt ret = AdvDlg->ConstructAndRunLD(); - - if( iNotifyFromAdv == KCmNotifiedNone ) - { - if( ret == KDialogUserExit ) - { - iExitReason = KDialogUserExit; - ExitSettingsL(EFalse); - } - else - { - // Re-register as watcher if advanced view comes back or exists normally - cmMgr.WatcherRegisterL( this ); - } - } - else - { - HandleCommsDatChangeL(); - } - } - -// -------------------------------------------------------------------------- -// CmPluginBaseSettingsDlg::UpdateListBoxContentBearerSpecificL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlg::UpdateListBoxContentBearerSpecificL( - CDesCArray& aItemArray ) - { - TBool boolSettingVal( EFalse ); // just for helping make code readable - TInt valResId(0); - - // DATA BEARER - only for real bearer types - AppendSettingTextsL( aItemArray, ECmBearerSettingName ); - // NETWORK NAME - AppendSettingTextsL( aItemArray, EWlanSSID ); - // NETWORK STATUS - boolSettingVal = iCmPluginBaseEng.GetBoolAttributeL( EWlanScanSSID ); - AppendSettingTextsL( aItemArray, - EWlanScanSSID, - boolSettingVal ? - R_QTN_WLAN_SETT_HIDDEN_NETWORK_YES : - R_QTN_WLAN_SETT_HIDDEN_NETWORK_NO ); - // WLAN NETWORK MODE - switch( iCmPluginBaseEng.GetIntAttributeL( EWlanConnectionMode ) ) - { - case EAdhoc: - { - valResId = R_QTN_WLAN_SETT_NETWORK_MODE_ADHOC; - break; - } - case EInfra: - // fall-through intended here - default: - { - valResId = R_QTN_WLAN_SETT_NETWORK_MODE_INFRA; - break; - } - } - - AppendSettingTextsL( aItemArray, EWlanConnectionMode, valResId ); - // WLAN SECURITY MODE - switch( iCmPluginBaseEng.GetIntAttributeL( EWlanSecurityMode ) ) - { - case EWlanSecModeWep : - { - valResId = R_QTN_WLAN_SETT_SECURITY_MODE_WEP; - break; - } - case EWlanSecMode802_1x: - { - valResId = R_QTN_WLAN_SETT_SECURITY_MODE_802_1X; - break; - } - case EWlanSecModeWpa: - case EWlanSecModeWpa2: - { - valResId = R_QTN_WLAN_SETT_SECURITY_MODE_WPA; - break; - } - case EWlanSecModeWAPI: - { - valResId = R_QTN_WLAN_SETT_SECURITY_MODE_WAPI; - break; - } - case EWlanSecModeOpen: - // fall-through intended here - default: - { - valResId = R_QTN_WLAN_SETT_SECURITY_MODE_OPEN; - break; - } - } - AppendSettingTextsL( aItemArray, EWlanSecurityMode, valResId ); - // WLAN SECURITY SETTINGS - AppendSettingTextsL( aItemArray, - EWlanSecuritySettings, - R_QTN_WLAN_SETT_SECURITY_SETTINGS, - 0 ); - // HOMEPAGE - AppendSettingTextsL( aItemArray, ECmStartPage ); - } - - -//--------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::ChangeBoolSettingL -//--------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlg::ChangeBoolSettingL( TUint32 aAttribute, - TInt aCommandId ) - { - // Change was selected from menu - if ( aCommandId == EPluginBaseCmdChange ) - { - TInt selected = - iCmPluginBaseEng.GetBoolAttributeL( aAttribute ); - TInt origVal = selected; - - if ( ShowRadioButtonSettingPageL( KScanSSIDSelectionItems, - selected, - R_QTN_WLAN_SETT_HIDDEN_NETWORK ) && - origVal != selected ) - { - iCmPluginBaseEng.SetBoolAttributeL( aAttribute, - selected ); - UpdateListBoxContentL(); - } - } - // Selection key was selected - else - { - switch ( aAttribute ) - { - case EWlanScanSSID: - { - TBool boolFromCM = EFalse; - boolFromCM = iCmPluginBaseEng.GetBoolAttributeL( aAttribute ); - iCmPluginBaseEng.SetBoolAttributeL( aAttribute , !boolFromCM ); - UpdateListBoxContentL(); - break; - } - case EWlanConnectionMode: - { - TInt intFromCM = 0; - intFromCM = iCmPluginBaseEng.GetIntAttributeL( aAttribute ); - iCmPluginBaseEng.SetIntAttributeL( aAttribute , !intFromCM ); - UpdateListBoxContentL(); - break; - } - } - } - } - -//--------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::ShowSecurityModeRBPageL -//--------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlg::ShowSecurityModeRBPageL() - { - TInt selected = 0; - TInt secMode = iCmPluginBaseEng.GetIntAttributeL( EWlanSecurityMode ); - const TUint32* items = NULL; - - //converting secMode to idex - switch ( secMode ) - { - case EWlanSecModeOpen: - { - selected = 0; - break; - } - case EWlanSecModeWep: - { - selected = 1; - break; - } - case EWlanSecMode802_1x: - { - selected = 2; - break; - } - case EWlanSecModeWpa: - { - selected = 3; - break; - } - // is this a real case? - case EWlanSecModeWpa2: - { - selected = 3; - break; - } - case EWlanSecModeWAPI: - { - selected = 4; - break; - } - default: - { - User::Leave( KErrNotSupported ); - break; - } - } - - if ( iCmPluginBaseEng.GetIntAttributeL( EWlanConnectionMode ) == EInfra ) - { - if ( !FeatureManager::FeatureSupported( KFeatureIdFfWlanWapi ) ) - { - items = KSecModeRBIRSelectionItems; - } - else - { - items = KSecModeRBIRSelectionItemsWAPI; - } - } - else - { - items = KSecModeRBSelectionItems; - } - - TInt origVal = selected; - if ( ShowRadioButtonSettingPageL( items, - selected, - R_QTN_WLAN_SETT_SECURITY_MODE ) && - origVal != selected ) - { - if ( !iHasSettingChanged ) - { - iHasSettingChanged = ETrue; - } - - switch ( selected ) - { - case 0: - { - secMode = EWlanSecModeOpen; - break; - } - case 1: - { - secMode = EWlanSecModeWep; - break; - } - case 2: - { - secMode = EWlanSecMode802_1x; - break; - } - case 3: - { - secMode = EWlanSecModeWpa; - break; - } - case 4: - { - secMode = EWlanSecModeWAPI; - break; - } - default: - { - User::Leave( KErrNotSupported ); - break; - } - } - iCmPluginBaseEng.SetIntAttributeL( EWlanSecurityMode , secMode ); - UpdateListBoxContentL(); - } - } - -//--------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::ShowNetworkModeRBPageL -//--------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlg:: ShowNetworkModeRBPageL() - { - const TUint32* items = KNetworkRBSelectionItems; - - TInt selected; - - // convert values to indices for UI - TInt netMode = iCmPluginBaseEng.GetIntAttributeL( EWlanConnectionMode ); - switch ( netMode ) - { - case EAdhoc: - { - selected = 1; - break; - } - case EInfra: - { - selected = 0; - break; - } - } - - TInt origVal = selected; - if ( ShowRadioButtonSettingPageL( items, - selected, - R_QTN_WLAN_SETT_NETWORK_MODE ) && - origVal != selected ) - { - // convert indices back to proper values - switch ( selected ) - { - case 0: - { - netMode = EInfra; - break; - } - case 1: - { - netMode = EAdhoc; - TInt secMode = iCmPluginBaseEng.GetIntAttributeL( - EWlanSecurityMode ); - if( secMode != EWlanSecModeOpen && - secMode != EWlanSecModeWep ) - { - iCmPluginBaseEng.SetIntAttributeL( EWlanSecurityMode, - EWlanSecModeOpen ); - } - break; - } - default: - { - User::Leave( KErrNotSupported ); - break; - } - } - iCmPluginBaseEng.SetIntAttributeL( EWlanConnectionMode , netMode ); - UpdateListBoxContentL(); - } - } - -//--------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::ShowWlanNWNamePageL -//--------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlg::ShowWlanNWNamePageL() - { - const TCmAttribConvTable* convItem = - iCmPluginBaseEng.ConvTableItem( EWlanSSID ); - - const TUint32* items = KNWNameSelectionItems; - TInt selected ( EWlanNwNameUserDefined ); - - // Display a radio button page with options: User defined and Scan for Networks - if ( ShowRadioButtonSettingPageL( items, - selected, - R_QTN_WLAN_SETT_NETWORK_NAME ) ) - { - if ( selected == EWlanNwNameUserDefined ) - { - HBufC* oldssId = iCmPluginBaseEng.GetStringAttributeL( EWlanSSID ); - CleanupStack::PushL( oldssId ); - - TBuf buf; - buf.Copy( *oldssId ); - - if ( TCmCommonUi::ShowConfirmationQueryWithInputL( - R_QTN_WLAN_PRMPT_NETWORK_NAME, - buf ) ) - { - if( buf.Compare( *oldssId ) ) - // SSID is changed - { - iCmPluginBaseEng.SetStringAttributeL( EWlanSSID, buf ); - UpdateListBoxContentL(); - } - } - CleanupStack::PopAndDestroy( oldssId ); - } - else - { - // Let's search for a WLAN network - TWlanSsid ssid; - TWlanConnectionMode connectionMode; - TWlanConnectionSecurityMode securityMode; - - CConnectionUiUtilities* uiUtils = CConnectionUiUtilities::NewL(); - CleanupStack::PushL( uiUtils ); - - if ( uiUtils->SearchWLANNetwork( ssid, connectionMode, securityMode ) ) - { - HBufC* temp = HBufC::NewLC( convItem->iMaxLength ); - temp->Des().Copy( ssid ); - iCmPluginBaseEng.SetStringAttributeL( EWlanSSID, *temp ); - CleanupStack::PopAndDestroy( temp ); - - UpdateListBoxContentL(); - } - CleanupStack::PopAndDestroy( uiUtils ); - } - } - } - -//--------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::ShowPopupSettingPageL -//--------------------------------------------------------------------------- -// -TBool CmPluginWlanSettingsDlg::ShowPopupSettingPageL( TUint32 aAttribute, - TInt aCommandId ) - { - TBool retval = EFalse; - switch( aAttribute ) - { - // Boolean settings - case EWlanScanSSID: - { - ChangeBoolSettingL( aAttribute, aCommandId ); - break; - } - // Textual Settings - case ECmStartPage: - { - ShowPopupTextSettingPageL( aAttribute ); - break; - } - case EWlanSecurityMode: - { - ShowSecurityModeRBPageL(); - break; - } - case EWlanSecuritySettings: - { - TInt secmode = iCmPluginBaseEng.GetIntAttributeL( EWlanSecurityMode ); - if( secmode == EWlanSecModeOpen ) - { - TCmCommonUi::ShowNoteL( R_QTN_WLAN_INFO_NO_SECURITY_SETTINGS, - TCmCommonUi::ECmInfoNote); - } - else - { - TInt exitValue = - STATIC_CAST( CCmPluginWlan*, &iCmPluginBaseEng )-> - EditSecuritySettingsL( *( CEikonEnv::Static() ) ); - if ( secmode == EWlanSecModeWep ) - { // WEP - if ( exitValue & CWEPSecuritySettings::EExitReq ) - { - iSecDialExit = ETrue; - iExitReason = KDialogUserExit; - ExitSettingsL(EFalse); - } - } - else if ( secmode == EWlanSecModeWAPI ) - { - if ( exitValue & CWAPISecuritySettings::EExitReq ) - { - iSecDialExit = ETrue; - iExitReason = KDialogUserExit; - ExitSettingsL(EFalse); - } - } - else - {// 802.1x, WPA/WPA2 - if ( exitValue & CWPASecuritySettings::EExitReq ) - { - iSecDialExit = ETrue; - iExitReason = KDialogUserExit; - ExitSettingsL(EFalse); - } - } - } - break; - } - case EWlanConnectionMode: - { - if ( aCommandId == EPluginBaseCmdChange ) - { - ShowNetworkModeRBPageL(); - } - else - { - TInt netMode = - iCmPluginBaseEng.GetIntAttributeL( EWlanConnectionMode ); - // OK has been used: switch the value without opening the setting page - if ( netMode == EInfra ) - { - netMode = EAdhoc; - TInt secMode = iCmPluginBaseEng.GetIntAttributeL( - EWlanSecurityMode ); - if( secMode != EWlanSecModeOpen && - secMode != EWlanSecModeWep ) - { - iCmPluginBaseEng.SetIntAttributeL( EWlanSecurityMode, - EWlanSecModeOpen ); - } - } - else - { - netMode = EInfra; - } - iCmPluginBaseEng.SetIntAttributeL( EWlanConnectionMode, netMode ); - UpdateListBoxContentL(); - } - break; - } - case EWlanSSID: - { - ShowWlanNWNamePageL(); - break; - } - default: - { - CmPluginBaseSettingsDlg::ShowPopupSettingPageL( aAttribute, - aCommandId ); - break; - } - } - return retval; - } - - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::ExitSettingsL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlg::ExitSettingsL( TBool aConfirm ) - { - if ( STATIC_CAST( CCmPluginWlan*, &iCmPluginBaseEng )-> - AreSecuritySettingsValidL() ) - { - if ( iIsPossibleToSaveSetting && iHasSettingChanged ) - { - iCmPluginBaseEng.UpdateL(); - iHasSettingChanged = EFalse; - } - TryExitL( iExitReason ); - } - else - { - HBufC* netwName = iCmPluginBaseEng.GetStringAttributeL( EWlanSSID ); - TBool noNetwName = ETrue; - CleanupStack::PushL( netwName ); - if ( *netwName != KNullDesC ) - { - noNetwName = EFalse; - } - CleanupStack::PopAndDestroy( netwName ); - - if ( noNetwName ) - { - if ( aConfirm ) - { - if ( TCmCommonUi::ShowConfirmationQueryL( - R_QTN_WLAN_QUEST_NW_NAME_NOT_DEFINED ) ) - { - iExitReason = KDialogUserDelete; - TryExitL( iExitReason ); - } - else - { - // Find the index of the EWlanSSID item - for ( TInt i = 0; i < iSettingIndex->Count(); i++ ) - { - if ( iSettingIndex->At(i) == EWlanSSID ) - { - SelectItem(i); - break; - } - } - } - } - else - { - TryExitL( iExitReason ); - } - } - else - { - if ( iCmPluginBaseEng.GetIntAttributeL( EWlanSecurityMode ) == - EWlanSecModeOpen ) - { - if ( iIsPossibleToSaveSetting && iHasSettingChanged) - { - iCmPluginBaseEng.UpdateL(); - iHasSettingChanged = EFalse; - } - TryExitL( iExitReason ); - } - else - { - if ( aConfirm ) - { - if ( TCmCommonUi::ShowConfirmationQueryL( - R_QTN_WLAN_QUEST_SECURITY_SETTINGS_EMPTY ) ) - { - iExitReason = KDialogUserDeleteConfirmed; - TryExitL( iExitReason ); - } - else - { - // Show the securitysettings page for WEP, other security mode - // is not supported here(WPA has a default value)... - ShowPopupSettingPageL( EWlanSecuritySettings, EWlanSecModeWep ); - } - } - else - { - TryExitL( iExitReason ); - } - } - } - } - } - - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::OkToExitL -// Good to know : EAknSoftkeyCancel is never called, because -// EEikDialogFlagNotifyEsc flag is not set in the resource. -// -------------------------------------------------------------------------- -// -TBool CmPluginWlanSettingsDlg::OkToExitL( TInt aButtonId ) - { - // Translate the button presses into commands for the appui & current - // view to handle - TBool retval( EFalse ); - - switch ( aButtonId ) - { - case EAknSoftkeyOk: - case EAknSoftkeyChange: - { - ProcessCommandL( aButtonId ); - break; - } - case EAknSoftkeyBack: - { - ProcessCommandL( aButtonId ); - break; - } - case EAknSoftkeyOptions: - { - DisplayMenuL(); - break; - } - case KDialogUserExit: - { - if ( iSecDialExit ) - { - iSecDialExit = EFalse; - } - retval=ETrue; - break; - } - default: - { - retval = ETrue; - break; - } - } - - return retval; - } - - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::ProcessCommandL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlg::ProcessCommandL( TInt aCommandId ) - { - if ( MenuShowing() ) - { - HideMenu(); - } - - switch ( aCommandId ) - { - case EPluginBaseCmdExit: - { - iExitReason = KDialogUserExit; - } - case EAknSoftkeyBack: - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherUnRegister(); - - ExitSettingsL(ETrue); - break; - } - case EPluginBaseCmdAdvanced: - { - RunAdvancedSettingsL(); - break; - } - case EPluginBaseCmdChange: - case EAknSoftkeyOk: - { - TUint32 attrib = iSettingIndex->At( iListbox->CurrentItemIndex() ); - ShowPopupSettingPageL( attrib, aCommandId ); - break; - } - default: - { - CmPluginBaseSettingsDlg::ProcessCommandL( aCommandId ); - break; - } - } - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::GetHelpContext -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlg::GetHelpContext( TCoeHelpContext& aContext ) const - { - LOGGER_ENTERFN( "CmPluginWlanSettingsDlg::GetHelpContext" ); - aContext.iMajor = KHelpUidPlugin; - aContext.iContext = KSET_HLP_AP_SETTING_WLAN; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::CommsDatChangesL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlg::CommsDatChangesL() - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - CCmDestinationImpl* parentDest = iCmPluginBaseEng.ParentDestination(); - - if ( parentDest ) - { - if( !cmMgr.DestinationStillExistedL( parentDest ) ) - { - cmMgr.WatcherUnRegister(); - // If parent destination is deleted by somebody then the dialog must exit back to main view - iExitReason = KDialogUserExit; - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - if( !cmMgr.IsIapStillInDestL( parentDest, iCmPluginBaseEng ) ) - { - cmMgr.WatcherUnRegister(); - // In this case, the dialog can go back to the parent view - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - // We may have to go back to parent view even though this Iap is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - } - else - { - if( !cmMgr.IapStillExistedL( iCmPluginBaseEng ) ) - { - cmMgr.WatcherUnRegister(); - // In this case, the dialog can go back to the parent view - TryExitL( iExitReason ); - return; - } - - // We may have to go back to parent view even though this Iap is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - } - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::NotifyParentView -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlg::NotifyParentView( TInt aValue ) - { - iNotifyFromAdv = aValue; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlg::HandleCommsDatChangeL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlg::HandleCommsDatChangeL() - { - //CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - - if( iNotifyFromAdv == KCmNotifiedIapIsNotInThisDestination || - iNotifyFromAdv == KCmNotifiedIapDisappear ) - { - TryExitL( iExitReason ); - } - else if( iNotifyFromAdv == KCmNotifiedDestinationDisappear ) - { - iExitReason = KDialogUserExit; - TryExitL( iExitReason ); - } - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpwlansettingsdlgadv.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpwlansettingsdlgadv.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,632 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Dialog for setting WLAN plugin advanced settings -* -*/ - -#include -#include -#include // for IP dialog -#include -#include -#include -#include -#include -#include - -#include "cmpluginwlan.h" -#include -#include "cmpwlansettingsdlgadv.h" -#include "cmpwlansettingsdlgipv4.h" -#include "cmpwlansettingsdlgipv6.h" -#include "cmwlancommonconstants.h" -#include -#include "cmpluginmenucommands.hrh" -#include -#include -#include "cmmanagerimpl.h" - -using namespace CMManager; - -const TUint32 KAdhocChannelSelectionItems[] = - { - R_QTN_WLAN_SETT_ADHOC_CHANNEL_AUTOMATIC, - R_QTN_WLAN_SETT_ADHOC_CHANNEL_USER_DEFINED, - 0 - }; - -// ================= MEMBER FUNCTIONS ========================================= - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::NewL() -// Two-phase dconstructor, second phase is ConstructAndRunLD -// -------------------------------------------------------------------------- -// -CmPluginWlanSettingsDlgAdv* CmPluginWlanSettingsDlgAdv::NewL( - CCmPluginBaseEng& aCmPluginBase ) - { - CmPluginWlanSettingsDlgAdv* self = - new (ELeave) CmPluginWlanSettingsDlgAdv( aCmPluginBase ); - return self; - } - - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::ConstructAndRunLD -// Constructs the dialog and runs it. -// -------------------------------------------------------------------------- -// -TInt CmPluginWlanSettingsDlgAdv::ConstructAndRunLD( ) - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherRegisterL( this ); - - return CmPluginBaseSettingsDlgAdv::ConstructAndRunLD(); - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::CmPluginWlanSettingsDlgAdv() -// -------------------------------------------------------------------------- -// -CmPluginWlanSettingsDlgAdv::CmPluginWlanSettingsDlgAdv( - CCmPluginBaseEng& aCmPluginBase ) : - CmPluginBaseSettingsDlgAdv( aCmPluginBase ), - iIpv6Supported( aCmPluginBase.FeatureSupported( KFeatureIdIPv6 ) ), - iParent( NULL ) - { - iHelpContext = KSET_HLP_AP_SETTING_WLAN_AS; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::~CmPluginWlanSettingsDlgAdv -// Destructor -// -------------------------------------------------------------------------- -// -CmPluginWlanSettingsDlgAdv::~CmPluginWlanSettingsDlgAdv() - { - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::UpdateListBoxContentBearerSpecificL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgAdv::UpdateListBoxContentBearerSpecificL( - CDesCArray& aItemArray ) - { - if ( iIpv6Supported ) - { - // IPV4 SETTINGS - AppendSettingTextsL( aItemArray, - ESettingPageCmdIpv4, - R_QTN_SET_IPV4_SETTINGS, - 0 ); - // IPV6 SETTINGS - AppendSettingTextsL( aItemArray, - ESettingPageCmdIpv6, - R_QTN_SET_IPV6_SETTINGS, - 0 ); - } - else - { - // PHONE IP ADDRESS - AppendSettingTextsL( aItemArray, EWlanIpAddr ); - HBufC* ipAddr = iCmPluginBaseEng.GetStringAttributeL( EWlanIpAddr ); - TBool isUnspec = IsUnspecifiedIPv4Address( *ipAddr ); - delete ipAddr; ipAddr = NULL; - - if ( !isUnspec ) - { - // SUBNET MASK - AppendSettingTextsL( aItemArray, EWlanIpNetMask ); - // DEFAULT GATEWAY - AppendSettingTextsL( aItemArray, EWlanIpGateway ); - } - - // PRIMARY NAME SERVER - AppendSettingTextsL( aItemArray, EWlanIpNameServer1 ); - // SECONDARY NAME SERVER - AppendSettingTextsL( aItemArray, EWlanIpNameServer2 ); - } - - // AD-HOC CHANNEL - if ( iCmPluginBaseEng.GetIntAttributeL( EWlanConnectionMode ) == EAdhoc ) - { - AppendSettingTextsL( aItemArray, EWlanChannelID ); - } - - // PROXY SERVER ADDRESS - AppendSettingTextsL( aItemArray, ECmProxyServerName ); - // PROXY PORT NUMBER - AppendSettingTextsL( aItemArray, ECmProxyPortNumber ); -/* - TInt valResId(0); - // Allow SSID Roaming? - - TBool res = iCmPluginBaseEng.GetBoolAttributeL( EWlanAllowSSIDRoaming ); - if ( res ) - { - valResId = R_QTN_WLAN_SETT_SSID_ROAMING_ENABLED; - } - else - { - valResId = R_QTN_WLAN_SETT_SSID_ROAMING_DISABLED; - } - - AppendSettingTextsL( aItemArray, EWlanAllowSSIDRoaming, valResId ); -*/ - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::ShowPopupSettingPageL -// -------------------------------------------------------------------------- -// -TBool CmPluginWlanSettingsDlgAdv::ShowPopupSettingPageL( TUint32 aAttribute, - TInt aCommandId ) - { - TBool retval = EFalse; - switch ( aAttribute ) - { - case EWlanIpAddr: - case EWlanIpNetMask: - case EWlanIpGateway: - case EWlanIpNameServer1: - case EWlanIpNameServer2: - { - ShowPopupIpSettingPageL( aAttribute ); - break; - } - case ESettingPageCmdIpv4: - { - ShowIpv4SettingPageL(); - break; - } - case ESettingPageCmdIpv6: - { - ShowIpv6SettingPageL(); - break; - } - case ECmProxyServerName: - { - retval = ShowPopupTextSettingPageL( aAttribute ); - break; - } - case ECmProxyPortNumber: - { - retval = ShowPopupPortNumSettingPageL( aAttribute ); - break; - } - case EWlanChannelID: // may not be correct - { - retval = ShowAdhocChannelSettingPageL(); - break; - } - case EWlanAllowSSIDRoaming: - { -// retval = ShowAdhocChannelSettingPageL(); - break; - } - default: - { - CmPluginBaseSettingsDlgAdv::ShowPopupSettingPageL( aAttribute, aCommandId ); - break; - } - } - return retval; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::ShowIpv4SettingPageL -// -------------------------------------------------------------------------- -// -TBool CmPluginWlanSettingsDlgAdv::ShowIpv4SettingPageL() - { - TInt retVal( EFalse ); - CmPluginWlanSettingsDlgIpv4* ipv4Dlg = - CmPluginWlanSettingsDlgIpv4::NewL( iCmPluginBaseEng ); - - // This view may have to un-register as watcher here - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherUnRegister(); - - ipv4Dlg->RegisterParentView( this ); - TInt ret = ipv4Dlg->ConstructAndRunLD(); - - if( iNotifyFromIp == KCmNotifiedNone ) - { - if ( ret == KDialogUserExit ) - { - retVal = ETrue; - TryExitL( KDialogUserExit ); - } - else - { - // Re-register as watcher if advanced view comes back or exists normally - cmMgr.WatcherRegisterL( this ); - } - } - else - { - HandleCommsDatChangeL(); - } - - return retVal; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::ShowIpv6SettingPageL -// -------------------------------------------------------------------------- -// -TBool CmPluginWlanSettingsDlgAdv::ShowIpv6SettingPageL() - { - TInt retVal( EFalse ); - CmPluginWlanSettingsDlgIpv6* ipv6Dlg = - CmPluginWlanSettingsDlgIpv6::NewL( iCmPluginBaseEng ); - - // This view may have to un-register as watcher here - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherUnRegister(); - - ipv6Dlg->RegisterParentView( this ); - TInt ret = ipv6Dlg->ConstructAndRunLD(); - - if( iNotifyFromIp == KCmNotifiedNone ) - { - if ( ret == KDialogUserExit ) - { - retVal = ETrue; - TryExitL( KDialogUserExit ); - } - else - { - // Re-register as watcher if advanced view comes back or exists normally - cmMgr.WatcherRegisterL( this ); - } - } - else - { - HandleCommsDatChangeL(); - } - - return retVal; - } - - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::ShowAdhocChannelSettingPageL -// -------------------------------------------------------------------------- -// -TBool CmPluginWlanSettingsDlgAdv::ShowAdhocChannelSettingPageL() - { - TInt retVal( EFalse ); - const TCmAttribConvTable* convItem = - iCmPluginBaseEng.ConvTableItem( EWlanChannelID ); - const TUint32* items = KAdhocChannelSelectionItems; - TInt value = iCmPluginBaseEng.GetIntAttributeL( EWlanChannelID ); - - TInt selected = value ? EAdhocUserDefined : EAdhocAutomatic; - - // Show the dialog - if ( ShowRadioButtonSettingPageL( items, - selected, - R_QTN_WLAN_SETT_ADHOC_CHANNEL ) ) - { - // 'User defined' selected - if ( selected == EAdhocUserDefined ) - { - // if EWlanChannelID doesn't have a valid number, use the defaul - if ( value < KCmAdhocChannelMinValue || value > KCmAdhocChannelMaxValue ) - { - value = KCmAdhocChannelDefaultValue; - } - - TBool loop ( ETrue ); - - do - { - HBufC* buf = HBufC::NewLC( convItem->iMaxLength ); - TPtr ptr ( buf->Des() ); - ptr.AppendNum( value ); - - // Display a numeric query dialog - CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( ptr ); - - dlg->PrepareLC( R_NUMERIC_QUERY ); - dlg->SetMaxLength( convItem->iMaxLength ); - dlg->SetDefaultInputMode( EAknEditorNumericInputMode ); - dlg->MakeLeftSoftkeyVisible( EFalse ); - - HBufC* prompt = StringLoader::LoadLC( - R_QTN_WLAN_PRMPT_ADHOC_CHANNEL ); - dlg->SetPromptL( *prompt ); - CleanupStack::PopAndDestroy( prompt ); - - // Show the popup - if ( dlg->RunLD() ) - { - TLex lex ( ptr ); - lex.Val( value ); - - // Check valid limits - if ( value >= KCmAdhocChannelMinValue && - value <= KCmAdhocChannelMaxValue ) - { - // set result - iCmPluginBaseEng.SetIntAttributeL( EWlanChannelID, value ); - loop = EFalse; - UpdateListBoxContentL(); - retVal = ETrue; - } - else - { - value = value < KCmAdhocChannelMinValue ? - KCmAdhocChannelMinValue : - KCmAdhocChannelMaxValue; - } - } - else - { - loop = EFalse; - } - CleanupStack::PopAndDestroy( buf ); - } while ( loop ); - } - else - { - iCmPluginBaseEng.SetIntAttributeL( EWlanChannelID, EAdhocAutomatic ); - UpdateListBoxContentL(); - retVal = ETrue; - } - } - - return retVal; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::ProcessCommandL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgAdv:: ProcessCommandL( TInt aCommandId ) - { - if ( MenuShowing() ) - { - HideMenu(); - } - - switch ( aCommandId ) - { - case EPluginBaseCmdExit: - { - iExitReason = KDialogUserExit; - } - case EAknSoftkeyBack: - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherUnRegister(); - - HBufC* ipAddr = iCmPluginBaseEng.GetStringAttributeL( EWlanIpAddr ); - TBool isUnspec = IsUnspecifiedIPv4Address( *ipAddr ); - delete ipAddr; ipAddr = NULL; - - if ( !isUnspec ) - { - ipAddr = iCmPluginBaseEng.GetStringAttributeL( EWlanIpNetMask ); - TBool isUnspec1 = IsUnspecifiedIPv4Address( *ipAddr ); - delete ipAddr; - ipAddr = iCmPluginBaseEng.GetStringAttributeL( EWlanIpGateway ); - TBool isUnspec2 = IsUnspecifiedIPv4Address( *ipAddr ); - delete ipAddr; - - if ( isUnspec1 || isUnspec2 ) - { - if ( TCmCommonUi::ShowConfirmationQueryL( - R_QTN_NETW_QUEST_IAP_INCOMPLETE_DELETE ) ) - { - iCmPluginBaseEng.RestoreAttributeL( EWlanIpAddr ); - iCmPluginBaseEng.RestoreAttributeL( EWlanIpNetMask ); - iCmPluginBaseEng.RestoreAttributeL( EWlanIpGateway ); - iCmPluginBaseEng.RestoreAttributeL( EWlanIpDNSAddrFromServer ); - TryExitL( iExitReason ); - } - } - else - { - TryExitL( iExitReason ); - } - } - else - { - TryExitL( iExitReason ); - } - break; - } - case EAknSoftkeyOk: - case EPluginBaseCmdChange: - { - ShowPopupSettingPageL( - iSettingIndex->At( iListbox->CurrentItemIndex() ), - aCommandId ); - break; - } - default: - { - CmPluginBaseSettingsDlgAdv::ProcessCommandL( aCommandId ); - break; - } - } - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::OkToExitL -// Good to know : EAknSoftkeyCancel is never called, because -// EEikDialogFlagNotifyEsc flag is not set in the resource. -// -------------------------------------------------------------------------- -// -TBool CmPluginWlanSettingsDlgAdv::OkToExitL( TInt aButtonId ) - { - // Translate the button presses into commands for the appui & current - // view to handle - TBool retval( EFalse ); - - switch ( aButtonId ) - { - case EAknSoftkeyOk: - case EAknSoftkeyChange: - { - ProcessCommandL( aButtonId ); - break; - } - case EAknSoftkeyBack: - { - ProcessCommandL( aButtonId ); - break; - } - case EAknSoftkeyOptions: - { - DisplayMenuL(); - break; - } - default: - { - retval = ETrue; - break; - } - } - - return retval; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::RegisterParentView -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgAdv::RegisterParentView( CCmParentViewNotifier* aParent ) - { - iParent = aParent; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::CommsDatChangesL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgAdv::CommsDatChangesL() - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - CCmDestinationImpl* parentDest = iCmPluginBaseEng.ParentDestination(); - - if ( parentDest ) - { - if( !cmMgr.DestinationStillExistedL( parentDest ) ) - { - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedDestinationDisappear ); - } - - cmMgr.WatcherUnRegister(); - // If parent destination is deleted by somebody then the dialog must exit back to main view - iExitReason = KDialogUserExit; - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - if( !cmMgr.IsIapStillInDestL( parentDest, iCmPluginBaseEng ) ) - { - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapIsNotInThisDestination ); - } - - cmMgr.WatcherUnRegister(); - // In this case, the dialog can go back to the parent view - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - // We may have to notify parent view to go back to its parent view even though this is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapDisappear ); - } - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - } - else - { - if( !cmMgr.IapStillExistedL( iCmPluginBaseEng ) ) - { - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapDisappear ); - } - - cmMgr.WatcherUnRegister(); - // In this case, the dialog can go back to the parent view - TryExitL( iExitReason ); - return; - } - - // We may have to notify parent view to go back to its parent view even though this is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapDisappear ); - } - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - } - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::NotifyParentView -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgAdv::NotifyParentView( TInt aValue ) - { - iNotifyFromIp = aValue; - - if( iParent ) - { - iParent->NotifyParentView( aValue ); - } - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgAdv::HandleCommsDatChangeL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgAdv::HandleCommsDatChangeL() - { - if( iNotifyFromIp == KCmNotifiedIapIsNotInThisDestination || - iNotifyFromIp == KCmNotifiedIapDisappear ) - { - TryExitL( iExitReason ); - } - else if( iNotifyFromIp == KCmNotifiedDestinationDisappear ) - { - iExitReason = KDialogUserExit; - TryExitL( iExitReason ); - } - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpwlansettingsdlgipv4.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpwlansettingsdlgipv4.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,394 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: WLAN Ipv4 settings dialog -* -*/ - -#include -#include -#include -#include // for IP dialog -#include -#include -#include -#include - -#include -#include -#include "cmpwlansettingsdlgipv4.h" -#include "cmwlancommonconstants.h" -#include "cmpluginmenucommands.hrh" -#include "cmpluginmultilinedialog.h" -#include -#include -#include "cmmanagerimpl.h" - -using namespace CMManager; - -// ================= MEMBER FUNCTIONS ========================================= - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv4::NewL -// Two-phase dconstructor, second phase is ConstructAndRunLD -// -------------------------------------------------------------------------- -// -CmPluginWlanSettingsDlgIpv4* CmPluginWlanSettingsDlgIpv4::NewL( - CCmPluginBaseEng& aCmPluginBase ) - { - CmPluginWlanSettingsDlgIpv4* self = - new ( ELeave ) CmPluginWlanSettingsDlgIpv4( aCmPluginBase ); - return self; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv4::CmPluginWlanSettingsDlgIpv4 -// -------------------------------------------------------------------------- -// -CmPluginWlanSettingsDlgIpv4::CmPluginWlanSettingsDlgIpv4( - CCmPluginBaseEng& aCmPluginBase ) : - CmPluginBaseSettingsDlgIp( aCmPluginBase ) , - iParent( NULL ) - { - iHelpContext = KSET_HLP_AP_WLAN_AS_IPV4; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv4::ConstructAndRunLD -// -------------------------------------------------------------------------- -// -TInt CmPluginWlanSettingsDlgIpv4::ConstructAndRunLD() - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherRegisterL( this ); - - return CmPluginBaseSettingsDlgIp::ConstructAndRunLD(); - } - -// --------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv4::~CmPluginWlanSettingsDlgIpv4 -// Destructor -// --------------------------------------------------------- -// -CmPluginWlanSettingsDlgIpv4::~CmPluginWlanSettingsDlgIpv4() - { - } - - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv4::UpdateListBoxContentBearerSpecificL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgIpv4::UpdateListBoxContentBearerSpecificL( - CDesCArray& aItemArray ) - { - // PHONE IP ADDRESS - AppendSettingTextsL( aItemArray, EWlanIpAddr ); - HBufC* ipAddr = iCmPluginBaseEng.GetStringAttributeL( EWlanIpAddr ); - TBool isUnspec = IsUnspecifiedIPv4Address( *ipAddr ); - delete ipAddr; ipAddr = NULL; - - if ( !isUnspec ) - { - // SUBNET MASK - AppendSettingTextsL( aItemArray, EWlanIpNetMask ); - // DEFAULT GATEWAY - AppendSettingTextsL( aItemArray, EWlanIpGateway ); - } - - // DNS SERVERS IP ADDRESS - TBool boolValue = iCmPluginBaseEng.GetBoolAttributeL( - EWlanIpDNSAddrFromServer ); - AppendSettingTextsL( aItemArray, - EWlanIpDNSAddrFromServer, - boolValue ? - R_QTN_SET_DNS_SERVERS_AUTOMATIC : - R_QTN_SET_IP_USER_DEFINED ); - } - -//--------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv4::ShowPopupSettingPageL -//--------------------------------------------------------------------------- -// -TBool CmPluginWlanSettingsDlgIpv4::ShowPopupSettingPageL( TUint32 aAttribute, - TInt aCommandId ) - { - TBool retval = EFalse; - switch ( aAttribute ) - { - case EWlanIpDNSAddrFromServer: - { - ShowPopupIPv4DNSEditorL( EWlanIpDNSAddrFromServer, - EWlanIpNameServer1, - EWlanIpNameServer2 ); - break; - } - case EWlanIpAddr: - case EWlanIpNetMask: - case EWlanIpGateway: - { - ShowPopupIpSettingPageL( aAttribute ); - break; - } - default: - { - CmPluginBaseSettingsDlgIp::ShowPopupSettingPageL( aAttribute, - aCommandId ); - break; - } - } - return retval; - } - - -//--------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv4::ProcessCommandL -//--------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgIpv4::ProcessCommandL( TInt aCommandId ) - { - if ( MenuShowing() ) - { - HideMenu(); - } - switch ( aCommandId ) - { - case EPluginBaseCmdExit: - { - if ( ValidateAttribsL() ) - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherUnRegister(); - - iExitReason = KDialogUserExit; - TryExitL( iExitReason ); - } - break; - } - case EPluginBaseCmdChange: - { - ShowPopupSettingPageL( - iSettingIndex->At( iListbox->CurrentItemIndex() ), - aCommandId ); - break; - } - default: - { - CmPluginBaseSettingsDlgIp::ProcessCommandL( aCommandId ); - break; - } - } - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv4::OkToExitL -// -------------------------------------------------------------------------- -// -TBool CmPluginWlanSettingsDlgIpv4::OkToExitL( TInt aButtonId ) - { - TBool retval( EFalse ); - - switch ( aButtonId ) - { - case EAknSoftkeyOk: - case EAknSoftkeyChange: - { - ProcessCommandL( EPluginBaseCmdChange ); - break; - } - case EAknSoftkeyBack: - { - if ( ValidateAttribsL() ) - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherUnRegister(); - - iExitReason = KDialogUserBack; - retval = ETrue; - } - break; - } - default: - { - retval = CmPluginBaseSettingsDlgIp::OkToExitL( aButtonId ); - break; - } - } - return retval; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv4::ValidateAttribsL -// -------------------------------------------------------------------------- -// -TBool CmPluginWlanSettingsDlgIpv4::ValidateAttribsL() - { - TBool retVal ( EFalse ); - HBufC* ipAddr = iCmPluginBaseEng.GetStringAttributeL( EWlanIpAddr ); - TBool isUnspec = IsUnspecifiedIPv4Address( *ipAddr ); - delete ipAddr; ipAddr = NULL; - - if ( !isUnspec ) - { - ipAddr = iCmPluginBaseEng.GetStringAttributeL( EWlanIpNetMask ); - TBool isUnspec1 = IsUnspecifiedIPv4Address( *ipAddr ); - delete ipAddr; - ipAddr = iCmPluginBaseEng.GetStringAttributeL( EWlanIpGateway ); - TBool isUnspec2 = IsUnspecifiedIPv4Address( *ipAddr ); - delete ipAddr; - - if ( isUnspec1 || isUnspec2 ) - { - if ( TCmCommonUi::ShowConfirmationQueryL( - R_QTN_NETW_QUEST_IAP_INCOMPLETE_DELETE ) ) - { - // quit without saving, so restore attributes - iCmPluginBaseEng.RestoreAttributeL( EWlanIpAddr ); - iCmPluginBaseEng.RestoreAttributeL( EWlanIpNetMask ); - iCmPluginBaseEng.RestoreAttributeL( EWlanIpGateway ); - iCmPluginBaseEng.RestoreAttributeL( EWlanIpDNSAddrFromServer ); - retVal = ETrue; - } - } - else - { - retVal = ETrue; - } - } - else - { - retVal = ETrue; - } - - return retVal; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv4::InitTextsL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgIpv4::InitTextsL() - { - // set pane text if neccessary... - // pane text needed if not pop-up... - if ( iEikonEnv ) - { - iStatusPane = iEikonEnv->AppUiFactory()->StatusPane(); - iTitlePane = - ( CAknTitlePane* )iStatusPane->ControlL( - TUid::Uid( EEikStatusPaneUidTitle ) ); - - iOldTitleText = iTitlePane->Text()->AllocL(); - HBufC* title = StringLoader::LoadLC ( R_QTN_SET_IPV4_SETTINGS ); - iTitlePane->SetTextL( *title ) ; - CleanupStack::PopAndDestroy(title); - iNaviPane = ( CAknNavigationControlContainer* ) - iStatusPane->ControlL( - TUid::Uid( EEikStatusPaneUidNavi ) ); - iNaviDecorator = iNaviPane->CreateNavigationLabelL( KNullDesC ); - iNaviPane->PushL( *iNaviDecorator ); - } - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv4::RegisterParentView -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgIpv4::RegisterParentView( CCmParentViewNotifier* aParent ) - { - iParent = aParent; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv4::CommsDatChangesL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgIpv4::CommsDatChangesL() - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - CCmDestinationImpl* parentDest = iCmPluginBaseEng.ParentDestination(); - - if ( parentDest ) - { - if( !cmMgr.DestinationStillExistedL( parentDest ) ) - { - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedDestinationDisappear ); - } - - cmMgr.WatcherUnRegister(); - // If parent destination is deleted by somebody then the dialog must exit back to main view - iExitReason = KDialogUserExit; - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - if( !cmMgr.IsIapStillInDestL( parentDest, iCmPluginBaseEng ) ) - { - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapIsNotInThisDestination ); - } - - cmMgr.WatcherUnRegister(); - // In this case, the dialog can go back to the parent view - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - // We may have to notify parent view to go back to its parent view even though this Iap is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapDisappear ); - } - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - } - else - { - if( !cmMgr.IapStillExistedL( iCmPluginBaseEng ) ) - { - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapDisappear ); - } - - cmMgr.WatcherUnRegister(); - // In this case, the dialog can go back to the parent view - TryExitL( iExitReason ); - return; - } - - // We may have to notify parent view to go back to its parent view even though this Iap is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapDisappear ); - } - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - } - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpwlansettingsdlgipv6.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmpwlansettingsdlgipv6.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,345 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: WLAN Ipv6 settings dialog -* -*/ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include "cmpluginwlan.h" -#include "cmpwlansettingsdlgipv6.h" -#include "cmwlancommonconstants.h" -#include "cmpluginmenucommands.hrh" -#include "cmpluginmultilinedialog.h" -#include -#include -#include "cmmanagerimpl.h" - -using namespace CMManager; - -const TUint32 KIPv6SelectionItems[] = - { - R_QTN_SET_DNS_SERVERS_AUTOMATIC, - R_QTN_SET_IP_WELL_KNOWN, - R_QTN_SET_IP_USER_DEFINED, - 0 - }; - -// ================= MEMBER FUNCTIONS ======================================= - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv6::NewL -// Two-phase dconstructor, second phase is ConstructAndRunLD -// -------------------------------------------------------------------------- -// -CmPluginWlanSettingsDlgIpv6* CmPluginWlanSettingsDlgIpv6::NewL( - CCmPluginBaseEng& aCmPluginBase ) - { - CmPluginWlanSettingsDlgIpv6* self = - new (ELeave) CmPluginWlanSettingsDlgIpv6( aCmPluginBase ); - return self; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv6::CmPluginWlanSettingsDlgIpv6 -// -------------------------------------------------------------------------- -// -CmPluginWlanSettingsDlgIpv6::CmPluginWlanSettingsDlgIpv6( - CCmPluginBaseEng& aCmPluginBase ): - CmPluginBaseSettingsDlgIp( aCmPluginBase ) , - iParent( NULL ) - { - iHelpContext = KSET_HLP_AP_WLAN_AS_IPV6; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv6::~CmPluginWlanSettingsDlgIpv6 -// -------------------------------------------------------------------------- -// -CmPluginWlanSettingsDlgIpv6::~CmPluginWlanSettingsDlgIpv6() - { - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv6::ConstructAndRunLD -// -------------------------------------------------------------------------- -// -TInt CmPluginWlanSettingsDlgIpv6::ConstructAndRunLD() - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherRegisterL( this ); - - return CmPluginBaseSettingsDlgIp::ConstructAndRunLD(); - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv6::UpdateListBoxContentBearerSpecificL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgIpv6::UpdateListBoxContentBearerSpecificL( - CDesCArray& aItemArray ) - { - TInt value( 0 ); - - // DNS SERVERS IP ADDRESS - switch ( GetIPv6DNSTypeL( EWlanIp6NameServer1, - EWlanIp6NameServer2 ) ) - { - case EIpv6DNSDynamic: - { - value = R_QTN_SET_DNS_SERVERS_AUTOMATIC; - break; - } - case EIpv6DNSWellKnown: - { - value = R_QTN_SET_IP_WELL_KNOWN; - break; - } - case EIpv6DNSUserDefined: - { - value = R_QTN_SET_IP_USER_DEFINED; - break; - } - default: - { - User::Leave( KErrNotSupported ); - break; - } - } - AppendSettingTextsL( aItemArray, - EWlanIp6DNSAddrFromServer, - value ); - } - -//--------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv6::ShowPopupSettingPageL -//--------------------------------------------------------------------------- -// -TBool CmPluginWlanSettingsDlgIpv6::ShowPopupSettingPageL( TUint32 aAttribute, - TInt aCommandId ) - { - TBool retval = EFalse; - switch ( aAttribute ) - { - case EWlanIp6DNSAddrFromServer: - { - ShowPopupIPv6DNSEditorL( KIPv6SelectionItems, - EWlanIp6DNSAddrFromServer, - EWlanIp6NameServer1, - EWlanIp6NameServer2 ); - break; - } - default: - { - CmPluginBaseSettingsDlgIp::ShowPopupSettingPageL( aAttribute, - aCommandId ); - break; - } - } - return retval; - } - -//--------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv6::InitTextsL -// called before the dialog is shown to initialize localized textual data -//--------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgIpv6::InitTextsL() - { - // set pane text if neccessary... - // pane text needed if not pop-up... - if ( iEikonEnv ) - { - iStatusPane = iEikonEnv->AppUiFactory()->StatusPane(); - iTitlePane = ( CAknTitlePane* )iStatusPane->ControlL( - TUid::Uid( EEikStatusPaneUidTitle ) ); - - iOldTitleText = iTitlePane->Text()->AllocL(); - HBufC* title = StringLoader::LoadLC ( R_QTN_SET_IPV6_SETTINGS ); - iTitlePane->SetTextL( *title ) ; - CleanupStack::PopAndDestroy(title); - iNaviPane = ( CAknNavigationControlContainer* ) - iStatusPane->ControlL( - TUid::Uid( EEikStatusPaneUidNavi ) ); - iNaviDecorator = iNaviPane->CreateNavigationLabelL( KNullDesC ); - iNaviPane->PushL( *iNaviDecorator ); - } - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv6::ProcessCommandL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgIpv6:: ProcessCommandL( TInt aCommandId ) - { - if ( MenuShowing() ) - { - HideMenu(); - } - - switch ( aCommandId ) - { - case EPluginBaseCmdExit: - { - iExitReason = KDialogUserExit; - } - // fall-through intended here - case EAknSoftkeyBack: - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherUnRegister(); - - TryExitL( iExitReason ); - break; - } - case EAknSoftkeyOk: - case EPluginBaseCmdChange: - { - TInt attrib = iSettingIndex->At( iListbox->CurrentItemIndex() ); - ShowPopupSettingPageL( attrib, aCommandId); - break; - } - default: - { - CmPluginBaseSettingsDlgIp::ProcessCommandL( aCommandId ); - break; - } - } - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv6::OkToExitL -// -------------------------------------------------------------------------- -// -TBool CmPluginWlanSettingsDlgIpv6::OkToExitL( TInt aButtonId ) - { - TBool retval( EFalse ); - - switch ( aButtonId ) - { - case EAknSoftkeyBack: - case EAknSoftkeyExit: - case KDialogUserExit: - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - cmMgr.WatcherUnRegister(); - } // Continue to call base setting dialog view - default: - { - retval = CmPluginBaseSettingsDlgIp::OkToExitL( aButtonId ); - break; - } - } - return retval; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv6::RegisterParentView -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgIpv6::RegisterParentView( CCmParentViewNotifier* aParent ) - { - iParent = aParent; - } - -// -------------------------------------------------------------------------- -// CmPluginWlanSettingsDlgIpv6::CommsDatChangesL -// -------------------------------------------------------------------------- -// -void CmPluginWlanSettingsDlgIpv6::CommsDatChangesL() - { - CCmManagerImpl& cmMgr = iCmPluginBaseEng.CmMgr(); - CCmDestinationImpl* parentDest = iCmPluginBaseEng.ParentDestination(); - - if ( parentDest ) - { - if( !cmMgr.DestinationStillExistedL( parentDest ) ) - { - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedDestinationDisappear ); - } - - // cmMgr.WatcherUnRegister(); - // If parent destination is deleted by somebody then the dialog must exit back to main view - iExitReason = KDialogUserExit; // cmMgr.WatcherUnRegister will be done in function OkToExitL in this case - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - if( !cmMgr.IsIapStillInDestL( parentDest, iCmPluginBaseEng ) ) - { - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapIsNotInThisDestination ); - } - - cmMgr.WatcherUnRegister(); - // In this case, the dialog can go back to the parent view - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - return; - } - - // We may have to notify parent view to go back to its parent view even though this Iap is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapDisappear ); - } - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - - cmMgr.RemoveDestFromPool( parentDest ); - delete parentDest; - } - else - { - if( !cmMgr.IapStillExistedL( iCmPluginBaseEng ) ) - { - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapDisappear ); - } - - cmMgr.WatcherUnRegister(); - // In this case, the dialog can go back to the parent view - TryExitL( iExitReason ); - return; - } - - // We may have to notify parent view to go back to its parent view even though this Iap is still in CommsDat - // for cmMgr ( = iCmPluginBaseEng.CmMgr() ) can not be accessed any more - // after this call when some Iap is deleted. - if( iParent ) - { - iParent->NotifyParentView( KCmNotifiedIapDisappear ); - } - cmMgr.WatcherUnRegister(); - TryExitL( iExitReason ); - } - } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmwlancoveragecheck.cpp --- a/cmmanager/cmmgr/Plugins/cmpluginwlan/src/cmwlancoveragecheck.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,413 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of WLAN Coverage Check class -* -*/ - - -#include - -#include "cmwlancoveragecheck.h" -#include "cmpluginwlan.h" -#include "cmpluginwlandata.h" -#include "cmpluginwlandataarray.h" -#include "cmlogger.h" - - -/** -* Management frame information element IDs. -* needed to determine coverage -*/ -enum T802Dot11InformationElementID - { - E802Dot11SsidIE = 0, - E802Dot11SupportedRatesIE = 1, - E802Dot11FhParameterSetIE = 2, - E802Dot11DsParameterSetIE = 3, - E802Dot11CfParameterSetIE = 4, - E802Dot11TimIE = 5, - E802Dot11IbssParameterSetIE = 6, - E802Dot11CountryIE = 7, - E802Dot11HoppingPatternParamIE = 8, - E802Dot11HoppingPatternTableIE = 9, - E802Dot11RequestIE = 10, - - E802Dot11ChallengeTextIE = 16, - // Reserved for challenge text extension 17 - 31 - E802Dot11ErpInformationIE = 42, - E802Dot11ExtendedRatesIE = 50, - E802Dot11AironetIE = 133, - E802Dot11ApIpAddressIE = 149, - E802Dot11RsnIE = 221 - }; - - -/** -* Bit masks for Capability Information field. -*/ -enum T802Dot11CapabilityBitMask - { - E802Dot11CapabilityEssMask = 0x0001, - E802Dot11CapabilityIbssMask = 0x0002, - E802Dot11CapabilityCfPollableMask = 0x0004, - E802Dot11CapabilityCfPollRequestMask= 0x0008, - E802Dot11CapabilityPrivacyMask = 0x0010, - E802Dot11ShortPreambleMask = 0x0020, - E802Dot11PbccMask = 0x0040, - E802Dot11ChannelAgilityMask = 0x0080 - }; - - -// ======================= MEMBER FUNCTIONS ================================= - -// ---------------------------------------------------------------------------- -// CCmWlanCoverageCheck::CCmWlanCoverageCheck() -// ---------------------------------------------------------------------------- -// -CCmWlanCoverageCheck::CCmWlanCoverageCheck() : CActive( EPriorityStandard ) - { - CActiveScheduler::Add( this ); - } - -// ---------------------------------------------------------------------------- -// CCmWlanCoverageCheck::~CCmWlanCoverageCheck() -// ---------------------------------------------------------------------------- -// -CCmWlanCoverageCheck::~CCmWlanCoverageCheck() - { - Cancel(); - } - -// ---------------------------------------------------------------------------- -// CCmWlanCoverageCheck::DoCancel -// ---------------------------------------------------------------------------- -// -void CCmWlanCoverageCheck::DoCancel() - { - iWait.AsyncStop(); - } - -// ---------------------------------------------------------------------------- -// CCmWlanCoverageCheck::RunL -// ---------------------------------------------------------------------------- -// -void CCmWlanCoverageCheck::RunL() - { - CLOG_WRITE( "RunL entered" ); - switch( iProgState ) - { - case EScanning: - { - if( !iStatus.Int() ) - // The list is ready - { - iProgState = EDone; - iWait.AsyncStop(); - } - else - // something went wrong -> no coverage. - { - iWait.AsyncStop(); - } - } - break; - case EDone: - { - iWait.AsyncStop(); - } - break; - - default: - { - User::Leave( KErrCorrupt ); - } - } - } - - - -// ---------------------------------------------------------------------------- -// CCmWlanCoverageCheck::GetCoverageL -// ---------------------------------------------------------------------------- -// -TInt CCmWlanCoverageCheck::GetCoverageL() - { - LOGGER_ENTERFN( "CCmWlanCoverageCheck::GetCoverageL" ); - - iProgState = EServiceStatus; - iCoverage = 0; - - CWlanMgmtClient* wlanMgmt = CWlanMgmtClient::NewL(); - CleanupStack::PushL( wlanMgmt ); - - CWlanScanInfo* scanInfo = CWlanScanInfo::NewL(); - CleanupStack::PushL( scanInfo ); - - iProgState = EScanning; - - wlanMgmt->GetScanResults( iStatus, *scanInfo ); - - SetActive(); - iWait.Start(); - - // now we have the results and might start to work on them... - if ( iProgState == EDone ) - { //finished without error, work on the result... - CCmPluginWlanDataArray* wlandataarray = new ( ELeave ) - CCmPluginWlanDataArray(); - CleanupStack::PushL( wlandataarray ); - - for ( scanInfo->First(); !scanInfo->IsDone(); scanInfo->Next() ) - { - // iWlanNetworks cannot be modified 'directly' in - // a const method (like GetBoolAttributeL), so we have to - // cast away the constness. - - // not simply count as before, but check if it is hidden, - // and do not allow duplicates... - TBool isHidden( EFalse ); - - TUint8 ieLen( 0 ); - const TUint8* ieData; - TBuf8 ssid8; - - TInt ret = scanInfo->InformationElement( E802Dot11SsidIE, ieLen, - &ieData ); - if ( ret == KErrNone ) - { - isHidden = IsHiddenSsid( ieLen, ieData ); - if ( !isHidden ) - { - // get the ssid - ssid8.Copy( ieData, ieLen ); - HBufC* tmp = HBufC::NewLC(KWlanMaxSsidLength); - TPtr tmpptr( tmp->Des() ); - - tmpptr.Copy(ssid8); - // get the signal strength - TUint8 rxLevel8 = scanInfo->RXLevel(); - TInt rxLevel = static_cast< TInt >( rxLevel8 ); - - // now add it to an array of CCmPluginWlanData, - // as it is not hidden - // the adding function should handle uniqeness and - // signal strength checking, it should contain only - // the strongest signal! - AddToArrayIfNeededL( *wlandataarray, rxLevel, tmpptr ); - - CleanupStack::PopAndDestroy( tmp ); - } - } - else - { - User::Leave( ret ); - } - } - iCoverage = wlandataarray->Count(); - - CleanupStack::PopAndDestroy( wlandataarray ); - - CleanupStack::PopAndDestroy( 2, wlanMgmt ); - } - else - { - User::LeaveIfError( iStatus.Int() ); - } - - return iCoverage; - } - -// --------------------------------------------------------- -// CCmWlanCoverageCheck::IsHiddenSsid -// --------------------------------------------------------- -// -TBool CCmWlanCoverageCheck::IsHiddenSsid( TUint aSsidLength, - const TUint8* aSsid ) const - { - LOGGER_ENTERFN( "CCmWlanCoverageCheck::IsHiddenSsid" ); - - const TUint8 CSPACE = 0x20; - TBool result( EFalse ); - TBool result2( ETrue ); - - if ( !aSsidLength ) - { - result = ETrue; - } - - TInt count( 0 ); - TUint8 temp( 0x00 ); - - for ( TUint i( 0 ); i < aSsidLength; ++i ) - { - temp = aSsid[i]; - count += temp; // in hidden networks characters are: 0x00 - result2 &= temp == CSPACE ; - } - - if( !count || result2 ) - { - result = ETrue; - } - - return result; - } - - -// --------------------------------------------------------- -// CCmWlanCoverageCheck::AddToArrayIfNeededL -// --------------------------------------------------------- -// -void CCmWlanCoverageCheck::AddToArrayIfNeededL( - CCmPluginWlanDataArray& aArray, - TInt aRXLevel, - TDesC& aNetworkName ) const - { - LOGGER_ENTERFN( "CCmWlanCoverageCheck::AddToArrayIfNeededL" ); - - // first check if it is already in the array - - TBool found( EFalse ); - TInt index( 0 ); - TInt count = aArray.Count(); - - while( ( index < count ) && !found ) - { - if( ( aArray )[index]->iNetworkName->Compare( aNetworkName ) ) - { - ++index; - } - else - { - found = ETrue; - } - } - - TSignalStrength strength = ( TSignalStrength )aRXLevel; - if ( found ) - { - // if already exists, check signal strengths - TSignalStrength signal = ( aArray )[index]->iSignalStrength; - - // set to higher value - ( aArray )[index]->iSignalStrength = - signal < strength ? signal : strength ; - } - else - { - // new element, add it to array with signal strength!! - CCmPluginWlanData* data = CCmPluginWlanData::NewLC(); - data->iNetworkName = aNetworkName.AllocL(); - data->iSignalStrength = strength; - aArray.AppendL( data ); - CleanupStack::Pop( data ); // item owned by list! - } - } - - -// ---------------------------------------------------------------------------- -// CCmWlanCoverageCheck::ScanForPromptedSsidL -// ---------------------------------------------------------------------------- -// -TBool CCmWlanCoverageCheck::ScanForPromptedSsidL( TWlanSsid aEnteredSsid, - TBool aBroadcast, - TWlanNetMode& aNetworkMode, - TWlanConnectionExtentedSecurityMode& aSecurityMode, - TBool& aProtectedSetupSupported ) - { - LOGGER_ENTERFN( "CCmWlanCoverageCheck::ScanForPromptedSsidL" ); - - TBool found = EFalse; - - iProgState = EServiceStatus; - - CWlanMgmtClient* wlanMgmt = CWlanMgmtClient::NewL(); - CleanupStack::PushL( wlanMgmt ); - - CWlanScanInfo* scanInfo = CWlanScanInfo::NewL(); - CleanupStack::PushL( scanInfo ); - - iProgState = EScanning; - - if ( aBroadcast ) - { - wlanMgmt->GetScanResults( iStatus, *scanInfo ); - } - else - { - wlanMgmt->GetScanResults( aEnteredSsid, iStatus, *scanInfo ); - } - - SetActive(); - iWait.Start(); - - // now we have the results and might start to work on them... - if ( iProgState == EDone ) - { //finished without error, work on the result... - TSignalStrength signalStrength = ESignalStrengthMin; - - for ( scanInfo->First(); !scanInfo->IsDone(); scanInfo->Next() ) - { - TUint8 ieLen( 0 ); - const TUint8* ieData; - TBuf8 ssid8; - - TInt ret = scanInfo->InformationElement( E802Dot11SsidIE, ieLen, - &ieData ); - if ( ret == KErrNone ) - { - // get the ssid - ssid8.Copy( ieData, ieLen ); - - if ( !aEnteredSsid.Compare( ssid8 ) ) - { - // get the signal strength - TUint8 rxLevel8 = scanInfo->RXLevel(); - TInt rxLevel = static_cast< TInt >( rxLevel8 ); - - TSignalStrength strength = ( TSignalStrength )rxLevel; - if ( !found || ( found && strength < signalStrength ) ) - { - found = ETrue; - signalStrength = strength; - - aNetworkMode = ( scanInfo->Capability() & - E802Dot11CapabilityEssMask ) ? - EInfra : EAdhoc; - aSecurityMode = scanInfo->ExtendedSecurityMode(); - - aProtectedSetupSupported = - scanInfo->IsProtectedSetupSupported(); - } - } - } - else - { - User::Leave( ret ); - } - - } - - CleanupStack::PopAndDestroy( scanInfo ); - CleanupStack::PopAndDestroy( wlanMgmt ); - } - else - { - User::LeaveIfError( iStatus.Int() ); - } - - return found; - } - - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Rom/CmManager.iby --- a/cmmanager/cmmgr/Rom/CmManager.iby Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef __CMMANAGER_IBY__ -#define __CMMANAGER_IBY__ - - -file=ABI_DIR\BUILD_DIR\cmmanager.dll SHARED_LIB_DIR\cmmanager.dll -SCALABLE_IMAGE(APP_RESOURCE_DIR,APP_RESOURCE_DIR,cmmanager) - - - -#endif // __CMMANAGER_IBY__ - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Rom/CmManagerResources.iby --- a/cmmanager/cmmgr/Rom/CmManagerResources.iby Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __CMMANAGER_RESOURCES_IBY__ -#define __CMMANAGER_RESOURCES_IBY__ - - - -data=ZRESOURCE\cmmanager.rsc RESOURCE_FILES_DIR\cmmanager.rsc - - -#endif \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Rom/cmplugincsd.iby --- a/cmmanager/cmmgr/Rom/cmplugincsd.iby Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef __CMPLUGINCSD_IBY__ -#define __CMPLUGINCSD_IBY__ - - -ECOM_PLUGIN(cmplugincsd.dll,10281BB6.rsc) -SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,cmplugincsd) - - -#endif // __CMPLUGINCSD_IBY__ diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Rom/cmplugincsdresources.iby --- a/cmmanager/cmmgr/Rom/cmplugincsdresources.iby Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __CMPLUGINCSD_RESOURCES_IBY__ -#define __CMPLUGINCSD_RESOURCES_IBY__ - - -data = DATAZ_\RESOURCE_FILES_DIR\cmplugincsdui.rsc RESOURCE_FILES_DIR\cmplugincsdui.rsc - - -#endif // __CMPLUGINCSD_RESOURCES_IBY__ \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Rom/cmpluginembdestination.iby --- a/cmmanager/cmmgr/Rom/cmpluginembdestination.iby Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef __CMPLUGIN_EMBDESTINATION_IBY__ -#define __CMPLUGIN_EMBDESTINATION_IBY__ - - -ECOM_PLUGIN(cmpluginembdestination.dll,1020737D.rsc) - - -#endif // __CMPLUGIN_EMBDESTINATION_IBY__ diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Rom/cmpluginembdestinationresources.iby --- a/cmmanager/cmmgr/Rom/cmpluginembdestinationresources.iby Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __CMPLUGIN_EMBDESTINATION_RESOURCES_IBY__ -#define __CMPLUGIN_EMBDESTINATION_RESOURCES_IBY__ - - -data = DATAZ_\RESOURCE_FILES_DIR\cmpluginembdestinationui.rsc RESOURCE_FILES_DIR\cmpluginembdestinationui.rsc - - -#endif // __CMPLUGIN_EMBDESTINATION_RESOURCES_IBY__ \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Rom/cmpluginpacketdata.iby --- a/cmmanager/cmmgr/Rom/cmpluginpacketdata.iby Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __CMPLUGINPACKETDATA_IBY__ -#define __CMPLUGINPACKETDATA_IBY__ - - -ECOM_PLUGIN(cmpluginpacketdata.dll,1020737C.rsc) -SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,cmpluginpacketdata) - - -#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Rom/cmpluginpacketdataresources.iby --- a/cmmanager/cmmgr/Rom/cmpluginpacketdataresources.iby Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __CMPLUGINPACKETDATA_RESOURCES_IBY__ -#define __CMPLUGINPACKETDATA_RESOURCES_IBY__ - - -data = DATAZ_\RESOURCE_FILES_DIR\cmpacketdataui.RSC RESOURCE_FILES_DIR\cmpacketdataui.RSC - - -#endif \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Rom/cmpluginvpn.iby --- a/cmmanager/cmmgr/Rom/cmpluginvpn.iby Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __CMPLUGINVPN_IBY__ -#define __CMPLUGINVPN_IBY__ - - -ECOM_PLUGIN(cmpluginvpn.dll,10281BBD.rsc) -SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,cmpluginvpn) - - -#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Rom/cmpluginvpnresources.iby --- a/cmmanager/cmmgr/Rom/cmpluginvpnresources.iby Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef __CMPLUGINVPN_RESOURCES_IBY__ -#define __CMPLUGINVPN_RESOURCES_IBY__ - - -data = DATAZ_\RESOURCE_FILES_DIR\cmpluginvpnui.rsc RESOURCE_FILES_DIR\cmpluginvpnui.rsc - -# -#endif \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Rom/cmpluginwlan.iby --- a/cmmanager/cmmgr/Rom/cmpluginwlan.iby Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef __CMPLUGINWLAN_IBY__ -#define __CMPLUGINWLAN_IBY__ - -#if defined( __PROTOCOL_WLAN ) - -ECOM_PLUGIN(cmpluginwlan.dll,10281BB2.rsc) -SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,cmpluginwlan) - -#endif // __PROTOCOL_WLAN - -#endif // __CMPLUGINWLAN_IBY__ diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/Rom/cmpluginwlanresources.iby --- a/cmmanager/cmmgr/Rom/cmpluginwlanresources.iby Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef __CMPLUGINWLAN_RESOURCES_IBY__ -#define __CMPLUGINWLAN_RESOURCES_IBY__ - -#if ( defined( __PROTOCOL_WLAN ) ) - -data = DATAZ_\RESOURCE_FILES_DIR\cmwlanui.rsc RESOURCE_FILES_DIR\cmwlanui.rsc - -#endif // __PROTOCOL_WLAN - -#endif // __CMPLUGINWLAN_RESOURCES_IBY__ \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/BWinsCw/CmManager_prot_setupU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/BWinsCw/CmManager_prot_setupU.DEF Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,398 @@ +EXPORTS + ??0CCmPluginBaseEng@@IAE@PAVTCmPluginInitParam@@@Z @ 1 NONAME ABSENT ; CCmPluginBaseEng::CCmPluginBaseEng(class TCmPluginInitParam *) + ??0CCmPluginLanBase@@IAE@PAVTCmPluginInitParam@@@Z @ 2 NONAME ABSENT ; CCmPluginLanBase::CCmPluginLanBase(class TCmPluginInitParam *) + ??0CmPluginBaseSettingsDlg@@QAE@AAVCCmPluginBaseEng@@@Z @ 3 NONAME ABSENT ; CmPluginBaseSettingsDlg::CmPluginBaseSettingsDlg(class CCmPluginBaseEng &) + ??0CmPluginBaseSettingsDlgAdv@@QAE@AAVCCmPluginBaseEng@@@Z @ 4 NONAME ABSENT ; CmPluginBaseSettingsDlgAdv::CmPluginBaseSettingsDlgAdv(class CCmPluginBaseEng &) + ??0CmPluginBaseSettingsDlgIp@@QAE@AAVCCmPluginBaseEng@@@Z @ 5 NONAME ABSENT ; CmPluginBaseSettingsDlgIp::CmPluginBaseSettingsDlgIp(class CCmPluginBaseEng &) + ??0RCmDestination@@QAE@ABV0@@Z @ 6 NONAME ; RCmDestination::RCmDestination(class RCmDestination const &) + ??0RCmDestinationExt@@QAE@ABV0@@Z @ 7 NONAME ; RCmDestinationExt::RCmDestinationExt(class RCmDestinationExt const &) + ??1CCmApplicationSettingsUi@@UAE@XZ @ 8 NONAME ; CCmApplicationSettingsUi::~CCmApplicationSettingsUi(void) + ??1CCmPluginBaseEng@@UAE@XZ @ 9 NONAME ABSENT ; CCmPluginBaseEng::~CCmPluginBaseEng(void) + ??1CCmPluginLanBase@@MAE@XZ @ 10 NONAME ABSENT ; CCmPluginLanBase::~CCmPluginLanBase(void) + ??1CCmSettingsUi@@UAE@XZ @ 11 NONAME ABSENT ; CCmSettingsUi::~CCmSettingsUi(void) + ??1CmPluginBaseSettingsDlg@@UAE@XZ @ 12 NONAME ABSENT ; CmPluginBaseSettingsDlg::~CmPluginBaseSettingsDlg(void) + ??1CmPluginBaseSettingsDlgAdv@@UAE@XZ @ 13 NONAME ABSENT ; CmPluginBaseSettingsDlgAdv::~CmPluginBaseSettingsDlgAdv(void) + ??1CmPluginBaseSettingsDlgIp@@UAE@XZ @ 14 NONAME ABSENT ; CmPluginBaseSettingsDlgIp::~CmPluginBaseSettingsDlgIp(void) + ??1RCmDestination@@QAE@XZ @ 15 NONAME ; RCmDestination::~RCmDestination(void) + ??1RCmDestinationExt@@QAE@XZ @ 16 NONAME ; RCmDestinationExt::~RCmDestinationExt(void) + ??4RCmDestination@@QAEAAV0@ABV0@@Z @ 17 NONAME ; class RCmDestination & RCmDestination::operator=(class RCmDestination const &) + ??4RCmDestinationExt@@QAEAAV0@ABV0@@Z @ 18 NONAME ; class RCmDestinationExt & RCmDestinationExt::operator=(class RCmDestinationExt const &) + ?AddCommonConversionTableL@CCmPluginBaseEng@@IAEXPBUTCmCommonAttrConvArrayItem@@@Z @ 19 NONAME ABSENT ; void CCmPluginBaseEng::AddCommonConversionTableL(struct TCmCommonAttrConvArrayItem const *) + ?AddConnectionMethodL@RCmDestinationExt@@QAEHVRCmConnectionMethodExt@@@Z @ 20 NONAME ; int RCmDestinationExt::AddConnectionMethodL(class RCmConnectionMethodExt) + ?AddConverstionTableL@CCmPluginBaseEng@@IAEXPAPAVCCDRecordBase@CommsDat@@PAHPBUTCmAttribConvTable@@@Z @ 21 NONAME ABSENT ; void CCmPluginBaseEng::AddConverstionTableL(class CommsDat::CCDRecordBase * *, int *, struct TCmAttribConvTable const *) + ?AddEmbeddedDestinationL@RCmDestinationExt@@QAEHABV1@@Z @ 22 NONAME ; int RCmDestinationExt::AddEmbeddedDestinationL(class RCmDestinationExt const &) + ?AddResourceFileL@CCmPluginBaseEng@@IAEXABVTDesC16@@@Z @ 23 NONAME ABSENT ; void CCmPluginBaseEng::AddResourceFileL(class TDesC16 const &) + ?AllDestinationsL@CCmManagerImpl@@QAEXAAV?$RArray@K@@@Z @ 24 NONAME ABSENT ; void CCmManagerImpl::AllDestinationsL(class RArray &) + ?AllDestinationsL@RCmManager@@QBEXAAV?$RArray@K@@@Z @ 25 NONAME ; void RCmManager::AllDestinationsL(class RArray &) const + ?AllDestinationsL@RCmManagerExt@@QAEXAAV?$RArray@K@@@Z @ 26 NONAME ; void RCmManagerExt::AllDestinationsL(class RArray &) + ?AllocReadL@CCmPluginBaseEng@@IBEPAVHBufC16@@H@Z @ 27 NONAME ABSENT ; class HBufC16 * CCmPluginBaseEng::AllocReadL(int) const + ?AppendSettingTextsL@CmPluginBaseSettingsDlg@@IAEXAAVCDesC16Array@@HH@Z @ 28 NONAME ABSENT ; void CmPluginBaseSettingsDlg::AppendSettingTextsL(class CDesC16Array &, int, int) + ?AppendSettingTextsL@CmPluginBaseSettingsDlg@@IAEXAAVCDesC16Array@@HPBVHBufC16@@@Z @ 29 NONAME ABSENT ; void CmPluginBaseSettingsDlg::AppendSettingTextsL(class CDesC16Array &, int, class HBufC16 const *) + ?AppendSettingTextsL@CmPluginBaseSettingsDlg@@IBEXAAVCDesC16Array@@HHABVTDesC16@@H@Z @ 30 NONAME ABSENT ; void CmPluginBaseSettingsDlg::AppendSettingTextsL(class CDesC16Array &, int, int, class TDesC16 const &, int) const + ?AppendSettingTextsL@CmPluginBaseSettingsDlg@@IBEXAAVCDesC16Array@@HHHH@Z @ 31 NONAME ABSENT ; void CmPluginBaseSettingsDlg::AppendSettingTextsL(class CDesC16Array &, int, int, int, int) const + ?BearerPriorityArrayL@RCmManager@@QBEXAAV?$RArray@VTBearerPriority@@@@@Z @ 32 NONAME ; void RCmManager::BearerPriorityArrayL(class RArray &) const + ?BearerPriorityArrayL@RCmManagerExt@@QBEXAAV?$RArray@VTBearerPriority@@@@@Z @ 33 NONAME ; void RCmManagerExt::BearerPriorityArrayL(class RArray &) const + ?BearerRecordIdLC@CCmPluginLanBase@@MAEXAAPAVHBufC16@@AAK@Z @ 34 NONAME ABSENT ; void CCmPluginLanBase::BearerRecordIdLC(class HBufC16 * &, unsigned long &) + ?CheckDNSServerAddressL@CCmPluginBaseEng@@QAEXHAAV?$CMDBField@VTDesC16@@@CommsDat@@0AAV?$CMDBField@H@3@@Z @ 35 NONAME ABSENT ; void CCmPluginBaseEng::CheckDNSServerAddressL(int, class CommsDat::CMDBField &, class CommsDat::CMDBField &, class CommsDat::CMDBField &) + ?CheckIPv4ValidityL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 36 NONAME ABSENT ; int CheckIPv4ValidityL(class CCmPluginBaseEng *, unsigned long, void const *) + ?CheckIPv6ValidityL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 37 NONAME ABSENT ; int CheckIPv6ValidityL(class CCmPluginBaseEng *, unsigned long, void const *) + ?CheckIfAlreadyConnected@CCmPluginBaseEng@@MBEHXZ @ 38 NONAME ABSENT ; int CCmPluginBaseEng::CheckIfAlreadyConnected(void) const + ?CheckIfNameModifiedL@CCmPluginBaseEng@@IBEXPAVCCDRecordBase@CommsDat@@@Z @ 39 NONAME ABSENT ; void CCmPluginBaseEng::CheckIfNameModifiedL(class CommsDat::CCDRecordBase *) const + ?CheckPortNumberValidityL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 40 NONAME ABSENT ; int CheckPortNumberValidityL(class CCmPluginBaseEng *, unsigned long, void const *) + ?CheckRecordIdValidityL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 41 NONAME ABSENT ; int CheckRecordIdValidityL(class CCmPluginBaseEng *, unsigned long, void const *) + ?CheckWAPWspOptionValidityL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 42 NONAME ABSENT ; int CheckWAPWspOptionValidityL(class CCmPluginBaseEng *, unsigned long, void const *) + ?ClassifyIPv6Address@@YA?AW4TIPv6Types@CMManager@@ABVTDesC16@@@Z @ 43 NONAME ABSENT ; enum CMManager::TIPv6Types ClassifyIPv6Address(class TDesC16 const &) + ?CleanupGlobalPriorityArray@RCmManager@@QBEXAAV?$RArray@VTBearerPriority@@@@@Z @ 44 NONAME ; void RCmManager::CleanupGlobalPriorityArray(class RArray &) const + ?CleanupGlobalPriorityArray@RCmManagerExt@@QBEXAAV?$RArray@VTBearerPriority@@@@@Z @ 45 NONAME ; void RCmManagerExt::CleanupGlobalPriorityArray(class RArray &) const + ?Close@CCmTransactionHandler@@QAEXXZ @ 46 NONAME ABSENT ; void CCmTransactionHandler::Close(void) + ?Close@RCmConnectionMethod@@QAEXXZ @ 47 NONAME ; void RCmConnectionMethod::Close(void) + ?Close@RCmConnectionMethodExt@@QAEXXZ @ 48 NONAME ; void RCmConnectionMethodExt::Close(void) + ?Close@RCmDestination@@QAEXXZ @ 49 NONAME ; void RCmDestination::Close(void) + ?Close@RCmDestinationExt@@QAEXXZ @ 50 NONAME ; void RCmDestinationExt::Close(void) + ?Close@RCmManager@@QAEXXZ @ 51 NONAME ; void RCmManager::Close(void) + ?Close@RCmManagerExt@@QAEXXZ @ 52 NONAME ; void RCmManagerExt::Close(void) + ?ConnectionMethodByIDL@RCmDestination@@QBE?AVRCmConnectionMethod@@H@Z @ 53 NONAME ; class RCmConnectionMethod RCmDestination::ConnectionMethodByIDL(int) const + ?ConnectionMethodByIDL@RCmDestinationExt@@QAE?AVRCmConnectionMethodExt@@H@Z @ 54 NONAME ; class RCmConnectionMethodExt RCmDestinationExt::ConnectionMethodByIDL(int) + ?ConnectionMethodCount@CCmDestinationImpl@@QAEHXZ @ 55 NONAME ABSENT ; int CCmDestinationImpl::ConnectionMethodCount(void) + ?ConnectionMethodCount@RCmDestination@@QBEHXZ @ 56 NONAME ; int RCmDestination::ConnectionMethodCount(void) const + ?ConnectionMethodCount@RCmDestinationExt@@QAEHXZ @ 57 NONAME ; int RCmDestinationExt::ConnectionMethodCount(void) + ?ConnectionMethodL@CCmDestinationImpl@@QAEPAVCCmPluginBaseEng@@H@Z @ 58 NONAME ABSENT ; class CCmPluginBaseEng * CCmDestinationImpl::ConnectionMethodL(int) + ?ConnectionMethodL@CCmManagerImpl@@QAEPAVCCmPluginBaseEng@@K@Z @ 59 NONAME ABSENT ; class CCmPluginBaseEng * CCmManagerImpl::ConnectionMethodL(unsigned long) + ?ConnectionMethodL@CCmManagerImpl@@QAEXAAV?$RArray@K@@HHHH@Z @ 60 NONAME ABSENT ; void CCmManagerImpl::ConnectionMethodL(class RArray &, int, int, int, int) + ?ConnectionMethodL@RCmDestination@@QBE?AVRCmConnectionMethod@@H@Z @ 61 NONAME ; class RCmConnectionMethod RCmDestination::ConnectionMethodL(int) const + ?ConnectionMethodL@RCmDestinationExt@@QAE?AVRCmConnectionMethodExt@@H@Z @ 62 NONAME ; class RCmConnectionMethodExt RCmDestinationExt::ConnectionMethodL(int) + ?ConnectionMethodL@RCmManager@@QBE?AVRCmConnectionMethod@@K@Z @ 63 NONAME ; class RCmConnectionMethod RCmManager::ConnectionMethodL(unsigned long) const + ?ConnectionMethodL@RCmManager@@QBEXAAV?$RArray@K@@HHH@Z @ 64 NONAME ; void RCmManager::ConnectionMethodL(class RArray &, int, int, int) const + ?ConnectionMethodL@RCmManagerExt@@QAE?AVRCmConnectionMethodExt@@K@Z @ 65 NONAME ; class RCmConnectionMethodExt RCmManagerExt::ConnectionMethodL(unsigned long) + ?ConnectionMethodL@RCmManagerExt@@QAEXAAV?$RArray@K@@HHH@Z @ 66 NONAME ; void RCmManagerExt::ConnectionMethodL(class RArray &, int, int, int) + ?ConstructAndRunLD@CmPluginBaseSettingsDlg@@QAEHXZ @ 67 NONAME ABSENT ; int CmPluginBaseSettingsDlg::ConstructAndRunLD(void) + ?ConstructL@CCmPluginBaseEng@@MAEXXZ @ 68 NONAME ABSENT ; void CCmPluginBaseEng::ConstructL(void) + ?ConstructL@CCmPluginLanBase@@MAEXXZ @ 69 NONAME ABSENT ; void CCmPluginLanBase::ConstructL(void) + ?ConvTableItem@CCmPluginBaseEng@@QAEPBUTCmAttribConvTable@@K@Z @ 70 NONAME ABSENT ; struct TCmAttribConvTable const * CCmPluginBaseEng::ConvTableItem(unsigned long) + ?CopyConnectionMethodL@RCmManagerExt@@QAEHAAVRCmDestinationExt@@AAVRCmConnectionMethodExt@@@Z @ 71 NONAME ; int RCmManagerExt::CopyConnectionMethodL(class RCmDestinationExt &, class RCmConnectionMethodExt &) + ?CreateConnectionMethodL@RCmDestinationExt@@QAE?AVRCmConnectionMethodExt@@K@Z @ 72 NONAME ; class RCmConnectionMethodExt RCmDestinationExt::CreateConnectionMethodL(unsigned long) + ?CreateConnectionMethodL@RCmManagerExt@@QAE?AVRCmConnectionMethodExt@@K@Z @ 73 NONAME ; class RCmConnectionMethodExt RCmManagerExt::CreateConnectionMethodL(unsigned long) + ?CreateCopyL@CCmPluginBaseEng@@UBEPAV1@XZ @ 74 NONAME ABSENT ; class CCmPluginBaseEng * CCmPluginBaseEng::CreateCopyL(void) const + ?CreateCopyL@RCmConnectionMethodExt@@QAE?AV1@XZ @ 75 NONAME ; class RCmConnectionMethodExt RCmConnectionMethodExt::CreateCopyL(void) + ?CreateDestinationL@RCmManagerExt@@QAE?AVRCmDestinationExt@@ABVTDesC16@@@Z @ 76 NONAME ; class RCmDestinationExt RCmManagerExt::CreateDestinationL(class TDesC16 const &) + ?CreateNewL@CCmPluginBaseEng@@UAEXXZ @ 77 NONAME ABSENT ; void CCmPluginBaseEng::CreateNewL(void) + ?CreateNewServiceRecordL@CCmPluginLanBase@@MAEXXZ @ 78 NONAME ABSENT ; void CCmPluginLanBase::CreateNewServiceRecordL(void) + ?DeleteConnectionMethodL@RCmDestinationExt@@QAEXAAVRCmConnectionMethodExt@@@Z @ 79 NONAME ; void RCmDestinationExt::DeleteConnectionMethodL(class RCmConnectionMethodExt &) + ?DeleteL@CCmPluginBaseEng@@UAEHHH@Z @ 80 NONAME ABSENT ; int CCmPluginBaseEng::DeleteL(int, int) + ?DeleteL@RCmConnectionMethodExt@@QAEHXZ @ 81 NONAME ; int RCmConnectionMethodExt::DeleteL(void) + ?DeleteLD@CCmDestinationImpl@@QAEXXZ @ 82 NONAME ABSENT ; void CCmDestinationImpl::DeleteLD(void) + ?DeleteLD@RCmDestinationExt@@QAEXXZ @ 83 NONAME ; void RCmDestinationExt::DeleteLD(void) + ?Destination@CCmPluginBaseEng@@UBEPAVCCmDestinationImpl@@XZ @ 84 NONAME ABSENT ; class CCmDestinationImpl * CCmPluginBaseEng::Destination(void) const + ?DestinationL@CCmManagerImpl@@QAEPAVCCmDestinationImpl@@K@Z @ 85 NONAME ABSENT ; class CCmDestinationImpl * CCmManagerImpl::DestinationL(unsigned long) + ?DestinationL@RCmConnectionMethod@@QBE?AVRCmDestination@@XZ @ 86 NONAME ; class RCmDestination RCmConnectionMethod::DestinationL(void) const + ?DestinationL@RCmConnectionMethodExt@@QBE?AVRCmDestinationExt@@XZ @ 87 NONAME ; class RCmDestinationExt RCmConnectionMethodExt::DestinationL(void) const + ?DestinationL@RCmManager@@QBE?AVRCmDestination@@K@Z @ 88 NONAME ; class RCmDestination RCmManager::DestinationL(unsigned long) const + ?DestinationL@RCmManagerExt@@QAE?AVRCmDestinationExt@@K@Z @ 89 NONAME ; class RCmDestinationExt RCmManagerExt::DestinationL(unsigned long) + ?DynInitMenuPaneL@CmPluginBaseSettingsDlg@@MAEXHPAVCEikMenuPane@@@Z @ 90 NONAME ABSENT ; void CmPluginBaseSettingsDlg::DynInitMenuPaneL(int, class CEikMenuPane *) + ?DynInitMenuPaneL@CmPluginBaseSettingsDlgAdv@@UAEXHPAVCEikMenuPane@@@Z @ 91 NONAME ABSENT ; void CmPluginBaseSettingsDlgAdv::DynInitMenuPaneL(int, class CEikMenuPane *) + ?DynInitMenuPaneL@CmPluginBaseSettingsDlgIp@@UAEXHPAVCEikMenuPane@@@Z @ 92 NONAME ABSENT ; void CmPluginBaseSettingsDlgIp::DynInitMenuPaneL(int, class CEikMenuPane *) + ?EasyWlanIdL@CCmManagerImpl@@QAEKXZ @ 93 NONAME ABSENT ; unsigned long CCmManagerImpl::EasyWlanIdL(void) + ?EasyWlanIdL@RCmManager@@QBEKXZ @ 94 NONAME ; unsigned long RCmManager::EasyWlanIdL(void) const + ?EasyWlanIdL@RCmManagerExt@@QAEKXZ @ 95 NONAME ; unsigned long RCmManagerExt::EasyWlanIdL(void) + ?ElementId@RCmDestination@@QBEKXZ @ 96 NONAME ; unsigned long RCmDestination::ElementId(void) const + ?ElementId@RCmDestinationExt@@QAEKXZ @ 97 NONAME ; unsigned long RCmDestinationExt::ElementId(void) + ?EnableChargeCardL@CCmPluginBaseEng@@AAEXH@Z @ 98 NONAME ABSENT ; void CCmPluginBaseEng::EnableChargeCardL(int) + ?EnableLocationL@CCmPluginBaseEng@@AAEXH@Z @ 99 NONAME ABSENT ; void CCmPluginBaseEng::EnableLocationL(int) + ?EnableProxyL@CCmPluginBaseEng@@AAEXH@Z @ 100 NONAME ABSENT ; void CCmPluginBaseEng::EnableProxyL(int) + ?FeatureSupported@CCmPluginBaseEng@@SAHH@Z @ 101 NONAME ABSENT ; int CCmPluginBaseEng::FeatureSupported(int) + ?GetBearerInfoBoolL@CCmManagerImpl@@QBEHKK@Z @ 102 NONAME ABSENT ; int CCmManagerImpl::GetBearerInfoBoolL(unsigned long, unsigned long) const + ?GetBearerInfoBoolL@RCmManager@@QBEHKK@Z @ 103 NONAME ; int RCmManager::GetBearerInfoBoolL(unsigned long, unsigned long) const + ?GetBearerInfoBoolL@RCmManagerExt@@QBEHKK@Z @ 104 NONAME ; int RCmManagerExt::GetBearerInfoBoolL(unsigned long, unsigned long) const + ?GetBearerInfoIntL@CCmManagerImpl@@QBEKKK@Z @ 105 NONAME ABSENT ; unsigned long CCmManagerImpl::GetBearerInfoIntL(unsigned long, unsigned long) const + ?GetBearerInfoIntL@RCmManager@@QBEKKK@Z @ 106 NONAME ; unsigned long RCmManager::GetBearerInfoIntL(unsigned long, unsigned long) const + ?GetBearerInfoIntL@RCmManagerExt@@QBEKKK@Z @ 107 NONAME ; unsigned long RCmManagerExt::GetBearerInfoIntL(unsigned long, unsigned long) const + ?GetBearerInfoString8L@CCmManagerImpl@@QBEPAVHBufC8@@KK@Z @ 108 NONAME ABSENT ; class HBufC8 * CCmManagerImpl::GetBearerInfoString8L(unsigned long, unsigned long) const + ?GetBearerInfoString8L@RCmManager@@QBEPAVHBufC8@@KK@Z @ 109 NONAME ; class HBufC8 * RCmManager::GetBearerInfoString8L(unsigned long, unsigned long) const + ?GetBearerInfoString8L@RCmManagerExt@@QBEPAVHBufC8@@KK@Z @ 110 NONAME ; class HBufC8 * RCmManagerExt::GetBearerInfoString8L(unsigned long, unsigned long) const + ?GetBearerInfoStringL@CCmManagerImpl@@QBEPAVHBufC16@@KK@Z @ 111 NONAME ABSENT ; class HBufC16 * CCmManagerImpl::GetBearerInfoStringL(unsigned long, unsigned long) const + ?GetBearerInfoStringL@RCmManager@@QBEPAVHBufC16@@KK@Z @ 112 NONAME ; class HBufC16 * RCmManager::GetBearerInfoStringL(unsigned long, unsigned long) const + ?GetBearerInfoStringL@RCmManagerExt@@QBEPAVHBufC16@@KK@Z @ 113 NONAME ; class HBufC16 * RCmManagerExt::GetBearerInfoStringL(unsigned long, unsigned long) const + ?GetBoolAttributeL@CCmPluginBaseEng@@UBEHK@Z @ 114 NONAME ABSENT ; int CCmPluginBaseEng::GetBoolAttributeL(unsigned long) const + ?GetBoolAttributeL@RCmConnectionMethod@@QBEHK@Z @ 115 NONAME ; int RCmConnectionMethod::GetBoolAttributeL(unsigned long) const + ?GetBoolAttributeL@RCmConnectionMethodExt@@QBEHK@Z @ 116 NONAME ; int RCmConnectionMethodExt::GetBoolAttributeL(unsigned long) const + ?GetConnectionMethodInfoBoolL@CCmManagerImpl@@QBEHKK@Z @ 117 NONAME ABSENT ; int CCmManagerImpl::GetConnectionMethodInfoBoolL(unsigned long, unsigned long) const + ?GetConnectionMethodInfoBoolL@RCmManager@@QBEHKK@Z @ 118 NONAME ; int RCmManager::GetConnectionMethodInfoBoolL(unsigned long, unsigned long) const + ?GetConnectionMethodInfoBoolL@RCmManagerExt@@QBEHKK@Z @ 119 NONAME ; int RCmManagerExt::GetConnectionMethodInfoBoolL(unsigned long, unsigned long) const + ?GetConnectionMethodInfoIntL@CCmManagerImpl@@QBEKKK@Z @ 120 NONAME ABSENT ; unsigned long CCmManagerImpl::GetConnectionMethodInfoIntL(unsigned long, unsigned long) const + ?GetConnectionMethodInfoIntL@RCmManager@@QBEKKK@Z @ 121 NONAME ; unsigned long RCmManager::GetConnectionMethodInfoIntL(unsigned long, unsigned long) const + ?GetConnectionMethodInfoIntL@RCmManagerExt@@QBEKKK@Z @ 122 NONAME ; unsigned long RCmManagerExt::GetConnectionMethodInfoIntL(unsigned long, unsigned long) const + ?GetConnectionMethodInfoString8L@CCmManagerImpl@@QBEPAVHBufC8@@KK@Z @ 123 NONAME ABSENT ; class HBufC8 * CCmManagerImpl::GetConnectionMethodInfoString8L(unsigned long, unsigned long) const + ?GetConnectionMethodInfoString8L@RCmManager@@QBEPAVHBufC8@@KK@Z @ 124 NONAME ; class HBufC8 * RCmManager::GetConnectionMethodInfoString8L(unsigned long, unsigned long) const + ?GetConnectionMethodInfoString8L@RCmManagerExt@@QBEPAVHBufC8@@KK@Z @ 125 NONAME ; class HBufC8 * RCmManagerExt::GetConnectionMethodInfoString8L(unsigned long, unsigned long) const + ?GetConnectionMethodInfoStringL@CCmManagerImpl@@QBEPAVHBufC16@@KK@Z @ 126 NONAME ABSENT ; class HBufC16 * CCmManagerImpl::GetConnectionMethodInfoStringL(unsigned long, unsigned long) const + ?GetConnectionMethodInfoStringL@RCmManager@@QBEPAVHBufC16@@KK@Z @ 127 NONAME ; class HBufC16 * RCmManager::GetConnectionMethodInfoStringL(unsigned long, unsigned long) const + ?GetConnectionMethodInfoStringL@RCmManagerExt@@QBEPAVHBufC16@@KK@Z @ 128 NONAME ; class HBufC16 * RCmManagerExt::GetConnectionMethodInfoStringL(unsigned long, unsigned long) const + ?GetHelpContext@CmPluginBaseSettingsDlg@@UBEXAAVTCoeHelpContext@@@Z @ 129 NONAME ABSENT ; void CmPluginBaseSettingsDlg::GetHelpContext(class TCoeHelpContext &) const + ?GetIPv6DNSTypeL@CmPluginBaseSettingsDlg@@QAEHKK@Z @ 130 NONAME ABSENT ; int CmPluginBaseSettingsDlg::GetIPv6DNSTypeL(unsigned long, unsigned long) + ?GetIntAttributeL@CCmPluginBaseEng@@UBEKK@Z @ 131 NONAME ABSENT ; unsigned long CCmPluginBaseEng::GetIntAttributeL(unsigned long) const + ?GetIntAttributeL@RCmConnectionMethod@@QBEKK@Z @ 132 NONAME ; unsigned long RCmConnectionMethod::GetIntAttributeL(unsigned long) const + ?GetIntAttributeL@RCmConnectionMethodExt@@QBEKK@Z @ 133 NONAME ; unsigned long RCmConnectionMethodExt::GetIntAttributeL(unsigned long) const + ?GetString8AttributeL@CCmPluginBaseEng@@UBEPAVHBufC8@@K@Z @ 134 NONAME ABSENT ; class HBufC8 * CCmPluginBaseEng::GetString8AttributeL(unsigned long) const + ?GetString8AttributeL@RCmConnectionMethod@@QBEPAVHBufC8@@K@Z @ 135 NONAME ; class HBufC8 * RCmConnectionMethod::GetString8AttributeL(unsigned long) const + ?GetString8AttributeL@RCmConnectionMethodExt@@QBEPAVHBufC8@@K@Z @ 136 NONAME ; class HBufC8 * RCmConnectionMethodExt::GetString8AttributeL(unsigned long) const + ?GetStringAttributeL@CCmPluginBaseEng@@UBEPAVHBufC16@@K@Z @ 137 NONAME ABSENT ; class HBufC16 * CCmPluginBaseEng::GetStringAttributeL(unsigned long) const + ?GetStringAttributeL@RCmConnectionMethod@@QBEPAVHBufC16@@K@Z @ 138 NONAME ; class HBufC16 * RCmConnectionMethod::GetStringAttributeL(unsigned long) const + ?GetStringAttributeL@RCmConnectionMethodExt@@QBEPAVHBufC16@@K@Z @ 139 NONAME ; class HBufC16 * RCmConnectionMethodExt::GetStringAttributeL(unsigned long) const + ?GlobalBearerPriority@CCmPluginBaseEng@@IBEHABVTDesC16@@@Z @ 140 NONAME ABSENT ; int CCmPluginBaseEng::GlobalBearerPriority(class TDesC16 const &) const + ?GlobalUiBearerPriority@CCmPluginBaseEng@@IBEHABVTDesC16@@@Z @ 141 NONAME ABSENT ; int CCmPluginBaseEng::GlobalUiBearerPriority(class TDesC16 const &) const + ?HandleListBoxEventL@CmPluginBaseSettingsDlg@@MAEXPAVCEikListBox@@W4TListBoxEvent@MEikListBoxObserver@@@Z @ 142 NONAME ABSENT ; void CmPluginBaseSettingsDlg::HandleListBoxEventL(class CEikListBox *, enum MEikListBoxObserver::TListBoxEvent) + ?HandleListboxDataChangeL@CmPluginBaseSettingsDlg@@QAEXXZ @ 143 NONAME ABSENT ; void CmPluginBaseSettingsDlg::HandleListboxDataChangeL(void) + ?IAPRecordElementId@CCmPluginBaseEng@@QBEKXZ @ 144 NONAME ABSENT ; unsigned long CCmPluginBaseEng::IAPRecordElementId(void) const + ?IconL@CCmDestinationImpl@@QAEPAVCGulIcon@@XZ @ 145 NONAME ABSENT ; class CGulIcon * CCmDestinationImpl::IconL(void) + ?IconL@RCmDestination@@QBEPAVCGulIcon@@XZ @ 146 NONAME ABSENT ; class CGulIcon * RCmDestination::IconL(void) const + ?IconL@RCmDestinationExt@@QAEPAVCGulIcon@@XZ @ 147 NONAME ABSENT ; class CGulIcon * RCmDestinationExt::IconL(void) + ?Id@RCmDestination@@QBEKXZ @ 148 NONAME ; unsigned long RCmDestination::Id(void) const + ?Id@RCmDestinationExt@@QAEKXZ @ 149 NONAME ; unsigned long RCmDestinationExt::Id(void) + ?InitTextsL@CmPluginBaseSettingsDlg@@UAEXXZ @ 150 NONAME ABSENT ; void CmPluginBaseSettingsDlg::InitTextsL(void) + ?InitializeWithUiL@CCmPluginLanBase@@UAEHH@Z @ 151 NONAME ABSENT ; int CCmPluginLanBase::InitializeWithUiL(int) + ?IsConnectedL@CCmDestinationImpl@@QBEHXZ @ 152 NONAME ABSENT ; int CCmDestinationImpl::IsConnectedL(void) const + ?IsConnectedL@RCmDestination@@QBEHXZ @ 153 NONAME ; int RCmDestination::IsConnectedL(void) const + ?IsConnectedL@RCmDestinationExt@@QBEHXZ @ 154 NONAME ; int RCmDestinationExt::IsConnectedL(void) const + ?IsHidden@CCmDestinationImpl@@QAEHXZ @ 155 NONAME ABSENT ; int CCmDestinationImpl::IsHidden(void) + ?IsHidden@RCmDestination@@QBEHXZ @ 156 NONAME ; int RCmDestination::IsHidden(void) const + ?IsHidden@RCmDestinationExt@@QAEHXZ @ 157 NONAME ; int RCmDestinationExt::IsHidden(void) + ?IsProtected@CCmPluginBaseEng@@QBEHXZ @ 158 NONAME ABSENT ; int CCmPluginBaseEng::IsProtected(void) const + ?IsUnspecifiedIPv4Address@@YAHABVTDesC16@@@Z @ 159 NONAME ABSENT ; int IsUnspecifiedIPv4Address(class TDesC16 const &) + ?LoadL@CCmPluginBaseEng@@UAEXK@Z @ 160 NONAME ABSENT ; void CCmPluginBaseEng::LoadL(unsigned long) + ?LoadResourceL@CmPluginBaseSettingsDlg@@IAEHABVTDesC16@@@Z @ 161 NONAME ABSENT ; int CmPluginBaseSettingsDlg::LoadResourceL(class TDesC16 const &) + ?LoadServiceSettingL@CCmPluginBaseEng@@MAEXXZ @ 162 NONAME ABSENT ; void CCmPluginBaseEng::LoadServiceSettingL(void) + ?LoadServiceSettingL@CCmPluginLanBase@@UAEXXZ @ 163 NONAME ABSENT ; void CCmPluginLanBase::LoadServiceSettingL(void) + ?MetadataL@RCmDestination@@QBEKW4TSnapMetadataField@CMManager@@@Z @ 164 NONAME ; unsigned long RCmDestination::MetadataL(enum CMManager::TSnapMetadataField) const + ?MetadataL@RCmDestinationExt@@QBEKW4TSnapMetadataField@CMManager@@@Z @ 165 NONAME ; unsigned long RCmDestinationExt::MetadataL(enum CMManager::TSnapMetadataField) const + ?ModifyPriorityL@RCmDestinationExt@@QAEXAAVRCmConnectionMethodExt@@I@Z @ 166 NONAME ; void RCmDestinationExt::ModifyPriorityL(class RCmConnectionMethodExt &, unsigned int) + ?MoveConnectionMethodL@RCmManagerExt@@QAEHAAVRCmDestinationExt@@0AAVRCmConnectionMethodExt@@@Z @ 167 NONAME ; int RCmManagerExt::MoveConnectionMethodL(class RCmDestinationExt &, class RCmDestinationExt &, class RCmConnectionMethodExt &) + ?NameLC@CCmDestinationImpl@@QAEPAVHBufC16@@XZ @ 168 NONAME ABSENT ; class HBufC16 * CCmDestinationImpl::NameLC(void) + ?NameLC@RCmDestination@@QBEPAVHBufC16@@XZ @ 169 NONAME ; class HBufC16 * RCmDestination::NameLC(void) const + ?NameLC@RCmDestinationExt@@QAEPAVHBufC16@@XZ @ 170 NONAME ; class HBufC16 * RCmDestinationExt::NameLC(void) + ?NewL@CCmApplicationSettingsUi@@SAPAV1@XZ @ 171 NONAME ; class CCmApplicationSettingsUi * CCmApplicationSettingsUi::NewL(void) + ?NewL@CCmApplicationSettingsUiImpl@@SAPAV1@XZ @ 172 NONAME ABSENT ; class CCmApplicationSettingsUiImpl * CCmApplicationSettingsUiImpl::NewL(void) + ?NewL@CCmConnSettingsUiImpl@@SAPAV1@PAVCCmManagerImpl@@@Z @ 173 NONAME ABSENT ; class CCmConnSettingsUiImpl * CCmConnSettingsUiImpl::NewL(class CCmManagerImpl *) + ?NewL@CCmDestinationImpl@@SAPAV1@AAVCCmManagerImpl@@ABVTDesC16@@@Z @ 174 NONAME ABSENT ; class CCmDestinationImpl * CCmDestinationImpl::NewL(class CCmManagerImpl &, class TDesC16 const &) + ?NewL@CCmDestinationImpl@@SAPAV1@AAVCCmManagerImpl@@I@Z @ 175 NONAME ABSENT ; class CCmDestinationImpl * CCmDestinationImpl::NewL(class CCmManagerImpl &, unsigned int) + ?NewL@CCmPluginMultiLineDialog@@SAPAV1@AAVTDes16@@0W4TTone@CAknQueryDialog@@@Z @ 176 NONAME ABSENT ; class CCmPluginMultiLineDialog * CCmPluginMultiLineDialog::NewL(class TDes16 &, class TDes16 &, enum CAknQueryDialog::TTone) + ?NewL@CCmSettingsUi@@SAPAV1@XZ @ 177 NONAME ABSENT ; class CCmSettingsUi * CCmSettingsUi::NewL(void) + ?NewLC@CCmApplicationSettingsUi@@SAPAV1@XZ @ 178 NONAME ; class CCmApplicationSettingsUi * CCmApplicationSettingsUi::NewLC(void) + ?NumOfConnMethodReferencesL@CCmPluginBaseEng@@UAEHXZ @ 179 NONAME ABSENT ; int CCmPluginBaseEng::NumOfConnMethodReferencesL(void) + ?OkToExitL@CmPluginBaseSettingsDlg@@MAEHH@Z @ 180 NONAME ABSENT ; int CmPluginBaseSettingsDlg::OkToExitL(int) + ?OpenL@RCmManager@@QAEXXZ @ 181 NONAME ; void RCmManager::OpenL(void) + ?OpenL@RCmManagerExt@@QAEXXZ @ 182 NONAME ; void RCmManagerExt::OpenL(void) + ?OpenLC@RCmManager@@QAEXXZ @ 183 NONAME ; void RCmManager::OpenLC(void) + ?OpenLC@RCmManagerExt@@QAEXXZ @ 184 NONAME ; void RCmManagerExt::OpenLC(void) + ?PreLayoutDynInitL@CmPluginBaseSettingsDlg@@MAEXXZ @ 185 NONAME ABSENT ; void CmPluginBaseSettingsDlg::PreLayoutDynInitL(void) + ?PrepareToLoadRecordsL@CCmPluginBaseEng@@MAEXXZ @ 186 NONAME ABSENT ; void CCmPluginBaseEng::PrepareToLoadRecordsL(void) + ?PrepareToUpdateRecordsL@CCmPluginBaseEng@@MAEXXZ @ 187 NONAME ABSENT ; void CCmPluginBaseEng::PrepareToUpdateRecordsL(void) + ?PrepareToUpdateRecordsL@CCmPluginLanBase@@UAEXXZ @ 188 NONAME ABSENT ; void CCmPluginLanBase::PrepareToUpdateRecordsL(void) + ?PriorityL@CCmDestinationImpl@@QAEIAAVCCmPluginBaseEng@@@Z @ 189 NONAME ABSENT ; unsigned int CCmDestinationImpl::PriorityL(class CCmPluginBaseEng &) + ?PriorityL@RCmDestination@@QBEIABVRCmConnectionMethod@@@Z @ 190 NONAME ; unsigned int RCmDestination::PriorityL(class RCmConnectionMethod const &) const + ?PriorityL@RCmDestinationExt@@QAEIABVRCmConnectionMethodExt@@@Z @ 191 NONAME ; unsigned int RCmDestinationExt::PriorityL(class RCmConnectionMethodExt const &) + ?ProcessCommandL@CmPluginBaseSettingsDlg@@UAEXH@Z @ 192 NONAME ABSENT ; void CmPluginBaseSettingsDlg::ProcessCommandL(int) + ?ProtectionLevel@CCmDestinationImpl@@QAE?AW4TProtectionLevel@CMManager@@XZ @ 193 NONAME ABSENT ; enum CMManager::TProtectionLevel CCmDestinationImpl::ProtectionLevel(void) + ?ProtectionLevel@RCmDestination@@QBE?AW4TProtectionLevel@CMManager@@XZ @ 194 NONAME ; enum CMManager::TProtectionLevel RCmDestination::ProtectionLevel(void) const + ?ProtectionLevel@RCmDestinationExt@@QAE?AW4TProtectionLevel@CMManager@@XZ @ 195 NONAME ; enum CMManager::TProtectionLevel RCmDestinationExt::ProtectionLevel(void) + ?ReadDefConnL@RCmManager@@QAEXAAUTCmDefConnValue@@@Z @ 196 NONAME ; void RCmManager::ReadDefConnL(struct TCmDefConnValue &) + ?ReadDefConnL@RCmManagerExt@@QAEXAAUTCmDefConnValue@@@Z @ 197 NONAME ; void RCmManagerExt::ReadDefConnL(struct TCmDefConnValue &) + ?ReadOnlyAttributeL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 198 NONAME ABSENT ; int ReadOnlyAttributeL(class CCmPluginBaseEng *, unsigned long, void const *) + ?RemoveAllReferencesL@RCmManagerExt@@QAEXAAVRCmConnectionMethodExt@@@Z @ 199 NONAME ; void RCmManagerExt::RemoveAllReferencesL(class RCmConnectionMethodExt &) + ?RemoveCommonConversionTable@CCmPluginBaseEng@@IAEXPBUTCmCommonAttrConvArrayItem@@@Z @ 200 NONAME ABSENT ; void CCmPluginBaseEng::RemoveCommonConversionTable(struct TCmCommonAttrConvArrayItem const *) + ?RemoveConnectionMethodL@RCmDestinationExt@@QAEXVRCmConnectionMethodExt@@@Z @ 201 NONAME ; void RCmDestinationExt::RemoveConnectionMethodL(class RCmConnectionMethodExt) + ?RemoveConnectionMethodL@RCmManagerExt@@QAEXAAVRCmDestinationExt@@AAVRCmConnectionMethodExt@@@Z @ 202 NONAME ; void RCmManagerExt::RemoveConnectionMethodL(class RCmDestinationExt &, class RCmConnectionMethodExt &) + ?RemoveConversionTable@CCmPluginBaseEng@@IAEXPBUTCmAttribConvTable@@@Z @ 203 NONAME ABSENT ; void CCmPluginBaseEng::RemoveConversionTable(struct TCmAttribConvTable const *) + ?RemoveFromPool@CCmDestinationImpl@@QAEXXZ @ 204 NONAME ABSENT ; void CCmDestinationImpl::RemoveFromPool(void) + ?RemoveResourceFile@CCmPluginBaseEng@@IAEXABVTDesC16@@@Z @ 205 NONAME ABSENT ; void CCmPluginBaseEng::RemoveResourceFile(class TDesC16 const &) + ?Reset@CCmPluginBaseEng@@IAEXXZ @ 206 NONAME ABSENT ; void CCmPluginBaseEng::Reset(void) + ?RestoreAttributeL@CCmPluginBaseEng@@UAEXK@Z @ 207 NONAME ABSENT ; void CCmPluginBaseEng::RestoreAttributeL(unsigned long) + ?RunAdvancedSettingsL@CmPluginBaseSettingsDlgAdv@@UAEXXZ @ 208 NONAME ABSENT ; void CmPluginBaseSettingsDlgAdv::RunAdvancedSettingsL(void) + ?RunAdvancedSettingsL@CmPluginBaseSettingsDlgIp@@UAEXXZ @ 209 NONAME ABSENT ; void CmPluginBaseSettingsDlgIp::RunAdvancedSettingsL(void) + ?RunApplicationSettingsL@CCmApplicationSettingsUi@@QAEHAAUTCmSettingSelection@@@Z @ 210 NONAME ; int CCmApplicationSettingsUi::RunApplicationSettingsL(struct TCmSettingSelection &) + ?RunApplicationSettingsL@CCmApplicationSettingsUi@@QAEHAAUTCmSettingSelection@@IAAV?$RArray@K@@@Z @ 211 NONAME ; int CCmApplicationSettingsUi::RunApplicationSettingsL(struct TCmSettingSelection &, unsigned int, class RArray &) + ?RunApplicationSettingsL@CCmApplicationSettingsUiImpl@@QAEHAAUTCmSettingSelection@@@Z @ 212 NONAME ABSENT ; int CCmApplicationSettingsUiImpl::RunApplicationSettingsL(struct TCmSettingSelection &) + ?RunApplicationSettingsL@CCmConnSettingsUiImpl@@QAEHAAUTCmSettingSelection@@IAAV?$RArray@K@@@Z @ 213 NONAME ABSENT ; int CCmConnSettingsUiImpl::RunApplicationSettingsL(struct TCmSettingSelection &, unsigned int, class RArray &) + ?RunSettingsL@CCmPluginLanBase@@UAEHXZ @ 214 NONAME ABSENT ; int CCmPluginLanBase::RunSettingsL(void) + ?RunSettingsL@CCmSettingsUi@@QAE?AW4TResult@1@XZ @ 215 NONAME ABSENT ; enum CCmSettingsUi::TResult CCmSettingsUi::RunSettingsL(void) + ?SelectDestinationDlgL@CCmSettingsUi@@QAEHAAK@Z @ 216 NONAME ABSENT ; int CCmSettingsUi::SelectDestinationDlgL(unsigned long &) + ?SelectItem@CmPluginBaseSettingsDlg@@IAEXH@Z @ 217 NONAME ABSENT ; void CmPluginBaseSettingsDlg::SelectItem(int) + ?ServiceRecord@CCmPluginLanBase@@ABEAAVCCDLANServiceRecord@CommsDat@@XZ @ 218 NONAME ABSENT ; class CommsDat::CCDLANServiceRecord & CCmPluginLanBase::ServiceRecord(void) const + ?ServiceRecordIdLC@CCmPluginLanBase@@MAEXAAPAVHBufC16@@AAK@Z @ 219 NONAME ABSENT ; void CCmPluginLanBase::ServiceRecordIdLC(class HBufC16 * &, unsigned long &) + ?Session@CCmPluginBaseEng@@QBEAAVCMDBSession@CommsDat@@XZ @ 220 NONAME ABSENT ; class CommsDat::CMDBSession & CCmPluginBaseEng::Session(void) const + ?SetBoolAttributeL@CCmPluginBaseEng@@UAEXKH@Z @ 221 NONAME ABSENT ; void CCmPluginBaseEng::SetBoolAttributeL(unsigned long, int) + ?SetBoolAttributeL@RCmConnectionMethodExt@@QAEXKH@Z @ 222 NONAME ; void RCmConnectionMethodExt::SetBoolAttributeL(unsigned long, int) + ?SetDNSServerAddressL@CCmPluginBaseEng@@QAEXKABVTDesC16@@K0KH@Z @ 223 NONAME ABSENT ; void CCmPluginBaseEng::SetDNSServerAddressL(unsigned long, class TDesC16 const &, unsigned long, class TDesC16 const &, unsigned long, int) + ?SetHiddenL@CCmDestinationImpl@@QAEXH@Z @ 224 NONAME ABSENT ; void CCmDestinationImpl::SetHiddenL(int) + ?SetHiddenL@RCmDestinationExt@@QAEXH@Z @ 225 NONAME ; void RCmDestinationExt::SetHiddenL(int) + ?SetIconL@CCmDestinationImpl@@QAEXK@Z @ 226 NONAME ABSENT ; void CCmDestinationImpl::SetIconL(unsigned long) + ?SetIconL@RCmDestinationExt@@QAEXK@Z @ 227 NONAME ABSENT ; void RCmDestinationExt::SetIconL(unsigned long) + ?SetIntAttributeL@CCmPluginBaseEng@@UAEXKK@Z @ 228 NONAME ABSENT ; void CCmPluginBaseEng::SetIntAttributeL(unsigned long, unsigned long) + ?SetIntAttributeL@RCmConnectionMethodExt@@QAEXKK@Z @ 229 NONAME ; void RCmConnectionMethodExt::SetIntAttributeL(unsigned long, unsigned long) + ?SetMetadataL@RCmDestinationExt@@QAEXW4TSnapMetadataField@CMManager@@K@Z @ 230 NONAME ; void RCmDestinationExt::SetMetadataL(enum CMManager::TSnapMetadataField, unsigned long) + ?SetNameL@CCmDestinationImpl@@QAEXABVTDesC16@@@Z @ 231 NONAME ABSENT ; void CCmDestinationImpl::SetNameL(class TDesC16 const &) + ?SetNameL@RCmDestinationExt@@QAEXABVTDesC16@@@Z @ 232 NONAME ; void RCmDestinationExt::SetNameL(class TDesC16 const &) + ?SetProtectionL@CCmDestinationImpl@@QAEXW4TProtectionLevel@CMManager@@@Z @ 233 NONAME ABSENT ; void CCmDestinationImpl::SetProtectionL(enum CMManager::TProtectionLevel) + ?SetProtectionL@RCmDestinationExt@@QAEXW4TProtectionLevel@CMManager@@@Z @ 234 NONAME ; void RCmDestinationExt::SetProtectionL(enum CMManager::TProtectionLevel) + ?SetProxyServerNameL@@YAHPAVCCmPluginBaseEng@@KPBX@Z @ 235 NONAME ABSENT ; int SetProxyServerNameL(class CCmPluginBaseEng *, unsigned long, void const *) + ?SetString8AttributeL@CCmPluginBaseEng@@UAEXKABVTDesC8@@@Z @ 236 NONAME ABSENT ; void CCmPluginBaseEng::SetString8AttributeL(unsigned long, class TDesC8 const &) + ?SetString8AttributeL@RCmConnectionMethodExt@@QAEXKABVTDesC8@@@Z @ 237 NONAME ; void RCmConnectionMethodExt::SetString8AttributeL(unsigned long, class TDesC8 const &) + ?SetStringAttributeL@CCmPluginBaseEng@@UAEXKABVTDesC16@@@Z @ 238 NONAME ABSENT ; void CCmPluginBaseEng::SetStringAttributeL(unsigned long, class TDesC16 const &) + ?SetStringAttributeL@RCmConnectionMethodExt@@QAEXKABVTDesC16@@@Z @ 239 NONAME ; void RCmConnectionMethodExt::SetStringAttributeL(unsigned long, class TDesC16 const &) + ?ShowConfirmationQueryL@TCmCommonUi@@SAHH@Z @ 240 NONAME ABSENT ; int TCmCommonUi::ShowConfirmationQueryL(int) + ?ShowConfirmationQueryL@TCmCommonUi@@SAHHABVTDesC16@@@Z @ 241 NONAME ABSENT ; int TCmCommonUi::ShowConfirmationQueryL(int, class TDesC16 const &) + ?ShowConfirmationQueryWithInputL@TCmCommonUi@@SAHHAAVTDes16@@@Z @ 242 NONAME ABSENT ; int TCmCommonUi::ShowConfirmationQueryWithInputL(int, class TDes16 &) + ?ShowNoteL@TCmCommonUi@@SAHABVTDesC16@@W4TCmNoteType@1@@Z @ 243 NONAME ABSENT ; int TCmCommonUi::ShowNoteL(class TDesC16 const &, enum TCmCommonUi::TCmNoteType) + ?ShowNoteL@TCmCommonUi@@SAHHABVTDesC16@@W4TCmNoteType@1@@Z @ 244 NONAME ABSENT ; int TCmCommonUi::ShowNoteL(int, class TDesC16 const &, enum TCmCommonUi::TCmNoteType) + ?ShowNoteL@TCmCommonUi@@SAHHW4TCmNoteType@1@@Z @ 245 NONAME ABSENT ; int TCmCommonUi::ShowNoteL(int, enum TCmCommonUi::TCmNoteType) + ?ShowPopupIPv4DNSEditorL@CmPluginBaseSettingsDlg@@QAEHKKKK@Z @ 246 NONAME ABSENT ; int CmPluginBaseSettingsDlg::ShowPopupIPv4DNSEditorL(unsigned long, unsigned long, unsigned long, unsigned long) + ?ShowPopupIPv6DNSEditorL@CmPluginBaseSettingsDlg@@QAEHPBKKKK@Z @ 247 NONAME ABSENT ; int CmPluginBaseSettingsDlg::ShowPopupIPv6DNSEditorL(unsigned long const *, unsigned long, unsigned long, unsigned long) + ?ShowPopupIpSettingPageL@CmPluginBaseSettingsDlg@@QAEHKK@Z @ 248 NONAME ABSENT ; int CmPluginBaseSettingsDlg::ShowPopupIpSettingPageL(unsigned long, unsigned long) + ?ShowPopupListL@TCmCommonUi@@SAHABVTDesC16@@PAVCDesC16ArrayFlat@@PAV?$CArrayPtr@VCGulIcon@@@@IAAH@Z @ 249 NONAME ABSENT ; int TCmCommonUi::ShowPopupListL(class TDesC16 const &, class CDesC16ArrayFlat *, class CArrayPtr *, unsigned int, int &) + ?ShowPopupPasswordSettingPageL@CmPluginBaseSettingsDlg@@QAEHKK@Z @ 250 NONAME ABSENT ; int CmPluginBaseSettingsDlg::ShowPopupPasswordSettingPageL(unsigned long, unsigned long) + ?ShowPopupPortNumSettingPageL@CmPluginBaseSettingsDlg@@QAEHKK@Z @ 251 NONAME ABSENT ; int CmPluginBaseSettingsDlg::ShowPopupPortNumSettingPageL(unsigned long, unsigned long) + ?ShowPopupSettingPageL@CmPluginBaseSettingsDlg@@MAEHKH@Z @ 252 NONAME ABSENT ; int CmPluginBaseSettingsDlg::ShowPopupSettingPageL(unsigned long, int) + ?ShowPopupSettingPageL@CmPluginBaseSettingsDlgAdv@@MAEHHH@Z @ 253 NONAME ABSENT ; int CmPluginBaseSettingsDlgAdv::ShowPopupSettingPageL(int, int) + ?ShowPopupTextSettingPageL@CmPluginBaseSettingsDlg@@QAEHKK@Z @ 254 NONAME ABSENT ; int CmPluginBaseSettingsDlg::ShowPopupTextSettingPageL(unsigned long, unsigned long) + ?ShowRadioButtonSettingPageL@CmPluginBaseSettingsDlg@@QAEHAAVCDesC16ArrayFlat@@AAHK@Z @ 255 NONAME ABSENT ; int CmPluginBaseSettingsDlg::ShowRadioButtonSettingPageL(class CDesC16ArrayFlat &, int &, unsigned long) + ?ShowRadioButtonSettingPageL@CmPluginBaseSettingsDlg@@QAEHPBKAAHK@Z @ 256 NONAME ABSENT ; int CmPluginBaseSettingsDlg::ShowRadioButtonSettingPageL(unsigned long const *, int &, unsigned long) + ?StringAttributeWithDefaultL@CmPluginBaseSettingsDlg@@IAEPAVHBufC16@@KK@Z @ 257 NONAME ABSENT ; class HBufC16 * CmPluginBaseSettingsDlg::StringAttributeWithDefaultL(unsigned long, unsigned long) + ?SupportedBearersL@RCmManagerExt@@QBEXAAV?$RArray@K@@@Z @ 258 NONAME ; void RCmManagerExt::SupportedBearersL(class RArray &) const + ?UncategorizedIconL@RCmManagerExt@@QBEPAVCGulIcon@@XZ @ 259 NONAME ABSENT ; class CGulIcon * RCmManagerExt::UncategorizedIconL(void) const + ?UpdateBearerPriorityArrayL@RCmManagerExt@@QAEXABV?$RArray@VTBearerPriority@@@@@Z @ 260 NONAME ; void RCmManagerExt::UpdateBearerPriorityArrayL(class RArray const &) + ?UpdateL@CCmDestinationImpl@@QAEXXZ @ 261 NONAME ABSENT ; void CCmDestinationImpl::UpdateL(void) + ?UpdateL@CCmPluginBaseEng@@UAEXXZ @ 262 NONAME ABSENT ; void CCmPluginBaseEng::UpdateL(void) + ?UpdateL@RCmConnectionMethodExt@@QAEXXZ @ 263 NONAME ; void RCmConnectionMethodExt::UpdateL(void) + ?UpdateL@RCmDestinationExt@@QAEXXZ @ 264 NONAME ; void RCmDestinationExt::UpdateL(void) + ?UpdateListBoxContentL@CmPluginBaseSettingsDlg@@MAEXXZ @ 265 NONAME ABSENT ; void CmPluginBaseSettingsDlg::UpdateListBoxContentL(void) + ?UpdateListBoxContentL@CmPluginBaseSettingsDlgAdv@@MAEXXZ @ 266 NONAME ABSENT ; void CmPluginBaseSettingsDlgAdv::UpdateListBoxContentL(void) + ?UpdateListBoxContentL@CmPluginBaseSettingsDlgIp@@MAEXXZ @ 267 NONAME ABSENT ; void CmPluginBaseSettingsDlgIp::UpdateListBoxContentL(void) + ?UpdateProxyRecordL@CCmPluginBaseEng@@AAEXXZ @ 268 NONAME ABSENT ; void CCmPluginBaseEng::UpdateProxyRecordL(void) + ?UpdateServiceRecordL@CCmPluginBaseEng@@MAEXXZ @ 269 NONAME ABSENT ; void CCmPluginBaseEng::UpdateServiceRecordL(void) + ?WriteDefConnL@RCmManagerExt@@QAEXABUTCmDefConnValue@@@Z @ 270 NONAME ; void RCmManagerExt::WriteDefConnL(struct TCmDefConnValue const &) + ??0RCmDestination@@QAE@XZ @ 271 NONAME ; RCmDestination::RCmDestination(void) + ??0RCmDestinationExt@@QAE@XZ @ 272 NONAME ; RCmDestinationExt::RCmDestinationExt(void) + ??8RCmDestination@@QBEHABV0@@Z @ 273 NONAME ; int RCmDestination::operator==(class RCmDestination const &) const + ??8RCmDestinationExt@@QBEHABV0@@Z @ 274 NONAME ; int RCmDestinationExt::operator==(class RCmDestinationExt const &) const + ??9RCmDestination@@QBEHABV0@@Z @ 275 NONAME ; int RCmDestination::operator!=(class RCmDestination const &) const + ??9RCmDestinationExt@@QBEHABV0@@Z @ 276 NONAME ; int RCmDestinationExt::operator!=(class RCmDestinationExt const &) const + ??0CCmPluginBase@@QAE@PAVCCmPluginBaseEng@@@Z @ 277 NONAME ABSENT ; CCmPluginBase::CCmPluginBase(class CCmPluginBaseEng *) + ??1CCmPluginBase@@UAE@XZ @ 278 NONAME ABSENT ; CCmPluginBase::~CCmPluginBase(void) + ?AddResourceFileL@CCmPluginBase@@IAEXABVTDesC16@@@Z @ 279 NONAME ABSENT ; void CCmPluginBase::AddResourceFileL(class TDesC16 const &) + ?AllocReadL@CCmPluginBase@@IBEPAVHBufC16@@H@Z @ 280 NONAME ABSENT ; class HBufC16 * CCmPluginBase::AllocReadL(int) const + ?CmMgr@CCmPluginBase@@QBEAAVCCmManagerImpl@@XZ @ 281 NONAME ABSENT ; class CCmManagerImpl & CCmPluginBase::CmMgr(void) const + ?ConstructL@CCmPluginBase@@IAEXXZ @ 282 NONAME ABSENT ; void CCmPluginBase::ConstructL(void) + ?CreateCopyL@CCmPluginBase@@QBEPAV1@XZ @ 283 NONAME ABSENT ; class CCmPluginBase * CCmPluginBase::CreateCopyL(void) const + ?CreateNewL@CCmPluginBase@@QAEXXZ @ 284 NONAME ABSENT ; void CCmPluginBase::CreateNewL(void) + ?DeleteL@CCmPluginBase@@QAEHHH@Z @ 285 NONAME ABSENT ; int CCmPluginBase::DeleteL(int, int) + ?Destination@CCmPluginBase@@QBEPAVCCmDestinationImpl@@XZ @ 286 NONAME ABSENT ; class CCmDestinationImpl * CCmPluginBase::Destination(void) const + ?EnableChargeCardL@CCmPluginBase@@AAEXH@Z @ 287 NONAME ABSENT ; void CCmPluginBase::EnableChargeCardL(int) + ?EnableLocationL@CCmPluginBase@@AAEXH@Z @ 288 NONAME ABSENT ; void CCmPluginBase::EnableLocationL(int) + ?EnableProxyL@CCmPluginBase@@AAEXH@Z @ 289 NONAME ABSENT ; void CCmPluginBase::EnableProxyL(int) + ?GetBoolAttributeL@CCmPluginBase@@QBEHK@Z @ 290 NONAME ABSENT ; int CCmPluginBase::GetBoolAttributeL(unsigned long) const + ?GetConnectionMethodL@CCmDestinationImpl@@QAEPAVCCmPluginBase@@H@Z @ 291 NONAME ABSENT ; class CCmPluginBase * CCmDestinationImpl::GetConnectionMethodL(int) + ?GetConnectionMethodL@CCmManagerImpl@@QAEPAVCCmPluginBase@@K@Z @ 292 NONAME ABSENT ; class CCmPluginBase * CCmManagerImpl::GetConnectionMethodL(unsigned long) + ?GetIntAttributeL@CCmPluginBase@@QBEKK@Z @ 293 NONAME ABSENT ; unsigned long CCmPluginBase::GetIntAttributeL(unsigned long) const + ?GetString8AttributeL@CCmPluginBase@@QBEPAVHBufC8@@K@Z @ 294 NONAME ABSENT ; class HBufC8 * CCmPluginBase::GetString8AttributeL(unsigned long) const + ?GetStringAttributeL@CCmPluginBase@@QBEPAVHBufC16@@K@Z @ 295 NONAME ABSENT ; class HBufC16 * CCmPluginBase::GetStringAttributeL(unsigned long) const + ?IAPRecordElementId@CCmPluginBase@@QBEKXZ @ 296 NONAME ABSENT ; unsigned long CCmPluginBase::IAPRecordElementId(void) const + ?LoadL@CCmPluginBase@@QAEXK@Z @ 297 NONAME ABSENT ; void CCmPluginBase::LoadL(unsigned long) + ?LoadServiceSettingL@CCmPluginBase@@IAEXXZ @ 298 NONAME ABSENT ; void CCmPluginBase::LoadServiceSettingL(void) + ?NumOfConnMethodReferencesL@CCmPluginBase@@QAEHXZ @ 299 NONAME ABSENT ; int CCmPluginBase::NumOfConnMethodReferencesL(void) + ?ParentDestination@CCmPluginBase@@QBEPAVCCmDestinationImpl@@XZ @ 300 NONAME ABSENT ; class CCmDestinationImpl * CCmPluginBase::ParentDestination(void) const + ?Plugin@CCmPluginBase@@QBEPAVCCmPluginBaseEng@@XZ @ 301 NONAME ABSENT ; class CCmPluginBaseEng * CCmPluginBase::Plugin(void) const + ?PrepareToLoadRecordsL@CCmPluginBase@@IAEXXZ @ 302 NONAME ABSENT ; void CCmPluginBase::PrepareToLoadRecordsL(void) + ?PrepareToUpdateRecordsL@CCmPluginBase@@IAEXXZ @ 303 NONAME ABSENT ; void CCmPluginBase::PrepareToUpdateRecordsL(void) + ?RemoveResourceFile@CCmPluginBase@@IAEXABVTDesC16@@@Z @ 304 NONAME ABSENT ; void CCmPluginBase::RemoveResourceFile(class TDesC16 const &) + ?RestoreAttributeL@CCmPluginBase@@QAEXK@Z @ 305 NONAME ABSENT ; void CCmPluginBase::RestoreAttributeL(unsigned long) + ?Session@CCmPluginBase@@QBEAAVCMDBSession@CommsDat@@XZ @ 306 NONAME ABSENT ; class CommsDat::CMDBSession & CCmPluginBase::Session(void) const + ?SetBoolAttributeL@CCmPluginBase@@QAEXKH@Z @ 307 NONAME ABSENT ; void CCmPluginBase::SetBoolAttributeL(unsigned long, int) + ?SetIntAttributeL@CCmPluginBase@@QAEXKK@Z @ 308 NONAME ABSENT ; void CCmPluginBase::SetIntAttributeL(unsigned long, unsigned long) + ?SetString8AttributeL@CCmPluginBase@@QAEXKABVTDesC8@@@Z @ 309 NONAME ABSENT ; void CCmPluginBase::SetString8AttributeL(unsigned long, class TDesC8 const &) + ?SetStringAttributeL@CCmPluginBase@@QAEXKABVTDesC16@@@Z @ 310 NONAME ABSENT ; void CCmPluginBase::SetStringAttributeL(unsigned long, class TDesC16 const &) + ?UpdateL@CCmPluginBase@@QAEXXZ @ 311 NONAME ABSENT ; void CCmPluginBase::UpdateL(void) + ?UpdateProxyRecordL@CCmPluginBase@@AAEXXZ @ 312 NONAME ABSENT ; void CCmPluginBase::UpdateProxyRecordL(void) + ?UpdateServiceRecordL@CCmPluginBase@@IAEXXZ @ 313 NONAME ABSENT ; void CCmPluginBase::UpdateServiceRecordL(void) + ??0RCmConnectionMethod@@QAE@XZ @ 314 NONAME ; RCmConnectionMethod::RCmConnectionMethod(void) + ??0RCmConnectionMethodExt@@QAE@XZ @ 315 NONAME ; RCmConnectionMethodExt::RCmConnectionMethodExt(void) + ??4RCmConnectionMethod@@QAEAAV0@ABV0@@Z @ 316 NONAME ; class RCmConnectionMethod & RCmConnectionMethod::operator=(class RCmConnectionMethod const &) + ??4RCmConnectionMethodExt@@QAEAAV0@ABV0@@Z @ 317 NONAME ; class RCmConnectionMethodExt & RCmConnectionMethodExt::operator=(class RCmConnectionMethodExt const &) + ??8RCmConnectionMethod@@QBEHAAV0@@Z @ 318 NONAME ; int RCmConnectionMethod::operator==(class RCmConnectionMethod &) const + ??8RCmConnectionMethodExt@@QBEHAAV0@@Z @ 319 NONAME ; int RCmConnectionMethodExt::operator==(class RCmConnectionMethodExt &) const + ??9RCmConnectionMethod@@QBEHAAV0@@Z @ 320 NONAME ; int RCmConnectionMethod::operator!=(class RCmConnectionMethod &) const + ??9RCmConnectionMethodExt@@QBEHAAV0@@Z @ 321 NONAME ; int RCmConnectionMethodExt::operator!=(class RCmConnectionMethodExt &) const + ??1RCmConnectionMethod@@QAE@XZ @ 322 NONAME ; RCmConnectionMethod::~RCmConnectionMethod(void) + ??1RCmConnectionMethodExt@@QAE@XZ @ 323 NONAME ; RCmConnectionMethodExt::~RCmConnectionMethodExt(void) + ?ClearDestinationArrayToUse@CCmConnSettingsUiImpl@@QAEXXZ @ 324 NONAME ABSENT ; void CCmConnSettingsUiImpl::ClearDestinationArrayToUse(void) + ?SetDestinationArrayToUseL@CCmConnSettingsUiImpl@@QAEXV?$RArray@K@@@Z @ 325 NONAME ABSENT ; void CCmConnSettingsUiImpl::SetDestinationArrayToUseL(class RArray) + ?GetAdditionalUids@CCmPluginBase@@QAEXAAV?$RArray@K@@@Z @ 326 NONAME ABSENT ; void CCmPluginBase::GetAdditionalUids(class RArray &) + ?GetAdditionalUids@CCmPluginBaseEng@@UAEXAAV?$RArray@K@@@Z @ 327 NONAME ABSENT ; void CCmPluginBaseEng::GetAdditionalUids(class RArray &) + ?WrapCmManager@CCmManagerImpl@@QAEXAAVRCmManagerExt@@@Z @ 328 NONAME ABSENT ; void CCmManagerImpl::WrapCmManager(class RCmManagerExt &) + ?CombineArraysForPriorityOrderL@CCmManagerImpl@@AAEXAAV?$RPointerArray@VCCmPluginBase@@@@0@Z @ 329 NONAME ABSENT ; void CCmManagerImpl::CombineArraysForPriorityOrderL(class RPointerArray &, class RPointerArray &) + ?CreateFlatCMListL@CCmManagerImpl@@QAEXKAAV?$RPointerArray@VCCmPluginBase@@@@@Z @ 330 NONAME ABSENT ; void CCmManagerImpl::CreateFlatCMListL(unsigned long, class RPointerArray &) + ?FilterOutVirtualsL@CCmManagerImpl@@QAEXAAV?$RPointerArray@VCCmPluginBase@@@@@Z @ 331 NONAME ABSENT ; void CCmManagerImpl::FilterOutVirtualsL(class RPointerArray &) + ?CreateFlatCMListLC@CCmManagerImpl@@QAEXKAAV?$RPointerArray@VCCmPluginBase@@@@@Z @ 332 NONAME ABSENT ; void CCmManagerImpl::CreateFlatCMListLC(unsigned long, class RPointerArray &) + ??0RCmConnectionMethod@@QAE@ABV0@@Z @ 333 NONAME ; RCmConnectionMethod::RCmConnectionMethod(class RCmConnectionMethod const &) + ??0RCmConnectionMethodExt@@QAE@ABV0@@Z @ 334 NONAME ; RCmConnectionMethodExt::RCmConnectionMethodExt(class RCmConnectionMethodExt const &) + ?IsLinkedToIap@CCmPluginBase@@QAEHK@Z @ 335 NONAME ABSENT ; int CCmPluginBase::IsLinkedToIap(unsigned long) + ?IsLinkedToSnap@CCmPluginBase@@QAEHK@Z @ 336 NONAME ABSENT ; int CCmPluginBase::IsLinkedToSnap(unsigned long) + ?ParentDestination@CCmPluginBaseEng@@QBEPAVCCmDestinationImpl@@XZ @ 337 NONAME ABSENT ; class CCmDestinationImpl * CCmPluginBaseEng::ParentDestination(void) const + ?CreateTablesAndOpenL@RCmManagerExt@@QAEXXZ @ 338 NONAME ; void RCmManagerExt::CreateTablesAndOpenL(void) + ?CreateConnectionMethodL@RCmDestinationExt@@QAE?AVRCmConnectionMethodExt@@KK@Z @ 339 NONAME ; class RCmConnectionMethodExt RCmDestinationExt::CreateConnectionMethodL(unsigned long, unsigned long) + ?CreateConnectionMethodL@RCmManagerExt@@QAE?AVRCmConnectionMethodExt@@KK@Z @ 340 NONAME ; class RCmConnectionMethodExt RCmManagerExt::CreateConnectionMethodL(unsigned long, unsigned long) + ?CreateDestinationL@RCmManagerExt@@QAE?AVRCmDestinationExt@@ABVTDesC16@@K@Z @ 341 NONAME ; class RCmDestinationExt RCmManagerExt::CreateDestinationL(class TDesC16 const &, unsigned long) + ?SetPreDefinedId@CCmPluginBaseEng@@QAEXK@Z @ 342 NONAME ABSENT ; void CCmPluginBaseEng::SetPreDefinedId(unsigned long) + ?HandleResourceChange@CmPluginBaseSettingsDlg@@UAEXH@Z @ 343 NONAME ABSENT ; void CmPluginBaseSettingsDlg::HandleResourceChange(int) + ?Execute@CmPluginBaseSettingsDlg@@UAEXXZ @ 344 NONAME ABSENT ; void CmPluginBaseSettingsDlg::Execute(void) + ?CheckSpaceBelowCriticalLevelL@CCmPluginBaseEng@@QBEHXZ @ 345 NONAME ABSENT ; int CCmPluginBaseEng::CheckSpaceBelowCriticalLevelL(void) const + ?HandleLeaveError@CmPluginBaseSettingsDlg@@UAEXH@Z @ 346 NONAME ABSENT ; void CmPluginBaseSettingsDlg::HandleLeaveError(int) + ?AddConnectionMethodL@RCmDestination@@QAEHVRCmConnectionMethod@@@Z @ 347 NONAME ; int RCmDestination::AddConnectionMethodL(class RCmConnectionMethod) + ?AddEmbeddedDestinationL@RCmDestination@@QAEHABV1@@Z @ 348 NONAME ; int RCmDestination::AddEmbeddedDestinationL(class RCmDestination const &) + ?CopyConnectionMethodL@RCmManager@@QAEHAAVRCmDestination@@AAVRCmConnectionMethod@@@Z @ 349 NONAME ; int RCmManager::CopyConnectionMethodL(class RCmDestination &, class RCmConnectionMethod &) + ?CreateConnectionMethodL@RCmDestination@@QAE?AVRCmConnectionMethod@@K@Z @ 350 NONAME ; class RCmConnectionMethod RCmDestination::CreateConnectionMethodL(unsigned long) + ?CreateConnectionMethodL@RCmDestination@@QAE?AVRCmConnectionMethod@@KK@Z @ 351 NONAME ; class RCmConnectionMethod RCmDestination::CreateConnectionMethodL(unsigned long, unsigned long) + ?CreateConnectionMethodL@RCmManager@@QAE?AVRCmConnectionMethod@@K@Z @ 352 NONAME ; class RCmConnectionMethod RCmManager::CreateConnectionMethodL(unsigned long) + ?CreateConnectionMethodL@RCmManager@@QAE?AVRCmConnectionMethod@@KK@Z @ 353 NONAME ; class RCmConnectionMethod RCmManager::CreateConnectionMethodL(unsigned long, unsigned long) + ?CreateCopyL@RCmConnectionMethod@@QAE?AV1@XZ @ 354 NONAME ; class RCmConnectionMethod RCmConnectionMethod::CreateCopyL(void) + ?CreateDestinationL@RCmManager@@QAE?AVRCmDestination@@ABVTDesC16@@@Z @ 355 NONAME ; class RCmDestination RCmManager::CreateDestinationL(class TDesC16 const &) + ?CreateDestinationL@RCmManager@@QAE?AVRCmDestination@@ABVTDesC16@@K@Z @ 356 NONAME ; class RCmDestination RCmManager::CreateDestinationL(class TDesC16 const &, unsigned long) + ?CreateTablesAndOpenL@RCmManager@@QAEXXZ @ 357 NONAME ; void RCmManager::CreateTablesAndOpenL(void) + ?DeleteConnectionMethodL@RCmDestination@@QAEXAAVRCmConnectionMethod@@@Z @ 358 NONAME ; void RCmDestination::DeleteConnectionMethodL(class RCmConnectionMethod &) + ?DeleteL@RCmConnectionMethod@@QAEHXZ @ 359 NONAME ; int RCmConnectionMethod::DeleteL(void) + ?DeleteLD@RCmDestination@@QAEXXZ @ 360 NONAME ; void RCmDestination::DeleteLD(void) + ?ModifyPriorityL@RCmDestination@@QAEXAAVRCmConnectionMethod@@I@Z @ 361 NONAME ; void RCmDestination::ModifyPriorityL(class RCmConnectionMethod &, unsigned int) + ?MoveConnectionMethodL@RCmManager@@QAEHAAVRCmDestination@@0AAVRCmConnectionMethod@@@Z @ 362 NONAME ; int RCmManager::MoveConnectionMethodL(class RCmDestination &, class RCmDestination &, class RCmConnectionMethod &) + ?RemoveAllReferencesL@RCmManager@@QAEXAAVRCmConnectionMethod@@@Z @ 363 NONAME ; void RCmManager::RemoveAllReferencesL(class RCmConnectionMethod &) + ?RemoveConnectionMethodL@RCmDestination@@QAEXVRCmConnectionMethod@@@Z @ 364 NONAME ; void RCmDestination::RemoveConnectionMethodL(class RCmConnectionMethod) + ?RemoveConnectionMethodL@RCmManager@@QAEXAAVRCmDestination@@AAVRCmConnectionMethod@@@Z @ 365 NONAME ; void RCmManager::RemoveConnectionMethodL(class RCmDestination &, class RCmConnectionMethod &) + ?SetBoolAttributeL@RCmConnectionMethod@@QAEXKH@Z @ 366 NONAME ; void RCmConnectionMethod::SetBoolAttributeL(unsigned long, int) + ?SetHiddenL@RCmDestination@@QAEXH@Z @ 367 NONAME ; void RCmDestination::SetHiddenL(int) + ?SetIconL@RCmDestination@@QAEXK@Z @ 368 NONAME ABSENT ; void RCmDestination::SetIconL(unsigned long) + ?SetIntAttributeL@RCmConnectionMethod@@QAEXKK@Z @ 369 NONAME ; void RCmConnectionMethod::SetIntAttributeL(unsigned long, unsigned long) + ?SetMetadataL@RCmDestination@@QAEXW4TSnapMetadataField@CMManager@@K@Z @ 370 NONAME ; void RCmDestination::SetMetadataL(enum CMManager::TSnapMetadataField, unsigned long) + ?SetNameL@RCmDestination@@QAEXABVTDesC16@@@Z @ 371 NONAME ; void RCmDestination::SetNameL(class TDesC16 const &) + ?SetProtectionL@RCmDestination@@QAEXW4TProtectionLevel@CMManager@@@Z @ 372 NONAME ; void RCmDestination::SetProtectionL(enum CMManager::TProtectionLevel) + ?SetString8AttributeL@RCmConnectionMethod@@QAEXKABVTDesC8@@@Z @ 373 NONAME ; void RCmConnectionMethod::SetString8AttributeL(unsigned long, class TDesC8 const &) + ?SetStringAttributeL@RCmConnectionMethod@@QAEXKABVTDesC16@@@Z @ 374 NONAME ; void RCmConnectionMethod::SetStringAttributeL(unsigned long, class TDesC16 const &) + ?SupportedBearersL@RCmManager@@QBEXAAV?$RArray@K@@@Z @ 375 NONAME ; void RCmManager::SupportedBearersL(class RArray &) const + ?UncategorizedIconL@RCmManager@@QBEPAVCGulIcon@@XZ @ 376 NONAME ABSENT ; class CGulIcon * RCmManager::UncategorizedIconL(void) const + ?UpdateBearerPriorityArrayL@RCmManager@@QAEXABV?$RArray@VTBearerPriority@@@@@Z @ 377 NONAME ; void RCmManager::UpdateBearerPriorityArrayL(class RArray const &) + ?UpdateL@RCmConnectionMethod@@QAEXXZ @ 378 NONAME ; void RCmConnectionMethod::UpdateL(void) + ?UpdateL@RCmDestination@@QAEXXZ @ 379 NONAME ; void RCmDestination::UpdateL(void) + ?WriteDefConnL@RCmManager@@QAEXABUTCmDefConnValue@@@Z @ 380 NONAME ; void RCmManager::WriteDefConnL(struct TCmDefConnValue const &) + ?WriteGenConnSettingsL@RCmManager@@QAEXABUTCmGenConnSettings@@@Z @ 381 NONAME ; void RCmManager::WriteGenConnSettingsL(struct TCmGenConnSettings const &) + ?ReadGenConnSettingsL@RCmManager@@QAEXAAUTCmGenConnSettings@@@Z @ 382 NONAME ; void RCmManager::ReadGenConnSettingsL(struct TCmGenConnSettings &) + ?WatcherRegisterL@CCmManagerImpl@@QAEXPAVMCmCommsDatWatcher@@@Z @ 383 NONAME ABSENT ; void CCmManagerImpl::WatcherRegisterL(class MCmCommsDatWatcher *) + ?DestinationStillExistedL@CCmManagerImpl@@QAEHPAVCCmDestinationImpl@@@Z @ 384 NONAME ABSENT ; int CCmManagerImpl::DestinationStillExistedL(class CCmDestinationImpl *) + ?IsIapStillInDestL@CCmManagerImpl@@QAEHPAVCCmDestinationImpl@@ABVCCmPluginBaseEng@@@Z @ 385 NONAME ABSENT ; int CCmManagerImpl::IsIapStillInDestL(class CCmDestinationImpl *, class CCmPluginBaseEng const &) + ?IapStillExistedL@CCmManagerImpl@@QAEHABVCCmPluginBaseEng@@@Z @ 386 NONAME ABSENT ; int CCmManagerImpl::IapStillExistedL(class CCmPluginBaseEng const &) + ?WatcherUnRegister@CCmManagerImpl@@QAEXXZ @ 387 NONAME ABSENT ; void CCmManagerImpl::WatcherUnRegister(void) + ?RemoveDestFromPool@CCmManagerImpl@@QAEXPAVCCmDestinationImpl@@@Z @ 388 NONAME ABSENT ; void CCmManagerImpl::RemoveDestFromPool(class CCmDestinationImpl *) + ?OfferKeyEventL@CmPluginBaseSettingsDlg@@MAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 389 NONAME ABSENT ; enum TKeyResponse CmPluginBaseSettingsDlg::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode) + ?GetUncategorizedIconL@RCmManager@@QBEPAVHBufC16@@XZ @ 390 NONAME ; class HBufC16 * RCmManager::GetUncategorizedIconL(void) const + ?GetIconL@RCmDestination@@QBEPAVHBufC16@@XZ @ 391 NONAME ; class HBufC16 * RCmDestination::GetIconL(void) const + ?GetIconL@RCmConnectionMethod@@QBEPAVHBufC16@@XZ @ 392 NONAME ; class HBufC16 * RCmConnectionMethod::GetIconL(void) const + ?SetIconL@RCmConnectionMethod@@QAEXABVTDesC16@@@Z @ 393 NONAME ; void RCmConnectionMethod::SetIconL(class TDesC16 const &) + ?SetIconL@RCmDestination@@QAEXABVTDesC16@@@Z @ 394 NONAME ; void RCmDestination::SetIconL(class TDesC16 const &) + ?RefreshL@RCmConnectionMethod@@QAEXXZ @ 395 NONAME ; void RCmConnectionMethod::RefreshL(void) + ?RefreshL@RCmDestination@@QAEXXZ @ 396 NONAME ; void RCmDestination::RefreshL(void) + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/EABI/CmManager_prot_setupU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/EABI/CmManager_prot_setupU.def Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,445 @@ +EXPORTS + _Z18CheckIPv4ValidityLP16CCmPluginBaseEngmPKv @ 1 NONAME ABSENT + _Z18CheckIPv6ValidityLP16CCmPluginBaseEngmPKv @ 2 NONAME ABSENT + _Z18ReadOnlyAttributeLP16CCmPluginBaseEngmPKv @ 3 NONAME ABSENT + _Z19ClassifyIPv6AddressRK7TDesC16 @ 4 NONAME ABSENT + _Z19SetProxyServerNameLP16CCmPluginBaseEngmPKv @ 5 NONAME ABSENT + _Z22CheckRecordIdValidityLP16CCmPluginBaseEngmPKv @ 6 NONAME ABSENT + _Z24CheckPortNumberValidityLP16CCmPluginBaseEngmPKv @ 7 NONAME ABSENT + _Z24IsUnspecifiedIPv4AddressRK7TDesC16 @ 8 NONAME ABSENT + _Z26CheckWAPWspOptionValidityLP16CCmPluginBaseEngmPKv @ 9 NONAME ABSENT + _ZN10RCmManager12ReadDefConnLER15TCmDefConnValue @ 10 NONAME + _ZN10RCmManager5CloseEv @ 11 NONAME + _ZN10RCmManager5OpenLEv @ 12 NONAME + _ZN10RCmManager6OpenLCEv @ 13 NONAME + _ZN11TCmCommonUi14ShowPopupListLERK7TDesC16P16CDesC16ArrayFlatP9CArrayPtrI8CGulIconEjRi @ 14 NONAME ABSENT + _ZN11TCmCommonUi22ShowConfirmationQueryLEi @ 15 NONAME ABSENT + _ZN11TCmCommonUi22ShowConfirmationQueryLEiRK7TDesC16 @ 16 NONAME ABSENT + _ZN11TCmCommonUi31ShowConfirmationQueryWithInputLEiR6TDes16 @ 17 NONAME ABSENT + _ZN11TCmCommonUi9ShowNoteLERK7TDesC16NS_11TCmNoteTypeE @ 18 NONAME ABSENT + _ZN11TCmCommonUi9ShowNoteLEiNS_11TCmNoteTypeE @ 19 NONAME ABSENT + _ZN11TCmCommonUi9ShowNoteLEiRK7TDesC16NS_11TCmNoteTypeE @ 20 NONAME ABSENT + _ZN13CCmSettingsUi12RunSettingsLEv @ 21 NONAME ABSENT + _ZN13CCmSettingsUi21SelectDestinationDlgLERm @ 22 NONAME ABSENT + _ZN13CCmSettingsUi4NewLEv @ 23 NONAME ABSENT + _ZN13CCmSettingsUiD0Ev @ 24 NONAME ABSENT + _ZN13CCmSettingsUiD1Ev @ 25 NONAME ABSENT + _ZN13CCmSettingsUiD2Ev @ 26 NONAME ABSENT + _ZN13RCmManagerExt11EasyWlanIdLEv @ 27 NONAME + _ZN13RCmManagerExt12DestinationLEm @ 28 NONAME + _ZN13RCmManagerExt12ReadDefConnLER15TCmDefConnValue @ 29 NONAME + _ZN13RCmManagerExt13WriteDefConnLERK15TCmDefConnValue @ 30 NONAME + _ZN13RCmManagerExt16AllDestinationsLER6RArrayImE @ 31 NONAME + _ZN13RCmManagerExt17ConnectionMethodLER6RArrayImEiii @ 32 NONAME + _ZN13RCmManagerExt17ConnectionMethodLEm @ 33 NONAME + _ZN13RCmManagerExt18CreateDestinationLERK7TDesC16 @ 34 NONAME + _ZN13RCmManagerExt20RemoveAllReferencesLER22RCmConnectionMethodExt @ 35 NONAME + _ZN13RCmManagerExt21CopyConnectionMethodLER17RCmDestinationExtR22RCmConnectionMethodExt @ 36 NONAME + _ZN13RCmManagerExt21MoveConnectionMethodLER17RCmDestinationExtS1_R22RCmConnectionMethodExt @ 37 NONAME + _ZN13RCmManagerExt23CreateConnectionMethodLEm @ 38 NONAME + _ZN13RCmManagerExt23RemoveConnectionMethodLER17RCmDestinationExtR22RCmConnectionMethodExt @ 39 NONAME + _ZN13RCmManagerExt26UpdateBearerPriorityArrayLERK6RArrayI15TBearerPriorityE @ 40 NONAME + _ZN13RCmManagerExt5CloseEv @ 41 NONAME + _ZN13RCmManagerExt5OpenLEv @ 42 NONAME + _ZN13RCmManagerExt6OpenLCEv @ 43 NONAME + _ZN14CCmManagerImpl11EasyWlanIdLEv @ 44 NONAME ABSENT + _ZN14CCmManagerImpl12DestinationLEm @ 45 NONAME ABSENT + _ZN14CCmManagerImpl16AllDestinationsLER6RArrayImE @ 46 NONAME ABSENT + _ZN14CCmManagerImpl17ConnectionMethodLER6RArrayImEiiii @ 47 NONAME ABSENT + _ZN14CCmManagerImpl17ConnectionMethodLEm @ 48 NONAME ABSENT + _ZN14RCmDestination5CloseEv @ 49 NONAME + _ZN14RCmDestinationC1ERKS_ @ 50 NONAME + _ZN14RCmDestinationC2ERKS_ @ 51 NONAME + _ZN14RCmDestinationD1Ev @ 52 NONAME + _ZN14RCmDestinationD2Ev @ 53 NONAME + _ZN14RCmDestinationaSERKS_ @ 54 NONAME + _ZN16CCmPluginBaseEng10ConstructLEv @ 55 NONAME ABSENT + _ZN16CCmPluginBaseEng10CreateNewLEv @ 56 NONAME ABSENT + _ZN16CCmPluginBaseEng12EnableProxyLEi @ 57 NONAME ABSENT + _ZN16CCmPluginBaseEng13ConvTableItemEm @ 58 NONAME ABSENT + _ZN16CCmPluginBaseEng15EnableLocationLEi @ 59 NONAME ABSENT + _ZN16CCmPluginBaseEng16AddResourceFileLERK7TDesC16 @ 60 NONAME ABSENT + _ZN16CCmPluginBaseEng16FeatureSupportedEi @ 61 NONAME ABSENT + _ZN16CCmPluginBaseEng16SetIntAttributeLEmm @ 62 NONAME ABSENT + _ZN16CCmPluginBaseEng17EnableChargeCardLEi @ 63 NONAME ABSENT + _ZN16CCmPluginBaseEng17RestoreAttributeLEm @ 64 NONAME ABSENT + _ZN16CCmPluginBaseEng17SetBoolAttributeLEmi @ 65 NONAME ABSENT + _ZN16CCmPluginBaseEng18RemoveResourceFileERK7TDesC16 @ 66 NONAME ABSENT + _ZN16CCmPluginBaseEng18UpdateProxyRecordLEv @ 67 NONAME ABSENT + _ZN16CCmPluginBaseEng19LoadServiceSettingLEv @ 68 NONAME ABSENT + _ZN16CCmPluginBaseEng19SetStringAttributeLEmRK7TDesC16 @ 69 NONAME ABSENT + _ZN16CCmPluginBaseEng20AddConverstionTableLEPPN8CommsDat13CCDRecordBaseEPiPK18TCmAttribConvTable @ 70 NONAME ABSENT + _ZN16CCmPluginBaseEng20SetDNSServerAddressLEmRK7TDesC16mS2_mi @ 71 NONAME ABSENT + _ZN16CCmPluginBaseEng20SetString8AttributeLEmRK6TDesC8 @ 72 NONAME ABSENT + _ZN16CCmPluginBaseEng20UpdateServiceRecordLEv @ 73 NONAME ABSENT + _ZN16CCmPluginBaseEng21PrepareToLoadRecordsLEv @ 74 NONAME ABSENT + _ZN16CCmPluginBaseEng21RemoveConversionTableEPK18TCmAttribConvTable @ 75 NONAME ABSENT + _ZN16CCmPluginBaseEng22CheckDNSServerAddressLEiRN8CommsDat9CMDBFieldI7TDesC16EES4_RNS1_IiEE @ 76 NONAME ABSENT + _ZN16CCmPluginBaseEng23PrepareToUpdateRecordsLEv @ 77 NONAME ABSENT + _ZN16CCmPluginBaseEng25AddCommonConversionTableLEPK26TCmCommonAttrConvArrayItem @ 78 NONAME ABSENT + _ZN16CCmPluginBaseEng26NumOfConnMethodReferencesLEv @ 79 NONAME ABSENT + _ZN16CCmPluginBaseEng27RemoveCommonConversionTableEPK26TCmCommonAttrConvArrayItem @ 80 NONAME ABSENT + _ZN16CCmPluginBaseEng5LoadLEm @ 81 NONAME ABSENT + _ZN16CCmPluginBaseEng5ResetEv @ 82 NONAME ABSENT + _ZN16CCmPluginBaseEng7DeleteLEii @ 83 NONAME ABSENT + _ZN16CCmPluginBaseEng7UpdateLEv @ 84 NONAME ABSENT + _ZN16CCmPluginBaseEngC2EP18TCmPluginInitParam @ 85 NONAME ABSENT + _ZN16CCmPluginBaseEngD0Ev @ 86 NONAME ABSENT + _ZN16CCmPluginBaseEngD1Ev @ 87 NONAME ABSENT + _ZN16CCmPluginBaseEngD2Ev @ 88 NONAME ABSENT + _ZN16CCmPluginLanBase10ConstructLEv @ 89 NONAME ABSENT + _ZN16CCmPluginLanBase12RunSettingsLEv @ 90 NONAME ABSENT + _ZN16CCmPluginLanBase16BearerRecordIdLCERP7HBufC16Rm @ 91 NONAME ABSENT + _ZN16CCmPluginLanBase17InitializeWithUiLEi @ 92 NONAME ABSENT + _ZN16CCmPluginLanBase17ServiceRecordIdLCERP7HBufC16Rm @ 93 NONAME ABSENT + _ZN16CCmPluginLanBase19LoadServiceSettingLEv @ 94 NONAME ABSENT + _ZN16CCmPluginLanBase23CreateNewServiceRecordLEv @ 95 NONAME ABSENT + _ZN16CCmPluginLanBase23PrepareToUpdateRecordsLEv @ 96 NONAME ABSENT + _ZN16CCmPluginLanBaseC2EP18TCmPluginInitParam @ 97 NONAME ABSENT + _ZN16CCmPluginLanBaseD0Ev @ 98 NONAME ABSENT + _ZN16CCmPluginLanBaseD1Ev @ 99 NONAME ABSENT + _ZN16CCmPluginLanBaseD2Ev @ 100 NONAME ABSENT + _ZN17RCmDestinationExt10SetHiddenLEi @ 101 NONAME + _ZN17RCmDestinationExt12SetMetadataLEN9CMManager18TSnapMetadataFieldEm @ 102 NONAME + _ZN17RCmDestinationExt14SetProtectionLEN9CMManager16TProtectionLevelE @ 103 NONAME + _ZN17RCmDestinationExt15ModifyPriorityLER22RCmConnectionMethodExtj @ 104 NONAME + _ZN17RCmDestinationExt15ProtectionLevelEv @ 105 NONAME + _ZN17RCmDestinationExt17ConnectionMethodLEi @ 106 NONAME + _ZN17RCmDestinationExt20AddConnectionMethodLE22RCmConnectionMethodExt @ 107 NONAME + _ZN17RCmDestinationExt21ConnectionMethodByIDLEi @ 108 NONAME + _ZN17RCmDestinationExt21ConnectionMethodCountEv @ 109 NONAME + _ZN17RCmDestinationExt23AddEmbeddedDestinationLERKS_ @ 110 NONAME + _ZN17RCmDestinationExt23CreateConnectionMethodLEm @ 111 NONAME + _ZN17RCmDestinationExt23DeleteConnectionMethodLER22RCmConnectionMethodExt @ 112 NONAME + _ZN17RCmDestinationExt23RemoveConnectionMethodLE22RCmConnectionMethodExt @ 113 NONAME + _ZN17RCmDestinationExt2IdEv @ 114 NONAME + _ZN17RCmDestinationExt5CloseEv @ 115 NONAME + _ZN17RCmDestinationExt5IconLEv @ 116 NONAME ABSENT + _ZN17RCmDestinationExt6NameLCEv @ 117 NONAME + _ZN17RCmDestinationExt7UpdateLEv @ 118 NONAME + _ZN17RCmDestinationExt8DeleteLDEv @ 119 NONAME + _ZN17RCmDestinationExt8IsHiddenEv @ 120 NONAME + _ZN17RCmDestinationExt8SetIconLEm @ 121 NONAME ABSENT + _ZN17RCmDestinationExt8SetNameLERK7TDesC16 @ 122 NONAME + _ZN17RCmDestinationExt9ElementIdEv @ 123 NONAME + _ZN17RCmDestinationExt9PriorityLERK22RCmConnectionMethodExt @ 124 NONAME + _ZN17RCmDestinationExtC1ERKS_ @ 125 NONAME + _ZN17RCmDestinationExtC2ERKS_ @ 126 NONAME + _ZN17RCmDestinationExtD1Ev @ 127 NONAME + _ZN17RCmDestinationExtD2Ev @ 128 NONAME + _ZN17RCmDestinationExtaSERKS_ @ 129 NONAME + _ZN18CCmDestinationImpl10SetHiddenLEi @ 130 NONAME ABSENT + _ZN18CCmDestinationImpl14RemoveFromPoolEv @ 131 NONAME ABSENT + _ZN18CCmDestinationImpl14SetProtectionLEN9CMManager16TProtectionLevelE @ 132 NONAME ABSENT + _ZN18CCmDestinationImpl15ProtectionLevelEv @ 133 NONAME ABSENT + _ZN18CCmDestinationImpl17ConnectionMethodLEi @ 134 NONAME ABSENT + _ZN18CCmDestinationImpl21ConnectionMethodCountEv @ 135 NONAME ABSENT + _ZN18CCmDestinationImpl4NewLER14CCmManagerImplRK7TDesC16 @ 136 NONAME ABSENT + _ZN18CCmDestinationImpl4NewLER14CCmManagerImplj @ 137 NONAME ABSENT + _ZN18CCmDestinationImpl5IconLEv @ 138 NONAME ABSENT + _ZN18CCmDestinationImpl6NameLCEv @ 139 NONAME ABSENT + _ZN18CCmDestinationImpl7UpdateLEv @ 140 NONAME ABSENT + _ZN18CCmDestinationImpl8DeleteLDEv @ 141 NONAME ABSENT + _ZN18CCmDestinationImpl8IsHiddenEv @ 142 NONAME ABSENT + _ZN18CCmDestinationImpl8SetNameLERK7TDesC16 @ 143 NONAME ABSENT + _ZN18CCmDestinationImpl9PriorityLER16CCmPluginBaseEng @ 144 NONAME ABSENT + _ZN19RCmConnectionMethod5CloseEv @ 145 NONAME + _ZN21CCmConnSettingsUiImpl23RunApplicationSettingsLER19TCmSettingSelectionjR6RArrayImE @ 146 NONAME ABSENT + _ZN21CCmConnSettingsUiImpl4NewLEP14CCmManagerImpl @ 147 NONAME ABSENT + _ZN21CCmTransactionHandler5CloseEv @ 148 NONAME ABSENT + _ZN22RCmConnectionMethodExt11CreateCopyLEv @ 149 NONAME + _ZN22RCmConnectionMethodExt16SetIntAttributeLEmm @ 150 NONAME + _ZN22RCmConnectionMethodExt17SetBoolAttributeLEmi @ 151 NONAME + _ZN22RCmConnectionMethodExt19SetStringAttributeLEmRK7TDesC16 @ 152 NONAME + _ZN22RCmConnectionMethodExt20SetString8AttributeLEmRK6TDesC8 @ 153 NONAME + _ZN22RCmConnectionMethodExt5CloseEv @ 154 NONAME + _ZN22RCmConnectionMethodExt7DeleteLEv @ 155 NONAME + _ZN22RCmConnectionMethodExt7UpdateLEv @ 156 NONAME + _ZN23CmPluginBaseSettingsDlg10InitTextsLEv @ 157 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg10SelectItemEi @ 158 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg13LoadResourceLERK7TDesC16 @ 159 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg15GetIPv6DNSTypeLEmm @ 160 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg15ProcessCommandLEi @ 161 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg16DynInitMenuPaneLEiP12CEikMenuPane @ 162 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg17ConstructAndRunLDEv @ 163 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg17PreLayoutDynInitLEv @ 164 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg19AppendSettingTextsLER12CDesC16ArrayiPK7HBufC16 @ 165 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg19AppendSettingTextsLER12CDesC16Arrayii @ 166 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg19HandleListBoxEventLEP11CEikListBoxN19MEikListBoxObserver13TListBoxEventE @ 167 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg21ShowPopupSettingPageLEmi @ 168 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg21UpdateListBoxContentLEv @ 169 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg23ShowPopupIPv4DNSEditorLEmmmm @ 170 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg23ShowPopupIPv6DNSEditorLEPKmmmm @ 171 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg23ShowPopupIpSettingPageLEmm @ 172 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg24HandleListboxDataChangeLEv @ 173 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg25ShowPopupTextSettingPageLEmm @ 174 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg27ShowRadioButtonSettingPageLEPKmRim @ 175 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg27ShowRadioButtonSettingPageLER16CDesC16ArrayFlatRim @ 176 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg27StringAttributeWithDefaultLEmm @ 177 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg28ShowPopupPortNumSettingPageLEmm @ 178 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg29ShowPopupPasswordSettingPageLEmm @ 179 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg9OkToExitLEi @ 180 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlgC2ER16CCmPluginBaseEng @ 181 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlgD0Ev @ 182 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlgD1Ev @ 183 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlgD2Ev @ 184 NONAME ABSENT + _ZN24CCmApplicationSettingsUi23RunApplicationSettingsLER19TCmSettingSelection @ 185 NONAME + _ZN24CCmApplicationSettingsUi23RunApplicationSettingsLER19TCmSettingSelectionjR6RArrayImE @ 186 NONAME + _ZN24CCmApplicationSettingsUi4NewLEv @ 187 NONAME + _ZN24CCmApplicationSettingsUi5NewLCEv @ 188 NONAME + _ZN24CCmApplicationSettingsUiD0Ev @ 189 NONAME + _ZN24CCmApplicationSettingsUiD1Ev @ 190 NONAME + _ZN24CCmApplicationSettingsUiD2Ev @ 191 NONAME + _ZN24CCmPluginMultiLineDialog4NewLER6TDes16S1_N15CAknQueryDialog5TToneE @ 192 NONAME ABSENT + _ZN25CmPluginBaseSettingsDlgIp16DynInitMenuPaneLEiP12CEikMenuPane @ 193 NONAME ABSENT + _ZN25CmPluginBaseSettingsDlgIp20RunAdvancedSettingsLEv @ 194 NONAME ABSENT + _ZN25CmPluginBaseSettingsDlgIp21UpdateListBoxContentLEv @ 195 NONAME ABSENT + _ZN25CmPluginBaseSettingsDlgIpC1ER16CCmPluginBaseEng @ 196 NONAME ABSENT + _ZN25CmPluginBaseSettingsDlgIpC2ER16CCmPluginBaseEng @ 197 NONAME ABSENT + _ZN25CmPluginBaseSettingsDlgIpD0Ev @ 198 NONAME ABSENT + _ZN25CmPluginBaseSettingsDlgIpD1Ev @ 199 NONAME ABSENT + _ZN25CmPluginBaseSettingsDlgIpD2Ev @ 200 NONAME ABSENT + _ZN26CmPluginBaseSettingsDlgAdv16DynInitMenuPaneLEiP12CEikMenuPane @ 201 NONAME ABSENT + _ZN26CmPluginBaseSettingsDlgAdv20RunAdvancedSettingsLEv @ 202 NONAME ABSENT + _ZN26CmPluginBaseSettingsDlgAdv21ShowPopupSettingPageLEii @ 203 NONAME ABSENT + _ZN26CmPluginBaseSettingsDlgAdv21UpdateListBoxContentLEv @ 204 NONAME ABSENT + _ZN26CmPluginBaseSettingsDlgAdvC1ER16CCmPluginBaseEng @ 205 NONAME ABSENT + _ZN26CmPluginBaseSettingsDlgAdvC2ER16CCmPluginBaseEng @ 206 NONAME ABSENT + _ZN26CmPluginBaseSettingsDlgAdvD0Ev @ 207 NONAME ABSENT + _ZN26CmPluginBaseSettingsDlgAdvD1Ev @ 208 NONAME ABSENT + _ZN26CmPluginBaseSettingsDlgAdvD2Ev @ 209 NONAME ABSENT + _ZN28CCmApplicationSettingsUiImpl23RunApplicationSettingsLER19TCmSettingSelection @ 210 NONAME ABSENT + _ZN28CCmApplicationSettingsUiImpl4NewLEv @ 211 NONAME ABSENT + _ZNK10RCmManager11EasyWlanIdLEv @ 212 NONAME + _ZNK10RCmManager12DestinationLEm @ 213 NONAME + _ZNK10RCmManager16AllDestinationsLER6RArrayImE @ 214 NONAME + _ZNK10RCmManager17ConnectionMethodLER6RArrayImEiii @ 215 NONAME + _ZNK10RCmManager17ConnectionMethodLEm @ 216 NONAME + _ZNK10RCmManager17GetBearerInfoIntLEmm @ 217 NONAME + _ZNK10RCmManager18GetBearerInfoBoolLEmm @ 218 NONAME + _ZNK10RCmManager20BearerPriorityArrayLER6RArrayI15TBearerPriorityE @ 219 NONAME + _ZNK10RCmManager20GetBearerInfoStringLEmm @ 220 NONAME + _ZNK10RCmManager21GetBearerInfoString8LEmm @ 221 NONAME + _ZNK10RCmManager26CleanupGlobalPriorityArrayER6RArrayI15TBearerPriorityE @ 222 NONAME + _ZNK10RCmManager27GetConnectionMethodInfoIntLEmm @ 223 NONAME + _ZNK10RCmManager28GetConnectionMethodInfoBoolLEmm @ 224 NONAME + _ZNK10RCmManager30GetConnectionMethodInfoStringLEmm @ 225 NONAME + _ZNK10RCmManager31GetConnectionMethodInfoString8LEmm @ 226 NONAME + _ZNK13RCmManagerExt17GetBearerInfoIntLEmm @ 227 NONAME + _ZNK13RCmManagerExt17SupportedBearersLER6RArrayImE @ 228 NONAME + _ZNK13RCmManagerExt18GetBearerInfoBoolLEmm @ 229 NONAME + _ZNK13RCmManagerExt18UncategorizedIconLEv @ 230 NONAME ABSENT + _ZNK13RCmManagerExt20BearerPriorityArrayLER6RArrayI15TBearerPriorityE @ 231 NONAME + _ZNK13RCmManagerExt20GetBearerInfoStringLEmm @ 232 NONAME + _ZNK13RCmManagerExt21GetBearerInfoString8LEmm @ 233 NONAME + _ZNK13RCmManagerExt26CleanupGlobalPriorityArrayER6RArrayI15TBearerPriorityE @ 234 NONAME + _ZNK13RCmManagerExt27GetConnectionMethodInfoIntLEmm @ 235 NONAME + _ZNK13RCmManagerExt28GetConnectionMethodInfoBoolLEmm @ 236 NONAME + _ZNK13RCmManagerExt30GetConnectionMethodInfoStringLEmm @ 237 NONAME + _ZNK13RCmManagerExt31GetConnectionMethodInfoString8LEmm @ 238 NONAME + _ZNK14CCmManagerImpl17GetBearerInfoIntLEmm @ 239 NONAME ABSENT + _ZNK14CCmManagerImpl18GetBearerInfoBoolLEmm @ 240 NONAME ABSENT + _ZNK14CCmManagerImpl20GetBearerInfoStringLEmm @ 241 NONAME ABSENT + _ZNK14CCmManagerImpl21GetBearerInfoString8LEmm @ 242 NONAME ABSENT + _ZNK14CCmManagerImpl27GetConnectionMethodInfoIntLEmm @ 243 NONAME ABSENT + _ZNK14CCmManagerImpl28GetConnectionMethodInfoBoolLEmm @ 244 NONAME ABSENT + _ZNK14CCmManagerImpl30GetConnectionMethodInfoStringLEmm @ 245 NONAME ABSENT + _ZNK14CCmManagerImpl31GetConnectionMethodInfoString8LEmm @ 246 NONAME ABSENT + _ZNK14RCmDestination12IsConnectedLEv @ 247 NONAME + _ZNK14RCmDestination15ProtectionLevelEv @ 248 NONAME + _ZNK14RCmDestination17ConnectionMethodLEi @ 249 NONAME + _ZNK14RCmDestination21ConnectionMethodByIDLEi @ 250 NONAME + _ZNK14RCmDestination21ConnectionMethodCountEv @ 251 NONAME + _ZNK14RCmDestination2IdEv @ 252 NONAME + _ZNK14RCmDestination5IconLEv @ 253 NONAME ABSENT + _ZNK14RCmDestination6NameLCEv @ 254 NONAME + _ZNK14RCmDestination8IsHiddenEv @ 255 NONAME + _ZNK14RCmDestination9ElementIdEv @ 256 NONAME + _ZNK14RCmDestination9MetadataLEN9CMManager18TSnapMetadataFieldE @ 257 NONAME + _ZNK14RCmDestination9PriorityLERK19RCmConnectionMethod @ 258 NONAME + _ZNK16CCmPluginBaseEng10AllocReadLEi @ 259 NONAME ABSENT + _ZNK16CCmPluginBaseEng11CreateCopyLEv @ 260 NONAME ABSENT + _ZNK16CCmPluginBaseEng11DestinationEv @ 261 NONAME ABSENT + _ZNK16CCmPluginBaseEng16GetIntAttributeLEm @ 262 NONAME ABSENT + _ZNK16CCmPluginBaseEng17GetBoolAttributeLEm @ 263 NONAME ABSENT + _ZNK16CCmPluginBaseEng19GetStringAttributeLEm @ 264 NONAME ABSENT + _ZNK16CCmPluginBaseEng20CheckIfNameModifiedLEPN8CommsDat13CCDRecordBaseE @ 265 NONAME ABSENT + _ZNK16CCmPluginBaseEng20GetString8AttributeLEm @ 266 NONAME ABSENT + _ZNK16CCmPluginBaseEng20GlobalBearerPriorityERK7TDesC16 @ 267 NONAME ABSENT + _ZNK16CCmPluginBaseEng22GlobalUiBearerPriorityERK7TDesC16 @ 268 NONAME ABSENT + _ZNK16CCmPluginBaseEng23CheckIfAlreadyConnectedEv @ 269 NONAME ABSENT + _ZNK16CCmPluginBaseEng7SessionEv @ 270 NONAME ABSENT + _ZNK16CCmPluginLanBase13ServiceRecordEv @ 271 NONAME ABSENT + _ZNK17RCmDestinationExt12IsConnectedLEv @ 272 NONAME + _ZNK17RCmDestinationExt9MetadataLEN9CMManager18TSnapMetadataFieldE @ 273 NONAME + _ZNK18CCmDestinationImpl12IsConnectedLEv @ 274 NONAME ABSENT + _ZNK19RCmConnectionMethod12DestinationLEv @ 275 NONAME + _ZNK19RCmConnectionMethod16GetIntAttributeLEm @ 276 NONAME + _ZNK19RCmConnectionMethod17GetBoolAttributeLEm @ 277 NONAME + _ZNK19RCmConnectionMethod19GetStringAttributeLEm @ 278 NONAME + _ZNK19RCmConnectionMethod20GetString8AttributeLEm @ 279 NONAME + _ZNK22RCmConnectionMethodExt12DestinationLEv @ 280 NONAME + _ZNK22RCmConnectionMethodExt16GetIntAttributeLEm @ 281 NONAME + _ZNK22RCmConnectionMethodExt17GetBoolAttributeLEm @ 282 NONAME + _ZNK22RCmConnectionMethodExt19GetStringAttributeLEm @ 283 NONAME + _ZNK22RCmConnectionMethodExt20GetString8AttributeLEm @ 284 NONAME + _ZNK23CmPluginBaseSettingsDlg14GetHelpContextER15TCoeHelpContext @ 285 NONAME ABSENT + _ZNK23CmPluginBaseSettingsDlg19AppendSettingTextsLER12CDesC16ArrayiiRK7TDesC16i @ 286 NONAME ABSENT + _ZNK23CmPluginBaseSettingsDlg19AppendSettingTextsLER12CDesC16Arrayiiii @ 287 NONAME ABSENT + _ZTI16CCmPluginBaseEng @ 288 NONAME ABSENT ; ## + _ZTI16CCmPluginLanBase @ 289 NONAME ABSENT ; ## + _ZTI23CmPluginBaseSettingsDlg @ 290 NONAME ABSENT ; ## + _ZTI25CmPluginBaseSettingsDlgIp @ 291 NONAME ABSENT ; ## + _ZTI26CmPluginBaseSettingsDlgAdv @ 292 NONAME ABSENT ; ## + _ZTIN11TCmCommonUi12CCmDesCArrayE @ 293 NONAME ABSENT ; ## + _ZTV16CCmPluginBaseEng @ 294 NONAME ABSENT ; ## + _ZTV16CCmPluginLanBase @ 295 NONAME ABSENT ; ## + _ZTV23CmPluginBaseSettingsDlg @ 296 NONAME ABSENT ; ## + _ZTV25CmPluginBaseSettingsDlgIp @ 297 NONAME ABSENT ; ## + _ZTV26CmPluginBaseSettingsDlgAdv @ 298 NONAME ABSENT ; ## + _ZTVN11TCmCommonUi12CCmDesCArrayE @ 299 NONAME ABSENT ; ## + _ZThn156_N23CmPluginBaseSettingsDlg15ProcessCommandLEi @ 300 NONAME ABSENT ; ## + _ZThn156_N23CmPluginBaseSettingsDlg16DynInitMenuPaneLEiP12CEikMenuPane @ 301 NONAME ABSENT ; ## + _ZThn156_N25CmPluginBaseSettingsDlgIp16DynInitMenuPaneLEiP12CEikMenuPane @ 302 NONAME ABSENT ; ## + _ZThn156_N26CmPluginBaseSettingsDlgAdv16DynInitMenuPaneLEiP12CEikMenuPane @ 303 NONAME ABSENT ; ## + _ZThn176_N23CmPluginBaseSettingsDlg19HandleListBoxEventLEP11CEikListBoxN19MEikListBoxObserver13TListBoxEventE @ 304 NONAME ABSENT ; ## + _ZN14RCmDestinationC1Ev @ 305 NONAME + _ZN14RCmDestinationC2Ev @ 306 NONAME + _ZN17RCmDestinationExtC1Ev @ 307 NONAME + _ZN17RCmDestinationExtC2Ev @ 308 NONAME + _ZNK14RCmDestinationeqERKS_ @ 309 NONAME + _ZNK14RCmDestinationneERKS_ @ 310 NONAME + _ZNK17RCmDestinationExteqERKS_ @ 311 NONAME + _ZNK17RCmDestinationExtneERKS_ @ 312 NONAME + _ZN13CCmPluginBase10ConstructLEv @ 313 NONAME ABSENT + _ZN13CCmPluginBase10CreateNewLEv @ 314 NONAME ABSENT + _ZN13CCmPluginBase12EnableProxyLEi @ 315 NONAME ABSENT + _ZN13CCmPluginBase15EnableLocationLEi @ 316 NONAME ABSENT + _ZN13CCmPluginBase16AddResourceFileLERK7TDesC16 @ 317 NONAME ABSENT + _ZN13CCmPluginBase16SetIntAttributeLEmm @ 318 NONAME ABSENT + _ZN13CCmPluginBase17EnableChargeCardLEi @ 319 NONAME ABSENT + _ZN13CCmPluginBase17RestoreAttributeLEm @ 320 NONAME ABSENT + _ZN13CCmPluginBase17SetBoolAttributeLEmi @ 321 NONAME ABSENT + _ZN13CCmPluginBase18RemoveResourceFileERK7TDesC16 @ 322 NONAME ABSENT + _ZN13CCmPluginBase18UpdateProxyRecordLEv @ 323 NONAME ABSENT + _ZN13CCmPluginBase19LoadServiceSettingLEv @ 324 NONAME ABSENT + _ZN13CCmPluginBase19SetStringAttributeLEmRK7TDesC16 @ 325 NONAME ABSENT + _ZN13CCmPluginBase20SetString8AttributeLEmRK6TDesC8 @ 326 NONAME ABSENT + _ZN13CCmPluginBase20UpdateServiceRecordLEv @ 327 NONAME ABSENT + _ZN13CCmPluginBase21PrepareToLoadRecordsLEv @ 328 NONAME ABSENT + _ZN13CCmPluginBase23PrepareToUpdateRecordsLEv @ 329 NONAME ABSENT + _ZN13CCmPluginBase26NumOfConnMethodReferencesLEv @ 330 NONAME ABSENT + _ZN13CCmPluginBase5LoadLEm @ 331 NONAME ABSENT + _ZN13CCmPluginBase7DeleteLEii @ 332 NONAME ABSENT + _ZN13CCmPluginBase7UpdateLEv @ 333 NONAME ABSENT + _ZN13CCmPluginBaseC1EP16CCmPluginBaseEng @ 334 NONAME ABSENT + _ZN13CCmPluginBaseC2EP16CCmPluginBaseEng @ 335 NONAME ABSENT + _ZN13CCmPluginBaseD0Ev @ 336 NONAME ABSENT + _ZN13CCmPluginBaseD1Ev @ 337 NONAME ABSENT + _ZN13CCmPluginBaseD2Ev @ 338 NONAME ABSENT + _ZN14CCmManagerImpl20GetConnectionMethodLEm @ 339 NONAME ABSENT + _ZN18CCmDestinationImpl20GetConnectionMethodLEi @ 340 NONAME ABSENT + _ZNK13CCmPluginBase10AllocReadLEi @ 341 NONAME ABSENT + _ZNK13CCmPluginBase11CreateCopyLEv @ 342 NONAME ABSENT + _ZNK13CCmPluginBase11DestinationEv @ 343 NONAME ABSENT + _ZNK13CCmPluginBase16GetIntAttributeLEm @ 344 NONAME ABSENT + _ZNK13CCmPluginBase17GetBoolAttributeLEm @ 345 NONAME ABSENT + _ZNK13CCmPluginBase17ParentDestinationEv @ 346 NONAME ABSENT + _ZNK13CCmPluginBase19GetStringAttributeLEm @ 347 NONAME ABSENT + _ZNK13CCmPluginBase20GetString8AttributeLEm @ 348 NONAME ABSENT + _ZNK13CCmPluginBase5CmMgrEv @ 349 NONAME ABSENT + _ZNK13CCmPluginBase6PluginEv @ 350 NONAME ABSENT + _ZNK13CCmPluginBase7SessionEv @ 351 NONAME ABSENT + _ZTI13CCmPluginBase @ 352 NONAME ABSENT ; ## + _ZTV13CCmPluginBase @ 353 NONAME ABSENT ; ## + _ZN19RCmConnectionMethodC1Ev @ 354 NONAME + _ZN19RCmConnectionMethodC2Ev @ 355 NONAME + _ZN19RCmConnectionMethodaSERKS_ @ 356 NONAME + _ZN22RCmConnectionMethodExtC1Ev @ 357 NONAME + _ZN22RCmConnectionMethodExtC2Ev @ 358 NONAME + _ZN22RCmConnectionMethodExtaSERKS_ @ 359 NONAME + _ZNK19RCmConnectionMethodeqERS_ @ 360 NONAME + _ZNK19RCmConnectionMethodneERS_ @ 361 NONAME + _ZNK22RCmConnectionMethodExteqERS_ @ 362 NONAME + _ZNK22RCmConnectionMethodExtneERS_ @ 363 NONAME + _ZN19RCmConnectionMethodD1Ev @ 364 NONAME + _ZN19RCmConnectionMethodD2Ev @ 365 NONAME + _ZN22RCmConnectionMethodExtD1Ev @ 366 NONAME + _ZN22RCmConnectionMethodExtD2Ev @ 367 NONAME + _ZN21CCmConnSettingsUiImpl25SetDestinationArrayToUseLE6RArrayImE @ 368 NONAME ABSENT + _ZN21CCmConnSettingsUiImpl26ClearDestinationArrayToUseEv @ 369 NONAME ABSENT + _ZN13CCmPluginBase17GetAdditionalUidsER6RArrayImE @ 370 NONAME ABSENT + _ZN14CCmManagerImpl13WrapCmManagerER13RCmManagerExt @ 371 NONAME ABSENT + _ZN16CCmPluginBaseEng17GetAdditionalUidsER6RArrayImE @ 372 NONAME ABSENT + _ZN14CCmManagerImpl17CreateFlatCMListLEmR13RPointerArrayI13CCmPluginBaseE @ 373 NONAME ABSENT + _ZN14CCmManagerImpl18FilterOutVirtualsLER13RPointerArrayI13CCmPluginBaseE @ 374 NONAME ABSENT + _ZN14CCmManagerImpl30CombineArraysForPriorityOrderLER13RPointerArrayI13CCmPluginBaseES3_ @ 375 NONAME ABSENT + _ZN14CCmManagerImpl18CreateFlatCMListLCEmR13RPointerArrayI13CCmPluginBaseE @ 376 NONAME ABSENT + _ZN19RCmConnectionMethodC1ERKS_ @ 377 NONAME + _ZN19RCmConnectionMethodC2ERKS_ @ 378 NONAME + _ZN22RCmConnectionMethodExtC1ERKS_ @ 379 NONAME + _ZN22RCmConnectionMethodExtC2ERKS_ @ 380 NONAME + _ZN13CCmPluginBase13IsLinkedToIapEm @ 381 NONAME ABSENT + _ZN13CCmPluginBase14IsLinkedToSnapEm @ 382 NONAME ABSENT + _ZNK16CCmPluginBaseEng17ParentDestinationEv @ 383 NONAME ABSENT + _ZN13RCmManagerExt20CreateTablesAndOpenLEv @ 384 NONAME + _ZN13RCmManagerExt18CreateDestinationLERK7TDesC16m @ 385 NONAME + _ZN13RCmManagerExt23CreateConnectionMethodLEmm @ 386 NONAME + _ZN16CCmPluginBaseEng15SetPreDefinedIdEm @ 387 NONAME ABSENT + _ZN17RCmDestinationExt23CreateConnectionMethodLEmm @ 388 NONAME + _ZN23CmPluginBaseSettingsDlg20HandleResourceChangeEi @ 389 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg7ExecuteEv @ 390 NONAME ABSENT + _ZThn180_N23CmPluginBaseSettingsDlg7ExecuteEv @ 391 NONAME ABSENT ; ## + _ZN23CmPluginBaseSettingsDlg16HandleLeaveErrorEi @ 392 NONAME ABSENT + _ZThn180_N23CmPluginBaseSettingsDlg16HandleLeaveErrorEi @ 393 NONAME ABSENT ; ## + _ZN10RCmManager13WriteDefConnLERK15TCmDefConnValue @ 394 NONAME + _ZN10RCmManager18CreateDestinationLERK7TDesC16 @ 395 NONAME + _ZN10RCmManager18CreateDestinationLERK7TDesC16m @ 396 NONAME + _ZN10RCmManager20CreateTablesAndOpenLEv @ 397 NONAME + _ZN10RCmManager20RemoveAllReferencesLER19RCmConnectionMethod @ 398 NONAME + _ZN10RCmManager21CopyConnectionMethodLER14RCmDestinationR19RCmConnectionMethod @ 399 NONAME + _ZN10RCmManager21MoveConnectionMethodLER14RCmDestinationS1_R19RCmConnectionMethod @ 400 NONAME + _ZN10RCmManager23CreateConnectionMethodLEm @ 401 NONAME + _ZN10RCmManager23CreateConnectionMethodLEmm @ 402 NONAME + _ZN10RCmManager23RemoveConnectionMethodLER14RCmDestinationR19RCmConnectionMethod @ 403 NONAME + _ZN10RCmManager26UpdateBearerPriorityArrayLERK6RArrayI15TBearerPriorityE @ 404 NONAME + _ZN14RCmDestination10SetHiddenLEi @ 405 NONAME + _ZN14RCmDestination12SetMetadataLEN9CMManager18TSnapMetadataFieldEm @ 406 NONAME + _ZN14RCmDestination14SetProtectionLEN9CMManager16TProtectionLevelE @ 407 NONAME + _ZN14RCmDestination15ModifyPriorityLER19RCmConnectionMethodj @ 408 NONAME + _ZN14RCmDestination20AddConnectionMethodLE19RCmConnectionMethod @ 409 NONAME + _ZN14RCmDestination23AddEmbeddedDestinationLERKS_ @ 410 NONAME + _ZN14RCmDestination23CreateConnectionMethodLEm @ 411 NONAME + _ZN14RCmDestination23CreateConnectionMethodLEmm @ 412 NONAME + _ZN14RCmDestination23DeleteConnectionMethodLER19RCmConnectionMethod @ 413 NONAME + _ZN14RCmDestination23RemoveConnectionMethodLE19RCmConnectionMethod @ 414 NONAME + _ZN14RCmDestination7UpdateLEv @ 415 NONAME + _ZN14RCmDestination8DeleteLDEv @ 416 NONAME + _ZN14RCmDestination8SetIconLEm @ 417 NONAME ABSENT + _ZN14RCmDestination8SetNameLERK7TDesC16 @ 418 NONAME + _ZN19RCmConnectionMethod11CreateCopyLEv @ 419 NONAME + _ZN19RCmConnectionMethod16SetIntAttributeLEmm @ 420 NONAME + _ZN19RCmConnectionMethod17SetBoolAttributeLEmi @ 421 NONAME + _ZN19RCmConnectionMethod19SetStringAttributeLEmRK7TDesC16 @ 422 NONAME + _ZN19RCmConnectionMethod20SetString8AttributeLEmRK6TDesC8 @ 423 NONAME + _ZN19RCmConnectionMethod7DeleteLEv @ 424 NONAME + _ZN19RCmConnectionMethod7UpdateLEv @ 425 NONAME + _ZNK10RCmManager17SupportedBearersLER6RArrayImE @ 426 NONAME + _ZNK10RCmManager18UncategorizedIconLEv @ 427 NONAME ABSENT + _ZN10RCmManager20ReadGenConnSettingsLER18TCmGenConnSettings @ 428 NONAME + _ZN10RCmManager21WriteGenConnSettingsLERK18TCmGenConnSettings @ 429 NONAME + _ZN14CCmManagerImpl16IapStillExistedLERK16CCmPluginBaseEng @ 430 NONAME ABSENT + _ZN14CCmManagerImpl16WatcherRegisterLEP18MCmCommsDatWatcher @ 431 NONAME ABSENT + _ZN14CCmManagerImpl17IsIapStillInDestLEP18CCmDestinationImplRK16CCmPluginBaseEng @ 432 NONAME ABSENT + _ZN14CCmManagerImpl17WatcherUnRegisterEv @ 433 NONAME ABSENT + _ZN14CCmManagerImpl18RemoveDestFromPoolEP18CCmDestinationImpl @ 434 NONAME ABSENT + _ZN14CCmManagerImpl24DestinationStillExistedLEP18CCmDestinationImpl @ 435 NONAME ABSENT + _ZN23CmPluginBaseSettingsDlg14OfferKeyEventLERK9TKeyEvent10TEventCode @ 436 NONAME ABSENT + _ZN14RCmDestination8SetIconLERK7TDesC16 @ 437 NONAME + _ZN19RCmConnectionMethod8SetIconLERK7TDesC16 @ 438 NONAME + _ZNK10RCmManager21GetUncategorizedIconLEv @ 439 NONAME + _ZNK14RCmDestination8GetIconLEv @ 440 NONAME + _ZNK19RCmConnectionMethod8GetIconLEv @ 441 NONAME + _ZN14RCmDestination8RefreshLEv @ 442 NONAME + _ZN19RCmConnectionMethod8RefreshLEv @ 443 NONAME + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/group/bld.inf Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2006-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: +* Build file for Connection Method Manager's framework. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// export iby files +../rom/cmmapi.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cmmapi.iby) + +PRJ_MMPFILES +cmmapi.mmp + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/group/cmmapi.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/group/cmmapi.mmp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2006-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: +* Makefile of Connection Method Manager's framework. +* +*/ + + +#include +#include + +TARGET cmmanager.dll +TARGETTYPE dll +UID 0x1000008d 0x10207376 +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../../cmmcommon/Src +SOURCE cmmclistatic.cpp + +SOURCEPATH ../Src +SOURCE cmmanager.cpp +SOURCE cmmanagerapi.cpp +SOURCE cmdestination.cpp +SOURCE cmdestinationwrapper.cpp +SOURCE cmdestinationapi.cpp +SOURCE cmconnectionmethod.cpp +SOURCE cmconnectionmethodwrapper.cpp +SOURCE cmconnectionmethodapi.cpp +SOURCE cmmanagerext.cpp +SOURCE cmdestinationext.cpp +SOURCE cmconnectionmethodext.cpp +SOURCE cmapplicationsettingsui.cpp + +// Component specific internal headers +USERINCLUDE ../inc +USERINCLUDE ../../cmmcommon/inc +USERINCLUDE ../traces + +// ADO specific internal headers +SYSTEMINCLUDE ../../../../inc + +//Macro to /epoc32 headers +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib + +DEBUGLIBRARY flogger.lib + +#if defined(ARMCC) +DEFFILE ../EABI/CmManager_prot_setup.def +#elif defined( WINSCW ) +DEFFILE ../BWinsCw/CmManager_prot_setup.def +#elif defined( WINS ) +DEFFILE ../BWins/CmManager_prot_setup.def +#else +DEFFILE ../BMarm/CmManager_prot_setup.def +#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/inc/cmconnectionmethodapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/inc/cmconnectionmethodapi.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Client side IPC handling for Connection Method Manager server. +* +*/ + + +#ifndef CMCONNECTIONMETHODAPI_H +#define CMCONNECTIONMETHODAPI_H + +#include + + +NONSHARABLE_CLASS( RCmConnectionMethodApi ) : public RSubSessionBase + { +public: + RCmConnectionMethodApi(); + TBool SessionConnected() const; + +public: + void ConnectAndGetConnMethodWithIdL( + const RSessionBase& aSession, + const TUint32 aIapId, + TInt& aExistingHandle ); + void ConnectAndGetConnMethodFromDestWithIndexL( + const RSessionBase& aSession, + const TInt aDestHandle, + const TInt aIndex, + TInt& aExistingHandle ); + void ConnectAndGetConnMethodFromDestWithIdL( + const RSessionBase& aSession, + const TInt aDestHandle, + const TInt aIapId, + TInt& aExistingHandle ); + void ConnectAndCreateConnMethodL( + const RSessionBase& aSession, + const TUint32 aBearerType ); + void ConnectAndCreateConnMethodWithIdL( + const RSessionBase& aSession, + const TUint32 aBearerType, + const TUint32 aIapId ); + TInt ConnectAndCreateConnMethodCopy( + const RSessionBase& aSession, + const TInt aConnMethodHandle ); + void ConnectAndCreateConnMethodToDestL( + const RSessionBase& aSession, + const TInt aDestHandle, + const TUint32 aBearerType ); + void ConnectAndCreateConnMethodToDestWithIdL( + const RSessionBase& aSession, + const TInt aDestHandle, + const TUint32 aBearerType, + const TUint32 aIapId ); + + void Close(); + + TInt GetIntAttribute( + const TUint32 aAttribute, + TUint32& aValue ); + TInt GetBoolAttribute( + const TUint32 aAttribute, + TBool& aValue ); + TInt GetStringAttribute( + const TUint32 aAttribute, + HBufC* aBuffer ); + TInt GetString8Attribute( + const TUint32 aAttribute, + HBufC8* aBuffer8 ); + + TInt SetIntAttribute( + const TUint32 aAttribute, + const TUint32 aValue ); + TInt SetBoolAttribute( + const TUint32 aAttribute, + const TBool aValue ); + TInt SetStringAttribute( + const TUint32 aAttribute, + const TDesC16& aValue ); + TInt SetString8Attribute( + const TUint32 aAttribute, + const TDesC8& aValue ); + + TInt Update(); + TInt Refresh(); + TInt Delete( TBool& aResult ); + TInt IsEqual( const TInt aHandle, TBool& aResult ); + +private: + // True when a subsession is established to the server. + TBool iSessionConnected; + }; + +#endif // CMCONNECTIONMETHODAPI_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/inc/cmconnectionmethodwrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/inc/cmconnectionmethodwrapper.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Collects API calls from RCmConnectionMethod- and +* RCmConnectionMethodExt-classes. +* +*/ + + +#ifndef CMCONNECTIONMETHODWRAPPER_H +#define CMCONNECTIONMETHODWRAPPER_H + +#include +#include "cmconnectionmethodapi.h" + +class RCmManagerApi; + + +NONSHARABLE_CLASS( CCmConnectionMethodWrapper ) : public CBase + { +public: + static CCmConnectionMethodWrapper* NewL(); + static CCmConnectionMethodWrapper* NewLC(); + virtual ~CCmConnectionMethodWrapper(); + +public: + CCmConnectionMethodWrapper(); + +public: + void GetConnMethodWithIdL( + RCmManagerApi* aCmManagerApi, + const TUint32 aIapId, + TInt& aExistingHandle ); + void GetConnMethodFromDestWithIndexL( + RCmManagerApi* aCmManagerApi, + const TInt aDestHandle, + const TInt aIndex, + TInt& aExistingHandle ); + void GetConnMethodFromDestWithIdL( + RCmManagerApi* aCmManagerApi, + const TInt aDestHandle, + const TInt aIapId, + TInt& aExistingHandle ); + void CreateConnMethodL( + RCmManagerApi* aCmManagerApi, + const TUint32 aBearerType ); + void CreateConnMethodWithIdL( + RCmManagerApi* aCmManagerApi, + const TUint32 aBearerType, + const TUint32 aIapId ); + TInt CreateConnMethodCopy( + RCmManagerApi* aCmManagerApi, + const TInt aConnMethodHandle ); + void CreateConnMethodToDestL( + RCmManagerApi* aCmManagerApi, + const TInt aDestHandle, + const TUint32 aBearerType ); + void CreateConnMethodToDestWithIdL( + RCmManagerApi* aCmManagerApi, + const TInt aDestHandle, + const TUint32 aBearerType, + const TUint32 aIapId ); + + TInt GetIntAttribute( + const TUint32 aAttribute, + TUint32& aValue ); + TInt GetBoolAttribute( + const TUint32 aAttribute, + TBool& aValue ); + TInt GetStringAttribute( + const TUint32 aAttribute, + HBufC* aBuffer ); + TInt GetString8Attribute( + const TUint32 aAttribute, + HBufC8* aBuffer ); + + TInt SetIntAttribute( + const TUint32 aAttribute, + const TUint32 aValue ); + TInt SetBoolAttribute( + const TUint32 aAttribute, + const TBool aValue ); + TInt SetStringAttribute( + const TUint32 aAttribute, + const TDesC16& aValue ); + TInt SetString8Attribute( + const TUint32 aAttribute, + const TDesC8& aValue ); + + TInt Update(); + TInt Refresh(); + TInt Delete( TBool& aResult ); + TInt IsEqual( const TInt aHandle, TBool& aResult ); + + TBool SessionConnected() const; + void CloseSession(); + TInt GetHandle() const; + RCmManagerApi* GetMainSession() const; + + void IncreaseReferenceCounter(); + TInt DecreaseReferenceCounter(); + +private: + // Subsession to server representing this connection method handle. + RCmConnectionMethodApi iCmConnectionMethodApi; + + // Pointer for main session to server. + RCmManagerApi* iCmManagerApi; // Not owned. + + // Counts the number of references client has to this specific handle. + TInt iReferenceCounter; + }; + +#endif // CMCONNECTIONMETHODWRAPPER_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/inc/cmdestinationapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/inc/cmdestinationapi.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Client side IPC handling for Connection Method Manager server. +* +*/ + + +#ifndef CMDESTINATIONAPI_H +#define CMDESTINATIONAPI_H + +#include + + +NONSHARABLE_CLASS( RCmDestinationApi ) : public RSubSessionBase + { +public: + RCmDestinationApi(); + TBool SessionConnected(); + +public: + void ConnectAndGetDestWithIdL( + const RSessionBase& aSession, + const TUint32 aId, + TInt& aExistingHandle ); + void ConnectAndCreateDestWithNameL( + const RSessionBase& aSession, + const TDesC& aName ); + void ConnectAndCreateDestWithNameAndIdL( + const RSessionBase& aSession, + const TDesC& aName, + const TUint32 aId ); + void ConnectAndGetConnMethodAsEmbeddedDestL( + const RSessionBase& aSession, + const TInt aConnMethodHandle, + TInt& aExistingHandle ); + + void Close(); + TInt ConnectionMethodCount( TInt& aCount ); + + TInt Priority( const TInt aHandle, TUint& aPriority ); + TInt GetName( HBufC* aBuffer ); + + TInt GetId( TUint32& aId ); + TInt GetElementId( TUint32& aElementId ); + TInt GetMetadata( + const TUint32 aMetadataField, + TUint32& aValue ); + TInt GetProtectionLevel( TInt& aProtectionLevel ); + + TInt AddConnectionMethod( + const TInt aConnMethodHandle, + TInt& aIndex ); + TInt AddEmbeddedDestination( + const TInt aDestHandle, + TInt& aIndex ); + TInt DeleteConnectionMethod( + const TInt aConnMethodHandle ); + TInt RemoveConnectionMethod( + const TInt aConnMethodHandle ); + + TInt ModifyPriority( + const TInt aConnMethodHandle, + const TUint aIndex ); + TInt SetName( const TDesC& aValue ); + TInt SetMetadata( + const TUint32 aMetaField, + const TUint32 aValue ); + TInt SetProtection( const TInt aValue ); + TInt SetHidden( const TBool aHidden ); + TInt Update(); + TInt Refresh(); + TInt Delete(); + TInt IsConnected( TBool& aResult ); + TInt IsHidden( TBool& aResult ); + TInt IsEqual( const TInt aHandle, TBool& aResult ); + +private: + // True when a subsession is established to the server. + TBool iSessionConnected; + }; + +#endif // CMDESTINATIONAPI_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/inc/cmdestinationwrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/inc/cmdestinationwrapper.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Collects API calls from RCmDestination- and RCmDestinationExt-classes. +* +*/ + + +#ifndef CMDESTINATIONWRAPPER_H +#define CMDESTINATIONWRAPPER_H + + +#include +#include "cmdestinationapi.h" + +class RCmManagerApi; + + +NONSHARABLE_CLASS( CCmDestinationWrapper ) : public CBase + { +public: + static CCmDestinationWrapper* NewL(); + static CCmDestinationWrapper* NewLC(); + virtual ~CCmDestinationWrapper(); + +public: + CCmDestinationWrapper(); + +public: + void GetDestWithIdL( + RCmManagerApi* aCmManagerApi, + const TUint32 aId, + TInt& aExistingHandle ); + void CreateDestByNameL( + RCmManagerApi* aCmManagerApi, + const TDesC& aName ); + void CreateDestByNameAndIdL( + RCmManagerApi* aCmManagerApi, + const TDesC& aName, + const TUint32 aId ); + void GetConnMethodAsEmbeddedDestL( + RCmManagerApi* aCmManagerApi, + const TInt aConnMethodHandle, + TInt& aExistingHandle ); + + TInt ConnectionMethodCount( TInt& aCount ); + TInt Priority( const TInt aHandle, TUint& aPriority ); + TInt GetName( HBufC* aBuffer ); + TInt GetId( TUint32& aId ); + TInt GetElementId( TUint32& aElementId ); + TInt GetMetadata( + const TUint32 aMetadataField, + TUint32& aValue ); + TInt GetProtectionLevel( TInt& aProtectionLevel ); + + TInt AddConnectionMethod( + const TInt aConnMethodHandle, + TInt& aIndex ); + TInt AddEmbeddedDestination( + const TInt aDestHandle, + TInt& aIndex ); + TInt DeleteConnectionMethod( + const TInt aConnMethodHandle); + TInt RemoveConnectionMethod( + const TInt aConnMethodHandle ); + + TInt ModifyPriority( + const TInt aConnMethodHandle, + const TUint aIndex ); + TInt SetName( const TDesC& aValue ); + TInt SetMetadata( + const TUint32 aMetaField, + const TUint32 aValue ); + TInt SetProtection( const TInt aValue ); + TInt SetHidden( const TBool aHidden ); + TInt Update(); + TInt Refresh(); + TInt Delete(); + TInt IsConnected( TBool& aResult ); + TInt IsHidden( TBool& aResult ); + TInt IsEqual( const TInt aHandle, TBool& aResult ); + + TBool SessionConnected(); + void CloseSession(); + TInt GetHandle() const; + RCmManagerApi* GetMainSession() const; + + void IncreaseReferenceCounter(); + TInt DecreaseReferenceCounter(); + +private: + // Subsession to server representing this destination handle. + RCmDestinationApi iCmDestinationApi; + + // Pointer for main session to server. + RCmManagerApi* iCmManagerApi; // Not owned. + + // Counts the number of references client has to this specific handle. + TInt iReferenceCounter; + }; + +#endif // CMDESTINATIONWRAPPER_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/inc/cmmanagerapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/inc/cmmanagerapi.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,159 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Client side IPC handling for Connection Method Manager server. +* +*/ + + +#ifndef CMMANAGERAPI_H +#define CMMANAGERAPI_H + +#include +#include +#include + +class CCmDestinationWrapper; +class CCmConnectionMethodWrapper; +class TBearerPriority; +class TCmmIpcStructGetConnMethods; +class TCmmIpcStructMoveConnMethod; + + +NONSHARABLE_CLASS( RCmManagerApi ) : public RSessionBase + { +public: + /** + * Constructor. + */ + RCmManagerApi(); + +public: + /** + * Opens a connection (session) to the CMM server. + * @return KErrNone if the connection succeeds, a system-wide error code + * if not. + */ + TInt Connect(); + + /** + * Closes the connection (session). + */ + void Close(); + + TInt StoreDestinationWrapper( + CCmDestinationWrapper* aDestinationWrapper ); + TInt RemoveDestinationWrapper( + CCmDestinationWrapper* aDestinationWrapper ); + CCmDestinationWrapper* GetDestinationWrapperL( const TInt& aHandle ); + + TInt StoreConnMethodWrapper( + CCmConnectionMethodWrapper* aConnMethodWrapper ); + TInt RemoveConnMethodWrapper( + CCmConnectionMethodWrapper* aConnMethodWrapper ); + CCmConnectionMethodWrapper* GetConnMethodWrapperL( const TInt& aHandle ); + + TInt GetBearerInfoInt( + const TUint32 aBearerType, + const TUint32 aAttribute, + TUint32& aValue ); + TInt GetBearerInfoBool( + const TUint32 aBearerType, + const TUint32 aAttribute, + TBool& aValue ); + TInt GetBearerInfoString( + const TUint32 aBearerType, + const TUint32 aAttribute, + HBufC* aBuffer ); + TInt GetBearerInfoString8( + const TUint32 aBearerType, + const TUint32 aAttribute, + HBufC8* aBuffer8 ); + + TInt GetConnectionMethodInfoInt( + const TUint32 aIapId, + const TUint32 aAttribute, + TUint32& aValue ); + TInt GetConnectionMethodInfoBool( + const TUint32 aIapId, + const TUint32 aAttribute, + TBool& aValue ); + TInt GetConnectionMethodInfoString( + const TUint32 aIapId, + const TUint32 aAttribute, + HBufC* aBuffer ); + TInt GetConnectionMethodInfoString8( + const TUint32 aIapId, + const TUint32 aAttribute, + HBufC8* aBuffer8 ); + + void GetConnMethodsL( + const TCmmIpcStructGetConnMethods& aParameters, + RArray& aCmArray ); + void GetAllDestinationsL( + RArray& aDestArray ); + + void GetBearerPriorityArrayL( RArray& aArray ); + void SetBearerPriorityArrayL( const RArray& aArray ); + + void GetSupportedBearersL( RArray& aArray ); + + TInt GetEasyWlanId( TUint32& aValue ); + + TInt ReadDefaultConnection( + TCmDefConnValue& aDefConnSetting ); + TInt WriteDefaultConnection( + const TCmDefConnValue& aDefConnSetting ); + + TInt ReadGeneralConnectionSettings( + TCmGenConnSettings& aGenConnSettings ); + TInt WriteGeneralConnectionSettings( + const TCmGenConnSettings& aGenConnSettings ); + + TInt CopyConnectionMethod( + const TInt aTargetDestHandle, + const TInt aConnMethodHandle, + TInt& aIndex ); + TInt MoveConnectionMethod( + TCmmIpcStructMoveConnMethod& aPkgData ); + TInt RemoveConnectionMethod( + const TInt aTargetDestHandle, + const TInt aConnMethodHandle ); + TInt RemoveAllReferences( + const TInt aConnMethodHandle ); + +private: + // Array of destination handles opened through this session. + // Does not have ownership of contained objects. + RPointerArray iDestinations; + + // Array of connection method handles opened through this session. + // Does not have ownership of contained objects. + RPointerArray iConnMethods; + + // True when a session is established to the server. + TBool iConnected; + + // True when using smaller buffer for ConnectionMethodL(array)-query. + // Bigger buffer is taken into use if needed. + TBool iSmallBufsForDestinations; + + // True when using smaller buffer for AllDestinationsL(array)-query. + // Bigger buffer is taken into use if needed. + TBool iSmallBufsForConnMethods; + }; + +#endif // CMMANAGERAPI_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/rom/cmmapi.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/rom/cmmapi.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* cmmanager.dll to ROM. +* +*/ + +#ifndef CMMAPI_IBY__ +#define CMMAPI_IBY__ + +file=ABI_DIR\BUILD_DIR\cmmanager.dll SHARED_LIB_DIR\cmmanager.dll + + +#endif // CMMAPI_IBY__ + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/src/cmapplicationsettingsui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/src/cmapplicationsettingsui.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Application Setting UI +* +*/ + +// Dummy implementation not to break the build. +// Not working at the moment due to cmmanager refactoring work. + +#include "cmapplicationsettingsui.h" +//#include +//#include "cmconnsettingsuiimpl.h" +//#include "cmmanager.hrh" + +using namespace CMManager; +//----------------------------------------------------------------------------- +// CCmApplicationSettingsUi::NewL() +//----------------------------------------------------------------------------- +// +EXPORT_C CCmApplicationSettingsUi* CCmApplicationSettingsUi::NewL() + { + /* + CCmApplicationSettingsUi* self = new (ELeave) CCmApplicationSettingsUi(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); // self + return self; + */ + return NULL; + } + +//----------------------------------------------------------------------------- +// CCmApplicationSettingsUi::NewLC() +//----------------------------------------------------------------------------- +// +EXPORT_C CCmApplicationSettingsUi* CCmApplicationSettingsUi::NewLC() + { + /* + CCmApplicationSettingsUi* self = new (ELeave) CCmApplicationSettingsUi(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + */ + return NULL; + } + +//----------------------------------------------------------------------------- +// CCmApplicationSettingsUi::CCmApplicationSettingsUi() +//----------------------------------------------------------------------------- +// +CCmApplicationSettingsUi::CCmApplicationSettingsUi() + { + iImpl = NULL; + } + +//----------------------------------------------------------------------------- +// CCmApplicationSettingsUi::~CCmApplicationSettingsUi() +//----------------------------------------------------------------------------- +// +EXPORT_C CCmApplicationSettingsUi::~CCmApplicationSettingsUi() + { + // delete iImpl; + } + +//----------------------------------------------------------------------------- +// CCmApplicationSettingsUi::ConstructL() +//----------------------------------------------------------------------------- +// +void CCmApplicationSettingsUi::ConstructL() + { + // iImpl = CCmConnSettingsUiImpl::NewWithoutTablesL(); */ + } + +//----------------------------------------------------------------------------- +// CCmApplicationSettingsUi::RunSettingsL() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool CCmApplicationSettingsUi::RunApplicationSettingsL( + TCmSettingSelection& aSelection ) + { + /* + TBearerFilterArray aFilterArray; + return iImpl->RunApplicationSettingsL( aSelection, + EShowDefaultConnection | + EShowDestinations | + EShowConnectionMethods, + aFilterArray ); + */ + (void) aSelection; + return NULL; + } + +//----------------------------------------------------------------------------- +// CCmApplicationSettingsUi::RunSettingsL() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool CCmApplicationSettingsUi::RunApplicationSettingsL( + TCmSettingSelection& aSelection, + TUint aListItems, + TBearerFilterArray& aFilterArray) + { + /* + return iImpl->RunApplicationSettingsL( aSelection, + aListItems, + aFilterArray ); + */ + (void) aSelection; + (void) aListItems; + (void) aFilterArray; + return NULL; + } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/src/cmconnectionmethod.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/src/cmconnectionmethod.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,536 @@ +/* +* Copyright (c) 2006-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 RCmConnectionMethod. +* +*/ + + +#include +#include + +#include "cmmserverdefs.h" +#include "cmmanagerapi.h" +#include "cmdestinationwrapper.h" +#include "cmconnectionmethodwrapper.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmconnectionmethodTraces.h" +#endif + + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::RCmConnectionMethod() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethod::RCmConnectionMethod( + const RCmConnectionMethod& aConnMethod ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_RCMCONNECTIONMETHOD_ENTRY ); + + this->iCmConnectionMethodWrapper = aConnMethod.iCmConnectionMethodWrapper; + if ( iCmConnectionMethodWrapper ) + { + iCmConnectionMethodWrapper->IncreaseReferenceCounter(); + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_RCMCONNECTIONMETHOD_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::Close() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethod::Close() + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_CLOSE_ENTRY ); + + if ( iCmConnectionMethodWrapper ) + { + if ( iCmConnectionMethodWrapper->DecreaseReferenceCounter() <= 0 ) + { + delete iCmConnectionMethodWrapper; + } + iCmConnectionMethodWrapper = NULL; + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_CLOSE_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::~RCmConnectionMethod() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethod::~RCmConnectionMethod() + { + OstTraceFunctionEntry0( DUP1_RCMCONNECTIONMETHOD_RCMCONNECTIONMETHOD_ENTRY ); + Close(); + OstTraceFunctionExit0( DUP1_RCMCONNECTIONMETHOD_RCMCONNECTIONMETHOD_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::CreateCopyL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethod RCmConnectionMethod::CreateCopyL() + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_CREATECOPYL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt connMethodHandle = iCmConnectionMethodWrapper->GetHandle(); + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + + TInt err = cmWrapper->CreateConnMethodCopy( + iCmConnectionMethodWrapper->GetMainSession(), + connMethodHandle ); + User::LeaveIfError( err ); + CleanupStack::Pop( cmWrapper ); + + RCmConnectionMethod cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_CREATECOPYL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::GetIntAttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmConnectionMethod::GetIntAttributeL( + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_GETINTATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TUint32 value( 0 ); + TInt err = iCmConnectionMethodWrapper->GetIntAttribute( aAttribute, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_GETINTATTRIBUTEL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::GetBoolAttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmConnectionMethod::GetBoolAttributeL( + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_GETBOOLATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TBool value( 0 ); + TInt err = iCmConnectionMethodWrapper->GetBoolAttribute( aAttribute, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_GETBOOLATTRIBUTEL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::GetStringAttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC* RCmConnectionMethod::GetStringAttributeL( + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_GETSTRINGATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + HBufC* buffer = HBufC::NewLC( KCmmStringLengthMax ); + TInt err = iCmConnectionMethodWrapper->GetStringAttribute( aAttribute, buffer ); + User::LeaveIfError( err ); + + if ( buffer->Length() > 0 ) + { + CleanupStack::Pop( buffer ); + } + else + { + CleanupStack::PopAndDestroy( buffer ); + buffer = NULL; + buffer = KNullDesC().AllocL(); + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_GETSTRINGATTRIBUTEL_EXIT ); + return buffer; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::GetString8AttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* RCmConnectionMethod::GetString8AttributeL( + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_GETSTRING8ATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + HBufC8* buffer8 = HBufC8::NewLC( KCmmStringLengthMax ); + TInt err = iCmConnectionMethodWrapper->GetString8Attribute( aAttribute, buffer8 ); + User::LeaveIfError( err ); + + if ( buffer8->Length() > 0 ) + { + CleanupStack::Pop( buffer8 ); + } + else + { + CleanupStack::PopAndDestroy( buffer8 ); + buffer8 = NULL; + buffer8 = KNullDesC8().AllocL(); + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_GETSTRING8ATTRIBUTEL_EXIT ); + return buffer8; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::SetIntAttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethod::SetIntAttributeL( + TUint32 aAttribute, + TUint32 aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_SETINTATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmConnectionMethodWrapper->SetIntAttribute( aAttribute, aValue ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_SETINTATTRIBUTEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::SetBoolAttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethod::SetBoolAttributeL( + TUint32 aAttribute, + TBool aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_SETBOOLATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmConnectionMethodWrapper->SetBoolAttribute( aAttribute, aValue ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_SETBOOLATTRIBUTEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::SetStringAttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethod::SetStringAttributeL( + TUint32 aAttribute, + const TDesC16& aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_SETSTRINGATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmConnectionMethodWrapper->SetStringAttribute( aAttribute, aValue ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_SETSTRINGATTRIBUTEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::SetString8AttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethod::SetString8AttributeL( + TUint32 aAttribute, + const TDesC8& aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_SETSTRING8ATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmConnectionMethodWrapper->SetString8Attribute( aAttribute, aValue ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_SETSTRING8ATTRIBUTEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::UpdateL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethod::UpdateL() + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_UPDATEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmConnectionMethodWrapper->Update(); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_UPDATEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::DeleteL() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmConnectionMethod::DeleteL() + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_DELETEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TBool result( ETrue ); + TInt err = iCmConnectionMethodWrapper->Delete( result ); + User::LeaveIfError( err ); + + // Instead of calling Close(), we need to force this handle closed even if + // copies have been made. So we delete the destination wrapper directly. + delete iCmConnectionMethodWrapper; + iCmConnectionMethodWrapper = NULL; + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_DELETEL_EXIT ); + return result; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::DestinationL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestination RCmConnectionMethod::DestinationL() const + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_DESTINATIONL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + // If client already has a handle open to this destination, give a + // reference to it. + CCmDestinationWrapper* destWrap = CCmDestinationWrapper::NewLC(); + TInt connMethodHandle = iCmConnectionMethodWrapper->GetHandle(); + TInt existingHandle( 0 ); + destWrap->GetConnMethodAsEmbeddedDestL( + iCmConnectionMethodWrapper->GetMainSession(), + connMethodHandle, + existingHandle ); + if ( existingHandle ) + { + CleanupStack::PopAndDestroy( destWrap ); + destWrap = iCmConnectionMethodWrapper->GetMainSession()->GetDestinationWrapperL( + existingHandle ); + destWrap->IncreaseReferenceCounter(); + } + else + { + CleanupStack::Pop( destWrap ); + } + + RCmDestination dest; + dest.iCmDestinationWrapper = destWrap; + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_DESTINATIONL_EXIT ); + return dest; + } + +//-------------------------------------------------------------------------- +// RCmConnectionMethod::RCmConnectionMethod() +//-------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethod::RCmConnectionMethod() : iCmConnectionMethodWrapper( NULL ) + { + OstTraceFunctionEntry0( DUP2_RCMCONNECTIONMETHOD_RCMCONNECTIONMETHOD_ENTRY ); + OstTraceFunctionExit0( DUP2_RCMCONNECTIONMETHOD_RCMCONNECTIONMETHOD_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::operator=() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethod& RCmConnectionMethod::operator=( + const RCmConnectionMethod& aConnMethod ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_OPERATOR_ENTRY ); + + if ( this != &aConnMethod ) + { + Close(); + this->iCmConnectionMethodWrapper = aConnMethod.iCmConnectionMethodWrapper; + if ( iCmConnectionMethodWrapper ) + { + iCmConnectionMethodWrapper->IncreaseReferenceCounter(); + } + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_OPERATOR_EXIT ); + return *this; + } + +//-------------------------------------------------------------------------- +// RCmConnectionMethod::operator==() +//-------------------------------------------------------------------------- +// +EXPORT_C TBool RCmConnectionMethod::operator==( RCmConnectionMethod& aConnMethod ) const + { + OstTraceFunctionEntry0( DUP1_RCMCONNECTIONMETHOD_OPERATOR_ENTRY ); + + TBool result( EFalse ); + if ( !aConnMethod.iCmConnectionMethodWrapper ) + { + if ( !iCmConnectionMethodWrapper ) + { + result = ETrue; // Both empty. + } + else + { + result = EFalse; + } + } + else if ( !iCmConnectionMethodWrapper ) + { + result = EFalse; + } + else + { + // Both connection method objects have wrappers. + + if ( !iCmConnectionMethodWrapper->SessionConnected() || + !aConnMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + result = EFalse; + } + else + { + // Both connection method objects are connected to server. + + TInt handle = aConnMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmConnectionMethodWrapper->IsEqual( handle, result ); + + if ( err ) + { + result = EFalse; + } + } + } + + OstTraceFunctionExit0( DUP1_RCMCONNECTIONMETHOD_OPERATOR_EXIT ); + return result; + } + +//-------------------------------------------------------------------------- +// +//-------------------------------------------------------------------------- +// +EXPORT_C TBool RCmConnectionMethod::operator!=( RCmConnectionMethod& aConnMethod ) const + { + OstTraceFunctionEntry0( DUP2_RCMCONNECTIONMETHOD_OPERATOR_ENTRY ); + + TBool result = !( operator==( aConnMethod ) ); + + OstTraceFunctionExit0( DUP2_RCMCONNECTIONMETHOD_OPERATOR_EXIT ); + return result; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::GetIconL() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC* RCmConnectionMethod::GetIconL() const + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_GETICONL_ENTRY ); + + User::Leave( KErrNotSupported ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_GETICONL_EXIT ); + return NULL; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::SetIconL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethod::SetIconL( const TDesC& /*aIcon*/ ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_SETICONL_ENTRY ); + + User::Leave( KErrNotSupported ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_SETICONL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethod::RefreshL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethod::RefreshL() + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_REFRESHL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmConnectionMethodWrapper->Refresh(); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHOD_REFRESHL_EXIT ); + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/src/cmconnectionmethodapi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/src/cmconnectionmethodapi.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,405 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Client side IPC handling for Connection Method Manager server. +* +*/ + + +#include "cmmserverdefs.h" +#include "cmconnectionmethodapi.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmconnectionmethodapiTraces.h" +#endif + + +RCmConnectionMethodApi::RCmConnectionMethodApi() + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_RCMCONNECTIONMETHODAPI_ENTRY ); + iSessionConnected = EFalse; + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_RCMCONNECTIONMETHODAPI_EXIT ); + } + +TBool RCmConnectionMethodApi::SessionConnected() const + { + return iSessionConnected; + } + +void RCmConnectionMethodApi::ConnectAndGetConnMethodWithIdL( + const RSessionBase& aSession, + const TUint32 aIapId, + TInt& aExistingHandle ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_CONNECTANDGETCONNMETHODWITHIDL_ENTRY ); + + if ( iSessionConnected ) + { + User::Leave( KErrAlreadyExists ); + } + + aExistingHandle = 0; + TPckg pckg( aExistingHandle ); + TIpcArgs args( aIapId, &pckg ); + TInt result = CreateSubSession( aSession, ECMGetConnMethodWithId, args ); + if ( !aExistingHandle ) + { + User::LeaveIfError( result ); + iSessionConnected = ETrue; + } + else + { + if ( result != KErrAlreadyExists ) + { + User::Leave( result ); + } + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_CONNECTANDGETCONNMETHODWITHIDL_EXIT ); + } + +void RCmConnectionMethodApi::ConnectAndGetConnMethodFromDestWithIndexL( + const RSessionBase& aSession, + const TInt aDestHandle, + const TInt aIndex, + TInt& aExistingHandle ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_CONNECTANDGETCONNMETHODFROMDESTWITHINDEXL_ENTRY ); + + if ( iSessionConnected ) + { + User::Leave( KErrAlreadyExists ); + } + + aExistingHandle = 0; + TPckg pckg( aExistingHandle ); + TIpcArgs args( aDestHandle, aIndex, &pckg ); + TInt result = CreateSubSession( aSession, ECMGetConnMethodFromDestWithIndex, args ); + if ( !aExistingHandle ) + { + User::LeaveIfError( result ); + iSessionConnected = ETrue; + } + else + { + if ( result != KErrAlreadyExists ) + { + User::Leave( result ); + } + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_CONNECTANDGETCONNMETHODFROMDESTWITHINDEXL_EXIT ); + } + +void RCmConnectionMethodApi::ConnectAndGetConnMethodFromDestWithIdL( + const RSessionBase& aSession, + const TInt aDestHandle, + const TInt aIapId, + TInt& aExistingHandle ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_CONNECTANDGETCONNMETHODFROMDESTWITHIDL_ENTRY ); + + if ( iSessionConnected ) + { + User::Leave( KErrAlreadyExists ); + } + + aExistingHandle = 0; + TPckg pckg( aExistingHandle ); + TIpcArgs args( aDestHandle, aIapId, &pckg ); + TInt result = CreateSubSession( aSession, ECMGetConnMethodFromDestWithId, args ); + if ( !aExistingHandle ) + { + User::LeaveIfError( result ); + iSessionConnected = ETrue; + } + else + { + if ( result != KErrAlreadyExists ) + { + User::Leave( result ); + } + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_CONNECTANDGETCONNMETHODFROMDESTWITHIDL_EXIT ); + } + +void RCmConnectionMethodApi::ConnectAndCreateConnMethodL( + const RSessionBase& aSession, + const TUint32 aBearerType ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODL_ENTRY ); + + if ( iSessionConnected ) + { + User::Leave( KErrAlreadyExists ); + } + + TIpcArgs args( aBearerType ); + User::LeaveIfError( CreateSubSession( aSession, ECMCreateConnMethod, args ) ); + iSessionConnected = ETrue; + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODL_EXIT ); + } + +void RCmConnectionMethodApi::ConnectAndCreateConnMethodWithIdL( + const RSessionBase& aSession, + const TUint32 aBearerType, + const TUint32 aIapId ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODWITHIDL_ENTRY ); + + if ( iSessionConnected ) + { + User::Leave( KErrAlreadyExists ); + } + + TIpcArgs args( aBearerType, aIapId ); + User::LeaveIfError( CreateSubSession( aSession, ECMCreateConnMethodWithId, args ) ); + iSessionConnected = ETrue; + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODWITHIDL_EXIT ); + } + +TInt RCmConnectionMethodApi::ConnectAndCreateConnMethodCopy( + const RSessionBase& aSession, + const TInt aConnMethodHandle ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODCOPY_ENTRY ); + + TInt err( KErrNone ); + if ( iSessionConnected ) + { + err = KErrAlreadyExists; + } + else + { + TIpcArgs args( aConnMethodHandle ); + err = CreateSubSession( aSession, ECMCreateCopyOfExisting, args ); + if ( !err ) + { + iSessionConnected = ETrue; + } + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODCOPY_EXIT ); + return err; + } + +void RCmConnectionMethodApi::ConnectAndCreateConnMethodToDestL( + const RSessionBase& aSession, + const TInt aDestHandle, + const TUint32 aBearerType ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODFROMDESTL_ENTRY ); + + if ( iSessionConnected ) + { + User::Leave( KErrAlreadyExists ); + } + + TIpcArgs args( aDestHandle, aBearerType ); + User::LeaveIfError( CreateSubSession( aSession, ECMCreateConnMethodToDest, args ) ); + iSessionConnected = ETrue; + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODFROMDESTL_EXIT ); + } + +void RCmConnectionMethodApi::ConnectAndCreateConnMethodToDestWithIdL( + const RSessionBase& aSession, + const TInt aDestHandle, + const TUint32 aBearerType, + const TUint32 aIapId ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODFROMDESTWITHIDL_ENTRY ); + + if ( iSessionConnected ) + { + User::Leave( KErrAlreadyExists ); + } + + TIpcArgs args( aDestHandle, aBearerType, aIapId ); + User::LeaveIfError( CreateSubSession( aSession, ECMCreateConnMethodToDestWithId, args ) ); + iSessionConnected = ETrue; + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODFROMDESTWITHIDL_EXIT ); + } + +void RCmConnectionMethodApi::Close() + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_CLOSE_ENTRY ); + + if ( iSessionConnected ) + { + CloseSubSession( ECMCloseConnMethod ); + iSessionConnected = EFalse; + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_CLOSE_EXIT ); + } + +TInt RCmConnectionMethodApi::GetIntAttribute( + const TUint32 aAttribute, + TUint32& aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_GETINTATTRIBUTE_ENTRY ); + + TPckg pckg( aValue ); + TIpcArgs args( aAttribute, &pckg ); + TInt err = SendReceive( ECMGetIntAttribute, args ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_GETINTATTRIBUTE_EXIT ); + return err; + } + +TInt RCmConnectionMethodApi::GetBoolAttribute( + const TUint32 aAttribute, + TBool& aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_GETBOOLATTRIBUTE_ENTRY ); + + TPckg pckg( aValue ); + TIpcArgs args( aAttribute, &pckg ); + TInt err = SendReceive( ECMGetBoolAttribute, args ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_GETBOOLATTRIBUTE_EXIT ); + return err; + } + +TInt RCmConnectionMethodApi::GetStringAttribute( + const TUint32 aAttribute, + HBufC* aBuffer ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_GETSTRINGATTRIBUTE_ENTRY ); + + TPtr descriptor( aBuffer->Des() ); + TIpcArgs args( aAttribute, &descriptor ); + TInt err = SendReceive( ECMGetStringAttribute, args ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_GETSTRINGATTRIBUTE_EXIT ); + return err; + } + +TInt RCmConnectionMethodApi::GetString8Attribute( + const TUint32 aAttribute, + HBufC8* aBuffer8 ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_GETSTRING8ATTRIBUTE_ENTRY ); + + TPtr8 descriptor( aBuffer8->Des() ); + TIpcArgs args( aAttribute, &descriptor ); + TInt err = SendReceive( ECMGetString8Attribute, args ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_GETSTRING8ATTRIBUTE_EXIT ); + return err; + } + +TInt RCmConnectionMethodApi::SetIntAttribute( + const TUint32 aAttribute, + const TUint32 aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_SETINTATTRIBUTE_ENTRY ); + + TIpcArgs args( aAttribute, aValue ); + TInt err = SendReceive( ECMSetIntAttribute, args ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_SETINTATTRIBUTE_EXIT ); + return err; + } + +TInt RCmConnectionMethodApi::SetBoolAttribute( + const TUint32 aAttribute, + const TBool aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_SETBOOLATTRIBUTE_ENTRY ); + + TIpcArgs args( aAttribute, aValue ); + TInt err = SendReceive( ECMSetBoolAttribute, args ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_SETBOOLATTRIBUTE_EXIT ); + return err; + } + +TInt RCmConnectionMethodApi::SetStringAttribute( + const TUint32 aAttribute, + const TDesC16& aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_SETSTRINGATTRIBUTE_ENTRY ); + + TIpcArgs args( aAttribute, &aValue ); + TInt err = SendReceive( ECMSetStringAttribute, args ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_SETSTRINGATTRIBUTE_EXIT ); + return err; + } + +TInt RCmConnectionMethodApi::SetString8Attribute( + const TUint32 aAttribute, + const TDesC8& aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_SETSTRING8ATTRIBUTE_ENTRY ); + + TIpcArgs args( aAttribute, &aValue ); + TInt err = SendReceive( ECMSetString8Attribute, args ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_SETSTRING8ATTRIBUTE_EXIT ); + return err; + } + +TInt RCmConnectionMethodApi::Update() + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_UPDATE_ENTRY ); + + TInt err = SendReceive( ECMUpdate ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_UPDATE_EXIT ); + return err; + } + +TInt RCmConnectionMethodApi::Refresh() + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_REFRESH_ENTRY ); + + TInt err = SendReceive( ECMRefresh ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_REFRESH_EXIT ); + return err; + } + +TInt RCmConnectionMethodApi::Delete( TBool& aResult ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_DELETE_ENTRY ); + + TPckg pckg( aResult ); + TIpcArgs args( &pckg ); + TInt err = SendReceive( ECMDelete, args ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_DELETE_EXIT ); + return err; + } + +TInt RCmConnectionMethodApi::IsEqual( const TInt aHandle, TBool& aResult ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODAPI_ISEQUAL_ENTRY ); + + TPckg pckg( aResult ); + TIpcArgs args( aHandle, &pckg ); + TInt err = SendReceive( ECMIsEqual, args ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODAPI_ISEQUAL_EXIT ); + return err; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/src/cmconnectionmethodext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/src/cmconnectionmethodext.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,488 @@ +/* +* Copyright (c) 2006-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 RCmConnectionMethodExt. +* +*/ + + +#include +#include + +#include "cmmserverdefs.h" +#include "cmmanagerapi.h" +#include "cmdestinationwrapper.h" +#include "cmconnectionmethodwrapper.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmconnectionmethodextTraces.h" +#endif + + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::RCmConnectionMethodExt() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethodExt::RCmConnectionMethodExt( + const RCmConnectionMethodExt& aConnMethod ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_RCMCONNECTIONMETHODEXT_ENTRY ); + + this->iCmConnectionMethodWrapper = aConnMethod.iCmConnectionMethodWrapper; + if ( iCmConnectionMethodWrapper ) + { + iCmConnectionMethodWrapper->IncreaseReferenceCounter(); + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_RCMCONNECTIONMETHODEXT_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::Close() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethodExt::Close() + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_CLOSE_ENTRY ); + + if ( iCmConnectionMethodWrapper ) + { + if ( iCmConnectionMethodWrapper->DecreaseReferenceCounter() <= 0 ) + { + delete iCmConnectionMethodWrapper; + } + iCmConnectionMethodWrapper = NULL; + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_CLOSE_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::~RCmConnectionMethodExt() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethodExt::~RCmConnectionMethodExt() + { + OstTraceFunctionEntry0( DUP2_RCMCONNECTIONMETHODEXT_RCMCONNECTIONMETHODEXT_ENTRY ); + Close(); + OstTraceFunctionExit0( DUP2_RCMCONNECTIONMETHODEXT_RCMCONNECTIONMETHODEXT_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::CreateCopyL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethodExt RCmConnectionMethodExt::CreateCopyL() + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_CREATECOPYL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt connMethodHandle = iCmConnectionMethodWrapper->GetHandle(); + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + + TInt err = cmWrapper->CreateConnMethodCopy( + iCmConnectionMethodWrapper->GetMainSession(), + connMethodHandle ); + User::LeaveIfError( err ); + CleanupStack::Pop( cmWrapper ); + + RCmConnectionMethodExt cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_CREATECOPYL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::GetIntAttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmConnectionMethodExt::GetIntAttributeL( + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_GETINTATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TUint32 value( 0 ); + TInt err = iCmConnectionMethodWrapper->GetIntAttribute( aAttribute, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_GETINTATTRIBUTEL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::GetBoolAttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmConnectionMethodExt::GetBoolAttributeL( + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_GETBOOLATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TBool value( 0 ); + TInt err = iCmConnectionMethodWrapper->GetBoolAttribute( aAttribute, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_GETBOOLATTRIBUTEL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::GetStringAttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC* RCmConnectionMethodExt::GetStringAttributeL( + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_GETSTRINGATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + HBufC* buffer = HBufC::NewLC( KCmmStringLengthMax ); + TInt err = iCmConnectionMethodWrapper->GetStringAttribute( aAttribute, buffer ); + User::LeaveIfError( err ); + + if ( buffer->Length() > 0 ) + { + CleanupStack::Pop( buffer ); + } + else + { + CleanupStack::PopAndDestroy( buffer ); + buffer = NULL; + buffer = KNullDesC().AllocL(); + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_GETSTRINGATTRIBUTEL_EXIT ); + return buffer; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::GetString8AttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* RCmConnectionMethodExt::GetString8AttributeL( + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_GETSTRING8ATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + HBufC8* buffer8 = HBufC8::NewLC( KCmmStringLengthMax ); + TInt err = iCmConnectionMethodWrapper->GetString8Attribute( aAttribute, buffer8 ); + User::LeaveIfError( err ); + + if ( buffer8->Length() > 0 ) + { + CleanupStack::Pop( buffer8 ); + } + else + { + CleanupStack::PopAndDestroy( buffer8 ); + buffer8 = NULL; + buffer8 = KNullDesC8().AllocL(); + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_GETSTRING8ATTRIBUTEL_EXIT ); + return buffer8; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::SetIntAttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethodExt::SetIntAttributeL( + TUint32 aAttribute, + TUint32 aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_SETINTATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmConnectionMethodWrapper->SetIntAttribute( aAttribute, aValue ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_SETINTATTRIBUTEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::SetBoolAttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethodExt::SetBoolAttributeL( + TUint32 aAttribute, + TBool aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_SETBOOLATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmConnectionMethodWrapper->SetBoolAttribute( aAttribute, aValue ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_SETBOOLATTRIBUTEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::SetStringAttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethodExt::SetStringAttributeL( + TUint32 aAttribute, + const TDesC16& aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_SETSTRINGATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmConnectionMethodWrapper->SetStringAttribute( aAttribute, aValue ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_SETSTRINGATTRIBUTEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::SetString8AttributeL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethodExt::SetString8AttributeL( + TUint32 aAttribute, + const TDesC8& aValue ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_SETSTRING8ATTRIBUTEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmConnectionMethodWrapper->SetString8Attribute( aAttribute, aValue ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_SETSTRING8ATTRIBUTEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::UpdateL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmConnectionMethodExt::UpdateL() + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_UPDATEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmConnectionMethodWrapper->Update(); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_UPDATEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::DeleteL() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmConnectionMethodExt::DeleteL() + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_DELETEL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TBool result( ETrue ); + TInt err = iCmConnectionMethodWrapper->Delete( result ); + User::LeaveIfError( err ); + + delete iCmConnectionMethodWrapper; + iCmConnectionMethodWrapper = NULL; + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_DELETEL_EXIT ); + return result; + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::DestinationL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestinationExt RCmConnectionMethodExt::DestinationL() const + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_DESTINATIONL_ENTRY ); + + if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + // If client already has a handle open to this destination, give a + // reference to it. + CCmDestinationWrapper* destWrap = CCmDestinationWrapper::NewLC(); + TInt connMethodHandle = iCmConnectionMethodWrapper->GetHandle(); + TInt existingHandle( 0 ); + destWrap->GetConnMethodAsEmbeddedDestL( + iCmConnectionMethodWrapper->GetMainSession(), + connMethodHandle, + existingHandle ); + if ( existingHandle ) + { + CleanupStack::PopAndDestroy( destWrap ); + destWrap = iCmConnectionMethodWrapper->GetMainSession()->GetDestinationWrapperL( + existingHandle ); + destWrap->IncreaseReferenceCounter(); + } + else + { + CleanupStack::Pop( destWrap ); + } + + RCmDestinationExt dest; + dest.iCmDestinationWrapper = destWrap; + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_DESTINATIONL_EXIT ); + return dest; + } + +//-------------------------------------------------------------------------- +// RCmConnectionMethodExt::RCmConnectionMethodExt() +//-------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethodExt::RCmConnectionMethodExt() : iCmConnectionMethodWrapper( NULL ) + { + OstTraceFunctionEntry0( DUP1_RCMCONNECTIONMETHODEXT_RCMCONNECTIONMETHODEXT_ENTRY ); + OstTraceFunctionExit0( DUP1_RCMCONNECTIONMETHODEXT_RCMCONNECTIONMETHODEXT_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmConnectionMethodExt::operator=() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethodExt& RCmConnectionMethodExt::operator=( + const RCmConnectionMethodExt& aConnMethod ) + { + OstTraceFunctionEntry0( RCMCONNECTIONMETHODEXT_OPERATOR_ENTRY ); + + if ( this != &aConnMethod ) + { + Close(); + this->iCmConnectionMethodWrapper = aConnMethod.iCmConnectionMethodWrapper; + if ( iCmConnectionMethodWrapper ) + { + iCmConnectionMethodWrapper->IncreaseReferenceCounter(); + } + } + + OstTraceFunctionExit0( RCMCONNECTIONMETHODEXT_OPERATOR_EXIT ); + return *this; + } + +//-------------------------------------------------------------------------- +// RCmConnectionMethodExt::operator==() +//-------------------------------------------------------------------------- +// +EXPORT_C TBool RCmConnectionMethodExt::operator==( RCmConnectionMethodExt& aConnMethod ) const + { + OstTraceFunctionEntry0( DUP1_RCMCONNECTIONMETHODEXT_OPERATOR_ENTRY ); + + TBool result( EFalse ); + if ( !aConnMethod.iCmConnectionMethodWrapper ) + { + if ( !iCmConnectionMethodWrapper ) + { + result = ETrue; // Both empty + } + else + { + result = EFalse; + } + } + else if ( !iCmConnectionMethodWrapper ) + { + result = EFalse; + } + else + { + // Both connection method objects have wrappers. + + if ( !iCmConnectionMethodWrapper->SessionConnected() || + !aConnMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + result = EFalse; + } + else + { + // Both connection method objects are connected to server. + + TInt handle = aConnMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmConnectionMethodWrapper->IsEqual( handle, result ); + + if ( err ) + { + result = EFalse; + } + } + } + + OstTraceFunctionExit0( DUP1_RCMCONNECTIONMETHODEXT_OPERATOR_EXIT ); + return result; + } + +//-------------------------------------------------------------------------- +// +//-------------------------------------------------------------------------- +// +EXPORT_C TBool RCmConnectionMethodExt::operator!=( RCmConnectionMethodExt& aConnMethod ) const + { + OstTraceFunctionEntry0( DUP2_RCMCONNECTIONMETHODEXT_OPERATOR_ENTRY ); + + TBool result = !( operator==( aConnMethod ) ); + + OstTraceFunctionExit0( DUP2_RCMCONNECTIONMETHODEXT_OPERATOR_EXIT ); + return result; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/src/cmconnectionmethodwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/src/cmconnectionmethodwrapper.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,448 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Collects API calls from RCmConnectionMethod- and +* RCmConnectionMethodExt-classes. +* +*/ + + +#include "cmconnectionmethodwrapper.h" +#include "cmmanagerapi.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmconnectionmethodwrapperTraces.h" +#endif + + +CCmConnectionMethodWrapper* CCmConnectionMethodWrapper::NewL() + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_NEWL_ENTRY ); + + CCmConnectionMethodWrapper* self = CCmConnectionMethodWrapper::NewLC(); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_NEWL_EXIT ); + return self; + } + +CCmConnectionMethodWrapper* CCmConnectionMethodWrapper::NewLC() + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_NEWLC_ENTRY ); + + CCmConnectionMethodWrapper* self = new (ELeave) CCmConnectionMethodWrapper; + CleanupStack::PushL( self ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_NEWLC_EXIT ); + return self; + } + +CCmConnectionMethodWrapper::~CCmConnectionMethodWrapper() + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_CCMCONNECTIONMETHODWRAPPER_ENTRY ); + + iCmConnectionMethodApi.Close(); + + if ( iCmManagerApi ) + { + iCmManagerApi->RemoveConnMethodWrapper( this ); + iCmManagerApi = NULL; + } + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_CCMCONNECTIONMETHODWRAPPER_EXIT ); + } + +CCmConnectionMethodWrapper::CCmConnectionMethodWrapper() + { + OstTraceFunctionEntry0( DUP1_CCMCONNECTIONMETHODWRAPPER_CCMCONNECTIONMETHODWRAPPER_ENTRY ); + + iCmManagerApi = NULL; + iReferenceCounter = 1; + + OstTraceFunctionExit0( DUP1_CCMCONNECTIONMETHODWRAPPER_CCMCONNECTIONMETHODWRAPPER_EXIT ); + } + +void CCmConnectionMethodWrapper::GetConnMethodWithIdL( + RCmManagerApi* aCmManagerApi, + const TUint32 aIapId, + TInt& aExistingHandle ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_GETCONNMETHODWITHIDL_ENTRY ); + + if ( iCmManagerApi || iCmConnectionMethodApi.SessionConnected() ) + { + User::Leave( KErrAlreadyExists ); + } + + iCmManagerApi = aCmManagerApi; + iCmConnectionMethodApi.ConnectAndGetConnMethodWithIdL( *aCmManagerApi, aIapId, aExistingHandle ); + if ( !aExistingHandle ) + { + iCmManagerApi->StoreConnMethodWrapper( this ); + } + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_GETCONNMETHODWITHIDL_EXIT ); + } + +void CCmConnectionMethodWrapper::GetConnMethodFromDestWithIndexL( + RCmManagerApi* aCmManagerApi, + const TInt aDestHandle, + const TInt aIndex, + TInt& aExistingHandle ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_GETCONNMETHODFROMDESTWITHINDEXL_ENTRY ); + + if ( iCmManagerApi || iCmConnectionMethodApi.SessionConnected() ) + { + User::Leave( KErrAlreadyExists ); + } + + iCmManagerApi = aCmManagerApi; + iCmConnectionMethodApi.ConnectAndGetConnMethodFromDestWithIndexL( + *aCmManagerApi, + aDestHandle, + aIndex, + aExistingHandle ); + if ( !aExistingHandle ) + { + iCmManagerApi->StoreConnMethodWrapper( this ); + } + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_GETCONNMETHODFROMDESTWITHINDEXL_EXIT ); + } + +void CCmConnectionMethodWrapper::GetConnMethodFromDestWithIdL( + RCmManagerApi* aCmManagerApi, + const TInt aDestHandle, + const TInt aIapId, + TInt& aExistingHandle ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_GETCONNMETHODFROMDESTWITHIDL_ENTRY ); + + if ( iCmManagerApi || iCmConnectionMethodApi.SessionConnected() ) + { + User::Leave( KErrAlreadyExists ); + } + + iCmManagerApi = aCmManagerApi; + iCmConnectionMethodApi.ConnectAndGetConnMethodFromDestWithIdL( + *aCmManagerApi, + aDestHandle, + aIapId, + aExistingHandle ); + if ( !aExistingHandle ) + { + iCmManagerApi->StoreConnMethodWrapper( this ); + } + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_GETCONNMETHODFROMDESTWITHIDL_EXIT ); + } + +void CCmConnectionMethodWrapper::CreateConnMethodL( + RCmManagerApi* aCmManagerApi, + const TUint32 aBearerType ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODL_ENTRY ); + + if ( iCmManagerApi || iCmConnectionMethodApi.SessionConnected() ) + { + User::Leave( KErrAlreadyExists ); + } + + iCmManagerApi = aCmManagerApi; + iCmConnectionMethodApi.ConnectAndCreateConnMethodL( + *aCmManagerApi, + aBearerType ); + iCmManagerApi->StoreConnMethodWrapper( this ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODL_EXIT ); + } + +void CCmConnectionMethodWrapper::CreateConnMethodWithIdL( + RCmManagerApi* aCmManagerApi, + const TUint32 aBearerType, + const TUint32 aIapId ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODWITHIDL_ENTRY ); + + if ( iCmManagerApi || iCmConnectionMethodApi.SessionConnected() ) + { + User::Leave( KErrAlreadyExists ); + } + + iCmManagerApi = aCmManagerApi; + iCmConnectionMethodApi.ConnectAndCreateConnMethodWithIdL( + *aCmManagerApi, + aBearerType, + aIapId ); + iCmManagerApi->StoreConnMethodWrapper( this ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODWITHIDL_EXIT ); + } + +TInt CCmConnectionMethodWrapper::CreateConnMethodCopy( + RCmManagerApi* aCmManagerApi, + const TInt aConnMethodHandle ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODCOPY_ENTRY ); + + TInt err( KErrNone ); + + if ( iCmManagerApi || iCmConnectionMethodApi.SessionConnected() ) + { + err = KErrAlreadyExists; + } + else + { + err = iCmConnectionMethodApi.ConnectAndCreateConnMethodCopy( + *aCmManagerApi, + aConnMethodHandle ); + if ( !err ) + { + iCmManagerApi = aCmManagerApi; + iCmManagerApi->StoreConnMethodWrapper( this ); + } + } + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODCOPY_EXIT ); + return err; + } + +void CCmConnectionMethodWrapper::CreateConnMethodToDestL( + RCmManagerApi* aCmManagerApi, + const TInt aDestHandle, + const TUint32 aBearerType ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODFROMDESTL_ENTRY ); + + if ( iCmManagerApi || iCmConnectionMethodApi.SessionConnected() ) + { + User::Leave( KErrAlreadyExists ); + } + + iCmManagerApi = aCmManagerApi; + iCmConnectionMethodApi.ConnectAndCreateConnMethodToDestL( + *aCmManagerApi, + aDestHandle, + aBearerType ); + iCmManagerApi->StoreConnMethodWrapper( this ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODFROMDESTL_EXIT ); + } + +void CCmConnectionMethodWrapper::CreateConnMethodToDestWithIdL( + RCmManagerApi* aCmManagerApi, + const TInt aDestHandle, + const TUint32 aBearerType, + const TUint32 aIapId ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODFROMDESTWITHIDL_ENTRY ); + + if ( iCmManagerApi || iCmConnectionMethodApi.SessionConnected() ) + { + User::Leave( KErrAlreadyExists ); + } + + iCmManagerApi = aCmManagerApi; + iCmConnectionMethodApi.ConnectAndCreateConnMethodToDestWithIdL( + *aCmManagerApi, + aDestHandle, + aBearerType, + aIapId ); + iCmManagerApi->StoreConnMethodWrapper( this ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODFROMDESTWITHIDL_EXIT ); + } + +TInt CCmConnectionMethodWrapper::GetIntAttribute( + const TUint32 aAttribute, + TUint32& aValue ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_GETINTATTRIBUTE_ENTRY ); + + TInt err = iCmConnectionMethodApi.GetIntAttribute( aAttribute, aValue ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_GETINTATTRIBUTE_EXIT ); + return err; + } + +TInt CCmConnectionMethodWrapper::GetBoolAttribute( + const TUint32 aAttribute, + TBool& aValue ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_GETBOOLATTRIBUTE_ENTRY ); + + TInt err = iCmConnectionMethodApi.GetBoolAttribute( aAttribute, aValue ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_GETBOOLATTRIBUTE_EXIT ); + return err; + } + +TInt CCmConnectionMethodWrapper::GetStringAttribute( + const TUint32 aAttribute, + HBufC* aBuffer ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_GETSTRINGATTRIBUTE_ENTRY ); + + TInt err = iCmConnectionMethodApi.GetStringAttribute( aAttribute, aBuffer ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_GETSTRINGATTRIBUTE_EXIT ); + return err; + } + +TInt CCmConnectionMethodWrapper::GetString8Attribute( + const TUint32 aAttribute, + HBufC8* aBuffer8 ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_GETSTRING8ATTRIBUTE_ENTRY ); + + TInt err = iCmConnectionMethodApi.GetString8Attribute( aAttribute, aBuffer8 ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_GETSTRING8ATTRIBUTE_EXIT ); + return err; + } + +TInt CCmConnectionMethodWrapper::SetIntAttribute( + const TUint32 aAttribute, + const TUint32 aValue ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_SETINTATTRIBUTE_ENTRY ); + + TInt err = iCmConnectionMethodApi.SetIntAttribute( aAttribute, aValue ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_SETINTATTRIBUTE_EXIT ); + return err; + } + +TInt CCmConnectionMethodWrapper::SetBoolAttribute( + const TUint32 aAttribute, + const TBool aValue ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_SETBOOLATTRIBUTE_ENTRY ); + + TInt err = iCmConnectionMethodApi.SetBoolAttribute( aAttribute, aValue ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_SETBOOLATTRIBUTE_EXIT ); + return err; + } + +TInt CCmConnectionMethodWrapper::SetStringAttribute( + const TUint32 aAttribute, + const TDesC16& aValue ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_SETSTRINGATTRIBUTE_ENTRY ); + + TInt err = iCmConnectionMethodApi.SetStringAttribute( aAttribute, aValue ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_SETSTRINGATTRIBUTE_EXIT ); + return err; + } + +TInt CCmConnectionMethodWrapper::SetString8Attribute( + const TUint32 aAttribute, + const TDesC8& aValue ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_SETSTRING8ATTRIBUTE_ENTRY ); + + TInt err = iCmConnectionMethodApi.SetString8Attribute( aAttribute, aValue ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_SETSTRING8ATTRIBUTE_EXIT ); + return err; + } + +TInt CCmConnectionMethodWrapper::Update() + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_UPDATE_ENTRY ); + + TInt result = iCmConnectionMethodApi.Update(); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_UPDATE_EXIT ); + return result; + } + +TInt CCmConnectionMethodWrapper::Refresh() + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_REFRESH_ENTRY ); + + TInt result = iCmConnectionMethodApi.Refresh(); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_REFRESH_EXIT ); + return result; + } + +TInt CCmConnectionMethodWrapper::Delete( TBool& aResult ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_DELETE_ENTRY ); + + TInt err = iCmConnectionMethodApi.Delete( aResult ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_DELETE_EXIT ); + return err; + } + +TInt CCmConnectionMethodWrapper::IsEqual( const TInt aHandle, TBool& aResult ) + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_ISEQUAL_ENTRY ); + + TInt err = iCmConnectionMethodApi.IsEqual( aHandle, aResult ); + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_ISEQUAL_EXIT ); + return err; + } + +TBool CCmConnectionMethodWrapper::SessionConnected() const + { + return iCmConnectionMethodApi.SessionConnected(); + } + +void CCmConnectionMethodWrapper::CloseSession() + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_CLOSESESSION_ENTRY ); + iCmConnectionMethodApi.Close(); + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_CLOSESESSION_EXIT ); + } + +TInt CCmConnectionMethodWrapper::GetHandle() const + { + return iCmConnectionMethodApi.SubSessionHandle(); + } + +RCmManagerApi* CCmConnectionMethodWrapper::GetMainSession() const + { + return iCmManagerApi; + } + +void CCmConnectionMethodWrapper::IncreaseReferenceCounter() + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_INCREASEREFERENCECOUNTER_ENTRY ); + iReferenceCounter++; + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_INCREASEREFERENCECOUNTER_EXIT ); + } + +TInt CCmConnectionMethodWrapper::DecreaseReferenceCounter() + { + OstTraceFunctionEntry0( CCMCONNECTIONMETHODWRAPPER_DECREASEREFERENCECOUNTER_ENTRY ); + + iReferenceCounter--; + if ( iReferenceCounter < 0 ) + { + iReferenceCounter = 0; + } + + OstTraceFunctionExit0( CCMCONNECTIONMETHODWRAPPER_DECREASEREFERENCECOUNTER_EXIT ); + return iReferenceCounter; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/src/cmdestination.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/src/cmdestination.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,837 @@ +/* +* Copyright (c) 2006-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 RCmDestination. +* +*/ + + +#include +#include + +#include "cmmserverdefs.h" +#include "cmmanagerapi.h" +#include "cmdestinationwrapper.h" +#include "cmconnectionmethodwrapper.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmdestinationTraces.h" +#endif + + +//----------------------------------------------------------------------------- +// RCmDestination::Close() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestination::Close() + { + OstTraceFunctionEntry0( RCMDESTINATION_CLOSE_ENTRY ); + + if ( iCmDestinationWrapper ) + { + if ( iCmDestinationWrapper->DecreaseReferenceCounter() <= 0 ) + { + delete iCmDestinationWrapper; + } + iCmDestinationWrapper = NULL; + } + + OstTraceFunctionExit0( RCMDESTINATION_CLOSE_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::~RCmDestination() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestination::~RCmDestination() + { + OstTraceFunctionEntry0( RCMDESTINATION_RCMDESTINATION_ENTRY ); + Close(); + OstTraceFunctionExit0( RCMDESTINATION_RCMDESTINATION_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::RCmDestination() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestination::RCmDestination( + const RCmDestination& aDestination ) + { + OstTraceFunctionEntry0( DUP1_RCMDESTINATION_RCMDESTINATION_ENTRY ); + + this->iCmDestinationWrapper = aDestination.iCmDestinationWrapper; + if ( iCmDestinationWrapper ) + { + iCmDestinationWrapper->IncreaseReferenceCounter(); + } + + OstTraceFunctionExit0( DUP1_RCMDESTINATION_RCMDESTINATION_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::operator=() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestination& RCmDestination::operator=( + const RCmDestination& aDestination ) + { + OstTraceFunctionEntry0( RCMDESTINATION_OPERATOR_ENTRY ); + + if ( this != &aDestination ) + { + Close(); + this->iCmDestinationWrapper = aDestination.iCmDestinationWrapper; + if ( iCmDestinationWrapper ) + { + iCmDestinationWrapper->IncreaseReferenceCounter(); + } + } + + OstTraceFunctionExit0( RCMDESTINATION_OPERATOR_EXIT ); + return *this; + } + +//----------------------------------------------------------------------------- +// RCmDestination::ConnectionMethodCount() +//----------------------------------------------------------------------------- +// +EXPORT_C TInt RCmDestination::ConnectionMethodCount() const + { + OstTraceFunctionEntry0( RCMDESTINATION_CONNECTIONMETHODCOUNT_ENTRY ); + + __ASSERT_ALWAYS( iCmDestinationWrapper && iCmDestinationWrapper->SessionConnected(), + User::Panic( KCmmPanicCategoryApi, EDestNotConnectedToServer ) ); + + TInt value( 0 ); + TInt err = iCmDestinationWrapper->ConnectionMethodCount( value ); + + if ( err ) + { + value = 0; + } + + OstTraceFunctionExit0( RCMDESTINATION_CONNECTIONMETHODCOUNT_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmDestination::ConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethod RCmDestination::ConnectionMethodL( + TInt aIndex ) const + { + OstTraceFunctionEntry0( RCMDESTINATION_CONNECTIONMETHODL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + TInt destHandle = iCmDestinationWrapper->GetHandle(); + TInt existingHandle( 0 ); + cmWrapper->GetConnMethodFromDestWithIndexL( + iCmDestinationWrapper->GetMainSession(), + destHandle, + aIndex, + existingHandle ); + if ( existingHandle ) + { + CleanupStack::PopAndDestroy( cmWrapper ); + cmWrapper = iCmDestinationWrapper->GetMainSession()->GetConnMethodWrapperL( existingHandle ); + cmWrapper->IncreaseReferenceCounter(); + } + else + { + CleanupStack::Pop( cmWrapper ); + } + + RCmConnectionMethod cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( RCMDESTINATION_CONNECTIONMETHODL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmDestination::ConnectionMethodByIDL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethod RCmDestination::ConnectionMethodByIDL( + TInt aConnMethodId ) const + { + OstTraceFunctionEntry0( RCMDESTINATION_CONNECTIONMETHODBYIDL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + TInt destHandle = iCmDestinationWrapper->GetHandle(); + TInt existingHandle( 0 ); + cmWrapper->GetConnMethodFromDestWithIdL( + iCmDestinationWrapper->GetMainSession(), + destHandle, + aConnMethodId, + existingHandle ); + if ( existingHandle ) + { + CleanupStack::PopAndDestroy( cmWrapper ); + cmWrapper = iCmDestinationWrapper->GetMainSession()->GetConnMethodWrapperL( + existingHandle ); + cmWrapper->IncreaseReferenceCounter(); + } + else + { + CleanupStack::Pop( cmWrapper ); + } + + RCmConnectionMethod cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( RCMDESTINATION_CONNECTIONMETHODBYIDL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmDestination::PriorityL() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint RCmDestination::PriorityL( + const RCmConnectionMethod& aConnectionMethod ) const + { + OstTraceFunctionEntry0( RCMDESTINATION_PRIORITYL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + if ( !aConnectionMethod.iCmConnectionMethodWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TUint priority( 0 ); + TInt handle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->Priority( handle, priority ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_PRIORITYL_EXIT ); + return priority; + } + +//----------------------------------------------------------------------------- +// RCmDestination::NameLC() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC* RCmDestination::NameLC() const + { + OstTraceFunctionEntry0( RCMDESTINATION_NAMELC_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + HBufC* buffer = HBufC::NewLC( KCmmStringLengthMax ); + TInt err = iCmDestinationWrapper->GetName( buffer ); + User::LeaveIfError( err ); + // Leave buffer in cleanup stack. + + OstTraceFunctionExit0( RCMDESTINATION_NAMELC_EXIT ); + return buffer; + } + +//----------------------------------------------------------------------------- +// RCmDestination::Id() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmDestination::Id() const + { + OstTraceFunctionEntry0( RCMDESTINATION_ID_ENTRY ); + + __ASSERT_ALWAYS( iCmDestinationWrapper && iCmDestinationWrapper->SessionConnected(), + User::Panic( KCmmPanicCategoryApi, EDestNotConnectedToServer ) ); + + TUint32 id( 0 ); + TInt err = iCmDestinationWrapper->GetId( id ); + + if ( err ) + { + id = 0; + } + + OstTraceFunctionExit0( RCMDESTINATION_ID_EXIT ); + return id; + } + +//----------------------------------------------------------------------------- +// RCmDestination::ElementId() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmDestination::ElementId() const + { + OstTraceFunctionEntry0( RCMDESTINATION_ELEMENTID_ENTRY ); + + __ASSERT_ALWAYS( iCmDestinationWrapper && iCmDestinationWrapper->SessionConnected(), + User::Panic( KCmmPanicCategoryApi, EDestNotConnectedToServer ) ); + + TUint32 elementId( 0 ); + TInt err = iCmDestinationWrapper->GetElementId( elementId ); + + if ( err ) + { + elementId = 0; + } + + OstTraceFunctionExit0( RCMDESTINATION_ELEMENTID_EXIT ); + return elementId; + } + +//----------------------------------------------------------------------------- +// RCmDestination::MetadataL() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmDestination::MetadataL( + CMManager::TSnapMetadataField aMetadataField ) const + { + OstTraceFunctionEntry0( RCMDESTINATION_METADATAL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TUint32 value( 0 ); + TInt err = iCmDestinationWrapper->GetMetadata( aMetadataField, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_METADATAL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmDestination::ProtectionLevel() +//----------------------------------------------------------------------------- +// +EXPORT_C CMManager::TProtectionLevel RCmDestination::ProtectionLevel() const + { + OstTraceFunctionEntry0( RCMDESTINATION_PROTECTIONLEVEL_ENTRY ); + + __ASSERT_ALWAYS( iCmDestinationWrapper && iCmDestinationWrapper->SessionConnected(), + User::Panic( KCmmPanicCategoryApi, EDestNotConnectedToServer ) ); + + TInt protectionLevel( CMManager::EProtLevel0 ); + TInt err = iCmDestinationWrapper->GetProtectionLevel( protectionLevel ); + + if ( err ) + { + protectionLevel = CMManager::EProtLevel0; + } + + OstTraceFunctionExit0( RCMDESTINATION_PROTECTIONLEVEL_EXIT ); + return ( CMManager::TProtectionLevel )protectionLevel; + } + +//----------------------------------------------------------------------------- +// RCmDestination::IsHidden() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmDestination::IsHidden() const + { + OstTraceFunctionEntry0( RCMDESTINATION_ISHIDDEN_ENTRY ); + + __ASSERT_ALWAYS( iCmDestinationWrapper && iCmDestinationWrapper->SessionConnected(), + User::Panic( KCmmPanicCategoryApi, EDestNotConnectedToServer ) ); + + TBool value( EFalse ); + TInt err = iCmDestinationWrapper->IsHidden( value ); + + if ( err ) + { + value = EFalse; + } + + OstTraceFunctionExit0( RCMDESTINATION_ISHIDDEN_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmDestination::CreateConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethod RCmDestination::CreateConnectionMethodL( + TUint32 aBearerType ) + { + OstTraceFunctionEntry0( RCMDESTINATION_CREATECONNECTIONMETHODL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + TInt destHandle = iCmDestinationWrapper->GetHandle(); + cmWrapper->CreateConnMethodToDestL( + iCmDestinationWrapper->GetMainSession(), + destHandle, + aBearerType ); + CleanupStack::Pop( cmWrapper ); + + RCmConnectionMethod cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( RCMDESTINATION_CREATECONNECTIONMETHODL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmDestination::CreateConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethod RCmDestination::CreateConnectionMethodL( + TUint32 aBearerType, + TUint32 aConnMethodId ) + { + OstTraceFunctionEntry0( DUP1_RCMDESTINATION_CREATECONNECTIONMETHODL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + TInt destHandle = iCmDestinationWrapper->GetHandle(); + cmWrapper->CreateConnMethodToDestWithIdL( + iCmDestinationWrapper->GetMainSession(), + destHandle, + aBearerType, + aConnMethodId ); + CleanupStack::Pop( cmWrapper ); + + RCmConnectionMethod cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( DUP1_RCMDESTINATION_CREATECONNECTIONMETHODL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmDestination::AddConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C TInt RCmDestination::AddConnectionMethodL( + RCmConnectionMethod aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMDESTINATION_ADDCONNECTIONMETHODL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + if ( !aConnectionMethod.iCmConnectionMethodWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt index( 0 ); + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->AddConnectionMethod( connMethodHandle, index ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_ADDCONNECTIONMETHODL_EXIT ); + return index; + } + +//----------------------------------------------------------------------------- +// RCmDestination::AddEmbeddedDestinationL() +//----------------------------------------------------------------------------- +// +EXPORT_C TInt RCmDestination::AddEmbeddedDestinationL( + const RCmDestination& aDestination ) + { + OstTraceFunctionEntry0( RCMDESTINATION_ADDEMBEDDEDDESTINATIONL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + if ( iCmDestinationWrapper == aDestination.iCmDestinationWrapper ) + { + User::Leave( KErrArgument ); + } + if ( !aDestination.iCmDestinationWrapper || + !aDestination.iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt index( 0 ); + TInt destinationHandle = aDestination.iCmDestinationWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->AddEmbeddedDestination( destinationHandle, index ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_ADDEMBEDDEDDESTINATIONL_EXIT ); + return index; + } + +//----------------------------------------------------------------------------- +// RCmDestination::DeleteConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestination::DeleteConnectionMethodL( + RCmConnectionMethod& aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMDESTINATION_DELETECONNECTIONMETHODL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + if ( !aConnectionMethod.iCmConnectionMethodWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->DeleteConnectionMethod( connMethodHandle ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_DELETECONNECTIONMETHODL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::RemoveConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestination::RemoveConnectionMethodL( + RCmConnectionMethod aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMDESTINATION_REMOVECONNECTIONMETHODL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + if ( !aConnectionMethod.iCmConnectionMethodWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->RemoveConnectionMethod( connMethodHandle ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_REMOVECONNECTIONMETHODL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::ModifyPriorityL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestination::ModifyPriorityL( + RCmConnectionMethod& aConnectionMethod, + TUint aIndex ) + { + OstTraceFunctionEntry0( RCMDESTINATION_MODIFYPRIORITYL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + if ( !aConnectionMethod.iCmConnectionMethodWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->ModifyPriority( connMethodHandle, aIndex ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_MODIFYPRIORITYL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::SetNameL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestination::SetNameL( const TDesC& aName ) + { + OstTraceFunctionEntry0( RCMDESTINATION_SETNAMEL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmDestinationWrapper->SetName( aName ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_SETNAMEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::SetMetadataL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestination::SetMetadataL( + CMManager::TSnapMetadataField aMetadataField, + TUint32 aValue ) + { + OstTraceFunctionEntry0( RCMDESTINATION_SETMETADATAL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmDestinationWrapper->SetMetadata( aMetadataField, aValue ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_SETMETADATAL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::SetProtectionL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestination::SetProtectionL( CMManager::TProtectionLevel aProtLevel ) + { + OstTraceFunctionEntry0( RCMDESTINATION_SETPROTECTIONL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmDestinationWrapper->SetProtection( aProtLevel ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_SETPROTECTIONL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::SetHiddenL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestination::SetHiddenL( TBool aHidden ) + { + OstTraceFunctionEntry0( RCMDESTINATION_SETHIDDENL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmDestinationWrapper->SetHidden( aHidden ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_SETHIDDENL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::UpdateL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestination::UpdateL() + { + OstTraceFunctionEntry0( RCMDESTINATION_UPDATEL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmDestinationWrapper->Update(); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_UPDATEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::DeleteLD() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestination::DeleteLD() + { + OstTraceFunctionEntry0( RCMDESTINATION_DELETELD_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmDestinationWrapper->Delete(); + User::LeaveIfError( err ); + + // Instead of calling Close(), we need to force this handle closed even if + // copies have been made. So we delete the destination wrapper directly. + delete iCmDestinationWrapper; + iCmDestinationWrapper = NULL; + + OstTraceFunctionExit0( RCMDESTINATION_DELETELD_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::IsConnectedL() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmDestination::IsConnectedL() const + { + OstTraceFunctionEntry0( RCMDESTINATION_ISCONNECTEDL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TBool value( 0 ); + TInt err = iCmDestinationWrapper->IsConnected( value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_ISCONNECTEDL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmDestination::RCmDestination() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestination::RCmDestination() : iCmDestinationWrapper( NULL ) + { + OstTraceFunctionEntry0( DUP2_RCMDESTINATION_RCMDESTINATION_ENTRY ); + OstTraceFunctionExit0( DUP2_RCMDESTINATION_RCMDESTINATION_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::operator==() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmDestination::operator==( + const RCmDestination& aDestination ) const + { + OstTraceFunctionEntry0( DUP1_RCMDESTINATION_OPERATOR_ENTRY ); + + TBool result( EFalse ); + if ( !aDestination.iCmDestinationWrapper ) + { + if ( !iCmDestinationWrapper ) + { + result = ETrue; // Both empty. + } + else + { + result = EFalse; + } + } + else if ( !iCmDestinationWrapper ) + { + result = EFalse; + } + else + { + // Both destination objects have wrappers. + + if ( !iCmDestinationWrapper->SessionConnected() || + !aDestination.iCmDestinationWrapper->SessionConnected() ) + { + result = EFalse; + } + else + { + // Both destination objects are connected to server. + + TInt handle = aDestination.iCmDestinationWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->IsEqual( handle, result ); + if ( err ) + { + result = EFalse; + } + } + } + + OstTraceFunctionExit0( DUP1_RCMDESTINATION_OPERATOR_EXIT ); + return result; + } + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmDestination::operator!=( + const RCmDestination& aDestination ) const + { + OstTraceFunctionEntry0( DUP2_RCMDESTINATION_OPERATOR_ENTRY ); + + TBool result = !( operator==( aDestination ) ); + + OstTraceFunctionExit0( DUP2_RCMDESTINATION_OPERATOR_EXIT ); + return result; + } + +//----------------------------------------------------------------------------- +// RCmDestination::GetIconL() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC* RCmDestination::GetIconL() const + { + OstTraceFunctionEntry0( RCMDESTINATION_GETICONL_ENTRY ); + + User::Leave( KErrNotSupported ); + + OstTraceFunctionExit0( RCMDESTINATION_GETICONL_EXIT ); + return NULL; + } + +//----------------------------------------------------------------------------- +// RCmDestination::SetIconL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestination::SetIconL( const TDesC& /*aIcon*/ ) + { + OstTraceFunctionEntry0( RCMDESTINATION_SETICONL_ENTRY ); + + User::Leave( KErrNotSupported ); + + OstTraceFunctionExit0( RCMDESTINATION_SETICONL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestination::RefreshL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestination::RefreshL() + { + OstTraceFunctionEntry0( RCMDESTINATION_REFRESHL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmDestinationWrapper->Refresh(); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATION_REFRESHL_EXIT ); + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/src/cmdestinationapi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/src/cmdestinationapi.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,416 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Client side IPC handling for Connection Method Manager server. +* +*/ + + +#include "cmmserverdefs.h" +#include "cmdestinationapi.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmdestinationapiTraces.h" +#endif + + +RCmDestinationApi::RCmDestinationApi() + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_RCMDESTINATIONAPI_ENTRY ); + iSessionConnected = EFalse; + OstTraceFunctionExit0( RCMDESTINATIONAPI_RCMDESTINATIONAPI_EXIT ); + } + +TBool RCmDestinationApi::SessionConnected() + { + return iSessionConnected; + } + +void RCmDestinationApi::ConnectAndGetDestWithIdL( + const RSessionBase& aSession, + const TUint32 aId, + TInt& aExistingHandle ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_CONNECTANDGETDESTWITHIDL_ENTRY ); + + if ( iSessionConnected ) + { + User::Leave( KErrAlreadyExists ); + } + + aExistingHandle = 0; + TPckg pckg( aExistingHandle ); + TIpcArgs args( aId, &pckg ); + TInt result = CreateSubSession( aSession, EDestGetDestination, args ); + if ( !aExistingHandle ) + { + User::LeaveIfError( result ); + iSessionConnected = ETrue; + } + else + { + if ( result != KErrAlreadyExists ) + { + User::Leave( result ); + } + } + + OstTraceFunctionExit0( RCMDESTINATIONAPI_CONNECTANDGETDESTWITHIDL_EXIT ); + } + +void RCmDestinationApi::ConnectAndCreateDestWithNameL( + const RSessionBase& aSession, + const TDesC& aName ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_CONNECTANDCREATEDESTWITHNAMEL_ENTRY ); + + if ( iSessionConnected ) + { + User::Leave( KErrAlreadyExists ); + } + TIpcArgs args( &aName ); + User::LeaveIfError( CreateSubSession( aSession, EDestCreateDestinationWithName, args ) ); + iSessionConnected = ETrue; + + OstTraceFunctionExit0( RCMDESTINATIONAPI_CONNECTANDCREATEDESTWITHNAMEL_EXIT ); + } + +void RCmDestinationApi::ConnectAndCreateDestWithNameAndIdL( + const RSessionBase& aSession, + const TDesC& aName, + const TUint32 aId ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_CONNECTANDCREATEDESTWITHNAMEANDIDL_ENTRY ); + + if ( iSessionConnected ) + { + User::Leave( KErrAlreadyExists ); + } + TIpcArgs args( &aName, aId ); + User::LeaveIfError( CreateSubSession( aSession, EDestCreateDestinationWithNameAndId, args ) ); + iSessionConnected = ETrue; + + OstTraceFunctionExit0( RCMDESTINATIONAPI_CONNECTANDCREATEDESTWITHNAMEANDIDL_EXIT ); + } + +void RCmDestinationApi::ConnectAndGetConnMethodAsEmbeddedDestL( + const RSessionBase& aSession, + const TInt aConnMethodHandle, + TInt& aExistingHandle ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_CONNECTANDGETCONNMETHODASEMBEDDEDDESTL_ENTRY ); + + if ( iSessionConnected ) + { + User::Leave( KErrAlreadyExists ); + } + + aExistingHandle = 0; + TPckg pckg( aExistingHandle ); + TIpcArgs args( aConnMethodHandle, &pckg ); + TInt result = CreateSubSession( aSession, EDestGetEmbeddedDestination, args ); + if ( !aExistingHandle ) + { + User::LeaveIfError( result ); + iSessionConnected = ETrue; + } + else + { + if ( result != KErrAlreadyExists ) + { + User::Leave( result ); + } + } + + OstTraceFunctionExit0( RCMDESTINATIONAPI_CONNECTANDGETCONNMETHODASEMBEDDEDDESTL_EXIT ); + } + +void RCmDestinationApi::Close() + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_CLOSE_ENTRY ); + + if ( iSessionConnected ) + { + CloseSubSession( EDestCloseDestination ); + iSessionConnected = EFalse; + } + + OstTraceFunctionExit0( RCMDESTINATIONAPI_CLOSE_EXIT ); + } + +TInt RCmDestinationApi::ConnectionMethodCount( TInt& aCount ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_CONNECTIONMETHODCOUNT_ENTRY ); + + TPckg pckg( aCount ); + TIpcArgs args( &pckg ); + TInt err = SendReceive( EDestGetConnMethodCount, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_CONNECTIONMETHODCOUNT_EXIT ); + return err; + } + +TInt RCmDestinationApi::Priority( const TInt aHandle, TUint& aPriority ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_PRIORITY_ENTRY ); + + TPckg pckg( aPriority ); + TIpcArgs args( aHandle, &pckg ); + TInt err = SendReceive( EDestGetConnMethodPriority, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_PRIORITY_EXIT ); + return err; + } + +TInt RCmDestinationApi::GetName( HBufC* aBuffer ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_GETNAME_ENTRY ); + + TPtr descriptor( aBuffer->Des() ); + TIpcArgs args( &descriptor ); + TInt err = SendReceive( EDestGetName, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_GETNAME_EXIT ); + return err; + } + +TInt RCmDestinationApi::GetId( TUint32& aId ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_GETID_ENTRY ); + + TPckg pckg( aId ); + TIpcArgs args( &pckg ); + TInt err = SendReceive( EDestGetId, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_GETID_EXIT ); + return err; + } + +TInt RCmDestinationApi::GetElementId( TUint32& aElementId ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_GETELEMENTID_ENTRY ); + + TPckg pckg( aElementId ); + TIpcArgs args( &pckg ); + TInt err = SendReceive( EDestGetElementId, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_GETELEMENTID_EXIT ); + return err; + } + +TInt RCmDestinationApi::GetMetadata( + const TUint32 aMetadataField, + TUint32& aValue ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_GETMETADATA_ENTRY ); + + TPckg pckg( aValue ); + TIpcArgs args( aMetadataField, &pckg ); + TInt err = SendReceive( EDestMetadata, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_GETMETADATA_EXIT ); + return err; + } + +TInt RCmDestinationApi::GetProtectionLevel( TInt& aProtectionLevel ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_GETPROTECTIONLEVEL_ENTRY ); + + TPckg pckg( aProtectionLevel ); + TIpcArgs args( &pckg ); + TInt err = SendReceive( EDestGetProtectionLevel, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_GETPROTECTIONLEVEL_EXIT ); + return err; + } + +TInt RCmDestinationApi::AddConnectionMethod( + const TInt aConnMethodHandle, + TInt& aIndex ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_ADDCONNECTIONMETHOD_ENTRY ); + + TPckg pckg( aIndex ); + TIpcArgs args( aConnMethodHandle, &pckg ); + TInt err = SendReceive( EDestAddConnMethod, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_ADDCONNECTIONMETHOD_EXIT ); + return err; + } + +TInt RCmDestinationApi::AddEmbeddedDestination( + const TInt aDestHandle, + TInt& aIndex ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_ADDEMBEDDEDDESTINATION_ENTRY ); + + TPckg pckg( aIndex ); + TIpcArgs args( aDestHandle, &pckg ); + TInt err = SendReceive( EDestAddEmbeddedDestination, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_ADDEMBEDDEDDESTINATION_EXIT ); + return err; + } + +TInt RCmDestinationApi::DeleteConnectionMethod( + const TInt aConnMethodHandle ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_DELETECONNECTIONMETHOD_ENTRY ); + + TIpcArgs args( aConnMethodHandle ); + TInt err = SendReceive( EDestDeleteConnMethod, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_DELETECONNECTIONMETHOD_EXIT ); + return err; + } + +TInt RCmDestinationApi::RemoveConnectionMethod( + const TInt aConnMethodHandle ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_REMOVECONNECTIONMETHOD_ENTRY ); + + TIpcArgs args( aConnMethodHandle ); + TInt err = SendReceive( EDestRemoveConnMethod, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_REMOVECONNECTIONMETHOD_EXIT ); + return err; + } + +TInt RCmDestinationApi::ModifyPriority( + const TInt aConnMethodHandle, + const TUint aIndex ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_MODIFYPRIORITY_ENTRY ); + + TIpcArgs args( aConnMethodHandle, aIndex ); + TInt err = SendReceive( EDestModifyPriority, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_MODIFYPRIORITY_EXIT ); + return err; + } + +TInt RCmDestinationApi::SetName( const TDesC& aValue ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_SETNAME_ENTRY ); + + TIpcArgs args( &aValue ); + TInt err = SendReceive( EDestSetName, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_SETNAME_EXIT ); + return err; + } + +TInt RCmDestinationApi::SetMetadata( + const TUint32 aMetaField, + const TUint32 aValue ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_SETMETADATA_ENTRY ); + + TIpcArgs args( aMetaField, aValue ); + TInt err = SendReceive( EDestSetMetadata, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_SETMETADATA_EXIT ); + return err; + } + +TInt RCmDestinationApi::SetProtection( const TInt aValue ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_SETPROTECTION_ENTRY ); + + TIpcArgs args( aValue ); + TInt err = SendReceive( EDestSetProtection, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_SETPROTECTION_EXIT ); + return err; + } + +TInt RCmDestinationApi::SetHidden( const TBool aHidden ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_SETHIDDEN_ENTRY ); + + TIpcArgs args( aHidden ); + TInt err = SendReceive( EDestSetHidden, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_SETHIDDEN_EXIT ); + return err; + } + +TInt RCmDestinationApi::Update() + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_UPDATE_ENTRY ); + + TInt err = SendReceive( EDestUpdate ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_UPDATE_EXIT ); + return err; + } + +TInt RCmDestinationApi::Refresh() + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_REFRESH_ENTRY ); + + TInt err = SendReceive( EDestRefresh ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_REFRESH_EXIT ); + return err; + } + +TInt RCmDestinationApi::Delete() + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_DELETE_ENTRY ); + + TInt err = SendReceive( EDestDelete ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_DELETE_EXIT ); + return err; + } + +TInt RCmDestinationApi::IsConnected( TBool& aResult ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_ISCONNECTED_ENTRY ); + + TPckg pckg( aResult ); + TIpcArgs args( &pckg ); + TInt err = SendReceive( EDestIsConnected, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_ISCONNECTED_EXIT ); + return err; + } + +TInt RCmDestinationApi::IsHidden( TBool& aResult ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_ISHIDDEN_ENTRY ); + + TPckg pckg( aResult ); + TIpcArgs args( &pckg ); + TInt err = SendReceive( EDestIsHidden, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_ISHIDDEN_EXIT ); + return err; + } + +TInt RCmDestinationApi::IsEqual( const TInt aHandle, TBool& aResult ) + { + OstTraceFunctionEntry0( RCMDESTINATIONAPI_ISEQUAL_ENTRY ); + + TPckg pckg( aResult ); + TIpcArgs args( aHandle, &pckg ); + TInt err = SendReceive( EDestIsEqual, args ); + + OstTraceFunctionExit0( RCMDESTINATIONAPI_ISEQUAL_EXIT ); + return err; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/src/cmdestinationext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/src/cmdestinationext.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,792 @@ +/* +* Copyright (c) 2006-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 RCmDestinationExt. +* +*/ + + +#include +#include + +#include "cmmserverdefs.h" +#include "cmmanagerapi.h" +#include "cmdestinationwrapper.h" +#include "cmconnectionmethodwrapper.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmdestinationextTraces.h" +#endif + + +//----------------------------------------------------------------------------- +// RCmDestinationExt::Close() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestinationExt::Close() + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_CLOSE_ENTRY ); + + if ( iCmDestinationWrapper ) + { + if ( iCmDestinationWrapper->DecreaseReferenceCounter() <= 0 ) + { + delete iCmDestinationWrapper; + } + iCmDestinationWrapper = NULL; + } + + OstTraceFunctionExit0( RCMDESTINATIONEXT_CLOSE_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::~RCmDestinationExt() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestinationExt::~RCmDestinationExt() + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_RCMDESTINATIONEXT_ENTRY ); + Close(); + OstTraceFunctionExit0( RCMDESTINATIONEXT_RCMDESTINATIONEXT_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::RCmDestinationExt() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestinationExt::RCmDestinationExt( + const RCmDestinationExt& aDestination ) + { + OstTraceFunctionEntry0( DUP1_RCMDESTINATIONEXT_RCMDESTINATIONEXT_ENTRY ); + + this->iCmDestinationWrapper = aDestination.iCmDestinationWrapper; + if ( iCmDestinationWrapper ) + { + iCmDestinationWrapper->IncreaseReferenceCounter(); + } + + OstTraceFunctionExit0( DUP1_RCMDESTINATIONEXT_RCMDESTINATIONEXT_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::operator=() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestinationExt& RCmDestinationExt::operator=( + const RCmDestinationExt& aDestination ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_OPERATOR_ENTRY ); + + if ( this != &aDestination ) + { + Close(); + this->iCmDestinationWrapper = aDestination.iCmDestinationWrapper; + if ( iCmDestinationWrapper ) + { + iCmDestinationWrapper->IncreaseReferenceCounter(); + } + } + + OstTraceFunctionExit0( RCMDESTINATIONEXT_OPERATOR_EXIT ); + return *this; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::ConnectionMethodCount() +//----------------------------------------------------------------------------- +// +EXPORT_C TInt RCmDestinationExt::ConnectionMethodCount() + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_CONNECTIONMETHODCOUNT_ENTRY ); + + __ASSERT_ALWAYS( iCmDestinationWrapper && iCmDestinationWrapper->SessionConnected(), + User::Panic( KCmmPanicCategoryApi, EDestNotConnectedToServer ) ); + + TInt value( 0 ); + TInt err = iCmDestinationWrapper->ConnectionMethodCount( value ); + + if ( err ) + { + value = 0; + } + + OstTraceFunctionExit0( RCMDESTINATIONEXT_CONNECTIONMETHODCOUNT_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::ConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethodExt RCmDestinationExt::ConnectionMethodL( + TInt aIndex ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_CONNECTIONMETHODL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + TInt destHandle = iCmDestinationWrapper->GetHandle(); + TInt existingHandle( 0 ); + cmWrapper->GetConnMethodFromDestWithIndexL( + iCmDestinationWrapper->GetMainSession(), + destHandle, + aIndex, + existingHandle ); + if ( existingHandle ) + { + CleanupStack::PopAndDestroy( cmWrapper ); + cmWrapper = iCmDestinationWrapper->GetMainSession()->GetConnMethodWrapperL( existingHandle ); + cmWrapper->IncreaseReferenceCounter(); + } + else + { + CleanupStack::Pop( cmWrapper ); + } + + RCmConnectionMethodExt cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( RCMDESTINATIONEXT_CONNECTIONMETHODL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::ConnectionMethodByIDL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethodExt RCmDestinationExt::ConnectionMethodByIDL( + TInt aConnMethodId ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_CONNECTIONMETHODBYIDL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + TInt destHandle = iCmDestinationWrapper->GetHandle(); + TInt existingHandle( 0 ); + cmWrapper->GetConnMethodFromDestWithIdL( + iCmDestinationWrapper->GetMainSession(), + destHandle, + aConnMethodId, + existingHandle ); + if ( existingHandle ) + { + CleanupStack::PopAndDestroy( cmWrapper ); + cmWrapper = iCmDestinationWrapper->GetMainSession()->GetConnMethodWrapperL( existingHandle ); + cmWrapper->IncreaseReferenceCounter(); + } + else + { + CleanupStack::Pop( cmWrapper ); + } + + RCmConnectionMethodExt cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( RCMDESTINATIONEXT_CONNECTIONMETHODBYIDL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::PriorityL() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint RCmDestinationExt::PriorityL( + const RCmConnectionMethodExt& aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_PRIORITYL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + if ( !aConnectionMethod.iCmConnectionMethodWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TUint priority( 0 ); + TInt handle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->Priority( handle, priority ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATIONEXT_PRIORITYL_EXIT ); + return priority; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::NameLC() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC* RCmDestinationExt::NameLC() + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_NAMELC_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + HBufC* buffer = HBufC::NewLC( KCmmStringLengthMax ); + TInt err = iCmDestinationWrapper->GetName( buffer ); + User::LeaveIfError( err ); + // Leave buffer in cleanup stack. + + OstTraceFunctionExit0( RCMDESTINATIONEXT_NAMELC_EXIT ); + return buffer; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::Id() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmDestinationExt::Id() + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_ID_ENTRY ); + + __ASSERT_ALWAYS( iCmDestinationWrapper && iCmDestinationWrapper->SessionConnected(), + User::Panic( KCmmPanicCategoryApi, EDestNotConnectedToServer ) ); + + TUint32 id( 0 ); + TInt err = iCmDestinationWrapper->GetId( id ); + + if ( err ) + { + id = 0; + } + + OstTraceFunctionExit0( RCMDESTINATIONEXT_ID_EXIT ); + return id; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::ElementId() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmDestinationExt::ElementId() + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_ELEMENTID_ENTRY ); + + __ASSERT_ALWAYS( iCmDestinationWrapper && iCmDestinationWrapper->SessionConnected(), + User::Panic( KCmmPanicCategoryApi, EDestNotConnectedToServer ) ); + + TUint32 elementId( 0 ); + TInt err = iCmDestinationWrapper->GetElementId( elementId ); + + if ( err ) + { + elementId = 0; + } + + OstTraceFunctionExit0( RCMDESTINATIONEXT_ELEMENTID_EXIT ); + return elementId; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::MetadataL() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmDestinationExt::MetadataL( + CMManager::TSnapMetadataField aMetadataField ) const + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_METADATAL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TUint32 value( 0 ); + TInt err = iCmDestinationWrapper->GetMetadata( aMetadataField, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATIONEXT_METADATAL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::ProtectionLevel() +//----------------------------------------------------------------------------- +// +EXPORT_C CMManager::TProtectionLevel RCmDestinationExt::ProtectionLevel() + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_PROTECTIONLEVEL_ENTRY ); + + __ASSERT_ALWAYS( iCmDestinationWrapper && iCmDestinationWrapper->SessionConnected(), + User::Panic( KCmmPanicCategoryApi, EDestNotConnectedToServer ) ); + + TInt protectionLevel( CMManager::EProtLevel0 ); + TInt err = iCmDestinationWrapper->GetProtectionLevel( protectionLevel ); + + if ( err ) + { + protectionLevel = CMManager::EProtLevel0; + } + + OstTraceFunctionExit0( RCMDESTINATIONEXT_PROTECTIONLEVEL_EXIT ); + return ( CMManager::TProtectionLevel )protectionLevel; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::IsHidden() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmDestinationExt::IsHidden() + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_ISHIDDEN_ENTRY ); + + __ASSERT_ALWAYS( iCmDestinationWrapper && iCmDestinationWrapper->SessionConnected(), + User::Panic( KCmmPanicCategoryApi, EDestNotConnectedToServer ) ); + + TBool value( EFalse ); + TInt err = iCmDestinationWrapper->IsHidden( value ); + + if ( err ) + { + value = EFalse; + } + + OstTraceFunctionExit0( RCMDESTINATIONEXT_ISHIDDEN_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::CreateConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethodExt RCmDestinationExt::CreateConnectionMethodL( + TUint32 aBearerType ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_CREATECONNECTIONMETHODL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + TInt destHandle = iCmDestinationWrapper->GetHandle(); + cmWrapper->CreateConnMethodToDestL( + iCmDestinationWrapper->GetMainSession(), + destHandle, + aBearerType ); + CleanupStack::Pop( cmWrapper ); + + RCmConnectionMethodExt cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( RCMDESTINATIONEXT_CREATECONNECTIONMETHODL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::CreateConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethodExt RCmDestinationExt::CreateConnectionMethodL( + TUint32 aBearerType, + TUint32 aConnMethodId ) + { + OstTraceFunctionEntry0( DUP1_RCMDESTINATIONEXT_CREATECONNECTIONMETHODL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + TInt destHandle = iCmDestinationWrapper->GetHandle(); + cmWrapper->CreateConnMethodToDestWithIdL( + iCmDestinationWrapper->GetMainSession(), + destHandle, + aBearerType, + aConnMethodId ); + CleanupStack::Pop( cmWrapper ); + + RCmConnectionMethodExt cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( DUP1_RCMDESTINATIONEXT_CREATECONNECTIONMETHODL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::AddConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C TInt RCmDestinationExt::AddConnectionMethodL( + RCmConnectionMethodExt aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_ADDCONNECTIONMETHODL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + if ( !aConnectionMethod.iCmConnectionMethodWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt index( 0 ); + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->AddConnectionMethod( connMethodHandle, index ); + + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATIONEXT_ADDCONNECTIONMETHODL_EXIT ); + return index; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::AddEmbeddedDestinationL() +//----------------------------------------------------------------------------- +// +EXPORT_C TInt RCmDestinationExt::AddEmbeddedDestinationL( + const RCmDestinationExt& aDestination ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_ADDEMBEDDEDDESTINATIONL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + if ( iCmDestinationWrapper == aDestination.iCmDestinationWrapper ) + { + User::Leave( KErrArgument ); + } + if ( !aDestination.iCmDestinationWrapper || + !aDestination.iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt index( 0 ); + TInt destinationHandle = aDestination.iCmDestinationWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->AddEmbeddedDestination( destinationHandle, index ); + + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATIONEXT_ADDEMBEDDEDDESTINATIONL_EXIT ); + return index; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::DeleteConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestinationExt::DeleteConnectionMethodL( + RCmConnectionMethodExt& aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_DELETECONNECTIONMETHODL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + if ( !aConnectionMethod.iCmConnectionMethodWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->DeleteConnectionMethod( connMethodHandle ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATIONEXT_DELETECONNECTIONMETHODL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::RemoveConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestinationExt::RemoveConnectionMethodL( + RCmConnectionMethodExt aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_REMOVECONNECTIONMETHODL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + if ( !aConnectionMethod.iCmConnectionMethodWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->RemoveConnectionMethod( connMethodHandle ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATIONEXT_REMOVECONNECTIONMETHODL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::ModifyPriorityL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestinationExt::ModifyPriorityL( + RCmConnectionMethodExt& aConnectionMethod, + TUint aIndex ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_MODIFYPRIORITYL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + if ( !aConnectionMethod.iCmConnectionMethodWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->ModifyPriority( connMethodHandle, aIndex ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATIONEXT_MODIFYPRIORITYL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::SetNameL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestinationExt::SetNameL( const TDesC& aName ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_SETNAMEL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmDestinationWrapper->SetName( aName ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATIONEXT_SETNAMEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::SetMetadataL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestinationExt::SetMetadataL( + CMManager::TSnapMetadataField aMetadataField, + TUint32 aValue ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_SETMETADATAL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmDestinationWrapper->SetMetadata( aMetadataField, aValue ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATIONEXT_SETMETADATAL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::SetProtectionL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestinationExt::SetProtectionL( CMManager::TProtectionLevel aProtLevel ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_SETPROTECTIONL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmDestinationWrapper->SetProtection( aProtLevel ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATIONEXT_SETPROTECTIONL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::SetHiddenL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestinationExt::SetHiddenL( TBool aHidden ) + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_SETHIDDENL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmDestinationWrapper->SetHidden( aHidden ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATIONEXT_SETHIDDENL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::UpdateL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestinationExt::UpdateL() + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_UPDATEL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmDestinationWrapper->Update(); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATIONEXT_UPDATEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::DeleteLD() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmDestinationExt::DeleteLD() + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_DELETELD_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmDestinationWrapper->Delete(); + User::LeaveIfError( err ); + + // Instead of calling Close(), we need to force this handle closed even if + // copies have been made. So we delete the destination wrapper directly. + delete iCmDestinationWrapper; + iCmDestinationWrapper = NULL; + + OstTraceFunctionExit0( RCMDESTINATIONEXT_DELETELD_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::IsConnectedL() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmDestinationExt::IsConnectedL() const + { + OstTraceFunctionEntry0( RCMDESTINATIONEXT_ISCONNECTEDL_ENTRY ); + + if ( !iCmDestinationWrapper || !iCmDestinationWrapper->SessionConnected() ) + { + User::Leave( KErrBadHandle ); + } + + TBool value( 0 ); + TInt err = iCmDestinationWrapper->IsConnected( value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMDESTINATIONEXT_ISCONNECTEDL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::RCmDestinationExt() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestinationExt::RCmDestinationExt() : iCmDestinationWrapper( NULL ) + { + OstTraceFunctionEntry0( DUP2_RCMDESTINATIONEXT_RCMDESTINATIONEXT_ENTRY ); + OstTraceFunctionExit0( DUP2_RCMDESTINATIONEXT_RCMDESTINATIONEXT_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmDestinationExt::operator==() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmDestinationExt::operator==( + const RCmDestinationExt& aDestination ) const + { + OstTraceFunctionEntry0( DUP1_RCMDESTINATIONEXT_OPERATOR_ENTRY ); + + TBool result( EFalse ); + if ( !aDestination.iCmDestinationWrapper ) + { + if ( !iCmDestinationWrapper ) + { + result = ETrue; // Both empty. + } + else + { + result = EFalse; + } + } + else if ( !iCmDestinationWrapper ) + { + result = EFalse; + } + else + { + // Both destination objects have wrappers. + + if ( !iCmDestinationWrapper->SessionConnected() || + !aDestination.iCmDestinationWrapper->SessionConnected() ) + { + result = EFalse; + } + else + { + // Both destination objects are connected to server. + + TInt handle = aDestination.iCmDestinationWrapper->GetHandle(); + TInt err = iCmDestinationWrapper->IsEqual( handle, result ); + if ( err ) + { + result = EFalse; + } + } + } + + OstTraceFunctionExit0( DUP1_RCMDESTINATIONEXT_OPERATOR_EXIT ); + return result; + } + +//----------------------------------------------------------------------------- +//RCmDestinationExt::operator!=() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmDestinationExt::operator!=( + const RCmDestinationExt& aDestination ) const + { + OstTraceFunctionEntry0( DUP2_RCMDESTINATIONEXT_OPERATOR_ENTRY ); + + TBool result = !( operator==( aDestination ) ); + + OstTraceFunctionExit0( DUP2_RCMDESTINATIONEXT_OPERATOR_EXIT ); + return result; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/src/cmdestinationwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/src/cmdestinationwrapper.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,432 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Collects API calls from RCmDestination- and RCmDestinationExt-classes. +* +*/ + + +#include "cmdestinationwrapper.h" +#include "cmmanagerapi.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmdestinationwrapperTraces.h" +#endif + + +CCmDestinationWrapper* CCmDestinationWrapper::NewL() + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_NEWL_ENTRY ); + + CCmDestinationWrapper* self = CCmDestinationWrapper::NewLC(); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_NEWL_EXIT ); + return self; + } + +CCmDestinationWrapper* CCmDestinationWrapper::NewLC() + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_NEWLC_ENTRY ); + + CCmDestinationWrapper* self = new (ELeave) CCmDestinationWrapper; + CleanupStack::PushL( self ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_NEWLC_EXIT ); + return self; + } + +CCmDestinationWrapper::~CCmDestinationWrapper() + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_CCMDESTINATIONWRAPPER_ENTRY ); + + iCmDestinationApi.Close(); + + if ( iCmManagerApi ) + { + iCmManagerApi->RemoveDestinationWrapper( this ); + iCmManagerApi = NULL; + } + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_CCMDESTINATIONWRAPPER_EXIT ); + } + +CCmDestinationWrapper::CCmDestinationWrapper() + { + OstTraceFunctionEntry0( DUP1_CCMDESTINATIONWRAPPER_CCMDESTINATIONWRAPPER_ENTRY ); + + iCmManagerApi = NULL; + iReferenceCounter = 1; + + OstTraceFunctionExit0( DUP1_CCMDESTINATIONWRAPPER_CCMDESTINATIONWRAPPER_EXIT ); + } + +void CCmDestinationWrapper::GetDestWithIdL( + RCmManagerApi* aCmManagerApi, + const TUint32 aId, + TInt& aExistingHandle ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_GETDESTWITHIDL_ENTRY ); + + if ( iCmManagerApi || iCmDestinationApi.SessionConnected() ) + { + User::Leave( KErrAlreadyExists ); + } + + iCmManagerApi = aCmManagerApi; + iCmDestinationApi.ConnectAndGetDestWithIdL( *aCmManagerApi, aId, aExistingHandle ); + if ( !aExistingHandle ) + { + iCmManagerApi->StoreDestinationWrapper( this ); + } + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_GETDESTWITHIDL_EXIT ); + } + +void CCmDestinationWrapper::CreateDestByNameL( + RCmManagerApi* aCmManagerApi, + const TDesC& aName ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_CREATEDESTBYNAMEL_ENTRY ); + + if ( iCmManagerApi || iCmDestinationApi.SessionConnected() ) + { + User::Leave( KErrAlreadyExists ); + } + + iCmManagerApi = aCmManagerApi; + iCmDestinationApi.ConnectAndCreateDestWithNameL( *aCmManagerApi, aName ); + iCmManagerApi->StoreDestinationWrapper( this ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_CREATEDESTBYNAMEL_EXIT ); + } + +void CCmDestinationWrapper::CreateDestByNameAndIdL( + RCmManagerApi* aCmManagerApi, + const TDesC& aName, + const TUint32 aId ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_CREATEDESTBYNAMEANDIDL_ENTRY ); + + if ( iCmManagerApi || iCmDestinationApi.SessionConnected() ) + { + User::Leave( KErrAlreadyExists ); + } + + iCmManagerApi = aCmManagerApi; + iCmDestinationApi.ConnectAndCreateDestWithNameAndIdL( *aCmManagerApi, aName, aId ); + iCmManagerApi->StoreDestinationWrapper( this ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_CREATEDESTBYNAMEANDIDL_EXIT ); + } + +void CCmDestinationWrapper::GetConnMethodAsEmbeddedDestL( + RCmManagerApi* aCmManagerApi, + const TInt aConnMethodHandle, + TInt& aExistingHandle ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_GETCONNMETHODASEMBEDDEDDESTL_ENTRY ); + + if ( iCmManagerApi || iCmDestinationApi.SessionConnected() ) + { + User::Leave( KErrAlreadyExists ); + } + + iCmManagerApi = aCmManagerApi; + iCmDestinationApi.ConnectAndGetConnMethodAsEmbeddedDestL( *aCmManagerApi, aConnMethodHandle, aExistingHandle ); + if ( !aExistingHandle ) + { + iCmManagerApi->StoreDestinationWrapper( this ); + } + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_GETCONNMETHODASEMBEDDEDDESTL_EXIT ); + } + +TInt CCmDestinationWrapper::ConnectionMethodCount( TInt& aCount ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_CONNECTIONMETHODCOUNT_ENTRY ); + + TInt err = iCmDestinationApi.ConnectionMethodCount( aCount ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_CONNECTIONMETHODCOUNT_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::Priority( const TInt aHandle, TUint& aPriority ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_PRIORITY_ENTRY ); + + TInt err = iCmDestinationApi.Priority( aHandle, aPriority ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_PRIORITY_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::GetName( HBufC* aBuffer ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_GETNAME_ENTRY ); + + TInt err = iCmDestinationApi.GetName( aBuffer ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_GETNAME_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::GetId( TUint32& aId ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_GETID_ENTRY ); + + TInt err = iCmDestinationApi.GetId( aId ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_GETID_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::GetElementId( TUint32& aElementId ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_GETELEMENTID_ENTRY ); + + TInt err = iCmDestinationApi.GetElementId( aElementId ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_GETELEMENTID_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::GetMetadata( + const TUint32 aMetadataField, + TUint32& aValue ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_GETMETADATA_ENTRY ); + + TInt err = iCmDestinationApi.GetMetadata( aMetadataField, aValue ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_GETMETADATA_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::GetProtectionLevel( TInt& aProtectionLevel ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_GETPROTECTIONLEVEL_ENTRY ); + + TInt err = iCmDestinationApi.GetProtectionLevel( aProtectionLevel ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_GETPROTECTIONLEVEL_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::AddConnectionMethod( + const TInt aConnMethodHandle, + TInt& aIndex ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_ADDCONNECTIONMETHOD_ENTRY ); + + TInt err = iCmDestinationApi.AddConnectionMethod( aConnMethodHandle, aIndex ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_ADDCONNECTIONMETHOD_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::AddEmbeddedDestination( + const TInt aDestHandle, + TInt& aIndex ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_ADDEMBEDDEDDESTINATION_ENTRY ); + + TInt err = iCmDestinationApi.AddEmbeddedDestination( aDestHandle, aIndex ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_ADDEMBEDDEDDESTINATION_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::DeleteConnectionMethod( + const TInt aConnMethodHandle ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_DELETECONNECTIONMETHOD_ENTRY ); + + TInt err = iCmDestinationApi.DeleteConnectionMethod( aConnMethodHandle ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_DELETECONNECTIONMETHOD_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::RemoveConnectionMethod( + const TInt aConnMethodHandle ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_REMOVECONNECTIONMETHOD_ENTRY ); + + TInt err = iCmDestinationApi.RemoveConnectionMethod( aConnMethodHandle ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_REMOVECONNECTIONMETHOD_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::ModifyPriority( + const TInt aConnMethodHandle, + const TUint aIndex ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_MODIFYPRIORITY_ENTRY ); + + TInt err = iCmDestinationApi.ModifyPriority( aConnMethodHandle, aIndex ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_MODIFYPRIORITY_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::SetName( const TDesC& aValue ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_SETNAME_ENTRY ); + + TInt err = iCmDestinationApi.SetName( aValue ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_SETNAME_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::SetMetadata( + const TUint32 aMetaField, + const TUint32 aValue ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_SETMETADATA_ENTRY ); + + TInt err = iCmDestinationApi.SetMetadata( aMetaField, aValue ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_SETMETADATA_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::SetProtection( const TInt aValue ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_SETPROTECTION_ENTRY ); + + TInt err = iCmDestinationApi.SetProtection( aValue ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_SETPROTECTION_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::SetHidden( const TBool aHidden ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_SETHIDDEN_ENTRY ); + + TInt err = iCmDestinationApi.SetHidden( aHidden ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_SETHIDDEN_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::Update() + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_UPDATE_ENTRY ); + + TInt err = iCmDestinationApi.Update(); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_UPDATE_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::Refresh() + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_REFRESH_ENTRY ); + + TInt err = iCmDestinationApi.Refresh(); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_REFRESH_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::Delete() + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_DELETE_ENTRY ); + + TInt err = iCmDestinationApi.Delete(); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_DELETE_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::IsConnected( TBool& aResult ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_ISCONNECTED_ENTRY ); + + TInt err = iCmDestinationApi.IsConnected( aResult ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_ISCONNECTED_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::IsHidden( TBool& aResult ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_ISHIDDEN_ENTRY ); + + TInt err = iCmDestinationApi.IsHidden( aResult ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_ISHIDDEN_EXIT ); + return err; + } + +TInt CCmDestinationWrapper::IsEqual( const TInt aHandle, TBool& aResult ) + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_ISEQUAL_ENTRY ); + + TInt err = iCmDestinationApi.IsEqual( aHandle, aResult ); + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_ISEQUAL_EXIT ); + return err; + } + +TBool CCmDestinationWrapper::SessionConnected() + { + return iCmDestinationApi.SessionConnected(); + } + +void CCmDestinationWrapper::CloseSession() + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_CLOSESESSION_ENTRY ); + iCmDestinationApi.Close(); + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_CLOSESESSION_EXIT ); + } + +TInt CCmDestinationWrapper::GetHandle() const + { + return iCmDestinationApi.SubSessionHandle(); + } + +RCmManagerApi* CCmDestinationWrapper::GetMainSession() const + { + return iCmManagerApi; + } + +void CCmDestinationWrapper::IncreaseReferenceCounter() + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_INCREASEREFERENCECOUNTER_ENTRY ); + iReferenceCounter++; + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_INCREASEREFERENCECOUNTER_EXIT ); + } + +TInt CCmDestinationWrapper::DecreaseReferenceCounter() + { + OstTraceFunctionEntry0( CCMDESTINATIONWRAPPER_DECREASEREFERENCECOUNTER_ENTRY ); + + iReferenceCounter--; + if ( iReferenceCounter < 0 ) + { + iReferenceCounter = 0; + } + + OstTraceFunctionExit0( CCMDESTINATIONWRAPPER_DECREASEREFERENCECOUNTER_EXIT ); + return iReferenceCounter; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/src/cmmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/src/cmmanager.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,918 @@ +/* +* Copyright (c) 2006-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 RCmManager. +* +*/ + + +#include +#include +#include + +#include "cmmserverdefs.h" +#include "cmmanagerapi.h" +#include "cmconnectionmethodwrapper.h" +#include "cmdestinationwrapper.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmanagerTraces.h" +#endif + + +//----------------------------------------------------------------------------- +// RCmManager::OpenL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::OpenL() + { + OstTraceFunctionEntry0( RCMMANAGER_OPENL_ENTRY ); + + OpenLC(); + CleanupStack::Pop( this ); + + OstTraceFunctionExit0( RCMMANAGER_OPENL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::OpenLC() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::OpenLC() + { + OstTraceFunctionEntry0( RCMMANAGER_OPENLC_ENTRY ); + + if ( iCmManagerApi ) + { + User::Leave( KErrAlreadyExists ); + } + + CleanupClosePushL( *this ); + iCmManagerApi = new (ELeave) RCmManagerApi(); + User::LeaveIfError( iCmManagerApi->Connect() ); + + OstTraceFunctionExit0( RCMMANAGER_OPENLC_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::Close() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::Close() + { + OstTraceFunctionEntry0( RCMMANAGER_CLOSE_ENTRY ); + + if ( iCmManagerApi ) + { + iCmManagerApi->Close(); + delete iCmManagerApi; + iCmManagerApi = NULL; + } + + OstTraceFunctionExit0( RCMMANAGER_CLOSE_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::CreateTablesAndOpenL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::CreateTablesAndOpenL() + { + OstTraceFunctionEntry0( RCMMANAGER_CREATETABLESANDOPENL_ENTRY ); + OpenL(); + OstTraceFunctionExit0( RCMMANAGER_CREATETABLESANDOPENL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::ConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethod RCmManager::ConnectionMethodL( + TUint32 aConnectionMethodId ) const + { + OstTraceFunctionEntry0( RCMMANAGER_CONNECTIONMETHODL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( !( ( aConnectionMethodId > KCmmConnMethodIdIntervalMin ) && + ( aConnectionMethodId < KCmmConnMethodIdIntervalMax ) ) ) + { + User::Leave( KErrArgument ); + } + + // If client already has a handle open to this connection method, give a + // reference to it. + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + TInt existingHandle( 0 ); + cmWrapper->GetConnMethodWithIdL( iCmManagerApi, aConnectionMethodId, existingHandle ); + if ( existingHandle ) + { + CleanupStack::PopAndDestroy( cmWrapper ); + cmWrapper = iCmManagerApi->GetConnMethodWrapperL( existingHandle ); + cmWrapper->IncreaseReferenceCounter(); + } + else + { + CleanupStack::Pop( cmWrapper ); + } + + RCmConnectionMethod cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( DUP1_RCMMANAGER_CONNECTIONMETHODL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmManager::GetBearerInfoIntL() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmManager::GetBearerInfoIntL( + TUint32 aBearerType, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGER_GETBEARERINFOINTL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TUint32 value( 0 ); + TInt err = iCmManagerApi->GetBearerInfoInt( aBearerType, aAttribute, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGER_GETBEARERINFOINTL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmManager::GetBearerInfoBoolL() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmManager::GetBearerInfoBoolL( + TUint32 aBearerType, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGER_GETBEARERINFOBOOLL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TBool value( 0 ); + TInt err = iCmManagerApi->GetBearerInfoBool( aBearerType, aAttribute, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGER_GETBEARERINFOBOOLL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmManager::GetBearerInfoStringL() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC* RCmManager::GetBearerInfoStringL( + TUint32 aBearerType, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGER_GETBEARERINFOSTRINGL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + HBufC* buffer = HBufC::NewLC( KCmmStringLengthMax ); + TInt err = iCmManagerApi->GetBearerInfoString( aBearerType, aAttribute, buffer ); + User::LeaveIfError( err ); + + if ( buffer->Length() > 0 ) + { + CleanupStack::Pop( buffer ); + } + else + { + CleanupStack::PopAndDestroy( buffer ); + buffer = NULL; + buffer = KNullDesC().AllocL(); + } + + OstTraceFunctionExit0( RCMMANAGER_GETBEARERINFOSTRINGL_EXIT ); + return buffer; + } + +//----------------------------------------------------------------------------- +// RCmManager::GetBearerInfoString8L() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* RCmManager::GetBearerInfoString8L( + TUint32 aBearerType, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGER_GETBEARERINFOSTRING8L_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + HBufC8* buffer8 = HBufC8::NewLC( KCmmStringLengthMax ); + TInt err = iCmManagerApi->GetBearerInfoString8( aBearerType, aAttribute, buffer8 ); + User::LeaveIfError( err ); + + if ( buffer8->Length() > 0 ) + { + CleanupStack::Pop( buffer8 ); + } + else + { + CleanupStack::PopAndDestroy( buffer8 ); + buffer8 = NULL; + buffer8 = KNullDesC8().AllocL(); + } + + OstTraceFunctionExit0( RCMMANAGER_GETBEARERINFOSTRING8L_EXIT ); + return buffer8; + } + +//----------------------------------------------------------------------------- +// RCmManager::GetConnectionMethodInfoIntL() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmManager::GetConnectionMethodInfoIntL( + TUint32 aIapId, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGER_GETCONNECTIONMETHODINFOINTL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TUint32 value( 0 ); + TInt err = iCmManagerApi->GetConnectionMethodInfoInt( aIapId, aAttribute, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGER_GETCONNECTIONMETHODINFOINTL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmManager::GetConnectionMethodInfoBoolL() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmManager::GetConnectionMethodInfoBoolL( + TUint32 aIapId, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGER_GETCONNECTIONMETHODINFOBOOLL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TBool value( 0 ); + TInt err = iCmManagerApi->GetConnectionMethodInfoBool( aIapId, aAttribute, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGER_GETCONNECTIONMETHODINFOBOOLL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmManager::GetConnectionMethodInfoStringL() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC* RCmManager::GetConnectionMethodInfoStringL( + TUint32 aIapId, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGER_GETCONNECTIONMETHODINFOSTRINGL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + HBufC* buffer = HBufC::NewLC( KCmmStringLengthMax ); + TInt err = iCmManagerApi->GetConnectionMethodInfoString( aIapId, aAttribute, buffer ); + User::LeaveIfError( err ); + + if ( buffer->Length() > 0 ) + { + CleanupStack::Pop( buffer ); + } + else + { + CleanupStack::PopAndDestroy( buffer ); + buffer = NULL; + buffer = KNullDesC().AllocL(); + } + + OstTraceFunctionExit0( RCMMANAGER_GETCONNECTIONMETHODINFOSTRINGL_EXIT ); + return buffer; + } + +//----------------------------------------------------------------------------- +// RCmManager::GetConnectionMethodInfoString8L() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* RCmManager::GetConnectionMethodInfoString8L( + TUint32 aIapId, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGER_GETCONNECTIONMETHODINFOSTRING8L_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + HBufC8* buffer8 = HBufC8::NewLC( KCmmStringLengthMax ); + TInt err = iCmManagerApi->GetConnectionMethodInfoString8( aIapId, aAttribute, buffer8 ); + User::LeaveIfError( err ); + + if ( buffer8->Length() > 0 ) + { + CleanupStack::Pop( buffer8 ); + } + else + { + CleanupStack::PopAndDestroy( buffer8 ); + buffer8 = NULL; + buffer8 = KNullDesC8().AllocL(); + } + + OstTraceFunctionExit0( RCMMANAGER_GETCONNECTIONMETHODINFOSTRING8L_EXIT ); + return buffer8; + } + +//----------------------------------------------------------------------------- +// RCmManager::CreateDestinationL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestination RCmManager::CreateDestinationL( + const TDesC& aName ) + { + OstTraceFunctionEntry0( RCMMANAGER_CREATEDESTINATIONL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( aName.Length() == 0 ) + { + User::Leave( KErrArgument ); + } + + CCmDestinationWrapper* destWrap = CCmDestinationWrapper::NewLC(); + destWrap->CreateDestByNameL( iCmManagerApi, aName ); + CleanupStack::Pop( destWrap ); + + RCmDestination dest; + dest.iCmDestinationWrapper = destWrap; + + OstTraceFunctionExit0( RCMMANAGER_CREATEDESTINATIONL_EXIT ); + return dest; + } + +//----------------------------------------------------------------------------- +// RCmManager::CreateConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethod RCmManager::CreateConnectionMethodL( + TUint32 aBearerType ) + { + OstTraceFunctionEntry0( RCMMANAGER_CREATECONNECTIONMETHODL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + cmWrapper->CreateConnMethodL( iCmManagerApi, aBearerType ); + CleanupStack::Pop( cmWrapper ); + + RCmConnectionMethod cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( RCMMANAGER_CREATECONNECTIONMETHODL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmManager::CopyConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C TInt RCmManager::CopyConnectionMethodL( + RCmDestination& aTargetDestination, + RCmConnectionMethod& aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMMANAGER_COPYCONNECTIONMETHODL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( !aTargetDestination.iCmDestinationWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper ) + { + User::Leave( KErrArgument ); + } + if ( !aTargetDestination.iCmDestinationWrapper->SessionConnected() || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt index( 0 ); + TInt targetDestHandle = aTargetDestination.iCmDestinationWrapper->GetHandle(); + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmManagerApi->CopyConnectionMethod( targetDestHandle, connMethodHandle, index ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGER_COPYCONNECTIONMETHODL_EXIT ); + return index; + } + +//----------------------------------------------------------------------------- +// RCmManager::MoveConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C TInt RCmManager::MoveConnectionMethodL( + RCmDestination& aSourceDestination, + RCmDestination& aTargetDestination, + RCmConnectionMethod& aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMMANAGER_MOVECONNECTIONMETHODL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( !aSourceDestination.iCmDestinationWrapper || + !aTargetDestination.iCmDestinationWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper ) + { + User::Leave( KErrArgument ); + } + if ( !aSourceDestination.iCmDestinationWrapper->SessionConnected() || + !aTargetDestination.iCmDestinationWrapper->SessionConnected() || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TCmmIpcStructMoveConnMethod pkgData; + pkgData.iSourceDestHandle = aSourceDestination.iCmDestinationWrapper->GetHandle(); + pkgData.iTargetDestHandle = aTargetDestination.iCmDestinationWrapper->GetHandle(); + pkgData.iConnMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + pkgData.iIndex = 0; + + TInt err = iCmManagerApi->MoveConnectionMethod( pkgData ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGER_MOVECONNECTIONMETHODL_EXIT ); + return pkgData.iIndex; + } + +//----------------------------------------------------------------------------- +// RCmManager::RemoveConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::RemoveConnectionMethodL( + RCmDestination& aDestination, + RCmConnectionMethod& aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMMANAGER_REMOVECONNECTIONMETHODL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( !aDestination.iCmDestinationWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper ) + { + User::Leave( KErrArgument ); + } + if ( !aDestination.iCmDestinationWrapper->SessionConnected() || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt targetDestHandle = aDestination.iCmDestinationWrapper->GetHandle(); + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmManagerApi->RemoveConnectionMethod( targetDestHandle, connMethodHandle ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGER_REMOVECONNECTIONMETHODL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::RemoveAllReferencesL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::RemoveAllReferencesL( + RCmConnectionMethod& aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMMANAGER_REMOVEALLREFERENCESL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( !aConnectionMethod.iCmConnectionMethodWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmManagerApi->RemoveAllReferences( connMethodHandle ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGER_REMOVEALLREFERENCESL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::ConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::ConnectionMethodL( + RArray& aCmArray, + TBool aCheckBearerType, + TBool aLegacyOnly, + TBool aEasyWlan ) const + { + OstTraceFunctionEntry0( DUP1_RCMMANAGER_CONNECTIONMETHODL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TCmmIpcStructGetConnMethods parameters; + parameters.iCheckBearerType = aCheckBearerType; + parameters.iLegacyOnly = aLegacyOnly; + parameters.iEasyWlan = aEasyWlan; + + iCmManagerApi->GetConnMethodsL( parameters, aCmArray ); + + OstTraceFunctionExit0( RCMMANAGER_CONNECTIONMETHODL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::AllDestinationsL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::AllDestinationsL( RArray& aDestArray ) const + { + OstTraceFunctionEntry0( RCMMANAGER_ALLDESTINATIONSL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + iCmManagerApi->GetAllDestinationsL( aDestArray ); + + OstTraceFunctionExit0( RCMMANAGER_ALLDESTINATIONSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::DestinationL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestination RCmManager::DestinationL( TUint32 aDestinationId ) const + { + OstTraceFunctionEntry0( RCMMANAGER_DESTINATIONL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + // If client already has a handle open to this destination, give a + // reference to it. + CCmDestinationWrapper* destWrap = CCmDestinationWrapper::NewLC(); + TInt existingHandle( 0 ); + destWrap->GetDestWithIdL( iCmManagerApi, aDestinationId, existingHandle ); + if ( existingHandle ) + { + CleanupStack::PopAndDestroy( destWrap ); + destWrap = iCmManagerApi->GetDestinationWrapperL( existingHandle ); + destWrap->IncreaseReferenceCounter(); + } + else + { + CleanupStack::Pop( destWrap ); + } + + RCmDestination dest; + dest.iCmDestinationWrapper = destWrap; + + return dest; + } + +//----------------------------------------------------------------------------- +// RCmManager::BearerPriorityArrayL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::BearerPriorityArrayL( + RArray& aArray ) const + { + OstTraceFunctionEntry0( RCMMANAGER_BEARERPRIORITYARRAYL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + iCmManagerApi->GetBearerPriorityArrayL( aArray ); + + OstTraceFunctionExit0( RCMMANAGER_BEARERPRIORITYARRAYL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::UpdateBearerPriorityArrayL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::UpdateBearerPriorityArrayL( + const RArray& aArray ) + { + OstTraceFunctionEntry0( RCMMANAGER_UPDATEBEARERPRIORITYARRAYL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + iCmManagerApi->SetBearerPriorityArrayL( aArray ); + + OstTraceFunctionExit0( RCMMANAGER_UPDATEBEARERPRIORITYARRAYL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::CleanupGlobalPriorityArray() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::CleanupGlobalPriorityArray( + RArray& aArray ) const + { + OstTraceFunctionEntry0( RCMMANAGER_CLEANUPGLOBALPRIORITYARRAY_ENTRY ); + + for ( TInt i = 0; i < aArray.Count(); i++ ) + { + delete aArray[i].iServiceType; + } + aArray.Reset(); + aArray.Close(); + + OstTraceFunctionExit0( RCMMANAGER_CLEANUPGLOBALPRIORITYARRAY_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::SupportedBearersL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::SupportedBearersL( RArray& aArray ) const + { + OstTraceFunctionEntry0( RCMMANAGER_SUPPORTEDBEARERSL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + iCmManagerApi->GetSupportedBearersL( aArray ); + + OstTraceFunctionExit0( RCMMANAGER_SUPPORTEDBEARERSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::EasyWlanIdL() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmManager::EasyWlanIdL() const + { + OstTraceFunctionEntry0( RCMMANAGER_EASYWLANIDL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TUint32 value( 0 ); + TInt err = iCmManagerApi->GetEasyWlanId( value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGER_EASYWLANIDL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmManager::ReadDefConnL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::ReadDefConnL( + TCmDefConnValue& aDefConnSetting ) + { + OstTraceFunctionEntry0( RCMMANAGER_READDEFCONNL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmManagerApi->ReadDefaultConnection( aDefConnSetting ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGER_READDEFCONNL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::WriteDefConnL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::WriteDefConnL( + const TCmDefConnValue& aDefConnSetting ) + { + OstTraceFunctionEntry0( RCMMANAGER_WRITEDEFCONNL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmManagerApi->WriteDefaultConnection( aDefConnSetting ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGER_WRITEDEFCONNL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::ReadGenConnSettingsL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::ReadGenConnSettingsL( + TCmGenConnSettings& aGenConnSettings ) + { + OstTraceFunctionEntry0( RCMMANAGER_READGENCONNSETTINGSL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmManagerApi->ReadGeneralConnectionSettings( aGenConnSettings ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGER_READGENCONNSETTINGSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::WriteGenConnSettingsL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManager::WriteGenConnSettingsL( + const TCmGenConnSettings& aGenConnSettings ) + { + OstTraceFunctionEntry0( RCMMANAGER_WRITEGENCONNSETTINGSL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmManagerApi->WriteGeneralConnectionSettings( aGenConnSettings ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGER_WRITEGENCONNSETTINGSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManager::CreateDestinationL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestination RCmManager::CreateDestinationL( + const TDesC& aName, + TUint32 aDestId ) + { + OstTraceFunctionEntry0( DUP1_RCMMANAGER_CREATEDESTINATIONL_ENTRY ); + + if ( aDestId == 0 ) + { + return CreateDestinationL( aName ); + } + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( aName.Length() == 0 ) + { + User::Leave( KErrArgument ); + } + + TUint32 adjustedDestId( 0 ); + if ( aDestId > KCmmDestIdIntervalLegacyMin && aDestId < KCmmDestIdIntervalLegacyMax ) + { + adjustedDestId = aDestId + KCmDefaultDestinationAPTagId; + } + else if ( aDestId > KCmmDestIdIntervalMin && aDestId < KCmmDestIdIntervalMax ) + { + adjustedDestId = aDestId; + } + else + { + User::Leave( KErrArgument ); + } + + CCmDestinationWrapper* destWrap = CCmDestinationWrapper::NewLC(); + destWrap->CreateDestByNameAndIdL( iCmManagerApi, aName, adjustedDestId ); + CleanupStack::Pop( destWrap ); + + RCmDestination dest; + dest.iCmDestinationWrapper = destWrap; + + OstTraceFunctionExit0( DUP1_RCMMANAGER_CREATEDESTINATIONL_EXIT ); + return dest; + } + +//----------------------------------------------------------------------------- +// RCmManager::CreateConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethod RCmManager::CreateConnectionMethodL( + TUint32 aBearerType, + TUint32 aConnMethodId ) + { + OstTraceFunctionEntry0( DUP1_RCMMANAGER_CREATECONNECTIONMETHODL_ENTRY ); + + if ( aConnMethodId == 0 ) + { + return CreateConnectionMethodL( aBearerType ); + } + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + if ( !( aConnMethodId > KCmmConnMethodIdIntervalMin && + aConnMethodId < KCmmConnMethodIdIntervalMax ) ) + { + User::Leave( KErrArgument ); + } + + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + cmWrapper->CreateConnMethodWithIdL( iCmManagerApi, aBearerType, aConnMethodId ); + CleanupStack::Pop( cmWrapper ); + + RCmConnectionMethod cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( DUP1_RCMMANAGER_CREATECONNECTIONMETHODL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmManager::GetUncategorizedIconL() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC* RCmManager::GetUncategorizedIconL() const + { + OstTraceFunctionEntry0( RCMMANAGER_GETUNCATEGORIZEDICONL_ENTRY ); + + User::Leave( KErrNotSupported ); + + OstTraceFunctionExit0( RCMMANAGER_GETUNCATEGORIZEDICONL_EXIT ); + return NULL; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/src/cmmanagerapi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/src/cmmanagerapi.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,957 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Client side IPC handling for Connection Method Manager server. +* +*/ + + +#include + +#include "cmmserverdefs.h" +#include "cmmanagerapi.h" +#include "cmdestinationwrapper.h" +#include "cmconnectionmethodwrapper.h" +#include "cmmclistatic.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmanagerapiTraces.h" +#endif + + +RCmManagerApi::RCmManagerApi() : RSessionBase() + { + OstTraceFunctionEntry0( RCMMANAGERAPI_RCMMANAGERAPI_ENTRY ); + + iConnected = EFalse; + iSmallBufsForDestinations = ETrue; + iSmallBufsForConnMethods = ETrue; + + OstTraceFunctionExit0( RCMMANAGERAPI_RCMMANAGERAPI_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::Connect() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::Connect() + { + OstTraceFunctionEntry0( RCMMANAGERAPI_CONNECT_ENTRY ); + + if ( !iConnected ) + { + TInt retry = 2; + for (;;) + { + TInt err = CreateSession( KCmmServer, TVersion( 0, 0, 0 ), KCmmDefaultMessageSlots ); + + if ( err != KErrNotFound && err != KErrServerTerminated ) + { + if ( !err ) + { + iConnected = ETrue; + } + OstTraceFunctionExit0( RCMMANAGERAPI_CONNECT_EXIT ); + return err; + } + // KErrNotFound and KErrServerTerminated will go through. + if ( --retry <= 0 ) + { + OstTraceFunctionExit0( DUP1_RCMMANAGERAPI_CONNECT_EXIT ); + return err; + } + err = TCmManagerLauncher::LaunchServer( + KCmmServer, + KCmmServerFile, + KCmmUid3, + KCmmServerInitHeapSize, + KCmmServerMaxHeapSize, + KCmmServerStackSize ); + + if ( err != KErrNone && err != KErrAlreadyExists ) + { + // Failed to launch server, and it wasn't already running. + OstTraceFunctionExit0( DUP2_RCMMANAGERAPI_CONNECT_EXIT ); + return err; + } + } + } + + OstTraceFunctionExit0( DUP3_RCMMANAGERAPI_CONNECT_EXIT ); + return KErrNone; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::Close() +//----------------------------------------------------------------------------- +// +void RCmManagerApi::Close() + { + OstTraceFunctionEntry0( RCMMANAGERAPI_CLOSE_ENTRY ); + + if ( iConnected ) + { + // Close all subsessions first. + // + // Don't call subsession destructors (wrappers), since they will try to + // remove themselves from these pointer arrays. Here we can just close + // the arrays at the end. + for ( TInt i = 0; i < iConnMethods.Count(); i++ ) + { + iConnMethods[i]->CloseSession(); + } + iConnMethods.Close(); + for ( TInt i = 0; i < iDestinations.Count(); i++ ) + { + iDestinations[i]->CloseSession(); + } + iDestinations.Close(); + + RSessionBase::Close(); + iConnected = EFalse; + } + + OstTraceFunctionExit0( RCMMANAGERAPI_CLOSE_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::StoreDestinationWrapper() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::StoreDestinationWrapper( + CCmDestinationWrapper* aDestinationWrapper ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_STOREDESTINATIONWRAPPER_ENTRY ); + + TInt err = iDestinations.InsertInAddressOrder( aDestinationWrapper ); + + OstTraceFunctionExit0( RCMMANAGERAPI_STOREDESTINATIONWRAPPER_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::RemoveDestinationWrapper() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::RemoveDestinationWrapper( + CCmDestinationWrapper* aDestinationWrapper ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_REMOVEDESTINATIONPOINTER_ENTRY ); + + TInt index = iDestinations.FindInAddressOrder( aDestinationWrapper ); + if ( index >= 0 ) + { + iDestinations.Remove( index ); + index = KErrNone; + } + + OstTraceFunctionExit0( RCMMANAGERAPI_REMOVEDESTINATIONPOINTER_EXIT ); + return index; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetDestinationWrapperL() +//----------------------------------------------------------------------------- +// +CCmDestinationWrapper* RCmManagerApi::GetDestinationWrapperL( const TInt& aHandle ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETDESTINATIONWRAPPER_ENTRY ); + + CCmDestinationWrapper* result( NULL ); + if ( aHandle ) + { + for ( TInt i = 0; i < iDestinations.Count(); i++ ) + { + if ( iDestinations[i]->GetHandle() == aHandle ) + { + result = iDestinations[i]; + break; + } + } + } + if ( !result ) + { + User::Leave( KErrCorrupt ); + } + + OstTraceFunctionExit0( RCMMANAGERAPI_GETDESTINATIONWRAPPER_EXIT ); + return result; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::StoreConnMethodWrapper() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::StoreConnMethodWrapper( + CCmConnectionMethodWrapper* aConnMethodWrapper ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_STORECONNMETHODWRAPPER_ENTRY ); + + TInt err = iConnMethods.InsertInAddressOrder( aConnMethodWrapper ); + + OstTraceFunctionExit0( RCMMANAGERAPI_STORECONNMETHODWRAPPER_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::RemoveConnMethodWrapper() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::RemoveConnMethodWrapper( + CCmConnectionMethodWrapper* aConnMethodWrapper ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_REMOVECONNMETHODPOINTER_ENTRY ); + + TInt index = iConnMethods.FindInAddressOrder( aConnMethodWrapper ); + if ( index >= 0 ) + { + iConnMethods.Remove( index ); + index = KErrNone; + } + + OstTraceFunctionExit0( RCMMANAGERAPI_REMOVECONNMETHODPOINTER_EXIT ); + return index; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetConnMethodWrapperL() +//----------------------------------------------------------------------------- +// +CCmConnectionMethodWrapper* RCmManagerApi::GetConnMethodWrapperL( const TInt& aHandle ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETCONNMETHODWRAPPER_ENTRY ); + + CCmConnectionMethodWrapper* result( NULL ); + if ( aHandle ) + { + for ( TInt i = 0; i < iConnMethods.Count(); i++ ) + { + if ( iConnMethods[i]->GetHandle() == aHandle ) + { + result = iConnMethods[i]; + break; + } + } + } + if ( !result ) + { + User::Leave( KErrCorrupt ); + } + + OstTraceFunctionExit0( RCMMANAGERAPI_GETCONNMETHODWRAPPER_EXIT ); + return result; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetBearerInfoInt() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::GetBearerInfoInt( + const TUint32 aBearerType, + const TUint32 aAttribute, + TUint32& aValue ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETBEARERINFOINT_ENTRY ); + + TPckg pckg( aValue ); + TIpcArgs args( aBearerType, aAttribute, &pckg ); + TInt err = SendReceive( ECmmGetBearerInfoInt, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_GETBEARERINFOINT_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetBearerInfoBool() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::GetBearerInfoBool( + const TUint32 aBearerType, + const TUint32 aAttribute, + TBool& aValue ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETBEARERINFOBOOL_ENTRY ); + + TPckg pckg( aValue ); + TIpcArgs args( aBearerType, aAttribute, &pckg ); + TInt err = SendReceive( ECmmGetBearerInfoBool, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_GETBEARERINFOBOOL_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetBearerInfoString() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::GetBearerInfoString( + const TUint32 aBearerType, + const TUint32 aAttribute, + HBufC* aBuffer ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETBEARERINFOSTRING_ENTRY ); + + TPtr descriptor( aBuffer->Des() ); + TIpcArgs args( aBearerType, aAttribute, &descriptor ); + TInt err = SendReceive( ECmmGetBearerInfoString, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_GETBEARERINFOSTRING_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetBearerInfoString8() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::GetBearerInfoString8( + const TUint32 aBearerType, + const TUint32 aAttribute, + HBufC8* aBuffer8 ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETBEARERINFOSTRING8_ENTRY ); + + TPtr8 descriptor( aBuffer8->Des() ); + TIpcArgs args( aBearerType, aAttribute, &descriptor ); + TInt err = SendReceive( ECmmGetBearerInfoString8, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_GETBEARERINFOSTRING8_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetConnectionMethodInfoInt() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::GetConnectionMethodInfoInt( + const TUint32 aIapId, + const TUint32 aAttribute, + TUint32& aValue ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETCONNECTIONMETHODINFOINT_ENTRY ); + + TPckg pckg( aValue ); + TIpcArgs args( aIapId, aAttribute, &pckg ); + TInt err = SendReceive( ECmmGetConnMethodInfoInt, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_GETCONNECTIONMETHODINFOINT_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetConnectionMethodInfoBool() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::GetConnectionMethodInfoBool( + const TUint32 aIapId, + const TUint32 aAttribute, + TBool& aValue ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETCONNECTIONMETHODINFOBOOL_ENTRY ); + + TPckg pckg( aValue ); + TIpcArgs args( aIapId, aAttribute, &pckg ); + TInt err = SendReceive( ECmmGetConnMethodInfoBool, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_GETCONNECTIONMETHODINFOBOOL_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetConnectionMethodInfoString() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::GetConnectionMethodInfoString( + const TUint32 aIapId, + const TUint32 aAttribute, + HBufC* aBuffer ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETCONNECTIONMETHODINFOSTRING_ENTRY ); + + TPtr descriptor( aBuffer->Des() ); + TIpcArgs args( aIapId, aAttribute, &descriptor ); + TInt err = SendReceive( ECmmGetConnMethodInfoString, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_GETCONNECTIONMETHODINFOSTRING_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetConnectionMethodInfoString8() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::GetConnectionMethodInfoString8( + const TUint32 aIapId, + const TUint32 aAttribute, + HBufC8* aBuffer8 ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETCONNECTIONMETHODINFOSTRING8_ENTRY ); + + TPtr8 descriptor( aBuffer8->Des() ); + TIpcArgs args( aIapId, aAttribute, &descriptor ); + TInt err = SendReceive( ECmmGetConnMethodInfoString8, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_GETCONNECTIONMETHODINFOSTRING8_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetConnMethodsL( +//----------------------------------------------------------------------------- +// +void RCmManagerApi::GetConnMethodsL( + const TCmmIpcStructGetConnMethods& aParameters, + RArray& aCmArray ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETCONNMETHODSL_ENTRY ); + + TInt err( KErrNone ); + TInt count( KMaxTInt ); + TPckg countPckg( count ); + TPckgBuf parametersPckg( aParameters ); + + HBufC8* smallBuf( NULL ); + HBufC8* bigBuf( NULL ); + + if ( iSmallBufsForConnMethods ) + { + smallBuf = HBufC8::NewLC( KCmmConnMethodAmountNormal ); + TPtr8 smallBufPtr( smallBuf->Des() ); + + TIpcArgs args( ¶metersPckg, &countPckg, &smallBufPtr ); + err = SendReceive( ECmmGetConnMethodArray, args ); + User::LeaveIfError( err ); + } + + if ( countPckg() <= KCmmConnMethodAmountNormal ) + { + aCmArray.Reset(); + aCmArray.ReserveL( countPckg() ); + for ( TInt i = 0; i < countPckg(); i++ ) + { + aCmArray.AppendL( (TUint32)(*smallBuf)[i] ); + } + } + else if ( countPckg() == KMaxTInt ) + { + // All connection methods didn't fit into small array, ask again with big array. + iSmallBufsForConnMethods = EFalse; // Switch small buffer mode off. + if ( smallBuf ) + { + CleanupStack::PopAndDestroy( smallBuf ); + smallBuf = NULL; + } + + bigBuf = HBufC8::NewLC( KCmmConnMethodAmountMax ); + TPtr8 bigBufPtr( bigBuf->Des() ); + + TIpcArgs args( ¶metersPckg, &countPckg, &bigBufPtr ); + err = SendReceive( ECmmGetConnMethodArray, args ); + User::LeaveIfError( err ); + + if ( countPckg() <= KCmmConnMethodAmountMax ) + { + // Don't switch back to small buffer mode if client was only asking + // for legacy connection methods (likely a small list). + if ( countPckg() < KCmmConnMethodAmountNormal && aParameters.iLegacyOnly == EFalse ) + { + iSmallBufsForConnMethods = ETrue; // Switch small buffer mode back on. + } + + aCmArray.Reset(); + aCmArray.ReserveL( countPckg() ); + for ( TInt i = 0; i < countPckg(); i++ ) + { + aCmArray.AppendL( (TUint32)(*smallBuf)[i] ); + } + } + else + { + User::Leave( KErrUnknown ); + } + CleanupStack::PopAndDestroy( bigBuf ); + } + else + { + User::Leave( KErrUnknown ); + } + + if ( smallBuf ) + { + CleanupStack::PopAndDestroy( smallBuf ); + } + + OstTraceFunctionExit0( RCMMANAGERAPI_GETCONNMETHODSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetAllDestinationsL() +//----------------------------------------------------------------------------- +// +void RCmManagerApi::GetAllDestinationsL( RArray& aDestArray ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETALLDESTINATIONSL_ENTRY ); + + TInt err( KErrNone ); + TInt count( KMaxTInt ); + TPckg countPckg( count ); + + HBufC16* smallBuf( NULL ); + HBufC16* bigBuf( NULL ); + + if ( iSmallBufsForDestinations ) + { + smallBuf = HBufC16::NewLC( KCmmDestAmountNormal ); + TPtr16 smallBufPtr( smallBuf->Des() ); + + TIpcArgs args( &countPckg, &smallBufPtr ); + err = SendReceive( ECmmGetAllDestinations, args ); + User::LeaveIfError( err ); + } + + if ( countPckg() <= KCmmDestAmountNormal ) + { + aDestArray.Reset(); + aDestArray.ReserveL( countPckg() ); + for ( TInt i = 0; i < countPckg(); i++ ) + { + aDestArray.AppendL( (TUint32)(*smallBuf)[i] ); + } + } + else if ( countPckg() == KMaxTInt ) + { + // All destinations didn't fit into small array, ask again with big array. + iSmallBufsForDestinations = EFalse; // Switch small buffer mode off. + if ( smallBuf ) + { + CleanupStack::PopAndDestroy( smallBuf ); + smallBuf = NULL; + } + + bigBuf = HBufC16::NewLC( KCmmDestAmountMax ); + TPtr16 bigBufPtr( bigBuf->Des() ); + + TIpcArgs args( &countPckg, &bigBufPtr ); + err = SendReceive( ECmmGetAllDestinations, args ); + User::LeaveIfError( err ); + + if ( countPckg() <= KCmmDestAmountMax ) + { + if ( countPckg() < KCmmDestAmountNormal ) + { + iSmallBufsForDestinations = ETrue; // Switch small buffer mode back on. + } + + aDestArray.Reset(); + aDestArray.ReserveL( countPckg() ); + for ( TInt i = 0; i < countPckg(); i++ ) + { + aDestArray.AppendL( (TUint32)(*smallBuf)[i] ); + } + } + else + { + User::Leave( KErrUnknown ); + } + CleanupStack::PopAndDestroy( bigBuf ); + } + else + { + User::Leave( KErrUnknown ); + } + + if ( smallBuf ) + { + CleanupStack::PopAndDestroy( smallBuf ); + } + + OstTraceFunctionExit0( RCMMANAGERAPI_GETALLDESTINATIONSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetBearerPriorityArrayL() +//----------------------------------------------------------------------------- +// +void RCmManagerApi::GetBearerPriorityArrayL( RArray& aArray ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETBEARERPRIORITYARRAYL_ENTRY ); + + HBufC* buffer = HBufC::NewLC( KCmmDefaultBearerPriorityArraySize ); + TPtr bufferPtr( buffer->Des() ); + + TIpcArgs args( &bufferPtr ); + TInt err = SendReceive( ECmmGetBearerPriorityArray, args ); + User::LeaveIfError( err ); + + // bufferPtr[1] should now contain the needed buffer length. + if ( bufferPtr[1] > bufferPtr.Length() ) + { + // First buffer wasn't big enough. Try again with correct size buffer. + CleanupStack::PopAndDestroy( buffer ); + buffer = HBufC::NewLC( bufferPtr[1] ); + bufferPtr.Set( buffer->Des() ); + + TIpcArgs args2( &bufferPtr ); + err = SendReceive( ECmmGetBearerPriorityArray, args2 ); + User::LeaveIfError( err ); + + if ( bufferPtr[1] > bufferPtr.Length() ) + { + User::Leave( KErrAbort ); + } + } + + const TInt bearerCount = bufferPtr[0]; + + // Cleanup old array. There's a pointer in that T-class... + for ( TInt i = 0; i < aArray.Count(); i++ ) + { + if ( aArray[i].iServiceType ) + { + delete aArray[i].iServiceType; + aArray[i].iServiceType = NULL; + } + } + aArray.Reset(); + aArray.ReserveL( bearerCount ); + + TInt position( 2 ); // Start of first priority item + for ( TInt i = 0; i < bearerCount; i++ ) + { + TBearerPriority bearerPriority; + bearerPriority.iPriority = bufferPtr[position++] << KBitsInTwoBytes; + bearerPriority.iPriority += bufferPtr[position++]; + bearerPriority.iUIPriority = bufferPtr[position++] << KBitsInTwoBytes; + bearerPriority.iUIPriority += bufferPtr[position++]; + bearerPriority.iServiceType = NULL; + + const TInt stringLength = bufferPtr[position++]; + if ( stringLength ) + { + HBufC* serviceName = HBufC::NewL( stringLength ); + serviceName->Des().Append( &(bufferPtr[position]), stringLength ); + position += stringLength; + bearerPriority.iServiceType = serviceName; + // Ownership moved into array. + } + aArray.AppendL( bearerPriority ); + } + + CleanupStack::PopAndDestroy( buffer ); + + OstTraceFunctionExit0( RCMMANAGERAPI_GETBEARERPRIORITYARRAYL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::SetBearerPriorityArrayL() +//----------------------------------------------------------------------------- +// +void RCmManagerApi::SetBearerPriorityArrayL( const RArray& aArray ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_SETBEARERPRIORITYARRAYL_ENTRY ); + + // iPriority: 2 16-bit values, + // iUIPriority: 2 16-bit values, + // iServiceType length: 1 16-bit value. + const TInt KCmmBearerPriorityHeaderLength = 5; + + // Buffer starts with legth of 2, to contain both the total amount of + // TBearerPriority objects, and the size of the buffer (number of 16-bit + // values) needed to contain the whole structure including all headers. + TInt bufferLength( 2 ); + + const TInt bearerCount = aArray.Count(); + for ( TInt i = 0; i < bearerCount; i++ ) + { + bufferLength += KCmmBearerPriorityHeaderLength; + const TBearerPriority& bearerPriority = aArray[i]; + if ( !bearerPriority.iServiceType ) + { + User::Leave( KErrArgument ); + } + // Get length of service type name and add it to needed buffer length. + bufferLength += bearerPriority.iServiceType->Length(); + } + + HBufC* buffer = HBufC::NewLC( bufferLength ); + TPtr bufferPtr( buffer->Des() ); + + bufferPtr.Append( bearerCount ); + bufferPtr.Append( bufferLength ); + + TInt position = bufferPtr.Length(); + for ( TInt i = 0; i < bearerCount; i++ ) + { + const TBearerPriority& bearerPriority = aArray[i]; + + bufferPtr.Append( ( bearerPriority.iPriority & 0xFFFF0000 ) >> KBitsInTwoBytes ); + bufferPtr.Append( ( bearerPriority.iPriority & 0x0000FFFF ) ); + bufferPtr.Append( ( bearerPriority.iUIPriority & 0xFFFF0000 ) >> KBitsInTwoBytes ); + bufferPtr.Append( ( bearerPriority.iUIPriority & 0x0000FFFF ) ); + + position += KCmmBearerPriorityHeaderLength; + if ( !bearerPriority.iServiceType ) + { + User::Leave( KErrArgument ); + } + const TInt stringLength = bearerPriority.iServiceType->Length(); + bufferPtr.Append( stringLength ); + bufferPtr.Insert( position, *(bearerPriority.iServiceType) ); + position += stringLength; + } + + TIpcArgs args( &bufferPtr ); + TInt err = SendReceive( ECmmUpdateBearerPriorityArray, args ); + User::LeaveIfError( err ); + CleanupStack::PopAndDestroy( buffer ); + + OstTraceFunctionExit0( RCMMANAGERAPI_SETBEARERPRIORITYARRAYL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetSupportedBearersL() +//----------------------------------------------------------------------------- +// +void RCmManagerApi::GetSupportedBearersL( RArray& aArray ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETSUPPORTEDBEARERSL_ENTRY ); + + TInt err( KErrNone ); + TInt count( KMaxTInt ); + TPckg countPckg( count ); + + HBufC8* smallBuf( NULL ); + HBufC8* bigBuf( NULL ); + + smallBuf = HBufC8::NewLC( KCmmBearerAmountNormal * sizeof( TUint32 ) ); + TPtr8 smallBufPtr( smallBuf->Des() ); + + TIpcArgs args( &countPckg, &smallBufPtr ); + err = SendReceive( ECmmGetSupportedBearers, args ); + User::LeaveIfError( err ); + + if ( countPckg() <= KCmmBearerAmountNormal ) + { + aArray.Reset(); + aArray.ReserveL( countPckg() ); + + TUint32 a( 0 ); + TPtr8 ptr = smallBuf->Des(); + for ( TInt i = 0; i < countPckg(); i++ ) + { + a = 0; + a += (TUint32)ptr[0 + ( i * sizeof( TUint32 ) )]; + a += (TUint32)ptr[1 + ( i * sizeof( TUint32 ) )] << KBitsInOneByte; + a += (TUint32)ptr[2 + ( i * sizeof( TUint32 ) )] << KBitsInTwoBytes; + a += (TUint32)ptr[3 + ( i * sizeof( TUint32 ) )] << KBitsInThreeBytes; + aArray.AppendL( a ); + } + } + else + { + TInt storedCount = countPckg(); + + bigBuf = HBufC8::NewLC( countPckg() * sizeof( TUint32 ) ); + TPtr8 bigBufPtr( bigBuf->Des() ); + + TIpcArgs args( &countPckg, &bigBufPtr ); + err = SendReceive( ECmmGetSupportedBearers, args ); + User::LeaveIfError( err ); + + if ( countPckg() <= storedCount ) + { + aArray.Reset(); + aArray.ReserveL( countPckg() ); + + TUint32 a( 0 ); + TPtr8 ptr = bigBuf->Des(); + for ( TInt i = 0; i < countPckg(); i++ ) + { + a = 0; + a += (TUint32)ptr[0 + ( i * sizeof( TUint32 ) )]; + a += (TUint32)ptr[1 + ( i * sizeof( TUint32 ) )] << KBitsInOneByte; + a += (TUint32)ptr[2 + ( i * sizeof( TUint32 ) )] << KBitsInTwoBytes; + a += (TUint32)ptr[3 + ( i * sizeof( TUint32 ) )] << KBitsInThreeBytes; + aArray.AppendL( a ); + } + } + else + { + User::Leave( KErrUnknown ); + } + + CleanupStack::PopAndDestroy( bigBuf ); + } + CleanupStack::PopAndDestroy( smallBuf ); + + OstTraceFunctionExit0( RCMMANAGERAPI_GETSUPPORTEDBEARERSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::GetEasyWlanId() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::GetEasyWlanId( TUint32& aValue ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_GETEASYWLANID_ENTRY ); + + TPckg pckg( aValue ); + TIpcArgs args( &pckg ); + TInt err = SendReceive( ECmmGetEasyWlanId, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_GETEASYWLANID_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::ReadDefaultConnection() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::ReadDefaultConnection( + TCmDefConnValue& aDefConnSetting ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_READDEFAULTCONNECTION_ENTRY ); + + TPckgBuf pkg( aDefConnSetting ); + TIpcArgs args( &pkg ); + TInt err = SendReceive( ECmmReadDefaultConnection, args ); + aDefConnSetting = pkg(); + + OstTraceFunctionExit0( RCMMANAGERAPI_READDEFAULTCONNECTION_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::WriteDefaultConnection() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::WriteDefaultConnection( + const TCmDefConnValue& aDefConnSetting ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_WRITEDEFAULTCONNECTION_ENTRY ); + + TPckgBuf pkg( aDefConnSetting ); + TIpcArgs args( &pkg ); + TInt err = SendReceive( ECmmWriteDefaultConnection, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_WRITEDEFAULTCONNECTION_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::ReadGeneralConnectionSettings() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::ReadGeneralConnectionSettings( + TCmGenConnSettings& aGenConnSettings ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_READGENERALCONNECTIONSETTINGS_ENTRY ); + + TPckgBuf pkg( aGenConnSettings ); + TIpcArgs args( &pkg ); + TInt err = SendReceive( ECmmReadGeneralConnectionSettings, args ); + aGenConnSettings = pkg(); + + OstTraceFunctionExit0( RCMMANAGERAPI_READGENERALCONNECTIONSETTINGS_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::WriteGeneralConnectionSettings() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::WriteGeneralConnectionSettings( + const TCmGenConnSettings& aGenConnSettings ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_WRITEGENERALCONNECTIONSETTINGS_ENTRY ); + + TPckgBuf pkg( aGenConnSettings ); + TIpcArgs args( &pkg ); + TInt err = SendReceive( ECmmWriteGeneralConnectionSettings, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_WRITEGENERALCONNECTIONSETTINGS_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::CopyConnectionMethod() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::CopyConnectionMethod( + const TInt aTargetDestHandle, + const TInt aConnMethodHandle, + TInt& aIndex ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_COPYCONNECTIONMETHOD_ENTRY ); + + TPckg pkg( aIndex ); + TIpcArgs args( aTargetDestHandle, aConnMethodHandle, &pkg ); + TInt err = SendReceive( ECmmCopyConnMethod, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_COPYCONNECTIONMETHOD_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::MoveConnectionMethod() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::MoveConnectionMethod( + TCmmIpcStructMoveConnMethod& aPkgData ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_MOVECONNECTIONMETHOD_ENTRY ); + + TPckgBuf pkg( aPkgData ); + TIpcArgs args( &pkg ); + TInt err = SendReceive( ECmmMoveConnMethod, args ); + aPkgData = pkg(); + + OstTraceFunctionExit0( RCMMANAGERAPI_MOVECONNECTIONMETHOD_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::RemoveConnectionMethod() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::RemoveConnectionMethod( + const TInt aTargetDestHandle, + const TInt aConnMethodHandle ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_REMOVECONNECTIONMETHOD_ENTRY ); + + TIpcArgs args( aTargetDestHandle, aConnMethodHandle ); + TInt err = SendReceive( ECmmRemoveConnMethod, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_REMOVECONNECTIONMETHOD_EXIT ); + return err; + } + +//----------------------------------------------------------------------------- +// RCmManagerApi::RemoveAllReferences() +//----------------------------------------------------------------------------- +// +TInt RCmManagerApi::RemoveAllReferences( + const TInt aConnMethodHandle ) + { + OstTraceFunctionEntry0( RCMMANAGERAPI_REMOVEALLREFERENCES_ENTRY ); + + TIpcArgs args( aConnMethodHandle ); + TInt err = SendReceive( ECmmRemoveAllReferences, args ); + + OstTraceFunctionExit0( RCMMANAGERAPI_REMOVEALLREFERENCES_EXIT ); + return err; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/src/cmmanagerext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/src/cmmanagerext.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,862 @@ +/* +* Copyright (c) 2006-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 RCmManagerExt. +* +*/ + + +#include +#include +#include + +#include "cmmserverdefs.h" +#include "cmmanagerapi.h" +#include "cmconnectionmethodwrapper.h" +#include "cmdestinationwrapper.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmanagerextTraces.h" +#endif + + +//----------------------------------------------------------------------------- +// RCmManagerExt::OpenL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::OpenL() + { + OstTraceFunctionEntry0( RCMMANAGEREXT_OPENL_ENTRY ); + + OpenLC(); + CleanupStack::Pop( this ); + + OstTraceFunctionExit0( RCMMANAGEREXT_OPENL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::OpenLC() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::OpenLC() + { + OstTraceFunctionEntry0( RCMMANAGEREXT_OPENLC_ENTRY ); + + if ( iCmManagerApi ) + { + User::Leave( KErrAlreadyExists ); + } + + CleanupClosePushL( *this ); + iCmManagerApi = new (ELeave) RCmManagerApi(); + User::LeaveIfError( iCmManagerApi->Connect() ); + + OstTraceFunctionExit0( RCMMANAGEREXT_OPENLC_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::Close() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::Close() + { + OstTraceFunctionEntry0( RCMMANAGEREXT_CLOSE_ENTRY ); + + if ( iCmManagerApi ) + { + iCmManagerApi->Close(); + delete iCmManagerApi; + iCmManagerApi = NULL; + } + + OstTraceFunctionExit0( RCMMANAGEREXT_CLOSE_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::CreateTablesAndOpenL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::CreateTablesAndOpenL() + { + OstTraceFunctionEntry0( RCMMANAGEREXT_CREATETABLESANDOPENL_ENTRY ); + OpenL(); + OstTraceFunctionExit0( RCMMANAGEREXT_CREATETABLESANDOPENL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::ConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethodExt RCmManagerExt::ConnectionMethodL( + TUint32 aConnectionMethodId ) + { + OstTraceFunctionEntry0( RCMMANAGEREXT_CONNECTIONMETHODL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( !( ( aConnectionMethodId > KCmmConnMethodIdIntervalMin ) && + ( aConnectionMethodId < KCmmConnMethodIdIntervalMax ) ) ) + { + User::Leave( KErrArgument ); + } + + // If client already has a handle open to this connection method, give a + // reference to it. + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + TInt existingHandle( 0 ); + cmWrapper->GetConnMethodWithIdL( iCmManagerApi, aConnectionMethodId, existingHandle ); + if ( existingHandle ) + { + CleanupStack::PopAndDestroy( cmWrapper ); + cmWrapper = iCmManagerApi->GetConnMethodWrapperL( existingHandle ); + cmWrapper->IncreaseReferenceCounter(); + } + else + { + CleanupStack::Pop( cmWrapper ); + } + + RCmConnectionMethodExt cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( RCMMANAGEREXT_CONNECTIONMETHODL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::GetBearerInfoIntL() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmManagerExt::GetBearerInfoIntL( + TUint32 aBearerType, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGEREXT_GETBEARERINFOINTL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TUint32 value( 0 ); + TInt err = iCmManagerApi->GetBearerInfoInt( aBearerType, aAttribute, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGEREXT_GETBEARERINFOINTL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::GetBearerInfoBoolL() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmManagerExt::GetBearerInfoBoolL( + TUint32 aBearerType, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGEREXT_GETBEARERINFOBOOLL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TBool value( 0 ); + TInt err = iCmManagerApi->GetBearerInfoBool( aBearerType, aAttribute, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGEREXT_GETBEARERINFOBOOLL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::GetBearerInfoStringL() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC* RCmManagerExt::GetBearerInfoStringL( + TUint32 aBearerType, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGEREXT_GETBEARERINFOSTRINGL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + HBufC* buffer = HBufC::NewLC( KCmmStringLengthMax ); + TInt err = iCmManagerApi->GetBearerInfoString( aBearerType, aAttribute, buffer ); + User::LeaveIfError( err ); + + if ( buffer->Length() > 0 ) + { + CleanupStack::Pop( buffer ); + } + else + { + CleanupStack::PopAndDestroy( buffer ); + buffer = NULL; + buffer = KNullDesC().AllocL(); + } + + OstTraceFunctionExit0( RCMMANAGEREXT_GETBEARERINFOSTRINGL_EXIT ); + return buffer; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::GetBearerInfoString8L() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* RCmManagerExt::GetBearerInfoString8L( + TUint32 aBearerType, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGEREXT_GETBEARERINFOSTRING8L_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + HBufC8* buffer8 = HBufC8::NewLC( KCmmStringLengthMax ); + TInt err = iCmManagerApi->GetBearerInfoString8( aBearerType, aAttribute, buffer8 ); + User::LeaveIfError( err ); + + if ( buffer8->Length() > 0 ) + { + CleanupStack::Pop( buffer8 ); + } + else + { + CleanupStack::PopAndDestroy( buffer8 ); + buffer8 = NULL; + buffer8 = KNullDesC8().AllocL(); + } + + OstTraceFunctionExit0( RCMMANAGEREXT_GETBEARERINFOSTRING8L_EXIT ); + return buffer8; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::GetConnectionMethodInfoIntL() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmManagerExt::GetConnectionMethodInfoIntL( + TUint32 aIapId, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGEREXT_GETCONNECTIONMETHODINFOINTL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TUint32 value( 0 ); + TInt err = iCmManagerApi->GetConnectionMethodInfoInt( aIapId, aAttribute, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGEREXT_GETCONNECTIONMETHODINFOINTL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::GetConnectionMethodInfoBoolL() +//----------------------------------------------------------------------------- +// +EXPORT_C TBool RCmManagerExt::GetConnectionMethodInfoBoolL( + TUint32 aIapId, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGEREXT_GETCONNECTIONMETHODINFOBOOLL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TBool value( 0 ); + TInt err = iCmManagerApi->GetConnectionMethodInfoBool( aIapId, aAttribute, value ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGEREXT_GETCONNECTIONMETHODINFOBOOLL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::GetConnectionMethodInfoStringL() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC* RCmManagerExt::GetConnectionMethodInfoStringL( + TUint32 aIapId, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGEREXT_GETCONNECTIONMETHODINFOSTRINGL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + HBufC* buffer = HBufC::NewLC( KCmmStringLengthMax ); + TInt err = iCmManagerApi->GetConnectionMethodInfoString( aIapId, aAttribute, buffer ); + User::LeaveIfError( err ); + + if ( buffer->Length() > 0 ) + { + CleanupStack::Pop( buffer ); + } + else + { + CleanupStack::PopAndDestroy( buffer ); + buffer = NULL; + buffer = KNullDesC().AllocL(); + } + + OstTraceFunctionExit0( RCMMANAGEREXT_GETCONNECTIONMETHODINFOSTRINGL_EXIT ); + return buffer; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::GetConnectionMethodInfoString8L() +//----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* RCmManagerExt::GetConnectionMethodInfoString8L( + TUint32 aIapId, + TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( RCMMANAGEREXT_GETCONNECTIONMETHODINFOSTRING8L_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + HBufC8* buffer8 = HBufC8::NewLC( KCmmStringLengthMax ); + TInt err = iCmManagerApi->GetConnectionMethodInfoString8( aIapId, aAttribute, buffer8 ); + User::LeaveIfError( err ); + + if ( buffer8->Length() > 0 ) + { + CleanupStack::Pop( buffer8 ); + } + else + { + CleanupStack::PopAndDestroy( buffer8 ); + buffer8 = NULL; + buffer8 = KNullDesC8().AllocL(); + } + + OstTraceFunctionExit0( RCMMANAGEREXT_GETCONNECTIONMETHODINFOSTRING8L_EXIT ); + return buffer8; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::CreateDestinationL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestinationExt RCmManagerExt::CreateDestinationL( + const TDesC& aName ) + { + OstTraceFunctionEntry0( RCMMANAGEREXT_CREATEDESTINATIONL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( aName.Length() == 0 ) + { + User::Leave( KErrArgument ); + } + + CCmDestinationWrapper* destWrap = CCmDestinationWrapper::NewLC(); + destWrap->CreateDestByNameL( iCmManagerApi, aName ); + CleanupStack::Pop( destWrap ); + + RCmDestinationExt dest; + dest.iCmDestinationWrapper = destWrap; + + OstTraceFunctionExit0( RCMMANAGEREXT_CREATEDESTINATIONL_EXIT ); + return dest; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::CreateConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethodExt RCmManagerExt::CreateConnectionMethodL( + TUint32 aBearerType ) + { + OstTraceFunctionEntry0( RCMMANAGEREXT_CREATECONNECTIONMETHODL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + cmWrapper->CreateConnMethodL( iCmManagerApi, aBearerType ); + CleanupStack::Pop( cmWrapper ); + + RCmConnectionMethodExt cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( RCMMANAGEREXT_CREATECONNECTIONMETHODL_EXIT ); + return cm; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::CopyConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C TInt RCmManagerExt::CopyConnectionMethodL( + RCmDestinationExt& aTargetDestination, + RCmConnectionMethodExt& aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMMANAGEREXT_COPYCONNECTIONMETHODL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( !aTargetDestination.iCmDestinationWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper ) + { + User::Leave( KErrArgument ); + } + if ( !aTargetDestination.iCmDestinationWrapper->SessionConnected() || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt index( 0 ); + TInt targetDestHandle = aTargetDestination.iCmDestinationWrapper->GetHandle(); + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmManagerApi->CopyConnectionMethod( targetDestHandle, connMethodHandle, index ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGEREXT_COPYCONNECTIONMETHODL_EXIT ); + return index; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::MoveConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C TInt RCmManagerExt::MoveConnectionMethodL( + RCmDestinationExt& aSourceDestination, + RCmDestinationExt& aTargetDestination, + RCmConnectionMethodExt& aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMMANAGEREXT_MOVECONNECTIONMETHODL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( !aSourceDestination.iCmDestinationWrapper || + !aTargetDestination.iCmDestinationWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper ) + { + User::Leave( KErrArgument ); + } + if ( !aSourceDestination.iCmDestinationWrapper->SessionConnected() || + !aTargetDestination.iCmDestinationWrapper->SessionConnected() || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TCmmIpcStructMoveConnMethod pkgData; + pkgData.iSourceDestHandle = aSourceDestination.iCmDestinationWrapper->GetHandle(); + pkgData.iTargetDestHandle = aTargetDestination.iCmDestinationWrapper->GetHandle(); + pkgData.iConnMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + pkgData.iIndex = 0; + + TInt err = iCmManagerApi->MoveConnectionMethod( pkgData ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGEREXT_MOVECONNECTIONMETHODL_EXIT ); + return pkgData.iIndex; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::RemoveConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::RemoveConnectionMethodL( + RCmDestinationExt& aDestination, + RCmConnectionMethodExt& aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMMANAGEREXT_REMOVECONNECTIONMETHODL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( !aDestination.iCmDestinationWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper ) + { + User::Leave( KErrArgument ); + } + if ( !aDestination.iCmDestinationWrapper->SessionConnected() || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt targetDestHandle = aDestination.iCmDestinationWrapper->GetHandle(); + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmManagerApi->RemoveConnectionMethod( targetDestHandle, connMethodHandle ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGEREXT_REMOVECONNECTIONMETHODL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::RemoveAllReferencesL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::RemoveAllReferencesL( + RCmConnectionMethodExt& aConnectionMethod ) + { + OstTraceFunctionEntry0( RCMMANAGEREXT_REMOVEALLREFERENCESL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( !aConnectionMethod.iCmConnectionMethodWrapper || + !aConnectionMethod.iCmConnectionMethodWrapper->SessionConnected() ) + { + User::Leave( KErrArgument ); + } + + TInt connMethodHandle = aConnectionMethod.iCmConnectionMethodWrapper->GetHandle(); + TInt err = iCmManagerApi->RemoveAllReferences( connMethodHandle ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGEREXT_REMOVEALLREFERENCESL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::ConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::ConnectionMethodL( + RArray& aCmArray, + TBool aCheckBearerType, + TBool aLegacyOnly, + TBool aEasyWlan ) + { + OstTraceFunctionEntry0( DUP1_RCMMANAGEREXT_CONNECTIONMETHODL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TCmmIpcStructGetConnMethods parameters; + parameters.iCheckBearerType = aCheckBearerType; + parameters.iLegacyOnly = aLegacyOnly; + parameters.iEasyWlan = aEasyWlan; + + iCmManagerApi->GetConnMethodsL( parameters, aCmArray ); + + OstTraceFunctionExit0( DUP1_RCMMANAGEREXT_CONNECTIONMETHODL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::AllDestinationsL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::AllDestinationsL( RArray& aDestArray ) + { + OstTraceFunctionEntry0( RCMMANAGEREXT_ALLDESTINATIONSL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + iCmManagerApi->GetAllDestinationsL( aDestArray ); + + OstTraceFunctionExit0( RCMMANAGEREXT_ALLDESTINATIONSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::DestinationL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestinationExt RCmManagerExt::DestinationL( TUint32 aDestinationId ) + { + OstTraceFunctionEntry0( RCMMANAGEREXT_DESTINATIONL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + // If client already has a handle open to this destination, give a + // reference to it. + CCmDestinationWrapper* destWrap = CCmDestinationWrapper::NewLC(); + TInt existingHandle( 0 ); + destWrap->GetDestWithIdL( iCmManagerApi, aDestinationId, existingHandle ); + if ( existingHandle ) + { + CleanupStack::PopAndDestroy( destWrap ); + destWrap = iCmManagerApi->GetDestinationWrapperL( existingHandle ); + destWrap->IncreaseReferenceCounter(); + } + else + { + CleanupStack::Pop( destWrap ); + } + + RCmDestinationExt dest; + dest.iCmDestinationWrapper = destWrap; + + OstTraceFunctionExit0( RCMMANAGEREXT_DESTINATIONL_EXIT ); + return dest; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::BearerPriorityArrayL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::BearerPriorityArrayL( + RArray& aArray ) const + { + OstTraceFunctionEntry0( RCMMANAGEREXT_BEARERPRIORITYARRAYL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + iCmManagerApi->GetBearerPriorityArrayL( aArray ); + + OstTraceFunctionExit0( RCMMANAGEREXT_BEARERPRIORITYARRAYL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::UpdateBearerPriorityArrayL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::UpdateBearerPriorityArrayL( + const RArray& aArray ) + { + OstTraceFunctionEntry0( RCMMANAGEREXT_UPDATEBEARERPRIORITYARRAYL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + iCmManagerApi->SetBearerPriorityArrayL( aArray ); + + OstTraceFunctionExit0( RCMMANAGEREXT_UPDATEBEARERPRIORITYARRAYL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::CleanupGlobalPriorityArray() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::CleanupGlobalPriorityArray( + RArray& aArray ) const + { + OstTraceFunctionEntry0( RCMMANAGEREXT_CLEANUPGLOBALPRIORITYARRAY_ENTRY ); + + for ( TInt i = 0; i < aArray.Count(); i++ ) + { + delete aArray[i].iServiceType; + } + aArray.Reset(); + aArray.Close(); + + OstTraceFunctionExit0( RCMMANAGEREXT_CLEANUPGLOBALPRIORITYARRAY_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::SupportedBearersL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::SupportedBearersL( RArray& aArray ) const + { + OstTraceFunctionEntry0( RCMMANAGEREXT_SUPPORTEDBEARERSL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + iCmManagerApi->GetSupportedBearersL( aArray ); + + OstTraceFunctionExit0( RCMMANAGEREXT_SUPPORTEDBEARERSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::EasyWlanIdL() +//----------------------------------------------------------------------------- +// +EXPORT_C TUint32 RCmManagerExt::EasyWlanIdL() + { + OstTraceFunctionEntry0( RCMMANAGEREXT_EASYWLANIDL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TUint32 value( 0 ); + TInt err = iCmManagerApi->GetEasyWlanId( value ); + User::LeaveIfError( err ); + OstTraceFunctionExit0( RCMMANAGEREXT_EASYWLANIDL_EXIT ); + return value; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::ReadDefConnL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::ReadDefConnL( TCmDefConnValue& aDefConnSetting ) + { + OstTraceFunctionEntry0( RCMMANAGEREXT_READDEFCONNL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmManagerApi->ReadDefaultConnection( aDefConnSetting ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGEREXT_READDEFCONNL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::WriteDefConnL() +//----------------------------------------------------------------------------- +// +EXPORT_C void RCmManagerExt::WriteDefConnL( const TCmDefConnValue& aDefConnSetting ) + { + OstTraceFunctionEntry0( RCMMANAGEREXT_WRITEDEFCONNL_ENTRY ); + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + TInt err = iCmManagerApi->WriteDefaultConnection( aDefConnSetting ); + User::LeaveIfError( err ); + + OstTraceFunctionExit0( RCMMANAGEREXT_WRITEDEFCONNL_EXIT ); + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::CreateDestinationL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmDestinationExt RCmManagerExt::CreateDestinationL( + const TDesC& aName, + TUint32 aDestId ) + { + OstTraceFunctionEntry0( DUP1_RCMMANAGEREXT_CREATEDESTINATIONL_ENTRY ); + + if ( aDestId == 0 ) + { + return CreateDestinationL( aName ); + } + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + + if ( aName.Length() == 0 ) + { + User::Leave( KErrArgument ); + } + + TUint32 adjustedDestId( 0 ); + if ( aDestId > KCmmDestIdIntervalLegacyMin && aDestId < KCmmDestIdIntervalLegacyMax ) + { + adjustedDestId = aDestId + KCmDefaultDestinationAPTagId; + } + else if ( aDestId > KCmmDestIdIntervalMin && aDestId < KCmmDestIdIntervalMax ) + { + adjustedDestId = aDestId; + } + else + { + User::Leave( KErrArgument ); + } + + CCmDestinationWrapper* destWrap = CCmDestinationWrapper::NewLC(); + destWrap->CreateDestByNameAndIdL( iCmManagerApi, aName, adjustedDestId ); + CleanupStack::Pop( destWrap ); + + RCmDestinationExt dest; + dest.iCmDestinationWrapper = destWrap; + + OstTraceFunctionExit0( DUP1_RCMMANAGEREXT_CREATEDESTINATIONL_EXIT ); + return dest; + } + +//----------------------------------------------------------------------------- +// RCmManagerExt::CreateConnectionMethodL() +//----------------------------------------------------------------------------- +// +EXPORT_C RCmConnectionMethodExt RCmManagerExt::CreateConnectionMethodL( + TUint32 aBearerType, + TUint32 aConnMethodId ) + { + OstTraceFunctionEntry0( DUP1_RCMMANAGEREXT_CREATECONNECTIONMETHODL_ENTRY ); + + if ( aConnMethodId == 0 ) + { + return CreateConnectionMethodL( aBearerType ); + } + + if ( !iCmManagerApi ) + { + User::Leave( KErrBadHandle ); + } + if ( !( aConnMethodId > KCmmConnMethodIdIntervalMin && + aConnMethodId < KCmmConnMethodIdIntervalMax ) ) + { + User::Leave( KErrArgument ); + } + + CCmConnectionMethodWrapper* cmWrapper = CCmConnectionMethodWrapper::NewLC(); + cmWrapper->CreateConnMethodWithIdL( iCmManagerApi, aBearerType, aConnMethodId ); + CleanupStack::Pop( cmWrapper ); + + RCmConnectionMethodExt cm; + cm.iCmConnectionMethodWrapper = cmWrapper; + + OstTraceFunctionExit0( DUP1_RCMMANAGEREXT_CREATECONNECTIONMETHODL_EXIT ); + return cm; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/traces/OstTraceDefinitions.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler +// REMOVE BEFORE CHECK-IN TO VERSION CONTROL +// #define OST_TRACE_COMPILER_IN_USE +#include +#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmapi/traces/fixed_id.definitions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmapi/traces/fixed_id.definitions Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,480 @@ +#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt. +[GROUP]TRACE_FLOW=0x7 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_CCMCONNECTIONMETHODWRAPPER_ENTRY=0xf9 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_CCMCONNECTIONMETHODWRAPPER_EXIT=0xfa +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_CLOSESESSION_ENTRY=0x116 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_CLOSESESSION_EXIT=0x117 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODFROMDESTL_ENTRY=0x102 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODFROMDESTL_EXIT=0x103 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODFROMDESTWITHIDL_ENTRY=0x104 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODFROMDESTWITHIDL_EXIT=0x105 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODL_ENTRY=0x106 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODL_EXIT=0x107 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODWITHIDL_ENTRY=0x108 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODWITHIDL_EXIT=0x109 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_DELETE_ENTRY=0x113 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_GETBOOLATTRIBUTE_ENTRY=0x10b +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_GETCONNMETHODFROMDESTWITHIDL_ENTRY=0x100 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_GETCONNMETHODFROMDESTWITHIDL_EXIT=0x101 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_GETCONNMETHODFROMDESTWITHINDEXL_ENTRY=0xfe +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_GETCONNMETHODFROMDESTWITHINDEXL_EXIT=0xff +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_GETCONNMETHODWITHIDL_ENTRY=0xfc +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_GETCONNMETHODWITHIDL_EXIT=0xfd +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_GETHANDLE_ENTRY=0x118 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_GETINTATTRIBUTE_ENTRY=0x10a +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_GETMAINSESSION_ENTRY=0x119 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_GETMAINSESSION_EXIT=0x11a +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_GETSTRING8ATTRIBUTE_ENTRY=0x10d +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_GETSTRINGATTRIBUTE_ENTRY=0x10c +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_ISEQUAL_ENTRY=0x114 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_NEWLC_ENTRY=0xf8 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_NEWL_ENTRY=0xf7 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_SESSIONCONNECTED_ENTRY=0x115 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_SETBOOLATTRIBUTE_ENTRY=0x10f +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_SETINTATTRIBUTE_ENTRY=0x10e +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_SETSTRING8ATTRIBUTE_ENTRY=0x111 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_SETSTRINGATTRIBUTE_ENTRY=0x110 +[TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_UPDATE_ENTRY=0x112 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_ADDCONNECTIONMETHOD_ENTRY=0x9e +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_CCMDESTINATIONWRAPPER_ENTRY=0x8c +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_CCMDESTINATIONWRAPPER_EXIT=0x8d +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_CLOSESESSION_ENTRY=0xad +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_CLOSESESSION_EXIT=0xae +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_CONNECTIONMETHODCOUNT_ENTRY=0x97 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_CREATEDESTBYNAMEANDIDL_ENTRY=0x93 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_CREATEDESTBYNAMEANDIDL_EXIT=0x94 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_CREATEDESTBYNAMEL_ENTRY=0x91 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_CREATEDESTBYNAMEL_EXIT=0x92 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_DELETECONNECTIONMETHOD_ENTRY=0xa0 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_DELETE_ENTRY=0xa8 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_GETCONNMETHODASEMBEDDEDDESTL_ENTRY=0x95 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_GETCONNMETHODASEMBEDDEDDESTL_EXIT=0x96 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_GETDESTWITHIDL_ENTRY=0x8f +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_GETDESTWITHIDL_EXIT=0x90 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_GETELEMENTID_ENTRY=0x9b +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_GETHANDLE_ENTRY=0xaf +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_GETID_ENTRY=0x9a +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_GETMAINSESSION_ENTRY=0xb0 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_GETMAINSESSION_EXIT=0xb1 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_GETMETADATA_ENTRY=0x9c +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_GETNAME_ENTRY=0x99 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_GETPROTECTIONLEVEL_ENTRY=0x9d +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_ISCONNECTED_ENTRY=0xa9 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_ISEQUAL_ENTRY=0xab +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_ISHIDDEN_ENTRY=0xaa +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_MODIFYPRIORITY_ENTRY=0xa2 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_NEWLC_ENTRY=0x8b +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_NEWL_ENTRY=0x8a +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_PRIORITY_ENTRY=0x98 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_REMOVECONNECTIONMETHOD_ENTRY=0xa1 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_SESSIONCONNECTED_ENTRY=0xac +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_SETHIDDEN_ENTRY=0xa6 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_SETMETADATA_ENTRY=0xa4 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_SETNAME=0xa3 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_SETPROTECTION_ENTRY=0xa5 +[TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_UPDATE_ENTRY=0xa7 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMCONNECTIONMETHODWRAPPER_CCMCONNECTIONMETHODWRAPPER_ENTRY=0x11b +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMCONNECTIONMETHODWRAPPER_CCMCONNECTIONMETHODWRAPPER_EXIT=0x11c +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMDESTINATIONWRAPPER_CCMDESTINATIONWRAPPER_ENTRY=0xb2 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMDESTINATIONWRAPPER_CCMDESTINATIONWRAPPER_EXIT=0xb3 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMCONNECTIONMETHODEXT_OPERATOR_ENTRY=0x1db +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMCONNECTIONMETHODEXT_OPERATOR_EXIT=0x1dc +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMCONNECTIONMETHODEXT_RCMCONNECTIONMETHODEXT_ENTRY=0x1d5 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMCONNECTIONMETHODEXT_RCMCONNECTIONMETHODEXT_EXIT=0x1d6 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMCONNECTIONMETHOD_OPERATOR_ENTRY=0xf3 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMCONNECTIONMETHOD_RCMCONNECTIONMETHOD_ENTRY=0xdd +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMCONNECTIONMETHOD_RCMCONNECTIONMETHOD_EXIT=0xde +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMDESTINATIONEXT_CREATECONNECTIONMETHODL_ENTRY=0x199 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMDESTINATIONEXT_CREATECONNECTIONMETHODL_EXIT=0x19a +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMDESTINATIONEXT_OPERATOR_ENTRY=0x1b5 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMDESTINATIONEXT_OPERATOR_EXIT=0x1b6 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMDESTINATIONEXT_RCMDESTINATIONEXT_ENTRY=0x180 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMDESTINATIONEXT_RCMDESTINATIONEXT_EXIT=0x181 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMDESTINATION_CREATECONNECTIONMETHODL_ENTRY=0x6f +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMDESTINATION_CREATECONNECTIONMETHODL_EXIT=0x70 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMDESTINATION_OPERATOR_ENTRY=0x88 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMDESTINATION_RCMDESTINATION_ENTRY=0x5b +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMDESTINATION_RCMDESTINATION_EXIT=0x5c +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMMANAGERAPI_CONNECT_EXIT=0x32 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMMANAGEREXT_CONNECTIONMETHODL_ENTRY=0x164 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMMANAGEREXT_CONNECTIONMETHODL_EXIT=0x165 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMMANAGEREXT_CREATECONNECTIONMETHODL_ENTRY=0x17a +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMMANAGEREXT_CREATECONNECTIONMETHODL_EXIT=0x17b +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMMANAGEREXT_CREATEDESTINATIONL_ENTRY=0x178 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMMANAGEREXT_CREATEDESTINATIONL_EXIT=0x179 +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMMANAGER_CONNECTIONMETHODL_ENTRY=0x1a +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMMANAGER_CREATECONNECTIONMETHODL_ENTRY=0x2d +[TRACE]TRACE_FLOW[0x7]_DUP1_RCMMANAGER_CREATEDESTINATIONL_ENTRY=0x2c +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMCONNECTIONMETHODEXT_OPERATOR_ENTRY=0x1dd +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMCONNECTIONMETHODEXT_OPERATOR_EXIT=0x1de +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMCONNECTIONMETHODEXT_RCMCONNECTIONMETHODEXT_ENTRY=0x1d7 +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMCONNECTIONMETHODEXT_RCMCONNECTIONMETHODEXT_EXIT=0x1d8 +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMCONNECTIONMETHOD_OPERATOR_ENTRY=0xf4 +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMCONNECTIONMETHOD_RCMCONNECTIONMETHOD_ENTRY=0xef +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMCONNECTIONMETHOD_RCMCONNECTIONMETHOD_EXIT=0xf0 +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMDESTINATIONEXT_OPERATOR_ENTRY=0x1b7 +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMDESTINATIONEXT_OPERATOR_EXIT=0x1b8 +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMDESTINATIONEXT_RCMDESTINATIONEXT_ENTRY=0x1b3 +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMDESTINATIONEXT_RCMDESTINATIONEXT_EXIT=0x1b4 +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMDESTINATION_OPERATOR_ENTRY=0x89 +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMDESTINATION_RCMDESTINATION_ENTRY=0x86 +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMDESTINATION_RCMDESTINATION_EXIT=0x87 +[TRACE]TRACE_FLOW[0x7]_DUP2_RCMMANAGERAPI_CONNECT_EXIT=0x33 +[TRACE]TRACE_FLOW[0x7]_DUP3_RCMMANAGERAPI_CONNECT_EXIT=0x34 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CLOSE_ENTRY=0x131 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CLOSE_EXIT=0x132 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODFROMDESTL_ENTRY=0x129 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODFROMDESTL_EXIT=0x12a +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODFROMDESTWITHIDL_ENTRY=0x12b +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODFROMDESTWITHIDL_EXIT=0x12c +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODL_ENTRY=0x12d +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODL_EXIT=0x12e +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODWITHIDL_ENTRY=0x12f +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODWITHIDL_EXIT=0x130 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDGETCONNMETHODFROMDESTWITHIDL_ENTRY=0x127 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDGETCONNMETHODFROMDESTWITHIDL_EXIT=0x128 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDGETCONNMETHODFROMDESTWITHINDEXL_ENTRY=0x125 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDGETCONNMETHODFROMDESTWITHINDEXL_EXIT=0x126 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDGETCONNMETHODWITHIDL_ENTRY=0x123 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDGETCONNMETHODWITHIDL_EXIT=0x124 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_DELETE_ENTRY=0x13c +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_GETBOOLATTRIBUTE_ENTRY=0x134 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_GETHANDLE_ENTRY=0x121 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_GETINTATTRIBUTE_ENTRY=0x133 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_GETSTRING8ATTRIBUTE_ENTRY=0x136 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_GETSTRINGATTRIBUTE_ENTRY=0x135 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_ISEQUAL_ENTRY=0x13d +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_RCMCONNECTIONMETHODAPI_ENTRY=0x11d +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_RCMCONNECTIONMETHODAPI_EXIT=0x11e +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_SESSIONCONNECTED_ENTRY=0x11f +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_SESSIONCONNECTED_EXIT=0x120 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_SETBOOLATTRIBUTE_ENTRY=0x138 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_SETINTATTRIBUTE_ENTRY=0x137 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_SETSTRING8ATTRIBUTE_ENTRY=0x13a +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_SETSTRINGATTRIBUTE_ENTRY=0x139 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_UPDATE_ENTRY=0x13b +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_CLOSE_ENTRY=0x1bb +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_CLOSE_EXIT=0x1bc +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_CREATECOPYL_ENTRY=0x1bd +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_CREATECOPYL_EXIT=0x1be +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_DELETEL_ENTRY=0x1d1 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_DELETEL_EXIT=0x1d2 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_DESTINATIONL_ENTRY=0x1d3 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_DESTINATIONL_EXIT=0x1d4 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_GETBOOLATTRIBUTEL_ENTRY=0x1c1 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_GETBOOLATTRIBUTEL_EXIT=0x1c2 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_GETINTATTRIBUTEL_ENTRY=0x1bf +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_GETINTATTRIBUTEL_EXIT=0x1c0 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_GETSTRING8ATTRIBUTEL_ENTRY=0x1c5 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_GETSTRING8ATTRIBUTEL_EXIT=0x1c6 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_GETSTRINGATTRIBUTEL_ENTRY=0x1c3 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_GETSTRINGATTRIBUTEL_EXIT=0x1c4 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_OPERATOR_ENTRY=0x1d9 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_OPERATOR_EXIT=0x1da +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_RCMCONNECTIONMETHODEXT_ENTRY=0x1b9 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_RCMCONNECTIONMETHODEXT_EXIT=0x1ba +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_SETBOOLATTRIBUTEL_ENTRY=0x1c9 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_SETBOOLATTRIBUTEL_EXIT=0x1ca +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_SETINTATTRIBUTEL_ENTRY=0x1c7 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_SETINTATTRIBUTEL_EXIT=0x1c8 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_SETSTRING8ATTRIBUTEL_ENTRY=0x1cd +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_SETSTRING8ATTRIBUTEL_EXIT=0x1ce +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_SETSTRINGATTRIBUTEL_ENTRY=0x1cb +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_SETSTRINGATTRIBUTEL_EXIT=0x1cc +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_UPDATEL_ENTRY=0x1cf +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODEXT_UPDATEL_EXIT=0x1d0 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_CLOSE_ENTRY=0xdb +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_CLOSE_EXIT=0xdc +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_CREATECOPYL_ENTRY=0xf5 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_CREATECOPYL_EXIT=0xf6 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_DELETEL_ENTRY=0xed +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_DESTINATIONL_ENTRY=0xee +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_GETBOOLATTRIBUTEL_ENTRY=0xe0 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_GETINTATTRIBUTEL_ENTRY=0xdf +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_GETSTRING8ATTRIBUTEL_ENTRY=0xe2 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_GETSTRINGATTRIBUTEL_ENTRY=0xe1 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_OPERATOR_ENTRY=0xf1 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_OPERATOR_EXIT=0xf2 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_RCMCONNECTIONMETHOD_ENTRY=0xd9 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_RCMCONNECTIONMETHOD_EXIT=0xda +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_SETBOOLATTRIBUTEL_ENTRY=0xe5 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_SETBOOLATTRIBUTEL_EXIT=0xe6 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_SETINTATTRIBUTEL_ENTRY=0xe3 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_SETINTATTRIBUTEL_EXIT=0xe4 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_SETSTRING8ATTRIBUTEL_ENTRY=0xe9 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_SETSTRING8ATTRIBUTEL_EXIT=0xea +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_SETSTRINGATTRIBUTEL_ENTRY=0xe7 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_SETSTRINGATTRIBUTEL_EXIT=0xe8 +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_UPDATEL_ENTRY=0xeb +[TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHOD_UPDATEL_EXIT=0xec +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_ADDCONNECTIONMETHOD_ENTRY=0xcb +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_ADDEMBEDDEDDESTINATION_ENTRY=0xcc +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_CLOSE_ENTRY=0xc2 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_CLOSE_EXIT=0xc3 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_CONNECTANDCREATEDESTWITHNAMEANDIDL_ENTRY=0xbe +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_CONNECTANDCREATEDESTWITHNAMEANDIDL_EXIT=0xbf +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_CONNECTANDCREATEDESTWITHNAMEL_ENTRY=0xbc +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_CONNECTANDCREATEDESTWITHNAMEL_EXIT=0xbd +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_CONNECTANDGETCONNMETHODASEMBEDDEDDESTL_ENTRY=0xc0 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_CONNECTANDGETCONNMETHODASEMBEDDEDDESTL_EXIT=0xc1 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_CONNECTANDGETDESTWITHIDL_ENTRY=0xba +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_CONNECTANDGETDESTWITHIDL_EXIT=0xbb +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_CONNECTIONMETHODCOUNT_ENTRY=0xc4 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_DELETECONNECTIONMETHOD_ENTRY=0xcd +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_DELETE_ENTRY=0xd5 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_GETELEMENTID_ENTRY=0xc8 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_GETHANDLE_ENTRY=0xb8 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_GETID_ENTRY=0xc7 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_GETMETADATA_ENTRY=0xc9 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_GETNAME_ENTRY=0xc6 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_GETPROTECTIONLEVEL_ENTRY=0xca +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_ISCONNECTED_ENTRY=0xd6 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_ISEQUAL_ENTRY=0xd8 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_ISHIDDEN_ENTRY=0xd7 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_MODIFYPRIORITY_ENTRY=0xcf +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_PRIORITY_ENTRY=0xc5 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_RCMDESTINATIONAPI_ENTRY=0xb4 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_RCMDESTINATIONAPI_EXIT=0xb5 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_REMOVECONNECTIONMETHOD_ENTRY=0xce +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_SESSIONCONNECTED_ENTRY=0xb6 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_SESSIONCONNECTED_EXIT=0xb7 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_SETHIDDEN_ENTRY=0xd3 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_SETMETADATA_ENTRY=0xd1 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_SETNAME_ENTRY=0xd0 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_SETPROTECTION_ENTRY=0xd2 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_UPDATE_ENTRY=0xd4 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_ADDCONNECTIONMETHODL_ENTRY=0x19b +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_ADDCONNECTIONMETHODL_EXIT=0x19c +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_ADDEMBEDDEDDESTINATIONL_ENTRY=0x19d +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_ADDEMBEDDEDDESTINATIONL_EXIT=0x19e +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_CLOSE_ENTRY=0x17c +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_CLOSE_EXIT=0x17d +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_CONNECTIONMETHODBYIDL_ENTRY=0x188 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_CONNECTIONMETHODBYIDL_EXIT=0x189 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_CONNECTIONMETHODCOUNT_ENTRY=0x184 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_CONNECTIONMETHODCOUNT_EXIT=0x185 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_CONNECTIONMETHODL_ENTRY=0x186 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_CONNECTIONMETHODL_EXIT=0x187 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_CREATECONNECTIONMETHODL_ENTRY=0x197 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_CREATECONNECTIONMETHODL_EXIT=0x198 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_DELETECONNECTIONMETHODL_ENTRY=0x19f +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_DELETECONNECTIONMETHODL_EXIT=0x1a0 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_DELETELD_ENTRY=0x1af +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_DELETELD_EXIT=0x1b0 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_ELEMENTID_ENTRY=0x190 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_ELEMENTID_EXIT=0x191 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_ID_ENTRY=0x18e +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_ID_EXIT=0x18f +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_ISCONNECTEDL_ENTRY=0x1b1 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_ISCONNECTEDL_EXIT=0x1b2 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_ISHIDDEN_ENTRY=0x195 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_ISHIDDEN_EXIT=0x196 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_METADATAL_ENTRY=0x192 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_METADATAL_EXIT=0x193 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_MODIFYPRIORITYL_ENTRY=0x1a3 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_MODIFYPRIORITYL_EXIT=0x1a4 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_NAMELC_ENTRY=0x18c +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_NAMELC_EXIT=0x18d +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_OPERATOR_ENTRY=0x182 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_OPERATOR_EXIT=0x183 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_PRIORITYL_ENTRY=0x18a +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_PRIORITYL_EXIT=0x18b +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_PROTECTIONLEVEL_ENTRY=0x194 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_RCMDESTINATIONEXT_ENTRY=0x17e +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_RCMDESTINATIONEXT_EXIT=0x17f +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_REMOVECONNECTIONMETHODL_ENTRY=0x1a1 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_REMOVECONNECTIONMETHODL_EXIT=0x1a2 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_SETHIDDENL_ENTRY=0x1ab +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_SETHIDDENL_EXIT=0x1ac +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_SETMETADATAL_ENTRY=0x1a7 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_SETMETADATAL_EXIT=0x1a8 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_SETNAMEL_ENTRY=0x1a5 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_SETNAMEL_EXIT=0x1a6 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_SETPROTECTIONL_ENTRY=0x1a9 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_SETPROTECTIONL_EXIT=0x1aa +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_UPDATEL_ENTRY=0x1ad +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONEXT_UPDATEL_EXIT=0x1ae +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_ADDCONNECTIONMETHODL_ENTRY=0x71 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_ADDEMBEDDEDDESTINATIONL_ENTRY=0x72 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_CLOSE_ENTRY=0x57 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_CLOSE_EXIT=0x58 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_CONNECTIONMETHODBYIDL_ENTRY=0x62 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_CONNECTIONMETHODBYIDL_EXIT=0x63 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_CONNECTIONMETHODCOUNT_ENTRY=0x5f +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_CONNECTIONMETHODL_ENTRY=0x60 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_CONNECTIONMETHODL_EXIT=0x61 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_CREATECONNECTIONMETHODL_ENTRY=0x6d +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_CREATECONNECTIONMETHODL_EXIT=0x6e +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_DELETECONNECTIONMETHODL_ENTRY=0x73 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_DELETECONNECTIONMETHODL_EXIT=0x74 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_DELETELD_ENTRY=0x83 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_DELETELD_EXIT=0x84 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_ELEMENTID_ENTRY=0x68 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_ID_ENTRY=0x67 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_ISCONNECTEDL_ENTRY=0x85 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_ISHIDDEN_ENTRY=0x6c +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_METADATAL_ENTRY=0x69 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_METADATAL_EXIT=0x6a +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_MODIFYPRIORITYL_ENTRY=0x77 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_MODIFYPRIORITYL_EXIT=0x78 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_NAMELC_ENTRY=0x66 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_OPERATOR_ENTRY=0x5d +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_OPERATOR_EXIT=0x5e +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_PRIORITYL_ENTRY=0x64 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_PRIORITYL_EXIT=0x65 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_PROTECTIONLEVEL_ENTRY=0x6b +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_RCMDESTINATION_ENTRY=0x59 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_RCMDESTINATION_EXIT=0x5a +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_REMOVECONNECTIONMETHODL_ENTRY=0x75 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_REMOVECONNECTIONMETHODL_EXIT=0x76 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_SETHIDDENL_ENTRY=0x7f +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_SETHIDDENL_EXIT=0x80 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_SETMETADATAL_ENTRY=0x7b +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_SETMETADATAL_EXIT=0x7c +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_SETNAMEL_ENTRY=0x79 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_SETNAMEL_EXIT=0x7a +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_SETPROTECTIONL_ENTRY=0x7d +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_SETPROTECTIONL_EXIT=0x7e +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_UPDATEL_ENTRY=0x81 +[TRACE]TRACE_FLOW[0x7]_RCMDESTINATION_UPDATEL_EXIT=0x82 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_CLOSE_ENTRY=0x35 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_CLOSE_EXIT=0x36 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_CONNECT_ENTRY=0x30 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_CONNECT_EXIT=0x31 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_COPYCONNECTIONMETHOD_ENTRY=0x53 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_CREATETABLES_ENTRY=0x3d +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETALLDESTINATIONSL_ENTRY=0x48 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETALLDESTINATIONSL_EXIT=0x49 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETBEARERINFOBOOL_ENTRY=0x3f +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETBEARERINFOINT_ENTRY=0x3e +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETBEARERINFOSTRING8_ENTRY=0x41 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETBEARERINFOSTRING_ENTRY=0x40 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETBEARERPRIORITYARRAYL_ENTRY=0x4a +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETBEARERPRIORITYARRAYL_EXIT=0x4b +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETCONNECTIONMETHODINFOBOOL_ENTRY=0x43 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETCONNECTIONMETHODINFOINT_ENTRY=0x42 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETCONNECTIONMETHODINFOSTRING8_ENTRY=0x45 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETCONNECTIONMETHODINFOSTRING_ENTRY=0x44 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETCONNMETHODSL_ENTRY=0x46 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETCONNMETHODSL_EXIT=0x47 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETEASYWLANID_ENTRY=0x50 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETSUPPORTEDBEARERSL_ENTRY=0x4e +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_GETSUPPORTEDBEARERSL_EXIT=0x4f +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_MOVECONNECTIONMETHOD_ENTRY=0x54 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_RCMMANAGERAPI_ENTRY=0x2e +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_RCMMANAGERAPI_EXIT=0x2f +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_READDEFAULTCONNECTION_ENTRY=0x51 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_REMOVEALLREFERENCES_ENTRY=0x56 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_REMOVECONNECTIONMETHOD_ENTRY=0x55 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_REMOVECONNMETHODPOINTER_ENTRY=0x3b +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_REMOVECONNMETHODPOINTER_EXIT=0x3c +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_REMOVEDESTINATIONPOINTER_ENTRY=0x38 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_REMOVEDESTINATIONPOINTER_EXIT=0x39 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_SETBEARERPRIORITYARRAYL_ENTRY=0x4c +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_SETBEARERPRIORITYARRAYL_EXIT=0x4d +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_STORECONNMETHODPOINTER_ENTRY=0x3a +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_STOREDESTINATIONPOINTER_ENTRY=0x37 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGERAPI_WRITEDEFAULTCONNECTION_ENTRY=0x52 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_ALLDESTINATIONSL_ENTRY=0x168 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_ALLDESTINATIONSL_EXIT=0x169 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_BEARERPRIORITYARRAYL_ENTRY=0x16a +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_BEARERPRIORITYARRAYL_EXIT=0x16b +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_CLEANUPGLOBALPRIORITYARRAY_ENTRY=0x16e +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_CLEANUPGLOBALPRIORITYARRAY_EXIT=0x16f +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_CLOSE_ENTRY=0x13e +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_CLOSE_EXIT=0x13f +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_CONNECTIONMETHODL_ENTRY=0x162 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_CONNECTIONMETHODL_EXIT=0x163 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_COPYCONNECTIONMETHODL_ENTRY=0x15a +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_COPYCONNECTIONMETHODL_EXIT=0x15b +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_CREATECONNECTIONMETHODL_ENTRY=0x158 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_CREATECONNECTIONMETHODL_EXIT=0x159 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_CREATEDESTINATIONL_ENTRY=0x156 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_CREATEDESTINATIONL_EXIT=0x157 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_CREATETABLESANDOPENL_ENTRY=0x142 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_CREATETABLESANDOPENL_EXIT=0x143 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_DESTINATIONL_ENTRY=0x166 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_DESTINATIONL_EXIT=0x167 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_EASYWLANIDL_ENTRY=0x172 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_EASYWLANIDL_EXIT=0x173 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETBEARERINFOBOOLL_ENTRY=0x148 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETBEARERINFOBOOLL_EXIT=0x149 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETBEARERINFOINTL_ENTRY=0x146 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETBEARERINFOINTL_EXIT=0x147 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETBEARERINFOSTRING8L_ENTRY=0x14c +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETBEARERINFOSTRING8L_EXIT=0x14d +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETBEARERINFOSTRINGL_ENTRY=0x14a +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETBEARERINFOSTRINGL_EXIT=0x14b +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETCONNECTIONMETHODINFOBOOLL_ENTRY=0x150 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETCONNECTIONMETHODINFOBOOLL_EXIT=0x151 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETCONNECTIONMETHODINFOINTL_ENTRY=0x14e +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETCONNECTIONMETHODINFOINTL_EXIT=0x14f +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETCONNECTIONMETHODINFOSTRING8L_ENTRY=0x154 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETCONNECTIONMETHODINFOSTRING8L_EXIT=0x155 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETCONNECTIONMETHODINFOSTRINGL_ENTRY=0x152 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_GETCONNECTIONMETHODINFOSTRINGL_EXIT=0x153 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_MOVECONNECTIONMETHODL_ENTRY=0x15c +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_MOVECONNECTIONMETHODL_EXIT=0x15d +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_OPENLC_ENTRY=0x144 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_OPENLC_EXIT=0x145 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_OPENL_ENTRY=0x140 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_OPENL_EXIT=0x141 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_READDEFCONNL_ENTRY=0x174 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_READDEFCONNL_EXIT=0x175 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_REMOVEALLREFERENCESL_ENTRY=0x160 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_REMOVEALLREFERENCESL_EXIT=0x161 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_REMOVECONNECTIONMETHODL_ENTRY=0x15e +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_REMOVECONNECTIONMETHODL_EXIT=0x15f +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_SUPPORTEDBEARERSL_ENTRY=0x170 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_SUPPORTEDBEARERSL_EXIT=0x171 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_UPDATEBEARERPRIORITYARRAYL_ENTRY=0x16c +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_UPDATEBEARERPRIORITYARRAYL_EXIT=0x16d +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_WRITEDEFCONNL_ENTRY=0x176 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGEREXT_WRITEDEFCONNL_EXIT=0x177 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_ALLDESTINATIONSL_ENTRY=0x1c +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_ALLDESTINATIONSL_EXIT=0x1d +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_BEARERPRIORITYARRAYL_ENTRY=0x1f +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_BEARERPRIORITYARRAYL_EXIT=0x20 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_CLEANUPGLOBALPRIORITYARRAY_ENTRY=0x23 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_CLEANUPGLOBALPRIORITYARRAY_EXIT=0x24 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_CLOSE_ENTRY=0x5 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_CLOSE_EXIT=0x6 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_CONNECTIONMETHODL_ENTRY=0x9 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_CONNECTIONMETHODL_EXIT=0x1b +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_COPYCONNECTIONMETHODL_ENTRY=0x14 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_CREATECONNECTIONMETHODL_ENTRY=0x13 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_CREATEDESTINATIONL_ENTRY=0x12 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_CREATETABLESANDOPENL_ENTRY=0x7 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_CREATETABLESANDOPENL_EXIT=0x8 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_DESTINATIONL_ENTRY=0x1e +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_EASYWLANIDL_ENTRY=0x27 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_GETBEARERINFOBOOLL_ENTRY=0xb +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_GETBEARERINFOINTL_ENTRY=0xa +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_GETBEARERINFOSTRING8L_ENTRY=0xd +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_GETBEARERINFOSTRINGL_ENTRY=0xc +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_GETCONNECTIONMETHODINFOBOOLL_ENTRY=0xf +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_GETCONNECTIONMETHODINFOINTL_ENTRY=0xe +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_GETCONNECTIONMETHODINFOSTRING8L_ENTRY=0x11 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_GETCONNECTIONMETHODINFOSTRINGL_ENTRY=0x10 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_MOVECONNECTIONMETHODL_ENTRY=0x15 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_OPENLC_ENTRY=0x3 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_OPENLC_EXIT=0x4 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_OPENL_ENTRY=0x1 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_OPENL_EXIT=0x2 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_READDEFCONNL_ENTRY=0x28 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_READDEFCONNL_EXIT=0x29 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_REMOVEALLREFERENCESL_ENTRY=0x18 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_REMOVEALLREFERENCESL_EXIT=0x19 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_REMOVECONNECTIONMETHODL_ENTRY=0x16 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_REMOVECONNECTIONMETHODL_EXIT=0x17 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_SUPPORTEDBEARERSL_ENTRY=0x25 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_SUPPORTEDBEARERSL_EXIT=0x26 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_UPDATEBEARERPRIORITYARRAYL_ENTRY=0x21 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_UPDATEBEARERPRIORITYARRAYL_EXIT=0x22 +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_WRITEDEFCONNL_ENTRY=0x2a +[TRACE]TRACE_FLOW[0x7]_RCMMANAGER_WRITEDEFCONNL_EXIT=0x2b +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODWRAPPER_CREATECONNMETHODCOPY_ENTRY=0xfb +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_ADDEMBEDDEDDESTINATION_ENTRY=0x9f +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONWRAPPER_CREATEDESTCOPY_ENTRY=0x8e +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_RCMCONNECTIONMETHODAPI_CONNECTANDCREATECONNMETHODCOPY_ENTRY=0x122 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_RCMDESTINATIONAPI_CONNECTANDCREATEDESTCOPY_ENTRY=0xb9 diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmcommon/inc/cmmclistatic.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmcommon/inc/cmmclistatic.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Launches the Connection Method Manager Server. +* +*/ + + +#ifndef CMMCLISTATIC_H +#define CMMCLISTATIC_H + +#include + +const TUint KCmmDefaultMinHeapSize = 0x1000; // 4K +const TUint KCmmDefaultMaxHeapSize = 0x10000; // 64K + +const TInt KCmmDefaultMessageSlots = 2; + +_LIT( KCmManagerStartupMutex, "CmManagerStartupMutex" ); + + +/** + * Class to handle CmManager server startup. + */ +class TCmManagerLauncher + { +public: + static TInt LaunchServer( + const TDesC& aServerName, + const TDesC& aServerFileName, + const TUid& aServerUid3, + const TUint aWinsMinHeapSize = KCmmDefaultMinHeapSize, + const TUint aWinsMaxHeapSize = KCmmDefaultMaxHeapSize, + const TUint aWinsStackSize = KDefaultStackSize ); + +private: + static TBool ServerStartupLock( RMutex& mutex, TInt& err ); + static void ServerStartupUnlock( RMutex& mutex ); + }; + +#endif // CMMCLISTATIC_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmcommon/inc/cmmserverdefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmcommon/inc/cmmserverdefs.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,296 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Common definitions and enumerations for connection method manager server +* (internal use). +* +*/ + + +#ifndef CMMSERVERDEFS_H +#define CMMSERVERDEFS_H + +#include + +static const TUid KCmmUid3 = { 0x20016A7A }; + +/** + * CmManager server name. + */ +_LIT( KCmmServer, "!CmmServer" ); + +/** + * CmManager server filename. + */ +_LIT( KCmmServerFile, "cmmserver" ); + +const TInt KCmmServerStackSize = 0x5000; //TODO, check if really used (in common code). +const TInt KCmmServerInitHeapSize = 0x1000; //TODO, check if really used (in common code). +const TInt KCmmServerMaxHeapSize = 0x1000000; //TODO, check if really used (in common code). + +const TInt KBitsInOneByte = 8; +const TInt KBitsInTwoBytes = 16; +const TInt KBitsInThreeBytes = 24; + +/** + * The server version. A version must be specified when creating a session with + * the server. + */ +const TUint KCmmServerMajorVersionNumber = 0; //TODO, check if really used (in common code). +const TUint KCmmServerMinorVersionNumber = 1; //TODO, check if really used (in common code). +const TUint KCmmServerBuildVersionNumber = 1; //TODO, check if really used (in common code). + +/** + * Amount of time in microseconds that the server will wait before shutting + * down, after last client has gone. + */ +#if defined(__WINSCW__) +const TUint KCmmShutdownDelay = 5000000; // 5 seconds, for testing purposes. +#else +const TUint KCmmShutdownDelay = 70000000; // 70 seconds. +#endif + +const TUint32 KCmDefaultDestinationAPTagId = 0x1000; +const TUint32 KCmMaxDestinationAPTagId = 0x1100; + +const TUint32 KCmmConnMethodIdIntervalMin = 0; +const TUint32 KCmmConnMethodIdIntervalMax = 0x0100; + +const TUint32 KCmmDestIdIntervalLegacyMin = 0; +const TUint32 KCmmDestIdIntervalLegacyMax = 0x0100; + +const TUint32 KCmmDestIdIntervalMin = 0x1000; +const TUint32 KCmmDestIdIntervalMax = 0x1100; + +const TInt KCmmStringLengthMax = 1024; //TODO, need to find out correct value here + +const TUint32 KTemporaryIdCounterStart = 32768; + +const TUint32 KDestProtectionLevelMask = 0xF0000000; +const TInt KBitsToShiftDestProtectionLevel = 28; + + +// Buffer size for initial connection method query +const TInt KCmmConnMethodAmountNormal = 64; //TODO, Check value +// Maximum theoretical amount of connection methods +const TInt KCmmConnMethodAmountMax = 256; + +// Buffer size for initial destination query +const TInt KCmmDestAmountNormal = 32; +// Maximum theoretical amount of connection methods +const TInt KCmmDestAmountMax = 256; + +// Buffer size for supported bearers query +const TInt KCmmBearerAmountNormal = 10; + +// Buffer size for bearer priority array query, first attempt +const TInt KCmmDefaultBearerPriorityArraySize = 256; + +// iPriority: 2 16-bit values, +// iUIPriority: 2 16-bit values, +// iServiceType length: 1 16-bit value. +const TInt KCmmBearerPriorityHeaderLength = 5; + + +// Opcodes used in message passing between client and server +enum TCmmRequests + { + ECmmGetBearerInfoInt = 0, + ECmmGetBearerInfoBool = 1, + ECmmGetBearerInfoString = 2, + ECmmGetBearerInfoString8 = 3, + ECmmGetConnMethodArray = 4, + ECmmGetAllDestinations = 5, + ECmmGetBearerPriorityArray = 6, + ECmmGetEasyWlanId = 7, + ECmmReadDefaultConnection = 8, + ECmmReadGeneralConnectionSettings = 9, + ECmmGetSupportedBearers = 10, + + ECmmGetConnMethodInfoInt = 11, + ECmmGetConnMethodInfoBool = 12, + ECmmGetConnMethodInfoString = 13, + ECmmGetConnMethodInfoString8 = 14, + + ECmmUpdateBearerPriorityArray = 15, + ECmmWriteDefaultConnection = 16, + ECmmWriteGeneralConnectionSettings = 17, + ECmmCopyConnMethod = 18, + ECmmMoveConnMethod = 19, + ECmmRemoveConnMethod = 20, + ECmmRemoveAllReferences = 21, // Connection method becomes uncategorized. + + // RCmDestination starts from 100 + EDestGetDestination = 100, + EDestRefresh = 101, + EDestCloseDestination = 102, + EDestGetConnMethodCount = 103, + EDestGetConnMethodPriority = 104, + EDestGetName = 105, + EDestGetId = 106, + EDestGetElementId = 107, + EDestMetadata = 108, + EDestGetProtectionLevel = 109, + EDestIsHidden = 110, + EDestIsEqual = 111, + EDestGetEmbeddedDestination = 112, + + EDestCreateDestinationWithName = 113, + EDestCreateDestinationWithNameAndId = 114, + EDestIsConnected = 115, + EDestAddConnMethod = 116, + EDestAddEmbeddedDestination = 117, + EDestDeleteConnMethod = 118, + EDestRemoveConnMethod = 119, + EDestModifyPriority = 120, + EDestSetName = 121, + EDestSetMetadata = 122, + EDestSetProtection = 123, + EDestSetHidden = 124, + EDestUpdate = 125, + EDestDelete = 126, + + //RCmConnectionMethod starts from 200 + ECMGetConnMethodWithId = 200, + ECMRefresh = 201, + ECMGetConnMethodFromDestWithIndex = 202, + ECMGetConnMethodFromDestWithId = 203, + ECMCloseConnMethod = 204, + ECMIsEqual = 205, + + ECMCreateConnMethod = 206, + ECMCreateConnMethodWithId = 207, + ECMCreateConnMethodToDest = 208, + ECMCreateConnMethodToDestWithId = 209, + ECMCreateCopyOfExisting = 210, + + ECMGetIntAttribute = 211, + ECMGetBoolAttribute = 212, + ECMGetStringAttribute = 213, + ECMGetString8Attribute = 214, + + ECMSetIntAttribute = 215, + ECMSetBoolAttribute = 216, + ECMSetStringAttribute = 217, + ECMSetString8Attribute = 218, + ECMDelete = 219, + ECMUpdate = 220 + }; + +// Panic categories +_LIT( KCmmPanicCategoryApi, "CmManager API" ); + +// Panic codes +enum TCmmServerPanic + { + ECreateTrapCleanup = 1, + ECreateServer, + EBadDescriptor, + EBadRequest, + EInvalidImportState, + EDestNotConnectedToServer = 201 + }; + +// Status flag values for database records. +enum TCmmRecordStatus + { + ECmmRecordStatusBlank = 0x0001, + ECmmRecordStatusLoaded = 0x0002, // Loaded and up-to-date. + ECmmRecordStatusExpired = 0x0004, // Loaded but out-of-date. //TODO, should this be cache side only? + ECmmRecordStatusModified = 0x0008, // Loaded and modified (Session side only). + ECmmRecordStatusUnsaved = 0x0010 // Doesn't yet exist in database (Cache side only). + }; + +// Status flag values for connection method instances. +enum TCmmConnMethodStatus + { + ECmmConnMethodStatusNotSaved = 1, // Connection method doesn't yet exist in database (cache side only). + ECmmConnMethodStatusValid = 2, // Connection method exists in database and sessions can open handles to it. + ECmmConnMethodStatusChanged = 3, // Contents modified, but not saved (session side only). + ECmmConnMethodStatusToBeDeleted = 4 // Connection method will be deleted when reference count goes to 0 (cache side only). + }; + +// Status flag values for destination instances. +enum TCmmDestinationStatus + { + ECmmDestinationStatusNotSaved = 1, // Destination doesn't yet exist in database (Cache side only). + ECmmDestinationStatusValid = 2, // Destination exists in database and sessions can open handles to it. + ECmmDestinationStatusChanged = 3, // Contents modified, but not saved (Session side only). + ECmmDestinationStatusToBeDeleted = 4 // Destination will be deleted when reference count goes to 0 (cache side only). + }; + +// Identifiers for different destination related database records for internal use. +enum TCmmDbRecords + { + ECmmDestNetworkRecord = 1, // + ECmmDestApRecord, // + ECmmDestMetadataRecord, // CCDSNAPMetadataRecord + ECmmDbSnapRecord, // CCDDataMobilitySelectionPolicyRecord + ECmmDbBearerPriorityRecord, // + ECmmDbDefConnRecord // + }; + +NONSHARABLE_CLASS( TCmmIpcStructGetConnMethods ) + { +public: + TBool iCheckBearerType; + TBool iLegacyOnly; + TBool iEasyWlan; + }; + +NONSHARABLE_CLASS( TCmmIpcStructMoveConnMethod ) + { +public: + TInt iSourceDestHandle; + TInt iTargetDestHandle; + TInt iConnMethodHandle; + TInt iIndex; + }; + +// Prefix 'Cmm' used to avoid any future problems or name overlapping with +// other similar implementations. +template +class CmmCleanupResetAndDestroy + { +public: + inline static void PushL( T& aRef ); + +private: + static void ResetAndDestroy( TAny *aPtr ); + }; + +template +inline void CmmCleanupResetAndDestroyPushL( T& aRef ); + +template +inline void CmmCleanupResetAndDestroy::PushL( T& aRef ) + { + CleanupStack::PushL( TCleanupItem( &ResetAndDestroy, &aRef ) ); + } + +template +void CmmCleanupResetAndDestroy::ResetAndDestroy( TAny *aPtr ) + { + (STATIC_CAST(T*,aPtr))->ResetAndDestroy(); + } + +template +inline void CmmCleanupResetAndDestroyPushL( T& aRef ) + { + CmmCleanupResetAndDestroy::PushL( aRef ); + } + +#endif // CMMSERVERDEFS_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmcommon/src/cmmclistatic.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmcommon/src/cmmclistatic.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Launches the Connection Method Manager Server. +* +*/ + + +#include "cmmclistatic.h" + +/** + * LaunchServer + * + * Launches the CmManager server. + * + * Return KErrNone if CmManager server is launched successfully, + * otherwise one of the system wide error codes. + */ +TInt TCmManagerLauncher::LaunchServer( + const TDesC& aServerName, + const TDesC& aServerFileName, + const TUid& aServerUid3, + const TUint aWinsMinHeapSize, + const TUint aWinsMaxHeapSize, + const TUint aWinsStackSize ) + { + RMutex mutex; + TInt err( KErrNone ); + const TUidType serverUid( KNullUid, KNullUid, aServerUid3 ); + + // + // EPOC and EKA2 is easy, we just create a new server process. Simultaneous + // launching of two such processes should be detected when the second one + // attempts to create the server object, failing with KErrAlreadyExists. + // + + // Try obtaining a lock. If that fails, server has already been started. + // If something fails with obtaining the lock, propagate the error to user. + if ( !ServerStartupLock( mutex, err ) ) + { + ServerStartupUnlock( mutex ); + return err; + } + + RProcess server; + err = server.Create( aServerFileName, KNullDesC, serverUid ); + (void)aServerName; + (void)aWinsMinHeapSize; + (void)aWinsMaxHeapSize; + (void)aWinsStackSize; + + if ( err != KErrNone ) + { + ServerStartupUnlock( mutex ); + return err; + } + + TRequestStatus stat; + server.Rendezvous( stat ); + if ( stat != KRequestPending ) + { + server.Kill( 0 ); // Abort startup. + } + else + { + server.Resume(); // Logon OK - start the server. + } + User::WaitForRequest( stat ); // Wait for start or death. + // We can't use the 'exit reason' if the server panicked as this + // is the panic 'reason' and may be '0' which cannot be distinguished + // from KErrNone. + err = ( server.ExitType() == EExitPanic ) ? KErrGeneral : stat.Int(); + server.Close(); + + ServerStartupUnlock( mutex ); + return err; + } + +/** + * ServerStartupLock + * + * Returns true if obtains the lock without waiting. That is, the + * mutex is not created before this call. + * + * Return false if mutex is created. + */ +TBool TCmManagerLauncher::ServerStartupLock( RMutex& mutex, TInt& err ) + { + TInt retval( ETrue ); + + // Create handle to mutex. + err = mutex.CreateGlobal( KCmManagerStartupMutex ); + if ( err != KErrNone ) + { + // Mutex already created, wait until done. + retval = EFalse; + err = mutex.OpenGlobal( KCmManagerStartupMutex ); + if ( err == KErrNone ) + { + // Wait for completion + mutex.Wait(); + // Server already running, return. + return EFalse; + } + // Else opening failed, err will be propagated to user. + } + // Else Obtained lock without waiting (retval is ETrue). + // The next call completes instantly. + mutex.Wait(); + return retval; + } + +/** + * ServerStartupUnlock + * + * Frees and closes the mutex. + */ +void TCmManagerLauncher::ServerStartupUnlock( RMutex& mutex ) + { + // Let others run + mutex.Signal(); + // Destroy handle + mutex.Close(); + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmpluginbase/BWinsCw/cmmpluginbaseu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmpluginbase/BWinsCw/cmmpluginbaseu.def Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,27 @@ +EXPORTS + ?GetBoolAttributeL@CCmPluginBaseEng@@QAEHKPAVCCmClientPluginInstance@@@Z @ 1 NONAME ; int CCmPluginBaseEng::GetBoolAttributeL(unsigned long, class CCmClientPluginInstance *) + ?CreateNewL@CCmPluginBaseEng@@QAEXK@Z @ 2 NONAME ; void CCmPluginBaseEng::CreateNewL(unsigned long) + ?SetStringAttributeL@CCmPluginBaseEng@@QAEXKABVTDesC16@@PAVCCmClientPluginInstance@@@Z @ 3 NONAME ; void CCmPluginBaseEng::SetStringAttributeL(unsigned long, class TDesC16 const &, class CCmClientPluginInstance *) + ?GetGenericTableIdsToBeObserved@CCmPluginBaseEng@@QBEXAAV?$RArray@K@@@Z @ 4 NONAME ; void CCmPluginBaseEng::GetGenericTableIdsToBeObserved(class RArray &) const + ?GetPluginDataL@CCmPluginBaseEng@@QAEXPAVCCmClientPluginInstance@@@Z @ 5 NONAME ; void CCmPluginBaseEng::GetPluginDataL(class CCmClientPluginInstance *) + ?SetString8AttributeL@CCmPluginBaseEng@@QAEXKABVTDesC8@@PAVCCmClientPluginInstance@@@Z @ 6 NONAME ; void CCmPluginBaseEng::SetString8AttributeL(unsigned long, class TDesC8 const &, class CCmClientPluginInstance *) + ?GetIntAttributeL@CCmPluginBaseEng@@QAEKKPAVCCmClientPluginInstance@@@Z @ 7 NONAME ; unsigned long CCmPluginBaseEng::GetIntAttributeL(unsigned long, class CCmClientPluginInstance *) + ?CheckIfNameModifiedL@CCmPluginBaseEng@@IBEXPAVCCDRecordBase@CommsDat@@0@Z @ 8 NONAME ; void CCmPluginBaseEng::CheckIfNameModifiedL(class CommsDat::CCDRecordBase *, class CommsDat::CCDRecordBase *) const + ??1CCmPluginBaseEng@@UAE@XZ @ 9 NONAME ; CCmPluginBaseEng::~CCmPluginBaseEng(void) + ?CreateCopyL@CCmPluginBaseEng@@QAEPAV1@PAVCCmClientPluginInstance@@@Z @ 10 NONAME ; class CCmPluginBaseEng * CCmPluginBaseEng::CreateCopyL(class CCmClientPluginInstance *) + ?SetIntAttributeL@CCmPluginBaseEng@@QAEXKKPAVCCmClientPluginInstance@@@Z @ 11 NONAME ; void CCmPluginBaseEng::SetIntAttributeL(unsigned long, unsigned long, class CCmClientPluginInstance *) + ?ReLoadL@CCmPluginBaseEng@@QAEXXZ @ 12 NONAME ; void CCmPluginBaseEng::ReLoadL(void) + ?NewL@CCmClientPluginInstance@@SAPAV1@XZ @ 13 NONAME ; class CCmClientPluginInstance * CCmClientPluginInstance::NewL(void) + ?ConstructL@CCmPluginBaseEng@@MAEXXZ @ 14 NONAME ; void CCmPluginBaseEng::ConstructL(void) + ??0CCmPluginBaseEng@@IAE@PAVTCmPluginInitParam@@@Z @ 15 NONAME ; CCmPluginBaseEng::CCmPluginBaseEng(class TCmPluginInitParam *) + ?NewLC@CCmClientPluginInstance@@SAPAV1@XZ @ 16 NONAME ; class CCmClientPluginInstance * CCmClientPluginInstance::NewLC(void) + ?SetBoolAttributeL@CCmPluginBaseEng@@QAEXKHPAVCCmClientPluginInstance@@@Z @ 17 NONAME ; void CCmPluginBaseEng::SetBoolAttributeL(unsigned long, int, class CCmClientPluginInstance *) + ?LoadL@CCmPluginBaseEng@@QAEXK@Z @ 18 NONAME ; void CCmPluginBaseEng::LoadL(unsigned long) + ?DeleteL@CCmPluginBaseEng@@UAEXXZ @ 19 NONAME ; void CCmPluginBaseEng::DeleteL(void) + ?CheckDNSServerAddressL@CCmPluginBaseEng@@IAEXHAAV?$CMDBField@VTDesC16@@@CommsDat@@0AAV?$CMDBField@H@3@@Z @ 20 NONAME ; void CCmPluginBaseEng::CheckDNSServerAddressL(int, class CommsDat::CMDBField &, class CommsDat::CMDBField &, class CommsDat::CMDBField &) + ??0TCmPluginInitParam@@QAE@AAVCMDBSession@CommsDat@@@Z @ 21 NONAME ; TCmPluginInitParam::TCmPluginInitParam(class CommsDat::CMDBSession &) + ?GetString8AttributeL@CCmPluginBaseEng@@QAEPAVHBufC8@@KPAVCCmClientPluginInstance@@@Z @ 22 NONAME ; class HBufC8 * CCmPluginBaseEng::GetString8AttributeL(unsigned long, class CCmClientPluginInstance *) + ?UpdateL@CCmPluginBaseEng@@UAEXPAVCCmClientPluginInstance@@@Z @ 23 NONAME ; void CCmPluginBaseEng::UpdateL(class CCmClientPluginInstance *) + ?GetStringAttributeL@CCmPluginBaseEng@@QAEPAVHBufC16@@KPAVCCmClientPluginInstance@@@Z @ 24 NONAME ; class HBufC16 * CCmPluginBaseEng::GetStringAttributeL(unsigned long, class CCmClientPluginInstance *) + ??1CCmClientPluginInstance@@UAE@XZ @ 25 NONAME ; CCmClientPluginInstance::~CCmClientPluginInstance(void) + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmpluginbase/EABI/cmmpluginbaseu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmpluginbase/EABI/cmmpluginbaseu.def Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,34 @@ +EXPORTS + _ZN16CCmPluginBaseEng10ConstructLEv @ 1 NONAME + _ZN16CCmPluginBaseEng10CreateNewLEm @ 2 NONAME + _ZN16CCmPluginBaseEng11CreateCopyLEP23CCmClientPluginInstance @ 3 NONAME + _ZN16CCmPluginBaseEng14GetPluginDataLEP23CCmClientPluginInstance @ 4 NONAME + _ZN16CCmPluginBaseEng16GetIntAttributeLEmP23CCmClientPluginInstance @ 5 NONAME + _ZN16CCmPluginBaseEng16SetIntAttributeLEmmP23CCmClientPluginInstance @ 6 NONAME + _ZN16CCmPluginBaseEng17GetBoolAttributeLEmP23CCmClientPluginInstance @ 7 NONAME + _ZN16CCmPluginBaseEng17SetBoolAttributeLEmiP23CCmClientPluginInstance @ 8 NONAME + _ZN16CCmPluginBaseEng19GetStringAttributeLEmP23CCmClientPluginInstance @ 9 NONAME + _ZN16CCmPluginBaseEng19SetStringAttributeLEmRK7TDesC16P23CCmClientPluginInstance @ 10 NONAME + _ZN16CCmPluginBaseEng20GetString8AttributeLEmP23CCmClientPluginInstance @ 11 NONAME + _ZN16CCmPluginBaseEng20SetString8AttributeLEmRK6TDesC8P23CCmClientPluginInstance @ 12 NONAME + _ZN16CCmPluginBaseEng22CheckDNSServerAddressLEiRN8CommsDat9CMDBFieldI7TDesC16EES4_RNS1_IiEE @ 13 NONAME + _ZN16CCmPluginBaseEng5LoadLEm @ 14 NONAME + _ZN16CCmPluginBaseEng7DeleteLEv @ 15 NONAME + _ZN16CCmPluginBaseEng7ReLoadLEv @ 16 NONAME + _ZN16CCmPluginBaseEng7UpdateLEP23CCmClientPluginInstance @ 17 NONAME + _ZN16CCmPluginBaseEngC2EP18TCmPluginInitParam @ 18 NONAME + _ZN16CCmPluginBaseEngD0Ev @ 19 NONAME + _ZN16CCmPluginBaseEngD1Ev @ 20 NONAME + _ZN16CCmPluginBaseEngD2Ev @ 21 NONAME + _ZN18TCmPluginInitParamC1ERN8CommsDat11CMDBSessionE @ 22 NONAME + _ZN18TCmPluginInitParamC2ERN8CommsDat11CMDBSessionE @ 23 NONAME + _ZN23CCmClientPluginInstance4NewLEv @ 24 NONAME + _ZN23CCmClientPluginInstance5NewLCEv @ 25 NONAME + _ZN23CCmClientPluginInstanceD0Ev @ 26 NONAME + _ZN23CCmClientPluginInstanceD1Ev @ 27 NONAME + _ZN23CCmClientPluginInstanceD2Ev @ 28 NONAME + _ZNK16CCmPluginBaseEng20CheckIfNameModifiedLEPN8CommsDat13CCDRecordBaseES2_ @ 29 NONAME + _ZNK16CCmPluginBaseEng30GetGenericTableIdsToBeObservedER6RArrayImE @ 30 NONAME + _ZTI16CCmPluginBaseEng @ 31 NONAME + _ZTV16CCmPluginBaseEng @ 32 NONAME + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmpluginbase/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmpluginbase/group/bld.inf Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Build file for cmpluginbase. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// export iby files +../rom/cmmpluginbase.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cmmpluginbase.iby) + +PRJ_MMPFILES +cmmpluginbase.mmp diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmpluginbase/group/cmmpluginbase.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmpluginbase/group/cmmpluginbase.mmp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Project definition file for project cmpluginbase +* +*/ + +#include +#include + +TARGET cmmpluginbase.dll +TARGETTYPE dll +UID 0x1000008d 0x20016A84 +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src + +SOURCE ccmpluginbaseeng.cpp +SOURCE ccmpluginbaseengtextresolver.cpp + +// Component specific internal headers +USERINCLUDE ../inc +USERINCLUDE ../../cmmserver/inc +USERINCLUDE ../traces + +// ADO specific internal headers +SYSTEMINCLUDE ../../../../inc + +//Macro to /epoc32 headers +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY commsdat.lib +LIBRARY featmgr.lib +LIBRARY esock.lib +LIBRARY ws32.lib +LIBRARY cmmanagerdatabase.lib +LIBRARY insock.lib +LIBRARY sysutil.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY hbcore.lib + +#if defined(ARMCC) + DEFFILE ../EABI/cmmpluginbase.def +#else + DEFFILE ../BWinsCw/cmmpluginbase.def +#endif + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmpluginbase/inc/ccmpluginbaseengtextresolver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmpluginbase/inc/ccmpluginbaseengtextresolver.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,36 @@ +/* +* 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: +* Provides functionality for text resolving +* +*/ + +#ifndef CMPLUGINBASEENGTEXTRESOLVER_H +#define CMPLUGINBASEENGTEXTRESOLVER_H + +/** + * Utility class for resolving localised text. + */ +class CCmPluginBaseEngTextResolver + { +public: + /** + * Resolves localised text from cmmanager translation file. + * @param aTextId Text Id from TS file + * @return Resolved text + */ + static HBufC* ResolveTextL( const TDesC& aTextId ); + }; + +#endif // CMPLUGINBASEENGTEXTRESOLVER_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmpluginbase/rom/cmmpluginbase.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmpluginbase/rom/cmmpluginbase.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* cmmpluginbase.dll to ROM. +* +*/ + +#ifndef CMMPLUGINBASE_IBY__ +#define CMMPLUGINBASE_IBY__ + +file=ABI_DIR\BUILD_DIR\cmmpluginbase.dll SHARED_LIB_DIR\cmmpluginbase.dll + + +#endif // CMMAPI_IBY__ + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmpluginbase/src/ccmpluginbaseeng.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmpluginbase/src/ccmpluginbaseeng.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,2968 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 plugin base class +* +*/ + + +#include +#include +#include +#include + +#include "ccmpluginbaseengtextresolver.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "ccmpluginbaseengTraces.h" +#endif + + +using namespace CMManager; +using namespace CommsDat; + +const TInt KApMaxConnNameLength = 30; +_LIT( KFormatPostfix, "%02d" ); +_LIT( KFormatLargePostfix, "%d" ); +_LIT( KFormatNameWithPostfix, "%S(%S)" ); +_LIT( KFormatNoPostfix, "%S" ); +const TInt KMaxPostfixLength = 5; + +_LIT( KDefWapGatewayIpAddress, "0.0.0.0" ); + +_LIT( KLocationName, "Mobile" ); + +_LIT( KDefaultIapName, "Connection Method" ); + + +EXPORT_C CCmClientPluginInstance* CCmClientPluginInstance::NewLC() + { + OstTraceFunctionEntry0( CCMCLIENTPLUGININSTANCE_NEWLC_ENTRY ); + + CCmClientPluginInstance* self = new( ELeave ) CCmClientPluginInstance(); + CleanupStack::PushL( self ); + self->ConstructL(); + + OstTraceFunctionExit0( CCMCLIENTPLUGININSTANCE_NEWLC_EXIT ); + return self; + } + +EXPORT_C CCmClientPluginInstance* CCmClientPluginInstance::NewL() + { + OstTraceFunctionEntry0( CCMCLIENTPLUGININSTANCE_NEWL_ENTRY ); + + CCmClientPluginInstance* self = CCmClientPluginInstance::NewLC(); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMCLIENTPLUGININSTANCE_NEWL_EXIT ); + return self; + } + +CCmClientPluginInstance::CCmClientPluginInstance() + : + iNamingMethod( ENamingUnique ), + iLocationEnabled( EFalse ), + iIapId( 0 ) + { + } + +EXPORT_C CCmClientPluginInstance::~CCmClientPluginInstance() + { + OstTraceFunctionEntry0( CCMCLIENTPLUGININSTANCE_CCMCLIENTPLUGININSTANCE_ENTRY ); + + iGenRecordArray.ResetAndDestroy(); + iBearerSpecRecordArray.ResetAndDestroy(); + + OstTraceFunctionExit0( CCMCLIENTPLUGININSTANCE_CCMCLIENTPLUGININSTANCE_EXIT ); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// +void CCmClientPluginInstance::ConstructL() + { + OstTraceFunctionEntry0( CCMCLIENTPLUGININSTANCE_CONSTRUCTL_ENTRY ); + OstTraceFunctionExit0( CCMCLIENTPLUGININSTANCE_CONSTRUCTL_EXIT ); + } + + +// --------------------------------------------------------------------------- +// TCmPluginInitParam::TCmPluginInitParam +// --------------------------------------------------------------------------- +// +EXPORT_C TCmPluginInitParam::TCmPluginInitParam( CommsDat::CMDBSession& aSession ) + : + iSessionRef( aSession ) + { + OstTraceFunctionEntry0( TCMPLUGININITPARAM_TCMPLUGININITPARAM_ENTRY ); + + iNotused1 = NULL; + iNotused2 = NULL; + + OstTraceFunctionExit0( TCMPLUGININITPARAM_TCMPLUGININITPARAM_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::CCmPluginBaseEng +// --------------------------------------------------------------------------- +// +EXPORT_C CCmPluginBaseEng::CCmPluginBaseEng( TCmPluginInitParam *aInitParam ) + : + iSession( aInitParam->iSessionRef ), + iNamingMethod( ENamingUnique ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_CCMPLUGINBASEENG_ENTRY ); + + iDtor_ID_Key.iUid = 0; + iBearerType = 0; + + iIapRecord = NULL; + iProxyRecord = NULL; + iServiceRecord = NULL; + iNetworkRecord = NULL; + iLocationRecord = NULL; + iWapAPRecord = NULL; + iWapIPBearerRecord = NULL; + iMetaDataRecord = NULL; + + iIapId = 0; + iMetadataTableId = 0; + iLocationEnabled = EFalse; + + OstTraceFunctionExit0( CCMPLUGINBASEENG_CCMPLUGINBASEENG_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::~CCmPluginBaseEng +// --------------------------------------------------------------------------- +// +EXPORT_C CCmPluginBaseEng::~CCmPluginBaseEng() + { + OstTraceFunctionEntry0( DUP1_CCMPLUGINBASEENG_CCMPLUGINBASEENG_ENTRY ); + + iIapId = 0; + delete iIapRecord; iIapRecord = NULL; + delete iProxyRecord; iProxyRecord = NULL; + delete iServiceRecord; iServiceRecord = NULL; + delete iNetworkRecord; iNetworkRecord = NULL; + delete iLocationRecord; iLocationRecord = NULL; + delete iWapAPRecord; iWapAPRecord = NULL; + delete iWapIPBearerRecord; iWapIPBearerRecord = NULL; + delete iMetaDataRecord; iMetaDataRecord = NULL; + + iLocationEnabled = EFalse; + + REComSession::DestroyedImplementation( iDtor_ID_Key ); + + OstTraceFunctionExit0( DUP1_CCMPLUGINBASEENG_CCMPLUGINBASEENG_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::ConstructL +// --------------------------------------------------------------------------- +// +EXPORT_C void CCmPluginBaseEng::ConstructL() + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_CONSTRUCTL_ENTRY ); + + TRAPD( err, iMetadataTableId = CCDIAPMetadataRecord::TableIdL( iSession ) ); + if ( err ) + { + if ( err == KErrNotFound ) + { + iMetadataTableId = CCDIAPMetadataRecord::CreateTableL( iSession ); + } + else + { + User::LeaveIfError( err ); + } + } + + OstTraceFunctionExit0( CCMPLUGINBASEENG_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::UpdateL +// --------------------------------------------------------------------------- +// +EXPORT_C void CCmPluginBaseEng::UpdateL( + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_UPDATEL_ENTRY ); + + PrepareToUpdateRecordsL( aClientPluginInstance ); + + UpdateServiceRecordL( aClientPluginInstance ); + UpdateLocationRecordL( aClientPluginInstance ); + UpdateNetworkRecordL( aClientPluginInstance ); + UpdateIAPRecordL( aClientPluginInstance ); + UpdateWapRecordL( aClientPluginInstance ); + UpdateProxyRecordL( aClientPluginInstance ); + UpdateMetadataRecordL( aClientPluginInstance ); + UpdateConnPrefSettingL(); + + UpdateBearerRecordsL( + aClientPluginInstance->iGenRecordArray, + aClientPluginInstance->iBearerSpecRecordArray ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_UPDATEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Delete this connection methond. +// Record ids are checked to be sure that we delete only records +// that were loaded before. +// --------------------------------------------------------------------------- +// +EXPORT_C void CCmPluginBaseEng::DeleteL() + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_DELETEL_ENTRY ); + + PrepareToDeleteRecordsL(); + + if ( iIapRecord && iIapRecord->RecordId() ) + { + iIapRecord->DeleteL( iSession ); + } + + if ( iProxyRecord && iProxyRecord->RecordId() ) + { + iProxyRecord->DeleteL( iSession ); + } + + if ( iServiceRecord && iServiceRecord->RecordId() ) + { + iServiceRecord->DeleteL( iSession ); + } + + if ( iNetworkRecord && iNetworkRecord->RecordId() ) + { + iNetworkRecord->DeleteL( iSession ); + } + + if ( iLocationRecord && iLocationRecord->RecordId() ) + { + iLocationRecord->DeleteL( iSession ); + } + + if ( iWapAPRecord && iWapAPRecord->RecordId() ) + { + iWapAPRecord->DeleteL( iSession ); + } + + if ( iWapIPBearerRecord && iWapIPBearerRecord->RecordId() ) + { + iWapIPBearerRecord->DeleteL( iSession ); + } + + if ( iMetaDataRecord && iMetaDataRecord->RecordId() ) + { + iMetaDataRecord->DeleteL( iSession ); + } + + DeleteBearerRecordsL(); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_DELETEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::ReLoad +// --------------------------------------------------------------------------- +// +EXPORT_C void CCmPluginBaseEng::ReLoadL() + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_RELOAD_ENTRY ); + + delete iIapRecord; iIapRecord = NULL; + delete iProxyRecord; iProxyRecord = NULL; + delete iServiceRecord; iServiceRecord = NULL; + delete iNetworkRecord; iNetworkRecord = NULL; + delete iLocationRecord; iLocationRecord = NULL; + delete iWapAPRecord; iWapAPRecord = NULL; + delete iWapIPBearerRecord; iWapIPBearerRecord = NULL; + delete iMetaDataRecord; iMetaDataRecord = NULL; + + iLocationEnabled = EFalse; + + ResetBearerRecords(); + + LoadL( iIapId ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_RELOAD_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::LoadL +// --------------------------------------------------------------------------- +// +EXPORT_C void CCmPluginBaseEng::LoadL( TUint32 aIapId ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_LOADL_ENTRY ); + + DoLoadL( aIapId ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_LOADL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::CreateNewL +// --------------------------------------------------------------------------- +// +EXPORT_C void CCmPluginBaseEng::CreateNewL( TUint32 aCmId ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_CREATENEWL_ENTRY ); + + if ( iIapId ) + // we already have IAP id -> + { + User::Leave( KErrAlreadyExists ); + } + + // optional record is disabled in default + iLocationEnabled = EFalse; + + // create mandatory records + iIapRecord = static_cast + (CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord)); + iNetworkRecord = static_cast + (CCDRecordBase::RecordFactoryL(KCDTIdNetworkRecord)); + iProxyRecord = static_cast + (CCDRecordBase::RecordFactoryL(KCDTIdProxiesRecord)); + NewWapRecordL(); + iWapIPBearerRecord->iWAPGatewayAddress.SetL( KDefWapGatewayIpAddress ); + + iMetaDataRecord = NewMetadataRecordL( ETrue ); + + // call plugin to create its own records + CreateServiceRecordL(); + + // Update iaprecord servicetype name + HBufC* servicetypeName( NULL ); + ServiceRecordNameLC( servicetypeName ); + iIapRecord->iServiceType.SetL( *servicetypeName ); + CleanupStack::PopAndDestroy( servicetypeName ); + + // Update iaprecord bearertype name + HBufC* bearerTypeName( NULL ); + BearerRecordNameLC( bearerTypeName ); + iIapRecord->iBearerType.SetL( *bearerTypeName ); + CleanupStack::PopAndDestroy( bearerTypeName ); + + CreateBearerRecordsL(); + + EnableProxyL( EFalse ); + + _LIT(KDefaultConnNameTextId, "txt_occ_setlabel_connection_name_val_connection"); + HBufC* resolvedText( NULL ); + resolvedText = CCmPluginBaseEngTextResolver::ResolveTextL( KDefaultConnNameTextId ); + if ( resolvedText != NULL ) + { + SetDefaultNameL( *resolvedText ); + } + else + { + SetDefaultNameL( KDefaultIapName ); + } + + delete resolvedText; + resolvedText = NULL; + + iIapRecord->iNetworkWeighting = 0; // it's always 0. + + if ( aCmId != 0 ) + { + iIapRecord->SetRecordId( aCmId ); + iIapId = 0; + } + else + { + iIapRecord->SetRecordId( KCDNewRecordRequest ); + } + + OstTraceFunctionExit0( CCMPLUGINBASEENG_CREATENEWL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::CreateCopyL +// --------------------------------------------------------------------------- +// +EXPORT_C CCmPluginBaseEng* CCmPluginBaseEng::CreateCopyL( + CCmClientPluginInstance* /*aClientPluginInstance*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_CREATECOPYL_ENTRY ); + + TCmPluginInitParam params( iSession ); + + CCmPluginBaseEng* copyInst = CreateInstanceL( params ); + CleanupStack::PushL( copyInst ); + + PrepareToCopyDataL( copyInst ); + + CopyDataL( copyInst ); + + CleanupStack::Pop( copyInst ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_CREATECOPYL_EXIT ); + + return copyInst; + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::GetGenericTableIdsToBeObserved +// --------------------------------------------------------------------------- +// +EXPORT_C void CCmPluginBaseEng::GetGenericTableIdsToBeObserved( + RArray& aTableIdArray ) const + { + // Service and bearer records should be added by plugins + + aTableIdArray.Append( KCDTIdIAPRecord ); + aTableIdArray.Append( KCDTIdWAPAccessPointRecord ); + aTableIdArray.Append( KCDTIdProxiesRecord ); + aTableIdArray.Append( iMetadataTableId ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::CopyDataL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::CopyDataL( CCmPluginBaseEng* aCopyInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_COPYDATAL_ENTRY ); + + aCopyInstance->iLocationEnabled = iLocationEnabled; + aCopyInstance->iNamingMethod = iNamingMethod; + CopyRecordsL( aCopyInstance ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_COPYDATAL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::CopyRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::CopyRecordsL( CCmPluginBaseEng* aCopyInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_COPYRECORDSL_ENTRY ); + + CopyRecordDataL( KIapRecordIndex, aCopyInstance ); + + // Ensure that iap's name is set by the rules(Naming Method) + SetNameL( iIapRecord->iRecordName.GetL(), + aCopyInstance->iIapRecord, + aCopyInstance->iNamingMethod ); + + CopyRecordDataL( KServiceRecordIndex, aCopyInstance ); + CopyRecordDataL( KNetworkRecordIndex, aCopyInstance ); + CopyRecordDataL( KWAPAPRecordIndex, aCopyInstance ); + CopyRecordDataL( KWAPBearerRecordIndex, aCopyInstance ); + CopyRecordDataL( KMetaDataRecordIndex, aCopyInstance ); + CopyRecordDataL( KLocationRecordIndex, aCopyInstance ); + CopyRecordDataL( KProxyRecordIndex, aCopyInstance ); + + CopyBearerRecordsL( aCopyInstance ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_COPYRECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::CopyRecordDataL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::CopyRecordDataL( TUint32 aRecordIdentifier, + CCmPluginBaseEng* aCopyInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_COPYRECORDDATAL_ENTRY ); + + switch( aRecordIdentifier ) + { + case KIapRecordIndex: + { + aCopyInstance->iIapRecord = + static_cast( CCDRecordBase::CreateCopyRecordL( *iIapRecord ) ); + } + break; + case KServiceRecordIndex: + { + aCopyInstance->iServiceRecord = CopyServiceRecordL(); + } + break; + case KNetworkRecordIndex: + { + aCopyInstance->iNetworkRecord = + static_cast( CCDRecordBase::CreateCopyRecordL( *iNetworkRecord ) ); + } + break; + case KWAPAPRecordIndex: + { + aCopyInstance->iWapAPRecord = + static_cast( CCDRecordBase::CreateCopyRecordL( *iWapAPRecord ) ); + } + break; + case KWAPBearerRecordIndex: + { + aCopyInstance->iWapIPBearerRecord = + static_cast( CCDRecordBase::CreateCopyRecordL( *iWapIPBearerRecord ) ); + } + break; + case KMetaDataRecordIndex: + { + aCopyInstance->iMetaDataRecord = new (ELeave) CCDIAPMetadataRecord( iMetadataTableId ); + aCopyInstance->iMetaDataRecord->iIAP = IAPRecordElementId(); + aCopyInstance->iMetaDataRecord->iMetadata.SetL( iMetaDataRecord->iMetadata ); + aCopyInstance->iMetaDataRecord->iSeamlessness.SetL( iMetaDataRecord->iSeamlessness ); + } + break; + case KLocationRecordIndex: + { + aCopyInstance->iWapIPBearerRecord = + static_cast + ( CCDRecordBase::CreateCopyRecordL( *iWapIPBearerRecord ) ); + } + break; + case KProxyRecordIndex: + { + if ( iProxyRecord ) + { + aCopyInstance->iProxyRecord = static_cast + ( CCDRecordBase::CreateCopyRecordL( *iProxyRecord ) ); + } + } + break; + default: + { + User::Leave( KErrArgument ); + } + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_COPYRECORDDATAL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::DoLoadL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::DoLoadL( TUint32 aIapId ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_DOLOADL_ENTRY ); + + PrepareToLoadRecordsL(); + + LoadIAPRecordL( aIapId ); + LoadWapRecordL(); + LoadMetadataRecordL(); + LoadNetworkRecordL(); + LoadLocationRecordL(); + + // This is a connectionmethodinfo instance, that has no + // service and proxy setting. + if ( KDummyBearerType != iBearerType ) + { + LoadServiceRecordL(); + LoadProxyRecordL(); + } + + LoadBearerRecordsL(); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_DOLOADL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::PrepareToLoadRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::PrepareToLoadRecordsL() + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_PREPARETOLOADRECORDSL_ENTRY ); + + iLocationEnabled = EFalse; + PreparePluginToLoadRecordsL(); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_PREPARETOLOADRECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::LoadIAPRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::LoadIAPRecordL( TUint32 aIapId ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_LOADIAPRECORDL_ENTRY ); + + iIapId = aIapId; + + // Load IAP record + CCDIAPRecord *iapRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); + + CleanupStack::PushL( iapRecord ); + + iapRecord->SetRecordId( iIapId ); + iapRecord->LoadL( iSession ); + + CleanupStack::Pop( iapRecord ); + iIapRecord = iapRecord; + + OstTraceFunctionExit0( CCMPLUGINBASEENG_LOADIAPRECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::LoadProxySettingL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::LoadProxyRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_LOADPROXYSETTINGL_ENTRY ); + + // Load Proxy record + CMDBRecordSet* proxieRS = + new( ELeave ) CMDBRecordSet( KCDTIdProxiesRecord ); + CleanupStack::PushL(proxieRS); + + // Now try to find the linked proxy record + // create new record + CCDProxiesRecord* proxyRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); + + CleanupStack::PushL( proxyRecord ); + + // Prime record + TPtrC serviceType( iIapRecord->iServiceType ); + proxyRecord->iServiceType.SetL( serviceType ); + proxieRS->iRecords.AppendL( proxyRecord ); // Ownership transfered. + + CleanupStack::Pop( proxyRecord ); + proxyRecord = NULL; + + if ( proxieRS->FindL(iSession) ) + { + TInt i( 0 ); + while( i < proxieRS->iRecords.Count() ) + // Now that we have a list of services with the proper service type + // search for our proxy record and remove it from the array, + // then destroy the array. + { + CCDProxiesRecord* proxyRecord = (*proxieRS)[i]; + + // Compare the record id of these 2 services + if ( TUint32( proxyRecord->iService ) == TUint32( iIapRecord->iService ) ) + { + iProxyRecord = proxyRecord; + // Take ownership of this record + proxieRS->iRecords.Remove( i ); + break; + } + ++i; + } + } + + proxieRS->iRecords.ResetAndDestroy(); + + if ( !iProxyRecord ) + { + // This creates a proxy record, where usage is disabled. + EnableProxyL( EFalse ); + } + + CleanupStack::PopAndDestroy( proxieRS ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_LOADPROXYSETTINGL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::LoadNetworkSettingL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::LoadNetworkRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_LOADNETWORKSETTINGL_ENTRY ); + + CCDNetworkRecord* networkRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdNetworkRecord ) ); + CleanupStack::PushL( networkRecord ); + + networkRecord->SetRecordId( iIapRecord->iNetwork ); + TRAPD( err, networkRecord->LoadL( iSession ) ); + if ( err == KErrNotFound ) + { + CleanupStack::PopAndDestroy( networkRecord ); + + networkRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdNetworkRecord ) ); + } + else + // KErrNotFound -> doesn't matter. We will do it UpdateL() + { + User::LeaveIfError( err ); + + CleanupStack::Pop( networkRecord ); + } + + iNetworkRecord = networkRecord; + + OstTraceFunctionExit0( CCMPLUGINBASEENG_LOADNETWORKSETTINGL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::LoadLocationSettingL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::LoadLocationRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_LOADLOCATIONSETTINGL_ENTRY ); + + CCDLocationRecord* locationRecord = static_cast + (CCDRecordBase::RecordFactoryL(KCDTIdLocationRecord)); + + CleanupStack::PushL( locationRecord ); + + locationRecord->SetRecordId( iIapRecord->iLocation ); + if ( locationRecord->FindL(iSession) ) + { + iLocationEnabled = ETrue; + + iLocationRecord = locationRecord; + + CleanupStack::Pop( locationRecord ); + } + else + { + iLocationEnabled = EFalse; + + CleanupStack::PopAndDestroy( locationRecord ); + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_LOADLOCATIONSETTINGL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::PrepareToUpdateRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::PrepareToUpdateRecordsL( + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_PREPARETOUPDATERECORDSL_ENTRY ); + + // Set the record attributes to bearer specific records + CCDIAPRecord* iapRecord = + static_cast( aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); + + for ( TInt i = 0; i < aClientPluginInstance->iBearerSpecRecordArray.Count(); i++ ) + { + CCDRecordBase* record = + static_cast( aClientPluginInstance->iBearerSpecRecordArray[i] ); + + CopyAttributes( iapRecord, record ); + } + + PreparePluginToUpdateRecordsL( aClientPluginInstance->iGenRecordArray, + aClientPluginInstance->iBearerSpecRecordArray ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_PREPARETOUPDATERECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::UpdateIAPRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::UpdateIAPRecordL( + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_UPDATEIAPRECORDL_ENTRY ); + + CCDIAPRecord* iapRecord = + static_cast( aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); + + if ( iIapId == 0 ) + { + // Otherwise predefined iapid + if ( !iIapRecord->RecordId() ) + { + iIapRecord->SetRecordId( KCDNewRecordRequest ); + } + + TUint32 id( 0 ); + id = ServiceRecordId(); + iIapRecord->iService = id; + + HBufC* name( NULL ); + ServiceRecordNameLC( name ); + iIapRecord->iServiceType.SetL( *name ); + CleanupStack::PopAndDestroy( name ); + + BearerRecordIdL( id ); + iIapRecord->iBearer = id; + BearerRecordNameLC( name ); + iIapRecord->iBearerType.SetL( *name ); + CleanupStack::PopAndDestroy( name ); + + iIapRecord->iNetwork = iNetworkRecord->RecordId(); + + if ( iLocationRecord ) + { + iIapRecord->iLocation = iLocationRecord->RecordId(); + } + else + { + iIapRecord->iLocation = GetLocationIdL(); + } + + CopyAttributes( iapRecord, iIapRecord ); + CheckIfNameModifiedL( iapRecord, iIapRecord ); + + iIapRecord->StoreL( iSession ); + + iIapId = iIapRecord->RecordId(); + aClientPluginInstance->iIapId = iIapId; + + CCDIAPRecord* tempIapRecord = static_cast( + CCDRecordBase::CreateCopyRecordL( *iIapRecord ) ); + CleanupStack::PushL( tempIapRecord ); + tempIapRecord->SetElementId( iIapRecord->ElementId() ); + + aClientPluginInstance->iGenRecordArray.Remove( KIapRecordIndex ); + CleanupStack::PushL( iapRecord ); + + aClientPluginInstance->iGenRecordArray.InsertL( + static_cast( tempIapRecord ), KIapRecordIndex ); + + CleanupStack::PopAndDestroy( iapRecord ); + CleanupStack::Pop( tempIapRecord ); + + } + else + { + delete iIapRecord; + iIapRecord = NULL; + + iIapRecord = static_cast + ( CCDRecordBase::CreateCopyRecordL( *iapRecord ) ); + + iIapRecord->SetElementId( iapRecord->ElementId() ); + + iIapRecord->ModifyL( iSession ); + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_UPDATEIAPRECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::UpdateProxyRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::UpdateProxyRecordL( + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_UPDATEPROXYRECORDL_ENTRY ); + + CCDIAPRecord* iapRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); + + CCDProxiesRecord* proxyRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ); + + CopyAttributes( iapRecord, proxyRecord ); + CheckIfNameModifiedL( iapRecord, proxyRecord ); + + if ( proxyRecord->iUseProxyServer ) + { + delete iProxyRecord; + iProxyRecord = NULL; + + iProxyRecord = static_cast + ( CCDRecordBase::CreateCopyRecordL( *proxyRecord ) ); + iProxyRecord->SetElementId( proxyRecord->ElementId() ); + + if ( !iProxyRecord->RecordId() ) + // new proxy setting -> create new record + { + iProxyRecord->iService = iServiceRecord->RecordId(); + iProxyRecord->iServiceType.SetL( iIapRecord->iServiceType ); + + // By default protocol is set to "http" + if ( TPtrC( proxyRecord->iProtocolName ).Length() == 0 ) + { + iProxyRecord->iProtocolName.SetL( KDefProxyProtocolName ); + } + + iProxyRecord->SetRecordId( KCDNewRecordRequest ); + iProxyRecord->StoreL( iSession ); + proxyRecord->SetElementId( iProxyRecord->ElementId() ); + proxyRecord->iService = iServiceRecord->RecordId(); + proxyRecord->iServiceType.SetL( iIapRecord->iServiceType ); + } + else + // already existing record -> update only + { + iProxyRecord->ModifyL( iSession ); + } + } + else + { + if ( iProxyRecord->RecordId() ) + { + iProxyRecord->DeleteL( iSession ); + } + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_UPDATEPROXYRECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::UpdateMetadataRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::UpdateMetadataRecordL( + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_UPDATEMETADATARECORDL_ENTRY ); + + CCDIAPRecord* iapRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); + + CCDIAPMetadataRecord* metadataRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); + + CopyAttributes( iapRecord, metadataRecord ); + CheckIfNameModifiedL( iapRecord, metadataRecord ); + + delete iMetaDataRecord; + iMetaDataRecord = NULL; + + // Get a new blank IAP metadata record. + iMetaDataRecord = NewMetadataRecordL( EFalse ); + + iMetaDataRecord->SetElementId( metadataRecord->ElementId() ); + iMetaDataRecord->iRecordName.SetL( metadataRecord->iRecordName ); + iMetaDataRecord->iMetadata.SetL( metadataRecord->iMetadata ); + iMetaDataRecord->iSeamlessness.SetL( metadataRecord->iSeamlessness ); + + if ( !iMetaDataRecord->RecordId() ) + { + iMetaDataRecord->iIAP = IAPRecordElementId(); + iMetaDataRecord->SetRecordId( KCDNewRecordRequest ); + iMetaDataRecord->StoreL( iSession ); + metadataRecord->SetElementId( iMetaDataRecord->ElementId() ); + } + else + { + iMetaDataRecord->ModifyL( iSession ); + } + + OstTraceFunctionExit0( CCMPLUGINBASEENG_UPDATEMETADATARECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::UpdateServiceRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::UpdateServiceRecordL( + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_UPDATESERVICERECORDL_ENTRY ); + + CCDIAPRecord* iapRecord = + static_cast( aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); + + CCDRecordBase* serviceRecord = + static_cast( aClientPluginInstance->iGenRecordArray[KServiceRecordIndex] ); + + CopyAttributes( iapRecord, serviceRecord ); + + UpdateServiceRecordL( aClientPluginInstance->iGenRecordArray, + aClientPluginInstance->iBearerSpecRecordArray ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_UPDATESERVICERECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::UpdateNetworkRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::UpdateNetworkRecordL( + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_UPDATENETWORKRECORDL_ENTRY ); + + CCDIAPRecord* iapRecord = + static_cast( aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); + + CCDNetworkRecord* networkRecord = + static_cast( aClientPluginInstance->iGenRecordArray[KNetworkRecordIndex] ); + + CopyAttributes( iapRecord, networkRecord ); + + delete iNetworkRecord; + iNetworkRecord = NULL; + + CheckIfNameModifiedL( iapRecord, networkRecord ); + + iNetworkRecord = static_cast + ( CCDRecordBase::CreateCopyRecordL( *networkRecord ) ); + + iNetworkRecord->SetElementId( networkRecord->ElementId() ); + + if ( !iNetworkRecord->RecordId() ) + { + iNetworkRecord->SetRecordId( KCDNewRecordRequest ); + iNetworkRecord->StoreL( iSession ); + networkRecord->SetElementId( iNetworkRecord->ElementId() ); + } + else + { + iNetworkRecord->ModifyL( iSession ); + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_UPDATENETWORKRECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::UpdateLocationRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::UpdateLocationRecordL( + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_UPDATELOCATIONRECORDL_ENTRY ); + + if ( iLocationEnabled ) + { + CCDIAPRecord* iapRecord = + static_cast( aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); + + CCDLocationRecord* locationRecord = + static_cast( aClientPluginInstance->iGenRecordArray[KLocationRecordIndex] ); + + // location record is not set as hidden because it can be shared between iaps + CopyAttributes( iapRecord, locationRecord ); + locationRecord->ClearAttributes( ECDHidden ); + + delete iLocationRecord; + iLocationRecord = NULL; + + iLocationRecord = static_cast + ( CCDRecordBase::CreateCopyRecordL( *locationRecord ) ); + + iLocationRecord->SetElementId( locationRecord->ElementId() ); + + CheckIfNameModifiedL( iapRecord, locationRecord ); + + if ( !iLocationRecord->RecordId() ) + { + iLocationRecord->SetRecordId( KCDNewRecordRequest ); + iLocationRecord->StoreL( iSession ); + } + else + { + iLocationRecord->ModifyL( iSession ); + } + } + else + { + if ( iLocationRecord ) + { + iLocationRecord->DeleteL( iSession ); + } + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_UPDATELOCATIONRECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::UpdateConnPrefSettingL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::UpdateConnPrefSettingL() + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_UPDATECONNPREFSETTINGL_ENTRY ); + OstTraceFunctionExit0( CCMPLUGINBASEENG_UPDATECONNPREFSETTINGL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::EnableProxyL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::EnableProxyL( TBool aEnable ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_ENABLEPROXYL_ENTRY ); + + if ( !iServiceRecord ) + { + User::Leave( KErrNotSupported ); + } + + if ( !iProxyRecord ) + { + iProxyRecord = static_cast + (CCDRecordBase::RecordFactoryL(KCDTIdProxiesRecord)); + } + + iProxyRecord->iUseProxyServer = aEnable; + + OstTraceFunctionExit0( CCMPLUGINBASEENG_ENABLEPROXYL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::EnableLocationL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::EnableLocationL( TBool aEnable ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_ENABLELOCATIONL_ENTRY ); + + if ( aEnable ) + { + if ( !iLocationRecord ) + { + iLocationRecord = static_cast + (CCDRecordBase::RecordFactoryL(KCDTIdLocationRecord)); + } + } + + iLocationEnabled = aEnable; + + OstTraceFunctionExit0( CCMPLUGINBASEENG_ENABLELOCATIONL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::LoadWapRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::LoadWapRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_LOADWAPRECORDL_ENTRY ); + + iWapIPBearerRecord = FindWAPRecordL(); + if ( iWapIPBearerRecord ) + { + CCDWAPAccessPointRecord *wapApRecord = static_cast + (CCDRecordBase::RecordFactoryL(KCDTIdWAPAccessPointRecord)); + + CleanupStack::PushL( wapApRecord ); + + wapApRecord->SetRecordId( iWapIPBearerRecord->iWAPAccessPointId ); + TRAPD( err, wapApRecord->LoadL( iSession ) ); + if ( err == KErrNotFound ) + { + CleanupStack::PopAndDestroy( wapApRecord ); + + wapApRecord = static_cast + (CCDRecordBase::RecordFactoryL(KCDTIdWAPAccessPointRecord)); + } + else + { + User::LeaveIfError( err ); + + CleanupStack::Pop( wapApRecord ); + } + + iWapAPRecord = wapApRecord; + } + else + // No WAP record found -> create a new one + { + NewWapRecordL(); + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_LOADWAPRECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::LoadMetadataRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::LoadMetadataRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_LOADSEAMLESSNESSRECORDL_ENTRY ); + + iMetaDataRecord = FindMetadataRecordL(); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_LOADSEAMLESSNESSRECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::UpdateWapRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::UpdateWapRecordL( + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_UPDATEWAPRECORDL_ENTRY ); + + delete iWapAPRecord; + iWapAPRecord = NULL; + + delete iWapIPBearerRecord; + iWapIPBearerRecord = NULL; + + CCDIAPRecord* iapRecord = + static_cast( aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); + + CCDWAPAccessPointRecord* wapAPRecord = + static_cast( aClientPluginInstance->iGenRecordArray[KWAPAPRecordIndex] ); + + CCDWAPIPBearerRecord* wapIPBearerRecord = + static_cast( aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] ); + + CopyAttributes( iapRecord, wapAPRecord ); + CopyAttributes( iapRecord, wapIPBearerRecord ); + + CheckIfNameModifiedL( iapRecord, wapAPRecord ); + CheckIfNameModifiedL( iapRecord, wapIPBearerRecord ); + + iWapAPRecord = static_cast + ( CCDRecordBase::CreateCopyRecordL( *wapAPRecord ) ); + iWapAPRecord->SetElementId( wapAPRecord->ElementId() ); + + iWapIPBearerRecord = static_cast + ( CCDRecordBase::CreateCopyRecordL( *wapIPBearerRecord ) ); + iWapIPBearerRecord->SetElementId( wapIPBearerRecord->ElementId() ); + + if ( !iWapAPRecord->RecordId() ) + { + iWapAPRecord->SetRecordId( KCDNewRecordRequest ); + iWapAPRecord->StoreL(iSession ); + wapAPRecord->SetElementId( iWapAPRecord->ElementId() ); + } + else + { + iWapAPRecord->ModifyL( iSession ); + } + + if ( !iWapIPBearerRecord->RecordId() ) + { + iWapIPBearerRecord->iWAPAccessPointId = iWapAPRecord->RecordId(); + iWapIPBearerRecord->iWAPIAP = iapRecord->RecordId(); + + iWapIPBearerRecord->SetRecordId( KCDNewRecordRequest ); + iWapIPBearerRecord->StoreL( iSession ); + wapIPBearerRecord->SetElementId( iWapIPBearerRecord->ElementId() ); + + wapIPBearerRecord->iWAPAccessPointId = iWapAPRecord->RecordId(); + wapIPBearerRecord->iWAPIAP = iapRecord->RecordId(); + } + else + { + iWapIPBearerRecord->ModifyL( iSession ); + } + OstTraceFunctionExit0( DUP1_CCMPLUGINBASEENG_UPDATEWAPRECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::NewWapRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::NewWapRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_NEWWAPRECORDL_ENTRY ); + + if ( !iWapIPBearerRecord ) + { + iWapIPBearerRecord = static_cast + ( CCDRecordBase::RecordFactoryL( KCDTIdWAPIPBearerRecord ) ); + iWapIPBearerRecord->iWAPProxyPort = 0; + iWapIPBearerRecord->iWAPWSPOption = ECmWapWspOptionConnectionOriented; + iWapIPBearerRecord->iWAPSecurity = EFalse; + } + + if ( !iWapAPRecord ) + { + iWapAPRecord = static_cast + ( CCDRecordBase::RecordFactoryL( KCDTIdWAPAccessPointRecord ) ); + // SMS bearer is not supported by this version + iWapAPRecord->iWAPCurrentBearer.SetL( TPtrC( KCDTypeNameWAPIPBearer ) ); + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_NEWWAPRECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::NewMetadataRecordL +// --------------------------------------------------------------------------- +// +CCDIAPMetadataRecord* CCmPluginBaseEng::NewMetadataRecordL( TBool aSetDef ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_NEWSEAMLESSNESSRECORDL_ENTRY ); + + CCDIAPMetadataRecord* record = new( ELeave ) CCDIAPMetadataRecord( iMetadataTableId ); + + if ( aSetDef ) + { + TRAPD( err, record->iSeamlessness = GetBearerInfoIntL( ECmSeamlessnessLevel ) ); + if ( err ) + { + record->iSeamlessness = ESeamlessnessConfirmFirst; + } + } + + OstTraceFunctionExit0( CCMPLUGINBASEENG_NEWSEAMLESSNESSRECORDL_EXIT ); + return record; + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::SetAttribute +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::SetAttribute( CCDRecordBase* aRecord, + TUint32 aAttribute, + TBool aSet ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_SETATTRIBUTE_ENTRY ); + + if ( aSet ) + { + aRecord->SetAttributes( aAttribute ); + } + else + { + aRecord->ClearAttributes( aAttribute ); + } + + OstTraceFunctionExit0( CCMPLUGINBASEENG_SETATTRIBUTE_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::CopyAttributes +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::CopyAttributes( CCDRecordBase* aSrcRecord, + CCDRecordBase* aDstRecord ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_COPYATTRIBUTES_ENTRY ); + + if ( aSrcRecord == NULL || aDstRecord == NULL ) + { + return; + } + + // clear the target record attributes first + aDstRecord->ClearAttributes( aDstRecord->Attributes() ); + + aDstRecord->SetAttributes( aSrcRecord->Attributes() ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_COPYATTRIBUTES_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::FindWAPRecordL +// --------------------------------------------------------------------------- +// +CCDWAPIPBearerRecord* CCmPluginBaseEng::FindWAPRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_FINDWAPRECORDL_ENTRY ); + + CMDBRecordSet* wapRS = + new(ELeave) + CMDBRecordSet(KCDTIdWAPIPBearerRecord); + CleanupStack::PushL( wapRS ); + + CCDWAPIPBearerRecord* wapBearerRecord = static_cast + (CCDRecordBase::RecordFactoryL(KCDTIdWAPIPBearerRecord)); + + CleanupStack::PushL( wapBearerRecord ); + + wapBearerRecord->iWAPIAP = iIapId; + wapRS->iRecords.AppendL( wapBearerRecord ); + + CleanupStack::Pop( wapBearerRecord ); + wapBearerRecord = NULL; + + if ( wapRS->FindL(iSession) ) + { + wapBearerRecord = + static_cast(wapRS->iRecords[0]); + + // we take over the ownership of this record + wapRS->iRecords.Remove( 0 ); + } + + CleanupStack::PopAndDestroy( wapRS ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_FINDWAPRECORDL_EXIT ); + + return wapBearerRecord; + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::FindSeamlessnessRecordL +// --------------------------------------------------------------------------- +// +CCDIAPMetadataRecord* CCmPluginBaseEng::FindMetadataRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_FINDSEAMLESSNESSRECORDL_ENTRY ); + + CMDBRecordSet* metadataRecordSet = + new(ELeave) CMDBRecordSet( iMetadataTableId ); + CleanupStack::PushL( metadataRecordSet ); + + CCDIAPMetadataRecord* metadataRecord = + new (ELeave) CCDIAPMetadataRecord( iMetadataTableId ); + + CleanupStack::PushL( metadataRecord ); + + metadataRecord->iIAP = IAPRecordElementId(); + metadataRecordSet->iRecords.AppendL( metadataRecord ); + + CleanupStack::Pop( metadataRecord ); + metadataRecord = NULL; + + if ( metadataRecordSet->FindL( iSession ) ) + { + CMDBRecordBase* record = metadataRecordSet->iRecords[0]; + + metadataRecord = NewMetadataRecordL( EFalse ); + metadataRecord->SetRecordId( record->RecordId() ); + + // This can leave only in case of OOM. + metadataRecord->LoadL( iSession ); + } + else + { + metadataRecord = NewMetadataRecordL( ETrue ); + } + + CleanupStack::PopAndDestroy( metadataRecordSet ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_FINDSEAMLESSNESSRECORDL_EXIT ); + + return metadataRecord; + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::DoMakeValidNameL +// --------------------------------------------------------------------------- +// +HBufC* CCmPluginBaseEng::DoMakeValidNameL( const TDesC& aName, + const TUint32& aIapId ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_DOMAKEVALIDNAMEL_ENTRY ); + + TBool changed( EFalse ); + HBufC* temp = HBufC::NewLC( KApMaxConnNameLength ); + HBufC* temp2 = HBufC::NewLC( KApMaxConnNameLength ); + + HBufC* corrname = EnsureMaxLengthLC( aName, changed ); + *temp = *corrname; + TInt postfix( 0 ); + TInt pf( 0 ); + TInt i( 0 ); + TBool valid ( EFalse ); + + TPtrC prefix = GetPrefix( *corrname ); + + postfix = GetPostfix( *temp, prefix ); + postfix = -1; + do + { + valid = IsValidNameL( *temp, aIapId ); + if ( !valid ) + { + changed = ETrue; + postfix++; + // check the length of postfix, check text length accordingly + pf = postfix; + for (i=1; i<10; i++) + { + pf /= 10; + if ( !pf ) + break; + } + TPtr sgdptr( temp->Des() ); + TPtr sgdptr2( temp2->Des() ); + if ( postfix ) + { + if ( postfix < 10 ) + { + sgdptr2 = prefix.Left( KApMaxConnNameLength - i - 3 ); + } + else + { + sgdptr2 = prefix.Left( KApMaxConnNameLength - i - 2 ); + } + } + else + { + sgdptr2 = prefix.Left( KApMaxConnNameLength ); + } + if ( postfix ) + { + TBuf< KMaxPostfixLength > postfixString; + if ( postfix > 9 ) + { + postfixString.Format( KFormatLargePostfix, postfix ); +// TODO: AknTextUtils::LanguageSpecificNumberConversion( postfixString ); + } + else + { + postfixString.Format( KFormatPostfix, postfix ); +// TODO: AknTextUtils::LanguageSpecificNumberConversion( postfixString ); + } + sgdptr.Format( KFormatNameWithPostfix, &sgdptr2, + &postfixString ); + } + else + { + sgdptr.Format( KFormatNoPostfix, &sgdptr2 ); + } + } + } while ( !valid ); + + CleanupStack::PopAndDestroy( corrname ); + CleanupStack::PopAndDestroy( temp2 ); + + if ( changed ) + { + CleanupStack::Pop( temp ); + } + else + { + CleanupStack::PopAndDestroy( temp ); + temp = NULL; + } + + OstTraceFunctionExit0( CCMPLUGINBASEENG_DOMAKEVALIDNAMEL_EXIT ); + + return temp; + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::EnsureMaxLengthLC +// --------------------------------------------------------------------------- +// +HBufC* CCmPluginBaseEng::EnsureMaxLengthLC( const TDesC& aName, + TBool& aChanged ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_ENSUREMAXLENGTHLC_ENTRY ); + + TInt length = aName.Length(); + + aChanged = EFalse; + + if ( !length ) + { + // Name is required. + User::Leave( KErrArgument ); + } + + HBufC* corrname; + if ( KApMaxConnNameLength < length ) + { // name too long, truncate. + corrname = aName.Left( KApMaxConnNameLength ).AllocLC(); + aChanged = ETrue; + } + else + { + corrname = aName.AllocLC(); + corrname->Des().Trim(); + if ( corrname->Length() == 0 ) + { + User::Leave( KErrArgument ); + } + // comes here only if name is valid + if ( corrname->Length() != aName.Length() ) + { + aChanged = ETrue; + } + } + + OstTraceFunctionExit0( CCMPLUGINBASEENG_ENSUREMAXLENGTHLC_EXIT ); + + return corrname; + } + +// --------------------------------------------------------------------------- +// Given aName in the format or , +// return a pointer to the leading part. +// That is, if there is trailing , +// then that is excluded; if there is no trailing part, then the original +// decriptor is returned. +// Examples: +// - "Foo" returns "Foo"; +// - "Foo 12" returns "Foo 12"; +// - "Foo(12)" returns "Foo"; +// - "Foo 12 (34)" returns "Foo 12 "; +// - "Foo bar" returns "Foo bar"; +// - "Foo " returns "Foo ". +// --------------------------------------------------------------------------- +TPtrC CCmPluginBaseEng::GetPrefix( const TDesC& aName ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_GETPREFIX_ENTRY ); + + TPtrC prefix = aName; + TInt lastBrace = aName.LocateReverse('('); + if ( lastBrace != KErrNotFound ) + { + // aName looks like "". + // See if is an integer number. + TPtrC num = aName.Right( aName.Length() - lastBrace - 1 ); + TInt val; + TLex lex( num ); + if ( lex.Val( val ) == KErrNone ) + { + // Yes, the trailer is an integer. + prefix.Set( aName.Left( lastBrace ) ); + } + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_GETPREFIX_EXIT ); + + return prefix; + } + + +// --------------------------------------------------------------------------- +// If aName is constructed from aPrefix with a postfix, get the numeric +// value of the postfix, e.g: +// - GetPostfix( "Foo (3)", "Foo" ) == 3 +// - GetPostfix( "Foo 23 (45)", "Foo 23" ) == 45 +// If aName is the same as aPrefix, return 0, e.g.: +// - GetPostfix( "Foo", "Foo" ) == 0 +// If aName is not constructed from aPrefix, return -1, e.g.: +// - GetPostfix( "Foobar", "Foo" ) == -1 +// - GetPostfix( "Fo 23 45", "Foo" ) == -1 +// --------------------------------------------------------------------------- +TInt CCmPluginBaseEng::GetPostfix( const TDesC& aName, const TDesC& aPrefix ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_GETPOSTFIX_ENTRY ); + + TInt postfix( KErrNotFound ); + TInt nameLength = aName.Length(); + TInt prefixLength = aPrefix.Length(); + if ( nameLength >= prefixLength && aName.FindF( aPrefix ) == 0 ) + { + // aName is longer or equal length, and + // aPrefix can be found in the beginning of aName. + if ( nameLength == prefixLength ) + { + // They have the same length; they equal. + postfix = 0; + } + else + { + if ( prefixLength > 0 ) + { + if ( aName[ prefixLength ] == '(' ) + { + // (Now we know that aName is longer than aPrefix.) + // aName looks like "aPrefix". + // See if is an integer number. + TPtrC num = aName.Right( nameLength - prefixLength - 1 ); + TBuf< KApMaxConnNameLength > pf; + pf = num; +// TODO AknTextUtils::ConvertDigitsTo( pf, EDigitTypeWestern ); + TInt val; + TLex lex( pf ); + if ( lex.Val( val ) == KErrNone ) + { + // Yes, the trailer is an integer. + if ( val > 0 ) + { + postfix = val; + } + else + { + // signal that it is invalid... + postfix = -1; + } + } + } + } + else + { + postfix = -1; + } + } + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_GETPOSTFIX_EXIT ); + + return postfix; + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::IsValidNameL +// --------------------------------------------------------------------------- +// +TBool CCmPluginBaseEng::IsValidNameL( const TDesC& aNameText, + const TUint32& aIapId ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_ISVALIDNAMEL_ENTRY ); + + TBool retVal( ETrue ); + + CMDBRecordSet* iapRS = + new(ELeave) CMDBRecordSet(KCDTIdIAPRecord); + CleanupStack::PushL(iapRS); + + CCDIAPRecord* iapRecord = static_cast + (CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord)); + + CleanupStack::PushL( iapRecord ); + + // Prime record + iapRecord->iRecordName.SetL( aNameText ); + + iapRS->iRecords.AppendL( iapRecord ); + + CleanupStack::Pop( iapRecord ); + + iapRecord = NULL; + + if ( iapRS->FindL(iSession) ) + { + if ( iIapId ) + // this is not a new CM + { + for ( TInt i = 0; i < iapRS->iRecords.Count(); ++i ) + { + if ( iapRS->iRecords[i]->RecordId() != aIapId ) + // duplication because it's not our name + { + retVal = EFalse; + break; + } + } + } + else + // new CM -> any occurence is a duplication + { + retVal = EFalse; + } + } + + CleanupStack::PopAndDestroy( iapRS ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_ISVALIDNAMEL_EXIT ); + + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::EscapeTextLC +// --------------------------------------------------------------------------- +// +HBufC* CCmPluginBaseEng::EscapeTextLC( const TDesC& aLiteral ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_ESCAPETEXTLC_ENTRY ); + + TInt l( aLiteral.Length() ); + //> 2*, to ensure correct esc. even if ALL chars are quotes... + HBufC* retbuf = HBufC::NewLC( 2*l ); + TPtr ret = retbuf->Des(); + TUint quote( '\'' ); // TChar gives warnings in THUMB & ARMI + TInt i( 0 ); + + for ( i=0; iiRecordName.SetL( aName ); + } + else if ( iNamingMethod == ENamingUnique ) + { + HBufC* newName = DoMakeValidNameL( aName, iIapId ); + + if ( newName ) + // name converted to unique + { + CleanupStack::PushL( newName ); + iIapRecord->iRecordName.SetL( *newName ); + CleanupStack::PopAndDestroy( newName ); + } + else + { + iIapRecord->iRecordName.SetL( aName ); + } + } + else if ( iNamingMethod == ENamingNotAccept ) + { + if ( IsValidNameL( aName, iIapId ) ) + { + iIapRecord->iRecordName.SetL( aName ); + } + else + { + User::Leave( KErrArgument ); + } + } + else + { + User::Leave( KErrCorrupt ); + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_SETDEFAULTNAMEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::SetNameL +// --------------------------------------------------------------------------- +// +void CCmPluginBaseEng::SetNameL( + const TDesC& aName, + CommsDat::CCDRecordBase* aIapRecord, + const CMManager::TNamingMethod aNamingMethod ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_SETNAMEL_ENTRY ); + + if ( aNamingMethod == ENamingNothing ) + { + aIapRecord->iRecordName.SetL( aName ); + } + else if ( aNamingMethod == ENamingUnique ) + { + TUint32 iapid = aIapRecord->RecordId(); + HBufC* newName = DoMakeValidNameL( aName, iapid ); + + if ( newName ) + // name converted to unique + { + CleanupStack::PushL( newName ); + aIapRecord->iRecordName.SetL( *newName ); + CleanupStack::PopAndDestroy( newName ); + } + else + { + aIapRecord->iRecordName.SetL( aName ); + } + } + else if ( aNamingMethod == ENamingNotAccept ) + { + if ( IsValidNameL( aName, aIapRecord->RecordId() ) ) + { + aIapRecord->iRecordName.SetL( aName ); + } + else + { + User::Leave( KErrArgument ); + } + } + else + { + User::Leave( KErrCorrupt ); + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_SETNAMEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::CheckIfNameModifiedL +// --------------------------------------------------------------------------- +EXPORT_C void CCmPluginBaseEng::CheckIfNameModifiedL( + CCDRecordBase* aSrcRecord, + CCDRecordBase* aDestRecord ) const + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_CHECKIFNAMEMODIFIEDL_ENTRY ); + + if ( !TPtrC( aSrcRecord->iRecordName ).CompareF( TPtrC( aDestRecord->iRecordName ) ) ) + // names matche + { + OstTraceFunctionExit0( CCMPLUGINBASEENG_CHECKIFNAMEMODIFIEDL_EXIT ); + return; + } + + aDestRecord->iRecordName.SetL( TPtrC( aSrcRecord->iRecordName ) ); + + OstTraceFunctionExit0( DUP1_CCMPLUGINBASEENG_CHECKIFNAMEMODIFIEDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::IAPRecordElementId +// --------------------------------------------------------------------------- +TMDBElementId CCmPluginBaseEng::IAPRecordElementId() const + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_IAPRECORDELEMENTID_ENTRY ); + + return ( KCDMaskShowField & iIapRecord->ElementId() ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::IsProtected +// --------------------------------------------------------------------------- +TBool CCmPluginBaseEng::IsProtected() const + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_ISPROTECTED_ENTRY ); + + return ( iIapRecord->Attributes() & ECDProtectedWrite ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::GetLocationIdL +// --------------------------------------------------------------------------- +TUint32 CCmPluginBaseEng::GetLocationIdL() const + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_GETLOCATIONIDL_ENTRY ); + + TUint32 locId( 0 ); + CMDBRecordSet* locRS = + new(ELeave) CMDBRecordSet(KCDTIdLocationRecord); + CleanupStack::PushL( locRS ); + + CCDLocationRecord* locRecord = static_cast + (CCDRecordBase::RecordFactoryL(KCDTIdLocationRecord)); + + CleanupStack::PushL( locRecord ); + locRecord->iRecordName.SetL( KLocationName ); + locRS->iRecords.AppendL( locRecord ); + CleanupStack::Pop( locRecord ); + + if ( locRS->FindL(iSession) ) + { + locRecord = static_cast(locRS->iRecords[0]); + + locId = locRecord->RecordId(); + } + else + { + User::Leave( KErrNotFound ); + } + + CleanupStack::PopAndDestroy( locRS ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_GETLOCATIONIDL_EXIT ); + + return locId; + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::SetProxyServerNameL +// --------------------------------------------------------------------------- + void CCmPluginBaseEng::SetProxyServerNameL( const TDesC& aProxyServer, + CCDRecordBase* aProxyRecord ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_SETPROXYSERVERNAMEL_ENTRY ); + + CCDProxiesRecord* proxyRecord = + static_cast( aProxyRecord ); + + proxyRecord->iServerName.SetL( aProxyServer ); + if ( !aProxyServer.Length() ) + { + proxyRecord->iPortNumber = 0; + proxyRecord->iUseProxyServer = EFalse; + } + else + { + proxyRecord->iUseProxyServer = ETrue; + } + + OstTraceFunctionExit0( CCMPLUGINBASEENG_SETPROXYSERVERNAMEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::CheckDNSServerAddressL +// --------------------------------------------------------------------------- +// +EXPORT_C void CCmPluginBaseEng::CheckDNSServerAddressL( TBool aIPv6, + CMDBField& aDNS1, + CMDBField& aDNS2, + CMDBField& aDNSFromServer ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_CHECKDNSSERVERADDRESSL_ENTRY ); + + if ( !aDNSFromServer ) + { + if ( aIPv6 ) + { + if ( ClassifyIPv6Address( aDNS1 ) == EIPv6Unspecified ) + { + if ( ClassifyIPv6Address( aDNS2 ) != EIPv6Unspecified ) + { + aDNS1.SetL( aDNS2 ); + aDNS2.SetL( KDynamicIpv6Address ); + } + else + { + // Both are unspecified + aDNSFromServer = ETrue; + } + } + } + else // IPv4 + { + if ( IsUnspecifiedIPv4Address( aDNS1 ) ) + { + if ( !IsUnspecifiedIPv4Address( aDNS2 ) ) + { + aDNS1.SetL( aDNS2 ); + aDNS2.SetL( KUnspecifiedIPv4 ); + } + else + { + // Both are unspecified + aDNSFromServer = ETrue; + } + } + } + } + + OstTraceFunctionExit0( DUP1_CCMPLUGINBASEENG_CHECKDNSSERVERADDRESSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// CCmPluginBaseEng::GetGenericCmRecordsL +// ----------------------------------------------------------------------------- +EXPORT_C void CCmPluginBaseEng::GetPluginDataL( + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_GETPLUGINDATAL_ENTRY ); + + if ( !aClientPluginInstance ) + { + User::Leave( KErrCorrupt ); + } + + aClientPluginInstance->iGenRecordArray.ResetAndDestroy(); + aClientPluginInstance->iBearerSpecRecordArray.ResetAndDestroy(); + + aClientPluginInstance->iNamingMethod = iNamingMethod; + aClientPluginInstance->iLocationEnabled = iLocationEnabled; + + if ( iIapRecord ) + { + CCDIAPRecord* iapRecord = + static_cast( CCDRecordBase::CreateCopyRecordL( *iIapRecord ) ); + CleanupStack::PushL( iapRecord ); + iapRecord->SetElementId( iIapRecord->ElementId() ); + aClientPluginInstance->iGenRecordArray.AppendL( static_cast( iapRecord ) ); + CleanupStack::Pop( iapRecord ); + } + else + { + User::Leave( KErrNotFound ); + } + + if ( iServiceRecord ) + { + CCDRecordBase* serviceRecord = CopyServiceRecordL(); + serviceRecord->SetElementId( iServiceRecord->ElementId() ); + CleanupStack::PushL( serviceRecord ); + aClientPluginInstance->iGenRecordArray.AppendL( serviceRecord ); + CleanupStack::Pop( serviceRecord ); + } + else + { + User::Leave( KErrNotFound ); + } + + if ( iNetworkRecord ) + { + CCDNetworkRecord* networkRecord = + static_cast( CCDRecordBase::CreateCopyRecordL( *iNetworkRecord ) ); + CleanupStack::PushL( networkRecord ); + networkRecord->SetElementId( iNetworkRecord->ElementId() ); + aClientPluginInstance->iGenRecordArray.AppendL( static_cast( networkRecord ) ); + CleanupStack::Pop( networkRecord ); + } + else + { + User::Leave( KErrNotFound ); + } + + if ( iWapAPRecord ) + { + CCDWAPAccessPointRecord* wapAPRecord = + static_cast( CCDRecordBase::CreateCopyRecordL( *iWapAPRecord ) ); + CleanupStack::PushL( wapAPRecord ); + wapAPRecord->SetElementId( iWapAPRecord->ElementId() ); + aClientPluginInstance->iGenRecordArray.AppendL( static_cast( wapAPRecord ) ); + CleanupStack::Pop( wapAPRecord ); + } + else + { + User::Leave( KErrNotFound ); + } + + if ( iWapIPBearerRecord ) + { + CCDWAPIPBearerRecord* wapIPBearerRecord = + static_cast( CCDRecordBase::CreateCopyRecordL( *iWapIPBearerRecord ) ); + CleanupStack::PushL( wapIPBearerRecord ); + wapIPBearerRecord->SetElementId( iWapIPBearerRecord->ElementId() ); + aClientPluginInstance->iGenRecordArray.AppendL( static_cast( wapIPBearerRecord ) ); + CleanupStack::Pop( wapIPBearerRecord ); + } + else + { + User::Leave( KErrNotFound ); + } + + if ( iMetaDataRecord ) + { + CCDIAPMetadataRecord* metaDataRecord = + new( ELeave ) CCDIAPMetadataRecord( iMetadataTableId ); + CleanupStack::PushL( metaDataRecord ); + metaDataRecord->iIAP = IAPRecordElementId(); + metaDataRecord->iMetadata.SetL( iMetaDataRecord->iMetadata ); + metaDataRecord->iSeamlessness.SetL( iMetaDataRecord->iSeamlessness ); + metaDataRecord->SetElementId( iMetaDataRecord->ElementId() ); + // Record name is set during update. + + aClientPluginInstance->iGenRecordArray.AppendL( + static_cast( metaDataRecord ) ); + CleanupStack::Pop( metaDataRecord ); + } + else + { + aClientPluginInstance->iGenRecordArray.AppendL( NULL ); + } + + if ( iLocationRecord ) + { + CCDLocationRecord* locationRecord = + static_cast( CCDRecordBase::CreateCopyRecordL( *iLocationRecord ) ); + CleanupStack::PushL( locationRecord ); + locationRecord->SetElementId( iLocationRecord->ElementId() ); + aClientPluginInstance->iGenRecordArray.AppendL( static_cast( locationRecord ) ); + CleanupStack::Pop( locationRecord ); + } + else + { + aClientPluginInstance->iGenRecordArray.AppendL( NULL ); + } + + if ( iProxyRecord ) + { + CCDProxiesRecord* proxyRecord = + static_cast( CCDRecordBase::CreateCopyRecordL( *iProxyRecord ) ); + CleanupStack::PushL( proxyRecord ); + proxyRecord->SetElementId( iProxyRecord->ElementId() ); + aClientPluginInstance->iGenRecordArray.AppendL( static_cast( proxyRecord ) ); + CleanupStack::Pop( proxyRecord ); + } + else + { + aClientPluginInstance->iGenRecordArray.AppendL( NULL ); + } + + GetBearerSpecificRecordsL( aClientPluginInstance->iBearerSpecRecordArray ); + + OstTraceFunctionExit0( CCMPLUGINBASEENG_GETPLUGINDATAL_EXIT ); + } + +//----------------------------------------------------------------------------- +// CCmPluginBaseEng::GetIntAttributeL +// ----------------------------------------------------------------------------- +EXPORT_C TUint32 CCmPluginBaseEng::GetIntAttributeL( + TUint32 aAttribute, + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_GETINTATTRIBUTEL_ENTRY ); + + TUint32 retVal( 0 ); + + switch ( aAttribute ) + { + case ECmIapId: // If the CM has an ECmIapId then the ECmIapId is the ECmId. + case ECmId: + { + retVal = static_cast( + aClientPluginInstance->iGenRecordArray[KIapRecordIndex] )->RecordId(); + } + break; + case ECmWapId: + { + retVal = static_cast( + aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] )->iWAPAccessPointId; + } + break; + case ECmIapServiceId: + { + retVal = static_cast( + aClientPluginInstance->iGenRecordArray[KIapRecordIndex] )->iService; + } + break; + case ECmBearerType: + { + retVal = iBearerType; + } + break; + case ECmDefaultPriority: + { + retVal = KDataMobilitySelectionPolicyPriorityWildCard; + } + break; + case ECmDefaultUiPriority: + { + retVal = KDataMobilitySelectionPolicyPriorityWildCard; + } + break; + case ECmNamingMethod: + { + retVal = iNamingMethod; + } + break; + case ECmSeamlessnessLevel: + { + if ( iMetaDataRecord ) + { + retVal = static_cast( + aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] )->iSeamlessness; + } + else + { + User::Leave( KErrNotFound ); + } + } + break; + case ECmElementID: + { + if ( !iIapRecord ) + { + User::Leave( KErrNotReady ); + } + + retVal = ( KCDMaskShowField & ( static_cast( + aClientPluginInstance->iGenRecordArray[KIapRecordIndex] )->ElementId() ) ); + } + break; + + case ECmLoadResult: + { + retVal = KErrNone; + } + break; + + case ECmNetworkId: + { + retVal = static_cast( + aClientPluginInstance->iGenRecordArray[KIapRecordIndex] )->iNetwork; + } + break; + case ECmProxyPortNumber: + { + if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) + { + User::Leave( KErrNotFound ); + } + + retVal = static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )->iPortNumber; + } + break; + case ECmWapIPWSPOption: + { + retVal = static_cast( + aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] )->iWAPWSPOption; + } + break; + case ECmWapIPProxyPort: + { + retVal = static_cast( + aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] )->iWAPProxyPort; + } + break; + default: + { + retVal = GetBearerIntAttributeL( aAttribute, + aClientPluginInstance->iGenRecordArray, + aClientPluginInstance->iBearerSpecRecordArray ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINBASEENG_GETINTATTRIBUTEL_EXIT ); + + return retVal; + } + +//----------------------------------------------------------------------------- +// CCmPluginBaseEng::GetBoolAttributeL +// ----------------------------------------------------------------------------- +EXPORT_C TBool CCmPluginBaseEng::GetBoolAttributeL( + TUint32 aAttribute, + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_GETBOOLATTRIBUTEL_ENTRY ); + + TBool retVal( EFalse ); + + switch ( aAttribute ) + { + case ECmProtected: + { + retVal = IsProtected(); + } + break; + case ECmHidden: + { + CCDIAPRecord* iapRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); + retVal = iapRecord->Attributes() & ECDHidden; + } + break; + case ECmProxyUsageEnabled: + { + if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) + { + retVal = EFalse; + } + + retVal = static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )->iUseProxyServer; + } + break; + case ECmDestination: + { + TRAPD( err, retVal = GetBearerBoolAttributeL( aAttribute, + aClientPluginInstance->iGenRecordArray, + aClientPluginInstance->iBearerSpecRecordArray ) ); + if ( err ) + { + if ( err == KErrNotFound ) + { + retVal = EFalse; + } + else + { + User::Leave( err ); + } + } + } + break; + case ECmChargeCardUsageEnabled: + { + retVal = EFalse; + } + break; + case ECmCoverage: + // In default the plugin has no network coverage + { + TRAPD( err, retVal = GetBearerBoolAttributeL( aAttribute, + aClientPluginInstance->iGenRecordArray, + aClientPluginInstance->iBearerSpecRecordArray ) ); + if ( err ) + { + if ( err == KErrNotFound ) + { + retVal = EFalse; + } + else + { + User::Leave( err ); + } + } + } + break; + case ECmMetaHighlight: + { + CCDIAPMetadataRecord* metadataRecord = + static_cast( + aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); + retVal = metadataRecord->iMetadata & EMetaHighlight; + } + break; + case ECmMetaHiddenAgent: + { + CCDIAPMetadataRecord* metadataRecord = + static_cast( + aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); + retVal = metadataRecord->iMetadata & EMetaHiddenAgent; + } + break; + case ECmVirtual: + { + retVal = EFalse; + } + break; + case ECmWapIPSecurity: + { + retVal = static_cast( + aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] )->iWAPSecurity; + } + break; + default: + { + retVal = GetBearerBoolAttributeL( aAttribute, + aClientPluginInstance->iGenRecordArray, + aClientPluginInstance->iBearerSpecRecordArray ); + } + } + + OstTraceFunctionExit0( CCMPLUGINBASEENG_GETBOOLATTRIBUTEL_EXIT ); + + return retVal; + } + +// ----------------------------------------------------------------------------- +// CCmPluginBaseEng::GetStringAttributeL() +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC* CCmPluginBaseEng::GetStringAttributeL( + TUint32 aAttribute, + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_GETSTRINGATTRIBUTEL_ENTRY ); + + HBufC* retVal = NULL; + + switch ( aAttribute ) + { + case ECmStartPage: + { + CCDWAPAccessPointRecord* wapAPRecord = + static_cast( + aClientPluginInstance->iGenRecordArray[KWAPAPRecordIndex] ); + + retVal = TPtrC( wapAPRecord->iWAPStartPage).AllocL(); + } + break; + case ECmName: + { + CCDIAPRecord* iapRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); + retVal = TPtrC( iapRecord->iRecordName ).AllocL(); + } + break; + case ECmProxyServerName: + { + if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) + { + User::Leave( KErrNotFound ); + } + + CCDProxiesRecord* proxyRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ); + + retVal = TPtrC( proxyRecord->iServerName ).AllocL(); + } + break; + case ECmProxyProtocolName: + { + if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) + { + User::Leave( KErrNotFound ); + } + + CCDProxiesRecord* proxyRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ); + + retVal = TPtrC( proxyRecord->iExceptions ).AllocL(); + } + break; + case ECmProxyExceptions: + { + if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) + { + User::Leave( KErrNotFound ); + } + + CCDProxiesRecord* proxyRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ); + + retVal = TPtrC( proxyRecord->iProtocolName ).AllocL(); + } + break; + case ECmWapIPGatewayAddress: + { + if ( !aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] ) + { + User::Leave( KErrNotFound ); + } + + CCDWAPIPBearerRecord* wapIPBearerRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] ); + + retVal = TPtrC( wapIPBearerRecord->iWAPGatewayAddress ).AllocL(); + } + break; + case ECmWapIPProxyLoginName: + { + if ( !aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] ) + { + User::Leave( KErrNotFound ); + } + + CCDWAPIPBearerRecord* wapIPBearerRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] ); + + retVal = TPtrC( wapIPBearerRecord->iWAPProxyLoginName ).AllocL(); + } + break; + case ECmWapIPProxyLoginPass: + { + if ( !aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] ) + { + User::Leave( KErrNotFound ); + } + + CCDWAPIPBearerRecord* wapIPBearerRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] ); + + retVal = TPtrC( wapIPBearerRecord->iWAPProxyLoginPass ).AllocL(); + } + break; + default: + { + retVal = GetBearerStringAttributeL( aAttribute, + aClientPluginInstance->iGenRecordArray, + aClientPluginInstance->iBearerSpecRecordArray ); + } + } + + OstTraceFunctionExit0( CCMPLUGINBASEENG_GETSTRINGATTRIBUTEL_EXIT ); + + return retVal; + } + +// ----------------------------------------------------------------------------- +// CCmPluginBaseEng::GetString8AttributeL() +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* CCmPluginBaseEng::GetString8AttributeL( + TUint32 aAttribute, + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_GETSTRING8ATTRIBUTEL_ENTRY ); + + HBufC8* retVal = NULL; + + switch ( aAttribute ) + { + default: + { + retVal = GetBearerString8AttributeL( aAttribute, + aClientPluginInstance->iGenRecordArray, + aClientPluginInstance->iBearerSpecRecordArray ); + } + } + + OstTraceFunctionExit0( CCMPLUGINBASEENG_GETSTRING8ATTRIBUTEL_EXIT ); + + return retVal; + } + +//----------------------------------------------------------------------------- +// CCmPluginBaseEng::GetIntAttributeL +// ----------------------------------------------------------------------------- +EXPORT_C void CCmPluginBaseEng::SetIntAttributeL( + TUint32 aAttribute, + TUint32 aValue, + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_SETINTATTRIBUTEL_ENTRY ); + + switch ( aAttribute ) + { + case ECmNamingMethod: + { + aClientPluginInstance->iNamingMethod = ( TNamingMethod )aValue; + } + break; + + case ECmCommsDBBearerType: + case ECmElementID: + case ECmIapId: + case ECmId: + { + User::Leave( KErrNotSupported ); + } + break; + + case ECmSeamlessnessLevel: + { + if ( aValue == ESeamlessnessConfirmFirst || aValue == ESeamlessnessShowprogress ) + { + static_cast( + aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] )-> + iSeamlessness.SetL( aValue ); + } + else + { + User::Leave( KErrNotSupported ); + } + } + break; + + case ECmNetworkId: + { + User::Leave( KErrNotSupported ); + } + break; + case ECmProxyPortNumber: + { + if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) + { + CCDProxiesRecord* proxyRecord = + static_cast( CCDRecordBase::CreateCopyRecordL( *iProxyRecord ) ); + CleanupStack::PushL( proxyRecord ); + proxyRecord->SetElementId( iProxyRecord->ElementId() ); + aClientPluginInstance->iGenRecordArray.AppendL( static_cast( proxyRecord ) ); + CleanupStack::Pop( proxyRecord ); + } + + static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) + ->iPortNumber = aValue; + } + break; + case ECmWapIPWSPOption: + { + if ( aValue > KMaxTUint8 ) + { + User::Leave( KErrArgument ); + } + else + { + static_cast( + aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] )->iWAPWSPOption.SetL( aValue ); + } + } + break; + case ECmWapIPProxyPort: + { + static_cast( + aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] )->iWAPProxyPort.SetL( aValue ); + } + break; + default: + { + SetBearerIntAttributeL( aAttribute, + aValue, + aClientPluginInstance->iGenRecordArray, + aClientPluginInstance->iBearerSpecRecordArray ); + } + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_SETINTATTRIBUTEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// CCmPluginBaseEng::SetBoolAttributeL +// ----------------------------------------------------------------------------- +EXPORT_C void CCmPluginBaseEng::SetBoolAttributeL( + TUint32 aAttribute, + TBool aValue, + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_SETBOOLATTRIBUTEL_ENTRY ); + + CCDIAPRecord* iapRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); + + switch ( aAttribute ) + { + case ECmProtected: + { + /** + * ECDProtectedWrite attribute is set in + * - iap record + * - network record + * - iapmetadata record + * - wap records + * - proxy record + * And depending the bearer + * - service record + * - bearer record + * - other bearer specific records + */ + SetAttribute( iapRecord, ECDProtectedWrite, aValue ); + } + break; + case ECmHidden: + { + /** + * ECDHidden attribute is set in + * - iap record + * - network record + * - iapmetadata record + * - wap records + * - proxy record + * And depending the bearer + * - service record + * - bearer record + * - other bearer specific records + */ + SetAttribute( iapRecord, ECDHidden, aValue ); + } + break; + case ECmProxyUsageEnabled: + { + if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) + { + CCDProxiesRecord* proxyRecord = + static_cast( CCDRecordBase::CreateCopyRecordL( *iProxyRecord ) ); + CleanupStack::PushL( proxyRecord ); + proxyRecord->SetElementId( iProxyRecord->ElementId() ); + aClientPluginInstance->iGenRecordArray.AppendL( static_cast( proxyRecord ) ); + CleanupStack::Pop( proxyRecord ); + } + + static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) + ->iUseProxyServer = aValue; + } + break; + case ECmChargeCardUsageEnabled: + { + User::Leave( KErrNotSupported ); + } + break; + case ECmLocationUsageEnabled: + { + EnableLocationL( aValue ); + } + break; + case ECmMetaHighlight: + { + CCDIAPMetadataRecord* metadataRecord = + static_cast( + aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); + if ( aValue ) + { + metadataRecord->iMetadata = EMetaHighlight | metadataRecord->iMetadata; + } + else + { + metadataRecord->iMetadata = ~EMetaHighlight & metadataRecord->iMetadata; + } + } + break; + case ECmMetaHiddenAgent: + { + CCDIAPMetadataRecord* metadataRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); + if ( aValue ) + { + metadataRecord->iMetadata = EMetaHiddenAgent | metadataRecord->iMetadata; + } + else + { + metadataRecord->iMetadata = ~EMetaHiddenAgent & metadataRecord->iMetadata; + } + } + break; + case ECmWapIPSecurity: + { + static_cast( + aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] )->iWAPSecurity.SetL( aValue ); + } + break; + default: + { + SetBearerBoolAttributeL( aAttribute, + aValue, + aClientPluginInstance->iGenRecordArray, + aClientPluginInstance->iBearerSpecRecordArray ); + } + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_SETBOOLATTRIBUTEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// CCmPluginBaseEng::SetStringAttributeL +// ----------------------------------------------------------------------------- +EXPORT_C void CCmPluginBaseEng::SetStringAttributeL( + TUint32 aAttribute, + const TDesC16& aValue, + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_SETSTRINGATTRIBUTEL_ENTRY ); + + switch ( aAttribute ) + { + case ECmStartPage: + { + CCDWAPAccessPointRecord* wapAPRecord = + static_cast( + aClientPluginInstance->iGenRecordArray[KWAPAPRecordIndex] ); + + wapAPRecord->iWAPStartPage.SetL( aValue ); + } + break; + case ECmName: + { + CCDIAPRecord* iapRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); + + SetNameL( aValue, iapRecord, aClientPluginInstance->iNamingMethod ); + } + break; + case ECmProxyServerName: + { + CCDProxiesRecord* proxyRecord = + static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ); + if ( !proxyRecord ) + { + proxyRecord = static_cast + ( CCDRecordBase::RecordFactoryL(KCDTIdProxiesRecord ) ); + + // map proxy record to this iap. + proxyRecord->iService = + static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )->RecordId(); + + aClientPluginInstance->iGenRecordArray.Insert( proxyRecord, KProxyRecordIndex ); + } + + SetProxyServerNameL( aValue, proxyRecord ); + } + break; + case ECmProxyProtocolName: + { + CCDProxiesRecord* proxyRecord = + static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ); + if ( !proxyRecord ) + { + proxyRecord = static_cast + ( CCDRecordBase::RecordFactoryL(KCDTIdProxiesRecord ) ); + + // map proxy record to this iap. + proxyRecord->iService = + static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )->RecordId(); + + aClientPluginInstance->iGenRecordArray.Insert( proxyRecord, KProxyRecordIndex ); + } + + proxyRecord->iProtocolName.SetL( aValue ); + } + break; + case ECmProxyExceptions: + { + CCDProxiesRecord* proxyRecord = + static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ); + if ( !proxyRecord ) + { + proxyRecord = static_cast + ( CCDRecordBase::RecordFactoryL(KCDTIdProxiesRecord ) ); + + // map proxy record to this iap. + proxyRecord->iService = + static_cast( + aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )->RecordId(); + + aClientPluginInstance->iGenRecordArray.Insert( proxyRecord, KProxyRecordIndex ); + } + + proxyRecord->iExceptions.SetL( aValue ); + } + break; + case ECmWapIPGatewayAddress: + { + CCDWAPIPBearerRecord* wapIPBearerRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] ); + + wapIPBearerRecord->iWAPGatewayAddress.SetL( aValue ); + } + break; + case ECmWapIPProxyLoginName: + { + CCDWAPIPBearerRecord* wapIPBearerRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] ); + + wapIPBearerRecord->iWAPProxyLoginName.SetL( aValue ); + } + break; + case ECmWapIPProxyLoginPass: + { + CCDWAPIPBearerRecord* wapIPBearerRecord = static_cast( + aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] ); + + wapIPBearerRecord->iWAPProxyLoginPass.SetL( aValue ); + } + break; + default: + { + SetBearerStringAttributeL( aAttribute, + aValue, + aClientPluginInstance->iGenRecordArray, + aClientPluginInstance->iBearerSpecRecordArray ); + } + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_SETSTRINGATTRIBUTEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// CCmPluginBaseEng::SetString8AttributeL +// ----------------------------------------------------------------------------- +EXPORT_C void CCmPluginBaseEng::SetString8AttributeL( + TUint32 aAttribute, + const TDesC8& aValue, + CCmClientPluginInstance* aClientPluginInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINBASEENG_SETSTRING8ATTRIBUTEL_ENTRY ); + + switch ( aAttribute ) + { + default: + { + SetBearerString8AttributeL( aAttribute, + aValue, + aClientPluginInstance->iGenRecordArray, + aClientPluginInstance->iBearerSpecRecordArray ); + } + } + OstTraceFunctionExit0( CCMPLUGINBASEENG_SETSTRING8ATTRIBUTEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::IsUnspecifiedIPv4Address +// --------------------------------------------------------------------------- +// +TBool CCmPluginBaseEng::IsUnspecifiedIPv4Address( const TDesC& aIpv4Address ) + { + OstTraceFunctionEntry0( _ISUNSPECIFIEDIPV4ADDRESS_ENTRY ); + + if ( aIpv4Address.Length() == 0 || !aIpv4Address.CompareF( KUnspecifiedIPv4 ) ) + { + OstTraceFunctionExit0( _ISUNSPECIFIEDIPV4ADDRESS_EXIT ); + return ETrue; + } + + OstTraceFunctionExit0( DUP1__ISUNSPECIFIEDIPV4ADDRESS_EXIT ); + + return EFalse; + } + +// --------------------------------------------------------------------------- +// CCmPluginBaseEng::ClassifyIPv6Address +// --------------------------------------------------------------------------- +// +TIPv6Types CCmPluginBaseEng::ClassifyIPv6Address( const TDesC& aIpv6Address ) + { + OstTraceFunctionEntry0( _CLASSIFYIPV6ADDRESS_ENTRY ); + + if ( aIpv6Address.Length() == 0 || !aIpv6Address.CompareF( KDynamicIpv6Address ) ) + { + OstTraceFunctionExit0( _CLASSIFYIPV6ADDRESS_EXIT ); + + return EIPv6Unspecified; + } + else if ( !aIpv6Address.CompareF( KKnownIp6NameServer1 ) || + !aIpv6Address.CompareF( KKnownIp6NameServer2 ) ) + { + OstTraceFunctionExit0( DUP1__CLASSIFYIPV6ADDRESS_EXIT ); + + return EIPv6WellKnown; + } + + OstTraceFunctionExit0( DUP2__CLASSIFYIPV6ADDRESS_EXIT ); + + return EIPv6UserDefined; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmpluginbase/src/ccmpluginbaseengtextresolver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmpluginbase/src/ccmpluginbaseengtextresolver.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,41 @@ +/* +* 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: Provides functionality for text resolving +* +*/ + +#include +#include "ccmpluginbaseengtextresolver.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "ccmpluginbaseengtextresolverTraces.h" +#endif + + +HBufC* CCmPluginBaseEngTextResolver::ResolveTextL( const TDesC& aTextId ) + { + _LIT(KCMManagerTranslationFile, "cmmanager_"); + _LIT(KTranslationPath, "\\resource\\qt\\translations"); + + TBool result = HbTextResolverSymbian::Init( KCMManagerTranslationFile, + KTranslationPath ); + if ( result ) + { + OstTrace0( TRACE_ERROR, CCMPLUGINBASEENGTEXTRESOLVER_RESOLVETEXTL, "CCmPluginBaseEngTextResolver::ResolveTextL" ); + } + + return HbTextResolverSymbian::LoadL( aTextId ); + } + + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmpluginbase/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmpluginbase/traces/OstTraceDefinitions.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler +// REMOVE BEFORE CHECK-IN TO VERSION CONTROL +// #define OST_TRACE_COMPILER_IN_USE +#include +#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmpluginbase/traces/fixed_id.definitions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmpluginbase/traces/fixed_id.definitions Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,397 @@ +#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt. +[GROUP]TRACE_FLOW=0x7 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ADDCOMMONCONVERSIONTABLEL_ENTRY=0x99 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ADDCOMMONCONVERSIONTABLEL_EXIT=0x9a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ADDCONVERSTIONTABLEL_ENTRY=0x97 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ADDCONVERSTIONTABLEL_EXIT=0x98 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ADDRESOURCEFILEL_ENTRY=0x41 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ADDRESOURCEFILEL_EXIT=0x42 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ALLDESTINATIONSL=0x184 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ALLOCREADL_ENTRY=0x45 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ALLOCREADL_EXIT=0x46 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CCMPLUGINBASEENG_ENTRY=0x1b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CCMPLUGINBASEENG_EXIT=0x1c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CHECKDNSSERVERADDRESSL_ENTRY=0xc0 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CHECKDNSSERVERADDRESSL_EXIT=0xc1 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CHECKFORCOMMONATTRIBUTE_ENTRY=0xac +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CHECKFORCOMMONATTRIBUTE_EXIT=0xad +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CHECKIFALREADYCONNECTED_ENTRY=0xa3 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CHECKIFALREADYCONNECTED_EXIT=0xa4 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CHECKIFNAMEMODIFIEDL_ENTRY=0xa5 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CHECKIFNAMEMODIFIEDL_EXIT=0xa6 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CHECKSPACEBELOWCRITICALLEVELL_ENTRY=0xc3 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CHECKSPACEBELOWCRITICALLEVELL_EXIT=0xc4 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_COMMITTRANSACTIONL_ENTRY=0x49 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_COMMITTRANSACTIONL_EXIT=0x4a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_COMMONATTRIBUTE_ENTRY=0xaf +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_COMMONATTRIBUTE_EXIT=0xb0 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CONSTRUCTL_ENTRY=0x1f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CONSTRUCTL_EXIT=0x20 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CONVERSIONTABLE_ENTRY=0xbb +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CONVERSIONTABLE_EXIT=0xbc +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CONVTABLEITEM_ENTRY=0xb8 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CONVTABLEITEM_EXIT=0xb9 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_COPYATTRIBUTES_ENTRY=0x83 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_COPYATTRIBUTES_EXIT=0x84 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CREATECOPYL_ENTRY=0x3f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CREATECOPYL_EXIT=0x40 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CREATENEWL_ENTRY=0x3d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_CREATENEWL_EXIT=0x3e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_DELETEL_ENTRY=0x39 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_DELETEL_EXIT=0x3a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_DESTINATIONPROTECTIONLEVELL_ENTRY=0xdf +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_DESTINATION_ENTRY=0x33 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_DESTINATION_EXIT=0x34 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_DOLOADL_ENTRY=0x4d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_DOLOADL_EXIT=0x4e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_DOMAKEVALIDNAMEL_ENTRY=0x89 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_DOMAKEVALIDNAMEL_EXIT=0x8a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_EASYWLANIDL=0x18b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ENABLECHARGECARDL_ENTRY=0x72 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ENABLECHARGECARDL_EXIT=0x73 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ENABLELOCATIONL_ENTRY=0x74 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ENABLELOCATIONL_EXIT=0x75 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ENABLEPROXYL_ENTRY=0x70 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ENABLEPROXYL_EXIT=0x71 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ENSUREMAXLENGTHLC_ENTRY=0x8b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ENSUREMAXLENGTHLC_EXIT=0x8c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ESCAPETEXTLC_ENTRY=0x93 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ESCAPETEXTLC_EXIT=0x94 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_FEATURESUPPORTED_ENTRY=0xb2 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_FEATURESUPPORTED_EXIT=0xb3 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_FIELDBYATTRIBUTEL_ENTRY=0xbd +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_FINDFIELDL_ENTRY=0x9f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_FINDFIELDL_EXIT=0xa0 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_FINDSEAMLESSNESSRECORDL_ENTRY=0x87 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_FINDSEAMLESSNESSRECORDL_EXIT=0x88 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_FINDWAPRECORDL_ENTRY=0x85 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_FINDWAPRECORDL_EXIT=0x86 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GENERICSTRINGWRITERL_ENTRY=0xc9 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GENERICSTRINGWRITERL_EXIT=0xca +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETADDITIONALUIDS_ENTRY=0xd0 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETADDITIONALUIDS_EXIT=0xd1 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETBOOLATTRIBUTEL_ENTRY=0x23 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETBOOLATTRIBUTEL_EXIT=0x24 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETCOMMONBOOLATTRIBUTEL_ENTRY=0xd5 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETCOMMONINTATTRIBUTEL_ENTRY=0xd4 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETCOMMONSTRINGATTRIBUTEL_ENTRY=0xd6 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETCONNECTIONMETHODINFOBOOLL=0x186 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETCONNECTIONMETHODINFOINTL=0x185 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETCONNECTIONMETHODINFOSTRING8L=0x188 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETCONNECTIONMETHODINFOSTRINGL=0x187 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETDESTINATIONID=0x18a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETDESTINATIONNAMELC=0x189 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETINTATTRIBUTEL_ENTRY=0x21 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETINTATTRIBUTEL_EXIT=0x22 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETLOCATIONIDL_ENTRY=0xaa +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETLOCATIONIDL_EXIT=0xab +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETPOSTFIX_ENTRY=0x8f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETPOSTFIX_EXIT=0x90 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETPREFIX_ENTRY=0x8d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETPREFIX_EXIT=0x8e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETSTRING8ATTRIBUTEL_ENTRY=0x27 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETSTRING8ATTRIBUTEL_EXIT=0x28 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETSTRINGATTRIBUTEL_ENTRY=0x25 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETSTRINGATTRIBUTEL_EXIT=0x26 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GLOBALBEARERPRIORITY_ENTRY=0xb4 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GLOBALUIBEARERPRIORITY_ENTRY=0xb5 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_IAPRECORDELEMENTID_ENTRY=0xa8 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_IDISVALID_ENTRY=0xc5 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_IDISVALID_EXIT=0xc6 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ISDESTINATIONCONNECTEDL_ENTRY=0xe1 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ISDESTINATIONHIDDENL_ENTRY=0xe0 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ISPROTECTED_ENTRY=0xa9 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ISVALIDNAMEL_ENTRY=0x91 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ISVALIDNAMEL_EXIT=0x92 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADCHARGECARDSETTINGL_ENTRY=0x57 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADCHARGECARDSETTINGL_EXIT=0x58 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADCOMMONSERVICESETTINGL_ENTRY=0xdd +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADCOMMONSERVICESETTINGL_EXIT=0xde +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADIAPRECORDL_ENTRY=0x51 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADIAPRECORDL_EXIT=0x52 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADLOCATIONSETTINGL_ENTRY=0x5c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADLOCATIONSETTINGL_EXIT=0x5d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADL_ENTRY=0x3b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADL_EXIT=0x3c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADNETWORKSETTINGL_ENTRY=0x5a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADNETWORKSETTINGL_EXIT=0x5b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADPROXYSETTINGL_ENTRY=0x53 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADPROXYSETTINGL_EXIT=0x54 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADSEAMLESSNESSRECORDL_ENTRY=0x78 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADSEAMLESSNESSRECORDL_EXIT=0x79 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADSERVICESETTINGL_ENTRY=0x55 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADSERVICESETTINGL_EXIT=0x56 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADWAPRECORDL_ENTRY=0x76 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_LOADWAPRECORDL_EXIT=0x77 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_MAPPEDCOMMONATTRIBUTE_ENTRY=0xcb +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_MAPPEDCOMMONATTRIBUTE_EXIT=0xcc +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_NEWSEAMLESSNESSRECORDL_ENTRY=0x7f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_NEWSEAMLESSNESSRECORDL_EXIT=0x80 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_NEWWAPRECORDL_ENTRY=0x7d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_NEWWAPRECORDL_EXIT=0x7e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_NUMOFCONNMETHODREFERENCESL_ENTRY=0x37 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_OPENTRANSACTIONLC_ENTRY=0x47 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_OPENTRANSACTIONLC_EXIT=0x48 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_PARENTDESTINATION_ENTRY=0xce +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_PARENTDESTINATION_EXIT=0xcf +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_PREPARETOLOADRECORDSL_ENTRY=0x4f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_PREPARETOLOADRECORDSL_EXIT=0x50 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_PREPARETOUPDATERECORDSL_ENTRY=0x5e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_PREPARETOUPDATERECORDSL_EXIT=0x5f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_REMOVECOMMONCONVERSIONTABLE_ENTRY=0x9d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_REMOVECOMMONCONVERSIONTABLE_EXIT=0x9e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_REMOVECONVERSIONTABLE_ENTRY=0x9b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_REMOVECONVERSIONTABLE_EXIT=0x9c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_REMOVERESOURCEFILE_ENTRY=0x43 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_REMOVERESOURCEFILE_EXIT=0x44 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_RESET_ENTRY=0xa1 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_RESET_EXIT=0xa2 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_RESTOREATTRIBUTEL_ENTRY=0x31 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_RESTOREATTRIBUTEL_EXIT=0x32 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ROLLBACKTRANSACTION_ENTRY=0x4b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_ROLLBACKTRANSACTION_EXIT=0x4c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SESSION_ENTRY=0x38 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETATTRIBUTE_ENTRY=0x81 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETATTRIBUTE_EXIT=0x82 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETBOOLATTRIBUTEL_ENTRY=0x2b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETBOOLATTRIBUTEL_EXIT=0x2c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETCOMMONBOOLATTRIBUTEL_ENTRY=0xd9 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETCOMMONBOOLATTRIBUTEL_EXIT=0xda +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETCOMMONINTATTRIBUTEL_ENTRY=0xd7 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETCOMMONINTATTRIBUTEL_EXIT=0xd8 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETCOMMONSTRINGATTRIBUTEL_ENTRY=0xdb +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETCOMMONSTRINGATTRIBUTEL_EXIT=0xdc +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETDNSSERVERADDRESSL_ENTRY=0xbe +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETDNSSERVERADDRESSL_EXIT=0xbf +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETIDVALIDITY_ENTRY=0xc7 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETIDVALIDITY_EXIT=0xc8 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETINTATTRIBUTEL_ENTRY=0x29 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETINTATTRIBUTEL_EXIT=0x2a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETNAMEL_ENTRY=0x95 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETNAMEL_EXIT=0x96 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETPREDEFINEDID_ENTRY=0xd2 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETPREDEFINEDID_EXIT=0xd3 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETPROXYSERVERNAMEL_ENTRY=0xb6 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETPROXYSERVERNAMEL_EXIT=0xb7 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETSTRING8ATTRIBUTEL_ENTRY=0x2f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETSTRING8ATTRIBUTEL_EXIT=0x30 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETSTRINGATTRIBUTEL_ENTRY=0x2d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_SETSTRINGATTRIBUTEL_EXIT=0x2e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATECHARGECARDRECORDL_ENTRY=0x66 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATECHARGECARDRECORDL_EXIT=0x67 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATECONNPREFSETTINGL_ENTRY=0x6e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATECONNPREFSETTINGL_EXIT=0x6f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATEIAPRECORDL_ENTRY=0x60 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATEIAPRECORDL_EXIT=0x61 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATELOCATIONRECORDL_ENTRY=0x6c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATELOCATIONRECORDL_EXIT=0x6d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATEL_ENTRY=0x35 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATEL_EXIT=0x36 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATENETWORKRECORDL_ENTRY=0x6a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATENETWORKRECORDL_EXIT=0x6b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATEPROXYRECORDL_ENTRY=0x62 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATEPROXYRECORDL_EXIT=0x63 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATESEAMLESSNESSRECORDL_ENTRY=0x64 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATESEAMLESSNESSRECORDL_EXIT=0x65 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATESERVICERECORDL_ENTRY=0x68 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATESERVICERECORDL_EXIT=0x69 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATEWAPRECORDL_ENTRY=0x7a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_UPDATEWAPRECORDL_EXIT=0x7b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEPRIVATE_CCMPLUGINBASEPRIVATE_ENTRY=0x17 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEPRIVATE_CCMPLUGINBASEPRIVATE_EXIT=0x18 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_ADDITIONALRESET_ENTRY=0xee +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_ADDITIONALRESET_EXIT=0xef +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_ADDRESOURCEFILEL_ENTRY=0x122 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_ADDRESOURCEFILEL_EXIT=0x123 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_ALLOCREADL_ENTRY=0x126 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_BEARERRECORDIDLC_ENTRY=0xf2 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_BEARERRECORDIDLC_EXIT=0xf3 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CANHANDLEIAPIDL_ENTRY=0xec +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CCMPLUGINBASE_ENTRY=0xe4 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CCMPLUGINBASE_EXIT=0xe5 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CMMGR_ENTRY=0x164 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_COMMITTRANSACTIONL_ENTRY=0x129 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_COMMITTRANSACTIONL_EXIT=0x12a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CONSTRUCTL_ENTRY=0xe8 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CONSTRUCTL_EXIT=0xe9 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_COPYADDITIONALDATAL_ENTRY=0xfe +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_COPYADDITIONALDATAL_EXIT=0xff +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_COPYATTRIBUTES_ENTRY=0x15e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_COPYATTRIBUTES_EXIT=0x15f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CREATEADDITIONALRECORDSL_ENTRY=0xfa +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CREATEADDITIONALRECORDSL_EXIT=0xfb +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CREATECOPYL_ENTRY=0x120 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CREATECOPYL_EXIT=0x121 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CREATEINSTANCEL_ENTRY=0xea +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CREATEINSTANCEL_EXIT=0xeb +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CREATENEWL_ENTRY=0x11e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CREATENEWL_EXIT=0x11f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CREATENEWSERVICERECORDL_ENTRY=0xf8 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_CREATENEWSERVICERECORDL_EXIT=0xf9 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_DECREMENTREFCOUNTER_ENTRY=0x16b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_DECREMENTREFCOUNTER_EXIT=0x16c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_DELETEADDITIONALRECORDSL_ENTRY=0xf6 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_DELETEADDITIONALRECORDSL_EXIT=0xf7 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_DELETEL_ENTRY=0x119 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_DESTINATION_ENTRY=0x114 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_DOLOADL_ENTRY=0x12b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_DOLOADL_EXIT=0x12c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_ENABLECHARGECARDL_ENTRY=0x14f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_ENABLECHARGECARDL_EXIT=0x150 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_ENABLELOCATIONL_ENTRY=0x151 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_ENABLELOCATIONL_EXIT=0x152 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_ENABLEPROXYL_ENTRY=0x14d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_ENABLEPROXYL_EXIT=0x14e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_FILTERPOSSIBLEPARENTSL_ENTRY=0x171 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_FILTERPOSSIBLEPARENTSL_EXIT=0x172 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_FINDSEAMLESSNESSRECORDL_ENTRY=0x161 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_FINDWAPRECORDL_ENTRY=0x160 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_GETADDITIONALUIDS_ENTRY=0x16f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_GETADDITIONALUIDS_EXIT=0x170 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_GETBOOLATTRIBUTEL_ENTRY=0x107 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_GETINTATTRIBUTEL_ENTRY=0x106 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_GETREFCOUNTER_ENTRY=0x16d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_GETREFCOUNTER_EXIT=0x16e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_GETSTRING8ATTRIBUTEL_ENTRY=0x109 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_GETSTRINGATTRIBUTEL_ENTRY=0x108 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_IAPRECORDELEMENTID_ENTRY=0x162 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_INCREMENTREFCOUNTER_ENTRY=0x169 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_INCREMENTREFCOUNTER_EXIT=0x16a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_ISLINKEDTOIAP_ENTRY=0x104 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_ISLINKEDTOSNAP_ENTRY=0x105 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADADDITIONALRECORDSL_ENTRY=0x100 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADADDITIONALRECORDSL_EXIT=0x101 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADCHARGECARDSETTINGL_ENTRY=0x135 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADCHARGECARDSETTINGL_EXIT=0x136 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADIAPRECORDL_ENTRY=0x12f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADIAPRECORDL_EXIT=0x130 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADLOCATIONSETTINGL_ENTRY=0x139 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADLOCATIONSETTINGL_EXIT=0x13a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADL_ENTRY=0x11a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADL_EXIT=0x11b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADNETWORKSETTINGL_ENTRY=0x137 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADNETWORKSETTINGL_EXIT=0x138 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADPROXYSETTINGL_ENTRY=0x131 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADPROXYSETTINGL_EXIT=0x132 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADSEAMLESSNESSRECORDL_ENTRY=0x155 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADSEAMLESSNESSRECORDL_EXIT=0x156 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADSERVICESETTINGL_ENTRY=0x133 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADSERVICESETTINGL_EXIT=0x134 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADWAPRECORDL_ENTRY=0x153 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_LOADWAPRECORDL_EXIT=0x154 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_NEWSEAMLESSNESSRECORDL_ENTRY=0x15b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_NEWWAPRECORDL_ENTRY=0x159 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_NEWWAPRECORDL_EXIT=0x15a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_NUMOFCONNMETHODREFERENCESL_ENTRY=0x117 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_OPENTRANSACTIONLC_ENTRY=0x127 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_OPENTRANSACTIONLC_EXIT=0x128 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_PARENTDESTINATION_ENTRY=0x163 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_PLUGIN_ENTRY=0x167 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_PLUGIN_EXIT=0x168 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_PREPARETOCOPYDATAL_ENTRY=0xfc +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_PREPARETOCOPYDATAL_EXIT=0xfd +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_PREPARETODELETERECORDSL_ENTRY=0xf4 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_PREPARETODELETERECORDSL_EXIT=0xf5 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_PREPARETOLOADRECORDSL_ENTRY=0x12d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_PREPARETOLOADRECORDSL_EXIT=0x12e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_PREPARETOUPDATERECORDSL_ENTRY=0x13b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_PREPARETOUPDATERECORDSL_EXIT=0x13c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_RELOADL_ENTRY=0x11c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_RELOADL_EXIT=0x11d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_REMOVERESOURCEFILE_ENTRY=0x124 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_REMOVERESOURCEFILE_EXIT=0x125 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_RESTOREATTRIBUTEL_ENTRY=0x112 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_RESTOREATTRIBUTEL_EXIT=0x113 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SERVICERECORDIDLC_ENTRY=0xf0 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SERVICERECORDIDLC_EXIT=0xf1 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SESSION_ENTRY=0x118 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SETATTRIBUTE_ENTRY=0x15c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SETATTRIBUTE_EXIT=0x15d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SETBOOLATTRIBUTEL_ENTRY=0x10c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SETBOOLATTRIBUTEL_EXIT=0x10d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SETINTATTRIBUTEL_ENTRY=0x10a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SETINTATTRIBUTEL_EXIT=0x10b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SETPLUGIN_ENTRY=0x165 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SETPLUGIN_EXIT=0x166 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SETSTRING8ATTRIBUTEL_ENTRY=0x110 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SETSTRING8ATTRIBUTEL_EXIT=0x111 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SETSTRINGATTRIBUTEL_ENTRY=0x10e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_SETSTRINGATTRIBUTEL_EXIT=0x10f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATEADDITIONALRECORDSL_ENTRY=0x102 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATEADDITIONALRECORDSL_EXIT=0x103 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATECHARGECARDRECORDL_ENTRY=0x143 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATECHARGECARDRECORDL_EXIT=0x144 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATECONNPREFSETTINGL_ENTRY=0x14b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATECONNPREFSETTINGL_EXIT=0x14c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATEIAPRECORDL_ENTRY=0x13d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATEIAPRECORDL_EXIT=0x13e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATELOCATIONRECORDL_ENTRY=0x149 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATELOCATIONRECORDL_EXIT=0x14a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATEL_ENTRY=0x115 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATEL_EXIT=0x116 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATENETWORKRECORDL_ENTRY=0x147 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATENETWORKRECORDL_EXIT=0x148 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATEPROXYRECORDL_ENTRY=0x13f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATEPROXYRECORDL_EXIT=0x140 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATESEAMLESSNESSRECORDL_ENTRY=0x141 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATESEAMLESSNESSRECORDL_EXIT=0x142 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATESERVICERECORDL_ENTRY=0x145 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATESERVICERECORDL_EXIT=0x146 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATEWAPRECORDL_ENTRY=0x157 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASE_UPDATEWAPRECORDL_EXIT=0x158 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_BEARERRECORDIDLC_ENTRY=0x17e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_BEARERRECORDIDLC_EXIT=0x17f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_CCMPLUGINLANBASE_ENTRY=0x173 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_CCMPLUGINLANBASE_EXIT=0x174 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_CONSTRUCTL_ENTRY=0x177 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_CONSTRUCTL_EXIT=0x178 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_CREATENEWSERVICERECORDL_ENTRY=0x180 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_CREATENEWSERVICERECORDL_EXIT=0x181 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_LOADSERVICESETTINGL_ENTRY=0x179 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_LOADSERVICESETTINGL_EXIT=0x17a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_PREPARETOUPDATERECORDSL_ENTRY=0x182 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_PREPARETOUPDATERECORDSL_EXIT=0x183 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_SERVICERECORDIDLC_ENTRY=0x17c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_SERVICERECORDIDLC_EXIT=0x17d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLANBASE_SERVICERECORD_ENTRY=0x17b +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASEENG_CCMPLUGINBASEENG_ENTRY=0x1d +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASEENG_CCMPLUGINBASEENG_EXIT=0x1e +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASEENG_CHECKDNSSERVERADDRESSL_EXIT=0xc2 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASEENG_CHECKFORCOMMONATTRIBUTE_EXIT=0xae +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASEENG_CHECKIFNAMEMODIFIEDL_EXIT=0xa7 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASEENG_COMMONATTRIBUTE_EXIT=0xb1 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASEENG_CONVTABLEITEM_EXIT=0xba +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASEENG_LOADCHARGECARDSETTINGL_EXIT=0x59 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASEENG_MAPPEDCOMMONATTRIBUTE_EXIT=0xcd +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASEENG_UPDATEWAPRECORDL_EXIT=0x7c +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASEPRIVATE_CCMPLUGINBASEPRIVATE_ENTRY=0x19 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASEPRIVATE_CCMPLUGINBASEPRIVATE_EXIT=0x1a +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASE_CANHANDLEIAPIDL_ENTRY=0xed +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASE_CCMPLUGINBASE_ENTRY=0xe6 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINBASE_CCMPLUGINBASE_EXIT=0xe7 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINLANBASE_CCMPLUGINLANBASE_ENTRY=0x175 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINLANBASE_CCMPLUGINLANBASE_EXIT=0x176 +[TRACE]TRACE_FLOW[0x7]_DUP1__CLASSIFYIPV6ADDRESS_EXIT=0x12 +[TRACE]TRACE_FLOW[0x7]_DUP1__ISUNSPECIFIEDIPV4ADDRESS_EXIT=0xf +[TRACE]TRACE_FLOW[0x7]_DUP2__CLASSIFYIPV6ADDRESS_EXIT=0x13 +[TRACE]TRACE_FLOW[0x7]_TCMPLUGININITPARAM_TCMPLUGININITPARAM_ENTRY=0x15 +[TRACE]TRACE_FLOW[0x7]_TCMPLUGININITPARAM_TCMPLUGININITPARAM_EXIT=0x16 +[TRACE]TRACE_FLOW[0x7]__CHECKIPV4VALIDITYL_ENTRY=0x3 +[TRACE]TRACE_FLOW[0x7]__CHECKIPV4VALIDITYL_EXIT=0x4 +[TRACE]TRACE_FLOW[0x7]__CHECKIPV6VALIDITYL_ENTRY=0x5 +[TRACE]TRACE_FLOW[0x7]__CHECKIPV6VALIDITYL_EXIT=0x6 +[TRACE]TRACE_FLOW[0x7]__CHECKPORTNUMBERVALIDITYL_ENTRY=0x7 +[TRACE]TRACE_FLOW[0x7]__CHECKPORTNUMBERVALIDITYL_EXIT=0x8 +[TRACE]TRACE_FLOW[0x7]__CHECKRECORDIDVALIDITYL_ENTRY=0x9 +[TRACE]TRACE_FLOW[0x7]__CHECKRECORDIDVALIDITYL_EXIT=0xa +[TRACE]TRACE_FLOW[0x7]__CHECKWAPWSPOPTIONVALIDITYL_ENTRY=0xb +[TRACE]TRACE_FLOW[0x7]__CHECKWAPWSPOPTIONVALIDITYL_EXIT=0xc +[TRACE]TRACE_FLOW[0x7]__CLASSIFYIPV6ADDRESS_ENTRY=0x10 +[TRACE]TRACE_FLOW[0x7]__CLASSIFYIPV6ADDRESS_EXIT=0x11 +[TRACE]TRACE_FLOW[0x7]__ISUNSPECIFIEDIPV4ADDRESS_ENTRY=0xd +[TRACE]TRACE_FLOW[0x7]__ISUNSPECIFIEDIPV4ADDRESS_EXIT=0xe +[TRACE]TRACE_FLOW[0x7]__READONLYATTRIBUTEL_ENTRY=0x1 +[TRACE]TRACE_FLOW[0x7]__READONLYATTRIBUTEL_EXIT=0x2 +[TRACE]TRACE_FLOW[0x7]__SETPROXYSERVERNAMEL_ENTRY=0x14 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETALLDESTINATIONSL_ENTRY=0xe2 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMPLUGINBASEENG_GETALLDESTINATIONSL_EXIT=0xe3 diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginlan/data/1020737B.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginlan/data/1020737B.rss Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* PacketData PlugIn's resource file +* +* +*/ + +#include "ecom/RegistryInfo.rh" + +// Because attribute enums had to be added to namespace CMManager +// it's not possible to included cmpluginlanbasedef.h +// Thus bearer type id had to be redefine here. +#define KUidLanBearerType 0x1020737A + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x1020737B; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207377; // = KCMPluginInterfaceUid + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidLanBearerType; + version_no = 1; + display_name = "Lan"; + default_data = "Lan"; + opaque_data = ""; + } + }; + } + }; + } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginlan/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginlan/group/bld.inf Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Build information for the LAN plugin. +* +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +//../Rom/cmmpluginlan.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cmmpluginlan.iby) + +PRJ_MMPFILES +cmpluginlan.mmp + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginlan/group/cmpluginlan.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginlan/group/cmpluginlan.mmp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Project specification for LAN Plugin. +* +* +*/ + +#include + +TARGET cmpluginlan.dll +UID 0x10009D8D 0x1020737B + +TARGETTYPE PLUGIN + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src + +SOURCE cmpluginlanproxy.cpp +SOURCE cmpluginlan.cpp + +SOURCEPATH ../data + +START RESOURCE 1020737B.rss +TARGET cmpluginlan.rsc +END + +// Component specific internal headers +USERINCLUDE ../inc +USERINCLUDE ../traces + +// ADO specific internal headers +SYSTEMINCLUDE ../../../../../inc + +//Macro to /epoc32 headers +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ECOM.LIB +LIBRARY cmmpluginbase.lib +LIBRARY COMMSDAT.lib +LIBRARY featmgr.lib \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginlan/inc/cmpluginlan.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginlan/inc/cmpluginlan.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,335 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 Lan interface implementation +* for "LAN" plugin +* +* +*/ + + +#ifndef LAN_PLUGIN_H +#define LAN_PLUGIN_H + +#include +#include + + +/** +* CCmPluginLan defines the functionality of lan bearer support. +* Most of the API is inherited from CCmPluginBaseEng class. +*/ +NONSHARABLE_CLASS( CCmPluginLan ) : public CCmPluginBaseEng + { + public: // Constructors and destructor + /** + * Two phased constructor. + * @return Returns the LAN plugin object. + */ + static CCmPluginLan* NewL( TCmPluginInitParam* aInitParam ); + + /** + * Destructor. + */ + virtual ~CCmPluginLan(); + + public: // From CCmPluginBaseEng + /** + * Creates a new instance of LAN bearer plugin. The instance + * created represents a bearer, not a connection method. + * @param aInitParam Initialization data. + * @return Returns CCmPluginBaseEng type pointer which represents pure + * bearer instance for the cmm server. + */ + virtual CCmPluginBaseEng* CreateInstanceL( + TCmPluginInitParam& aInitParam ) const; + + /** + * Following GetBearerInfoXXXL methods return the values of the + * requested attributes. These values are LAN specific + * so they don't vary between LAN Conneciton Methods. + * @param aAttribute An attribute identifier. + * @return Returns the value requested. If not found leaves with + * KErrNotFound error code. + */ + + virtual TUint32 GetBearerInfoIntL( TUint32 aAttribute ) const; + + virtual TBool GetBearerInfoBoolL( TUint32 aAttribute ) const; + + virtual HBufC* GetBearerInfoStringL( TUint32 aAttribute ) const; + + virtual HBufC8* GetBearerInfoString8L( TUint32 aAttribute ) const; + + /** + * Checks if the plug-in can handle the Connection Method identified + * with parameter aIapId. + * @param aIapId IAPId of the Connection Method to be checked. + * @return ETrue if plug-in can handle the IAP, otherwise EFalse. + */ + virtual TBool CanHandleIapIdL( TUint32 aIapId ) const; + + /** + * Checks if the plug-in can handle the given IAP record. + * @param aIapRecord IAP record to be checked + * @return ETrue if plug-in can handle the IAP, otherwise EFalse. + */ + virtual TBool CanHandleIapIdL( + CommsDat::CCDIAPRecord* aIapRecord ) const; + + public: // From CCmPluginBaseEng concerning a Connection Method + /** + * Before generic side starts to request plugins to load records + * it calls this to give a possibility make some preparations + * if needed. + */ + virtual void PreparePluginToLoadRecordsL(); + + /** + * Before generic side starts to request plugins to update records + * it calls this to give a possibility make some preparations + * if needed. + * @param aGenRecordArray An array of generic records to be updated. + * @param aBearerSpecRecordArray An array of bearer specific records + * to be updated. + */ + virtual void PreparePluginToUpdateRecordsL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Creates the CCDLANServiceRecord type service record. + */ + virtual void CreateServiceRecordL(); + + /** + * Loads the service record. Service record pointer is stored to + * plugins generic side implementation(CCmPluginBaseEng). + */ + void LoadServiceRecordL(); + + /** + * Returns the service record id of this Connection Method. + * @return Returns the id of the service record id of this Connection Method. + */ + virtual TUint32 ServiceRecordId() const; + + /** + * Returns the service record name of the Connection Method. + * @param aServiceName Name of the service record which CM's iap record + * points to. + */ + virtual void ServiceRecordNameLC( HBufC* &aServiceName ); + + /** + * Writes the service record data to CommsDat. + * @param aGenRecordArray An array containing pointers to service + * record of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records of the Connection Method. + */ + virtual void UpdateServiceRecordL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Creates LAN specific default records. + */ + virtual void CreateBearerRecordsL(); + + /** + * Loads LAN specific records of the Connection Method. + */ + virtual void LoadBearerRecordsL(); + + /** + * Returns the bearer record id of the Connection Method. + * @param aRecordId Id of the bearer record this CM's iap record + * points to. + */ + virtual void BearerRecordIdL( TUint32& aRecordId ); + + /** + * Returns the bearer record name of the Connection Method. + * @param aBearerName Name of the bearer record this CM's iap record + * points to. + */ + virtual void BearerRecordNameLC( HBufC*& aBearerName ); + + /** + * Writes LAN specific record data to CommsDat. + * @param aGenRecordArray An array containing pointers to service + * record of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records to be written. + */ + virtual void UpdateBearerRecordsL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Deletes LAN specific records of the Connection Method. + */ + void DeleteBearerRecordsL(); + + /** + * Releases the memory reserved by the LAN specific records + * of the Connection Method. + */ + virtual void ResetBearerRecords(); + + /** + * Creates a copy of LAN specific records and adds them to + * aRecordArray. + */ + virtual void GetBearerSpecificRecordsL( + RPointerArray& aRecordArray ); + + /** + * Following GetBearerXXXXAttribute methods get only the + * fields in records in pointer arrays(parameters). + * @param aAttribute Identifier of the requested value. + * @param aGenRecordArray An array containing pointers to generic + * records of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records of the Connection Method. aAttribute + * parameter should identify one field(integer, boolean string) + * in one of these records. + * @return Returns the requested value. In error case leaves with + * system-wide error code. + */ + + virtual TUint32 GetBearerIntAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual TBool GetBearerBoolAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual HBufC* GetBearerStringAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual HBufC8* GetBearerString8AttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Following SetBearerXXXXAttribute methods set only the + * fields in records in pointer arrays(parameters). They are not + * allowed to update the original records in plugins. + * @param aAttribute Identifier of the field to set. + * @param aValue The value to set. + * @param aGenRecordArray An array containing pointers to generic + * records of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records of the Connection Method. aAttribute + * parameter should identify one field(integer, boolean string) + * in one of these records. + * @return None. + */ + + virtual void SetBearerIntAttributeL( + TUint32 aAttribute, TUint32 aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual void SetBearerBoolAttributeL( + TUint32 aAttribute, TBool aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual void SetBearerStringAttributeL( + TUint32 aAttribute, const TDesC16& aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual void SetBearerString8AttributeL( + TUint32 aAttribute, const TDesC8& aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Bearer is requested by the server if it uses CommsDat tables which + * should be observed for possible changes to be able to keep the + * data in memory in up to date. + * @param aTableIdArray A reference to an array where to add those + * table ids. + */ + virtual void GetBearerTableIdsToBeObservedL( + RArray& aTableIdArray ) const; + + private: // Constructors + /** + * Constructor. + */ + CCmPluginLan( TCmPluginInitParam* aInitParam ); + + /** + * Second phase constructor. Leaves on failure. + */ + void ConstructL(); + + private: + /** + * Sets the daemon name for the Connection Method. + */ + void SetDaemonNameL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Returns a reference to service record of the Connection Method. + */ + CommsDat::CCDLANServiceRecord& ServiceRecord() const; + + /** + * Makes needed preparations before copying records. + * @param aCopyInstance Instance of the plugin where to copy. + */ + virtual void PrepareToCopyDataL( CCmPluginBaseEng* aCopyInstance ); + + /** + * Copies the service record. + * @return Returns a pointer to service record created. + */ + CommsDat::CCDRecordBase* CopyServiceRecordL(); + + /** + * Copies the bearer specific records to copy instance. + * @param aCopyInstance Instance of the plugin where to copy. + */ + virtual void CopyBearerRecordsL( CCmPluginBaseEng* aCopyInstance ); + + /** + * Adds LAN bearer record with default values to record array. + * @param aRecordArray The array where to add the bearer record. + */ + void GetDefaultLanBearerRecordL( + RPointerArray& aRecordArray ); + + private: // Data + + /** + * Pointer to LAN bearer record. + */ + CommsDat::CCDLANBearerRecord* iBearerRecord; + }; + +#endif // LAN_PLUGIN_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginlan/rom/cmmpluginlan.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginlan/rom/cmmpluginlan.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* cmpluginlan.dll to ROM. +* +*/ +#ifndef CMMPLUGINLAN_IBY__ +#define CMMPLUGINLAN_IBY__ + +ECOM_PLUGIN(cmpluginlan.dll,1020737B.rsc) + + +#endif // CMMPLUGINLAN_IBY__ + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginlan/src/cmpluginlan.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginlan/src/cmpluginlan.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,1354 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 Lan Plugin interface implementation +* for Lan Bearer +* +* +*/ + + +#include "cmpluginlan.h" + +#include "datamobilitycommsdattypes.h" +#include +#include // For REComSession +#include + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmpluginlanTraces.h" +#endif + + +using namespace CMManager; +using namespace CommsDat; + +_LIT( KEmpty, "" ); + +_LIT( KLanBearerName, "LANBearer" ); +_LIT( KLanBearerAgent, "nullagt.agt" ); +_LIT( KLanBearerNif, "ethint" ); + +_LIT( KLanLDDFileName, "enet" ); +_LIT( KLanPDDFileName, "ethernet" ); + +_LIT( KLanLDDName, "Ethernet" ); +_LIT( KLanPDDName, "Ethernet.Wins" ); +_LIT( KLanPacketDriverName, "EtherPkt.drv" ); + + +const TBool KDefIpAddrFromServer = ETrue; +const TBool KDefIpDnsAddrFromServer = ETrue; +const TBool KDefIp6DnsAddrFromServer = ETrue; + +const TInt KLanLastSocketActivityTimeout = -1; +const TInt KLanLastSocketClosedTimeout = -1; +const TInt KLanLastSessionClosedTimeout = -1; + +const TUint32 KDefaultPriorityLAN = 0; + + +// --------------------------------------------------------- +// CCmPluginLan::NewOutgoingL() +// --------------------------------------------------------- +// +CCmPluginLan* CCmPluginLan::NewL( TCmPluginInitParam* aInitParam ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_NEWL_ENTRY ); + + CCmPluginLan* self = new( ELeave ) CCmPluginLan( aInitParam ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMPLUGINLAN_NEWL_EXIT ); + return self; + } + +// ---------------------------------------------------------------------------- +// CCmPluginLan::CreateInstanceL +// ---------------------------------------------------------------------------- +// +CCmPluginBaseEng* CCmPluginLan::CreateInstanceL( TCmPluginInitParam& aInitParam ) const + { + OstTraceFunctionEntry0( CCMPLUGINLAN_CREATEINSTANCEL_ENTRY ); + + CCmPluginLan* self = new( ELeave ) CCmPluginLan( &aInitParam ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMPLUGINLAN_CREATEINSTANCEL_EXIT ); + return self; + } + +// --------------------------------------------------------- +// CCmPluginLan::~CCmPluginLan() +// --------------------------------------------------------- +// +CCmPluginLan::~CCmPluginLan() + { + OstTraceFunctionEntry0( CCMPLUGINLAN_CCMPLUGINLAN_ENTRY ); + + ResetBearerRecords(); + FeatureManager::UnInitializeLib(); + + OstTraceFunctionExit0( CCMPLUGINLAN_CCMPLUGINLAN_EXIT ); + } + +// --------------------------------------------------------- +// CCmPluginLan::CCmPluginLan() +// --------------------------------------------------------- +// +CCmPluginLan::CCmPluginLan( TCmPluginInitParam* aInitParam ) + : + CCmPluginBaseEng( aInitParam ) + { + OstTraceFunctionEntry0( DUP1_CCMPLUGINLAN_CCMPLUGINLAN_ENTRY ); + + iBearerType = KUidLanBearerType; + iBearerRecord = NULL; + + OstTraceFunctionExit0( DUP1_CCMPLUGINLAN_CCMPLUGINLAN_EXIT ); + } + +// --------------------------------------------------------- +// CCmPluginLan::ConstructL() +// --------------------------------------------------------- +// +void CCmPluginLan::ConstructL() + { + OstTraceFunctionEntry0( CCMPLUGINLAN_CONSTRUCTL_ENTRY ); + + FeatureManager::InitializeLibL(); + + CCmPluginBaseEng::ConstructL(); + + OstTraceFunctionExit0( CCMPLUGINLAN_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------- +// CCmPluginLan::CanHandleIapIdL() +// --------------------------------------------------------- +// +TBool CCmPluginLan::CanHandleIapIdL( TUint32 aIapId ) const + { + OstTraceFunctionEntryExt( CCMPLUGINLAN_CANHANDLEIAPIDL_ENTRY, this ); + + TBool retVal( EFalse ); + + CCDIAPRecord *iapRecord = static_cast + ( CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); + + CleanupStack::PushL( iapRecord ); + iapRecord->SetRecordId( aIapId ); + + TRAPD( err, iapRecord->LoadL( iSession ) ); + + if( !err ) + { + retVal = CanHandleIapIdL( iapRecord ); + } + + CleanupStack::PopAndDestroy( iapRecord ); + + OstTraceFunctionExitExt( CCMPLUGINLAN_CANHANDLEIAPIDL_EXIT, this, retVal ); + + return retVal; + } + +// --------------------------------------------------------- +// CCmPluginLan::CanHandleIapIdL() +// --------------------------------------------------------- +// +TBool CCmPluginLan::CanHandleIapIdL( CCDIAPRecord *aIapRecord ) const + { + OstTraceFunctionEntryExt( DUP1_CCMPLUGINLAN_CANHANDLEIAPIDL_ENTRY, this ); + + TBool retVal( EFalse ); + + if( (TPtrC( aIapRecord->iServiceType ) == TPtrC( KCDTypeNameLANService ) ) && + TPtrC( aIapRecord->iBearerType ) == TPtrC( KCDTypeNameLANBearer ) ) + { + retVal = ETrue; + } + + OstTraceFunctionExitExt( DUP1_CCMPLUGINLAN_CANHANDLEIAPIDL_EXIT, this, retVal ); + + return retVal; + } + +// ---------------------------------------------------------------------------- +// CCmPluginLan::PreparePluginToUpdateRecordsL() +// ---------------------------------------------------------------------------- +// +void CCmPluginLan::PreparePluginToLoadRecordsL() + { + OstTraceFunctionEntry0( CCMPLUGINLAN_PREPAREPLUGINTOLOADRECORDSL_ENTRY ); + + OstTraceFunctionExit0( CCMPLUGINLAN_PREPAREPLUGINTOLOADRECORDSL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginLan::PreparePluginToUpdateRecordsL() +// ---------------------------------------------------------------------------- +// +void CCmPluginLan::PreparePluginToUpdateRecordsL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_PREPAREPLUGINTOUPDATERECORDSL_ENTRY ); + + CCDIAPRecord* iapRecord = + static_cast( aGenRecordArray[KIapRecordIndex] ); + + CCDLANServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + + CheckIfNameModifiedL( iapRecord, serviceRecord ); + + CheckDNSServerAddressL( ETrue, + serviceRecord->iIp6NameServer1, + serviceRecord->iIp6NameServer2, + serviceRecord->iIp6DnsAddrFromServer ); + + CheckDNSServerAddressL( EFalse, + serviceRecord->iIpNameServer1, + serviceRecord->iIpNameServer2, + serviceRecord->iIpDnsAddrFromServer ); + + SetDaemonNameL( aGenRecordArray, aBearerSpecRecordArray ); + + OstTraceFunctionExit0( CCMPLUGINLAN_PREPAREPLUGINTOUPDATERECORDSL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginLan::CreateServiceRecordL +// -------------------------------------------------------------------------- +// +void CCmPluginLan::CreateServiceRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINLAN_CREATESERVICERECORDL_ENTRY ); + + delete iServiceRecord; + iServiceRecord = NULL; + + iServiceRecord = static_cast + (CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord ) ); + + CCDLANServiceRecord* lanServiceRecord = static_cast( iServiceRecord ); + + + if( FeatureManager::FeatureSupported( KFeatureIdIPv6 ) ) + { + lanServiceRecord->iIfNetworks.SetL( KDefIspIfNetworksIPv4IPv6LAN ); + } + else + { + lanServiceRecord->iIfNetworks.SetL( KDefIspIfNetworksIPv4 ); + } + + lanServiceRecord->iIpGateway.SetL( KUnspecifiedIPv4 ); + lanServiceRecord->iIpAddrFromServer.SetL( KDefIpAddrFromServer ); + + lanServiceRecord->iIpAddr.SetL( KUnspecifiedIPv4 ); + + lanServiceRecord->iIpDnsAddrFromServer.SetL( KDefIpDnsAddrFromServer ); + + lanServiceRecord->iIpNameServer1.SetL( KUnspecifiedIPv4 ); + lanServiceRecord->iIpNameServer2.SetL( KUnspecifiedIPv4 ); + lanServiceRecord->iIp6DnsAddrFromServer.SetL( KDefIp6DnsAddrFromServer ); + lanServiceRecord->iIp6NameServer1.SetL( KDynamicIpv6Address ); + lanServiceRecord->iIp6NameServer2.SetL( KDynamicIpv6Address ); + + if ( KDefIpAddrFromServer ) + { + lanServiceRecord->iConfigDaemonManagerName.SetL( KDaemonManagerName ); + lanServiceRecord->iConfigDaemonName.SetL( KConfigDaemonName ); + } + else + { + lanServiceRecord->iConfigDaemonManagerName.SetL( KEmpty ); + lanServiceRecord->iConfigDaemonName.SetL( KEmpty ); + } + OstTraceFunctionExit0( CCMPLUGINLAN_CREATESERVICERECORDL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginLan::LoadServiceRecordL +// -------------------------------------------------------------------------- +// +void CCmPluginLan::LoadServiceRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINLAN_LOADSERVICERECORDL_ENTRY ); + + if( TPtrC( KCDTypeNameLANService ) == iIapRecord->iServiceType ) + { + iServiceRecord = static_cast + (CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord)); + + ServiceRecord().SetRecordId( iIapRecord->iService ); + ServiceRecord().LoadL( iSession ); + } + else + // this IAP service is not supported by this plugin. + { + User::Leave( KErrNotSupported ); + } + OstTraceFunctionExit0( CCMPLUGINLAN_LOADSERVICERECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::PrepareToCopyDataL +// --------------------------------------------------------------------------- +// +void CCmPluginLan::PrepareToCopyDataL( CCmPluginBaseEng* /*aCopyInstance*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_PREPARETOCOPYDATAL_ENTRY ); + + OstTraceFunctionExit0( CCMPLUGINLAN_PREPARETOCOPYDATAL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::CopyServiceRecordL +// --------------------------------------------------------------------------- +// +CommsDat::CCDRecordBase* CCmPluginLan::CopyServiceRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINLAN_COPYSERVICERECORDL_ENTRY ); + + __ASSERT_DEBUG( iServiceRecord != NULL, User::Leave( KErrNotFound )); + + CCDRecordBase* serviceRecord = static_cast + ( CCDRecordBase::CreateCopyRecordL( *iServiceRecord ) ); + + OstTraceFunctionExit0( CCMPLUGINLAN_COPYSERVICERECORDL_EXIT ); + + return serviceRecord; + } + +// ---------------------------------------------------------------------------- +// CCmPluginLan::UpdateServiceRecordL() +// ---------------------------------------------------------------------------- +// +void CCmPluginLan::UpdateServiceRecordL( + RPointerArray& aGenRecordArray, + RPointerArray& /*aBearerSpecRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_UPDATESERVICERECORDL_ENTRY ); + + // Delete the original record and create a copy from the parameter + delete iServiceRecord; + iServiceRecord = NULL; + + iServiceRecord = static_cast + (CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord ) ); + + // LAN Service copy does not work so we have to copy it manually + + CCDLANServiceRecord* lanServiceRecordTo = static_cast( iServiceRecord ); + CCDLANServiceRecord* lanServiceRecordFrom = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + + if( !lanServiceRecordFrom->iRecordName.IsNull() ) + { + lanServiceRecordTo->iRecordName.SetL( lanServiceRecordFrom->iRecordName ); + } + if( !lanServiceRecordFrom->iIfNetworks.IsNull() ) + { + lanServiceRecordTo->iIfNetworks.SetL( lanServiceRecordFrom->iIfNetworks ); + } + if( !lanServiceRecordFrom->iIpNetmask.IsNull() ) + { + lanServiceRecordTo->iIpNetmask.SetL( lanServiceRecordFrom->iIpNetmask ); + } + if( !lanServiceRecordFrom->iIpGateway.IsNull() ) + { + lanServiceRecordTo->iIpGateway.SetL( lanServiceRecordFrom->iIpGateway ); + } + if( !lanServiceRecordFrom->iIpAddrFromServer.IsNull() ) + { + lanServiceRecordTo->iIpAddrFromServer.SetL( lanServiceRecordFrom->iIpAddrFromServer ); + } + if( !lanServiceRecordFrom->iIpAddr.IsNull() ) + { + lanServiceRecordTo->iIpAddr.SetL( lanServiceRecordFrom->iIpAddr ); + } + if( !lanServiceRecordFrom->iIpDnsAddrFromServer.IsNull() ) + { + lanServiceRecordTo->iIpDnsAddrFromServer.SetL( lanServiceRecordFrom->iIpDnsAddrFromServer ); + } + if( !lanServiceRecordFrom->iIpNameServer1.IsNull() ) + { + lanServiceRecordTo->iIpNameServer1.SetL( lanServiceRecordFrom->iIpNameServer1 ); + } + if( !lanServiceRecordFrom->iIpNameServer2.IsNull() ) + { + lanServiceRecordTo->iIpNameServer2.SetL( lanServiceRecordFrom->iIpNameServer2 ); + } + if( !lanServiceRecordFrom->iIp6DnsAddrFromServer.IsNull() ) + { + lanServiceRecordTo->iIp6DnsAddrFromServer.SetL( lanServiceRecordFrom->iIp6DnsAddrFromServer ); + } + if( !lanServiceRecordFrom->iIp6NameServer1.IsNull() ) + { + lanServiceRecordTo->iIp6NameServer1.SetL( lanServiceRecordFrom->iIp6NameServer1 ); + } + if( !lanServiceRecordFrom->iIp6NameServer2.IsNull() ) + { + lanServiceRecordTo->iIp6NameServer2.SetL( lanServiceRecordFrom->iIp6NameServer2 ); + } + if( !lanServiceRecordFrom->iIpAddrLeaseValidFrom.IsNull() ) + { + lanServiceRecordTo->iIpAddrLeaseValidFrom.SetL( lanServiceRecordFrom->iIpAddrLeaseValidFrom ); + } + if( !lanServiceRecordFrom->iIpAddrLeaseValidTo.IsNull() ) + { + lanServiceRecordTo->iIpAddrLeaseValidTo.SetL( lanServiceRecordFrom->iIpAddrLeaseValidTo ); + } + if( !lanServiceRecordFrom->iConfigDaemonManagerName.IsNull() ) + { + lanServiceRecordTo->iConfigDaemonManagerName.SetL( lanServiceRecordFrom->iConfigDaemonManagerName ); + } + if( !lanServiceRecordFrom->iConfigDaemonName.IsNull() ) + { + lanServiceRecordTo->iConfigDaemonName.SetL( lanServiceRecordFrom->iConfigDaemonName ); + } + + lanServiceRecordTo->SetElementId( lanServiceRecordFrom->ElementId() ); + + if ( !ServiceRecord().RecordId() ) + { + ServiceRecord().SetRecordId( KCDNewRecordRequest ); + ServiceRecord().StoreL( iSession ); + + // Update needed values to record tables too( lanservice and wlanservice ) + lanServiceRecordFrom->SetElementId( ServiceRecord().ElementId() ); + } + else + { + ServiceRecord().ModifyL( iSession ); + } + + OstTraceFunctionExit0( CCMPLUGINLAN_UPDATESERVICERECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::CreateBearerRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginLan::CreateBearerRecordsL() + { + OstTraceFunctionEntry0( CCMPLUGINLAN_CREATEBEARERRECORDSL_ENTRY ); + + OstTraceFunctionExit0( CCMPLUGINLAN_CREATEBEARERRECORDSL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginLan::LoadBearerRecordsL +// -------------------------------------------------------------------------- +// +void CCmPluginLan::LoadBearerRecordsL() + { + OstTraceFunctionEntry0( CCMPLUGINLAN_LOADBEARERRECORDSL_ENTRY ); + + OstTraceFunctionExit0( CCMPLUGINLAN_LOADBEARERRECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::ServiceRecord() +// --------------------------------------------------------------------------- +// +CCDLANServiceRecord& CCmPluginLan::ServiceRecord() const + { + OstTraceFunctionEntry0( CCMPLUGINLAN_SERVICERECORD_ENTRY ); + + return *static_cast( iServiceRecord ); + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::ServiceRecordIdLC +// --------------------------------------------------------------------------- +// +TUint32 CCmPluginLan::ServiceRecordId() const + { + OstTraceFunctionEntry0( CCMPLUGINLAN_SERVICERECORDID_ENTRY ); + + return ServiceRecord().RecordId(); + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::ServiceRecordNameLC +// --------------------------------------------------------------------------- +// +void CCmPluginLan::ServiceRecordNameLC( HBufC* &aName ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_SERVICERECORDNAMELC_ENTRY ); + + aName = TPtrC( KCDTypeNameLANService ).AllocLC(); + + OstTraceFunctionExit0( CCMPLUGINLAN_SERVICERECORDNAMELC_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::BearerRecordIdL() +// --------------------------------------------------------------------------- +// +void CCmPluginLan::BearerRecordIdL( TUint32& aRecordId ) + { + CCDLANBearerRecord* lanBearerRecord = static_cast + (CCDRecordBase::RecordFactoryL( KCDTIdLANBearerRecord )); + CleanupStack::PushL( lanBearerRecord ); + + lanBearerRecord->iRecordName.SetL( TPtrC( KLanBearerName ) ); + if ( !lanBearerRecord->FindL( iSession ) ) + { // bearer not found -> create dummy values + lanBearerRecord->SetRecordId( KCDNewRecordRequest ); + lanBearerRecord->iBearerAgent = KLanBearerAgent; + lanBearerRecord->iRecordName = KLanBearerName; + lanBearerRecord->iLanBearerNifName = KLanBearerNif; + + lanBearerRecord->iLanBearerLddFilename = KLanLDDFileName; + lanBearerRecord->iLanBearerLddName = KLanLDDName; + lanBearerRecord->iLanBearerPddFilename = KLanPDDFileName; + lanBearerRecord->iLanBearerPddName = KLanPDDName; + lanBearerRecord->iLanBearerPacketDriverName = KLanPacketDriverName; + lanBearerRecord->iLastSocketActivityTimeout = + (TUint32)KLanLastSocketActivityTimeout; + lanBearerRecord->iLastSessionClosedTimeout = + (TUint32)KLanLastSessionClosedTimeout; + lanBearerRecord->iLastSocketClosedTimeout = + (TUint32)KLanLastSocketClosedTimeout; + + lanBearerRecord->StoreL( iSession ); + } + + aRecordId = lanBearerRecord->RecordId(); + + CleanupStack::PopAndDestroy( lanBearerRecord ); + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::BearerRecordNameLC() +// --------------------------------------------------------------------------- +// +void CCmPluginLan::BearerRecordNameLC( HBufC*& aBearerName ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_BEARERRECORDNAMELC_ENTRY ); + + aBearerName = TPtrC( KCDTypeNameLANBearer ).AllocLC(); + + OstTraceFunctionExit0( CCMPLUGINLAN_BEARERRECORDNAMELC_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::GetBearerSpecificRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginLan::GetBearerSpecificRecordsL( + RPointerArray& /*aRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_GETBEARERSPECIFICRECORDSL_ENTRY ); + OstTraceFunctionExit0( CCMPLUGINLAN_GETBEARERSPECIFICRECORDSL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginLan::DeleteBearerRecordsL +// -------------------------------------------------------------------------- +// +void CCmPluginLan::DeleteBearerRecordsL() + { + OstTraceFunctionEntry0( CCMPLUGINLAN_DELETEBEARERRECORDSL_ENTRY ); + OstTraceFunctionExit0( CCMPLUGINLAN_DELETEBEARERRECORDSL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginLan::UpdateBearerRecordsL() +// ---------------------------------------------------------------------------- +// +void CCmPluginLan::UpdateBearerRecordsL( + RPointerArray& /*aGenRecordArray*/, + RPointerArray& /*aBearerSpecRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_UPDATEBEARERRECORDSL_ENTRY ); + OstTraceFunctionExit0( CCMPLUGINLAN_UPDATEBEARERRECORDSL_EXIT ); + } + +// --------------------------------------------------------- +// CCmPluginLan::ResetBearerRecords() +// --------------------------------------------------------- +// +void CCmPluginLan::ResetBearerRecords() + { + OstTraceFunctionEntry0( CCMPLUGINLAN_RESETBEARERRECORDS_ENTRY ); + OstTraceFunctionExit0( CCMPLUGINLAN_RESETBEARERRECORDS_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::SetDaemonNameL +// --------------------------------------------------------------------------- +// +void CCmPluginLan::SetDaemonNameL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_SETDAEMONNAMEL_ENTRY ); + + // we have to check first that these values has not been + // set(or changed) by any 3rd party sw to ensure that + // we don't break their settings + HBufC* daemonName = GetBearerStringAttributeL( ECmConfigDaemonManagerName, + aGenRecordArray, + aBearerSpecRecordArray ); + if ( daemonName ) + { + if ( daemonName->Compare( KDaemonManagerName ) != 0 ) + { + delete daemonName; + OstTraceFunctionExit1( CCMPLUGINWLAN_SETDAEMONNAMEL_EXIT, this ); + OstTraceFunctionExit0( CCMPLUGINLAN_SETDAEMONNAMEL_EXIT ); + return; + } + delete daemonName; + } + + // use DHCP if we can + TBool ipfromSrv = GetBearerBoolAttributeL( ECmIPAddFromServer, + aGenRecordArray, + aBearerSpecRecordArray ); + if ( ipfromSrv ) + { + SetBearerStringAttributeL( ECmConfigDaemonManagerName, + KDaemonManagerName, + aGenRecordArray, + aBearerSpecRecordArray ); + + SetBearerStringAttributeL( ECmConfigDaemonName, + KConfigDaemonName, + aGenRecordArray, + aBearerSpecRecordArray ); + + } + else + { + if ( FeatureManager::FeatureSupported( KFeatureIdIPv6 ) ) + { + SetBearerStringAttributeL( ECmConfigDaemonManagerName, + KDaemonManagerName, + aGenRecordArray, + aBearerSpecRecordArray ); + + SetBearerStringAttributeL( ECmConfigDaemonName, + KConfigDaemonName, + aGenRecordArray, + aBearerSpecRecordArray ); + } + else + { + SetBearerStringAttributeL( ECmConfigDaemonManagerName, + KNullDesC(), + aGenRecordArray, + aBearerSpecRecordArray ); + + SetBearerStringAttributeL( ECmConfigDaemonName, + KNullDesC(), + aGenRecordArray, + aBearerSpecRecordArray ); + } + } + OstTraceFunctionExit0( DUP1_CCMPLUGINLAN_SETDAEMONNAMEL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginLan::GetBearerIntAttributeL +// -------------------------------------------------------------------------- +// +TUint32 CCmPluginLan::GetBearerIntAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& /*aBearerSpecRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_GETBEARERINTATTRIBUTEL_ENTRY ); + + TUint32 retVal( 0 ); + + CCDLANServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + + switch ( aAttribute ) + { + case ECmInvalidAttribute: + { + retVal = 0; + } + break; + case ECmExtensionLevel: + { + retVal = KExtensionBaseLevel; + } + break; + case ECmCommsDBBearerType: + { + retVal = KCommDbBearerLAN; + } + break; + case ECmDefaultPriority: + { + retVal = KDefaultPriorityLAN; + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINLAN_GETBEARERINTATTRIBUTEL_EXIT ); + return retVal; + } + +// -------------------------------------------------------------------------- +// CCmPluginLan::GetBearerBoolAttributeL +// -------------------------------------------------------------------------- +// +TBool CCmPluginLan::GetBearerBoolAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& /*aBearerSpecRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_GETBEARERBOOLATTRIBUTEL_ENTRY ); + + TBool retVal( 0 ); + + CCDLANServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + + switch ( aAttribute ) + { + case ECmCoverage: + { + retVal = ETrue; + } + break; + case ECmDestination: + { + retVal = EFalse; + } + break; + case ECmBearerHasUi: + { + retVal = EFalse; + } + break; + case ECmIPv6Supported: + { + retVal = FeatureManager::FeatureSupported( KFeatureIdIPv6 ); + } + break; + case ECmIPAddFromServer: + case ELanIpAddrFromServer: + { + retVal = serviceRecord->iIpAddrFromServer; + } + break; + case ECmIPDNSAddrFromServer: + case ELanIpDNSAddrFromServer: + { + retVal = serviceRecord->iIpDnsAddrFromServer; + } + break; + case ECmIP6DNSAddrFromServer: + case ELanIp6DNSAddrFromServer: + { + retVal = serviceRecord->iIp6DnsAddrFromServer; + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINLAN_GETBEARERBOOLATTRIBUTEL_EXIT ); + return retVal; + } + +// -------------------------------------------------------------------------- +// CCmPluginLan::GetBearerStringAttributeL +// -------------------------------------------------------------------------- +// +HBufC* CCmPluginLan::GetBearerStringAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& /*aBearerSpecRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_GETBEARERSTRINGATTRIBUTEL_ENTRY ); + + HBufC* retVal = NULL; + + CCDLANServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + + switch ( aAttribute ) + { + case ECmIFNetworks: + case ELanIfNetworks: + { + if ( !serviceRecord->iIfNetworks.IsNull() ) + { + retVal = TPtrC( serviceRecord->iIfNetworks ).AllocL(); + } + } + break; + case ECmIPNetmask: + case ELanIpNetMask: + { + if ( !serviceRecord->iIpNetmask.IsNull() ) + { + retVal = TPtrC( serviceRecord->iIpNetmask ).AllocL(); + } + } + break; + case ECmIPGateway: + case ELanIpGateway: + { + if ( !serviceRecord->iIpGateway.IsNull() ) + { + retVal = TPtrC( serviceRecord->iIpGateway ).AllocL(); + } + } + break; + case ECmIPAddress: + case ELanIpAddr: + { + if ( !serviceRecord->iIpAddr.IsNull() ) + { + retVal = TPtrC( serviceRecord->iIpAddr ).AllocL(); + } + } + break; + case ECmIPNameServer1: + case ELanIpNameServer1: + { + if ( !serviceRecord->iIpNameServer1.IsNull() ) + { + retVal = TPtrC( serviceRecord->iIpNameServer1 ).AllocL(); + } + } + break; + case ECmIPNameServer2: + case ELanIpNameServer2: + { + if ( !serviceRecord->iIpNameServer2.IsNull() ) + { + retVal = TPtrC( serviceRecord->iIpNameServer2 ).AllocL(); + } + } + break; + case ECmIP6NameServer1: + case ELanIp6NameServer1: + { + if ( !serviceRecord->iIp6NameServer1.IsNull() ) + { + retVal = TPtrC( serviceRecord->iIp6NameServer1 ).AllocL(); + } + } + break; + case ECmIP6NameServer2: + case ELanIp6NameServer2: + { + if ( !serviceRecord->iIp6NameServer2.IsNull() ) + { + retVal = TPtrC( serviceRecord->iIp6NameServer2 ).AllocL(); + } + } + break; + case ECmIPAddrLeaseValidFrom: + case ELanIpAddrLeaseValidFrom: + { + if ( !serviceRecord->iIpAddrLeaseValidFrom.IsNull() ) + { + retVal = TPtrC( serviceRecord->iIpAddrLeaseValidFrom ).AllocL(); + } + } + break; + case ECmIPAddrLeaseValidTo: + case ELanIpAddrLeaseValidTo: + { + if ( !serviceRecord->iIpAddrLeaseValidTo.IsNull() ) + { + retVal = TPtrC( serviceRecord->iIpAddrLeaseValidTo ).AllocL(); + } + } + break; + case ECmConfigDaemonManagerName: + case ELanConfigDaemonManagerName: + { + if ( !serviceRecord->iConfigDaemonManagerName.IsNull() ) + { + retVal = TPtrC( serviceRecord->iConfigDaemonManagerName ).AllocL(); + } + } + break; + case ECmConfigDaemonName: + case ELanConfigDaemonName: + { + if ( !serviceRecord->iConfigDaemonName.IsNull() ) + { + retVal = TPtrC( serviceRecord->iConfigDaemonName ).AllocL(); + } + } + break; + case ELanServiceExtensionTableName: + { + if ( !serviceRecord->iServiceExtensionTableName.IsNull() ) + { + retVal = TPtrC( serviceRecord->iServiceExtensionTableName ).AllocL(); + } + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINLAN_GETBEARERSTRINGATTRIBUTEL_EXIT ); + return retVal; + } + +// -------------------------------------------------------------------------- +// CCmPluginLan::GetBearerString8AttributeL +// -------------------------------------------------------------------------- +// +HBufC8* CCmPluginLan::GetBearerString8AttributeL( + TUint32 aAttribute, + RPointerArray& /*aGenRecordArray*/, + RPointerArray& /*aBearerSpecRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_GETBEARERSTRING8ATTRIBUTEL_ENTRY ); + + HBufC8* retVal( NULL ); + + switch ( aAttribute ) + { + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINLAN_GETBEARERSTRING8ATTRIBUTEL_EXIT ); + return retVal; + } + +// -------------------------------------------------------------------------- +// CCmPluginLan::SetBearerIntAttributeL +// -------------------------------------------------------------------------- +// +void CCmPluginLan::SetBearerIntAttributeL( + TUint32 aAttribute, + TUint32 /*aValue*/, + RPointerArray& /*aGenRecordArray*/, + RPointerArray& /*aBearerSpecRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_SETBEARERINTATTRIBUTEL_ENTRY ); + + switch ( aAttribute ) + { + case ECmExtensionLevel: + case ECmCommsDBBearerType: + case ECmDefaultUiPriority: + case ECmDefaultPriority: + { + User::Leave( KErrArgument ); + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINLAN_SETBEARERINTATTRIBUTEL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginLan::SetBearerBoolAttributeL +// -------------------------------------------------------------------------- +// +void CCmPluginLan::SetBearerBoolAttributeL( + TUint32 aAttribute, + TBool aValue, + RPointerArray& aGenRecordArray, + RPointerArray& /*aBearerSpecRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_SETBEARERBOOLATTRIBUTEL_ENTRY ); + + CCDLANServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + + switch ( aAttribute ) + { + case ECmIPAddFromServer: + case ELanIpAddrFromServer: + { + serviceRecord->iIpAddrFromServer.SetL( aValue ); + } + break; + case ECmIPDNSAddrFromServer: + case ELanIpDNSAddrFromServer: + { + serviceRecord->iIpDnsAddrFromServer.SetL( aValue ); + } + break; + case ECmIP6DNSAddrFromServer: + case ELanIp6DNSAddrFromServer: + { + serviceRecord->iIp6DnsAddrFromServer.SetL( aValue ); + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINLAN_SETBEARERBOOLATTRIBUTEL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginLan::SetBearerStringAttributeL +// -------------------------------------------------------------------------- +// +void CCmPluginLan::SetBearerStringAttributeL( + TUint32 aAttribute, + const TDesC16& aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_SETBEARERSTRINGATTRIBUTEL_ENTRY ); + + CCDLANServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + + switch ( aAttribute ) + { + case ECmIFNetworks: + case ELanIfNetworks: + { + serviceRecord->iIfNetworks.SetL( aValue ); + } + break; + case ECmIPNetmask: + case ELanIpNetMask: + { + serviceRecord->iIpNetmask.SetL( aValue ); + } + break; + case ECmIPGateway: + case ELanIpGateway: + { + serviceRecord->iIpGateway.SetL( aValue ); + } + break; + case ECmIPAddress: + case ELanIpAddr: + { + if ( ( aValue.Compare( KUnspecifiedIPv4 ) == 0 ) || + ( aValue.Compare( KNullDesC ) == 0 ) ) + { + // If unspecified or NULL address is set dynamic + // IP must be enabled. + SetBearerBoolAttributeL( ECmIPAddFromServer, + ETrue, + aGenRecordArray, + aBearerSpecRecordArray ); + } + else + { + // If valid address is set dynamic IP is disabled. + SetBearerBoolAttributeL( ECmIPAddFromServer, + EFalse, + aGenRecordArray, + aBearerSpecRecordArray ); + } + serviceRecord->iIpAddr.SetL( aValue ); + } + break; + case ECmIPNameServer1: + case ELanIpNameServer1: + { + serviceRecord->iIpNameServer1.SetL( aValue ); + } + break; + case ECmIPNameServer2: + case ELanIpNameServer2: + { + serviceRecord->iIpNameServer2.SetL( aValue ); + } + break; + case ECmIP6NameServer1: + case ELanIp6NameServer1: + { + serviceRecord->iIp6NameServer1.SetL( aValue ); + } + break; + case ECmIP6NameServer2: + case ELanIp6NameServer2: + { + serviceRecord->iIp6NameServer2.SetL( aValue ); + } + break; + case ECmIPAddrLeaseValidFrom: + case ELanIpAddrLeaseValidFrom: + { + serviceRecord->iIpAddrLeaseValidFrom.SetL( aValue ); + } + break; + case ECmIPAddrLeaseValidTo: + case ELanIpAddrLeaseValidTo: + { + serviceRecord->iIpAddrLeaseValidTo.SetL( aValue ); + } + break; + case ECmConfigDaemonManagerName: + case ELanConfigDaemonManagerName: + { + serviceRecord->iConfigDaemonManagerName.SetL( aValue ); + } + break; + case ECmConfigDaemonName: + case ELanConfigDaemonName: + { + serviceRecord->iConfigDaemonName.SetL( aValue ); + } + break; + case ELanServiceExtensionTableName: + { + serviceRecord->iServiceExtensionTableName.SetL( aValue ); + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINLAN_SETBEARERSTRINGATTRIBUTEL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginLan::SetBearerString8AttributeL +// -------------------------------------------------------------------------- +// +void CCmPluginLan::SetBearerString8AttributeL( + TUint32 aAttribute, + const TDesC8& /*aValue*/, + RPointerArray& /*aGenRecordArray*/, + RPointerArray& /*aBearerSpecRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_SETBEARERSTRING8ATTRIBUTEL_ENTRY ); + + switch ( aAttribute ) + { + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINLAN_SETBEARERSTRING8ATTRIBUTEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::GetBearerInfoIntL +// --------------------------------------------------------------------------- +// +TUint32 CCmPluginLan::GetBearerInfoIntL( TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( CCMPLUGINLAN_GETBEARERINFOINTL_ENTRY ); + + TUint32 retVal( 0 ); + switch ( aAttribute ) + { + case ECmBearerType: + { + retVal = iBearerType; + } + break; + case ECmCommsDBBearerType: + { + retVal = KCommDbBearerLAN; + } + break; + case ECmDefaultUiPriority: + case ECmDefaultPriority: + { + retVal = KDefaultPriorityLAN; + } + break; + case ECmExtensionLevel: + { + retVal = KExtensionBaseLevel; + } + break; + case ECmSeamlessnessLevel: + { + retVal = ESeamlessnessShowprogress; + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINLAN_GETBEARERINFOINTL_EXIT ); + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::GetBearerInfoBoolL +// --------------------------------------------------------------------------- +// +TBool CCmPluginLan::GetBearerInfoBoolL( TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( CCMPLUGINLAN_GETBEARERINFOBOOLL_ENTRY ); + + TBool retVal( EFalse ); + + switch ( aAttribute ) + { + case ECmCoverage: + { +#ifndef __WINS__ + retVal = EFalse; +#else + retVal = ETrue; +#endif + } + break; + case ECmDestination: + { + retVal = EFalse; + } + break; + case ECmBearerHasUi: + { + retVal = EFalse; + } + break; + case ECmIPv6Supported: + { + retVal = FeatureManager::FeatureSupported( KFeatureIdIPv6 ); + } + break; + case ECmVirtual: + { + retVal = EFalse; + } + break; + + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINLAN_GETBEARERINFOBOOLL_EXIT ); + return retVal; + } + + +// --------------------------------------------------------------------------- +// CCmPluginLan::GetBearerInfoStringL +// --------------------------------------------------------------------------- +// +HBufC* CCmPluginLan::GetBearerInfoStringL( TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( CCMPLUGINLAN_GETBEARERINFOSTRINGL_ENTRY ); + + HBufC* retVal( NULL ); + switch ( aAttribute ) + { + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINLAN_GETBEARERINFOSTRINGL_EXIT ); + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::GetBearerInfoString8L +// --------------------------------------------------------------------------- +// +HBufC8* CCmPluginLan::GetBearerInfoString8L( TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( CCMPLUGINLAN_GETBEARERINFOSTRING8L_ENTRY ); + + HBufC8* retVal( NULL ); + switch ( aAttribute ) + { + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINLAN_GETBEARERINFOSTRING8L_EXIT ); + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::CopyBearerRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginLan::CopyBearerRecordsL( CCmPluginBaseEng* /*aCopyInstance*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINLAN_COPYBEARERRECORDSL_ENTRY ); + OstTraceFunctionExit0( CCMPLUGINLAN_COPYBEARERRECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginLan::GetBearerTableIdsToBeObserved +// --------------------------------------------------------------------------- +// +void CCmPluginLan::GetBearerTableIdsToBeObservedL( + RArray& aTableIdArray ) const + { + OstTraceFunctionEntry0( CCMPLUGINLAN_GETBEARERTABLEIDSTOBEOBSERVED_ENTRY ); + + aTableIdArray.AppendL( KCDTIdLANServiceRecord ); + + OstTraceFunctionExit0( CCMPLUGINLAN_GETBEARERTABLEIDSTOBEOBSERVED_EXIT ); + } + +// End of File diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginlan/src/cmpluginlanproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginlan/src/cmpluginlanproxy.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 Lan Plugin proxy table +* +* +*/ + + +#include "cmpluginlan.h" +#include +#include + +// Exported proxy for instantiation method resolution +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KUidLanBearerType, CCmPluginLan::NewL) + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginlan/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginlan/traces/OstTraceDefinitions.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler +// REMOVE BEFORE CHECK-IN TO VERSION CONTROL +// #define OST_TRACE_COMPILER_IN_USE +#include +#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginlan/traces/fixed_id.definitions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginlan/traces/fixed_id.definitions Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,21 @@ +#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt. +[GROUP]TRACE_FLOW=0x7 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_ADDITIONALRESET_ENTRY=0x11 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_ADDITIONALRESET_EXIT=0x12 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_CANHANDLEIAPIDL_ENTRY=0xd +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_CANHANDLEIAPIDL_EXIT=0xe +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_CCMPLUGINLAN_ENTRY=0x5 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_CCMPLUGINLAN_EXIT=0x6 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_CONSTRUCTL_ENTRY=0x9 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_CONSTRUCTL_EXIT=0xa +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_CREATEINSTANCEL_ENTRY=0x3 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_CREATEINSTANCEL_EXIT=0x4 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_NEWL_ENTRY=0x1 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_NEWL_EXIT=0x2 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_SETDAEMONNAMEL_EXIT=0x13 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINLAN_CANHANDLEIAPIDL_ENTRY=0xf +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINLAN_CANHANDLEIAPIDL_EXIT=0x10 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINLAN_CCMPLUGINLAN_ENTRY=0x7 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINLAN_CCMPLUGINLAN_EXIT=0x8 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_GETINTATTRIBUTEL_ENTRY=0xb +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMPLUGINLAN_GETINTATTRIBUTEL_EXIT=0xc diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/data/1020737C.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/data/1020737C.rss Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Resource definitions for project cmpluginpacketdata +* +*/ + +#include "ecom/RegistryInfo.rh" + +// Because attribute enums had to be added to namespace CMManager +// it's not possible to included cmpluginpacketdatadef.h. +// Thus bearer type id had to be redefine here. +#define KPacketDataBearerType 0x10207378 + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x1020737C; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207377; // = KCMPluginInterfaceUid + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KPacketDataBearerType; + version_no = 1; + display_name = "Packet Data"; + default_data = "PacketData"; + opaque_data = ""; + } + }; + } + }; + } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/group/bld.inf Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Build information file for project cmpluginpacketdata +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// export iby files +../Rom/cmmpluginpacketdata.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cmmpluginpacketdata.iby) + +PRJ_MMPFILES +cmpluginpacketdata.mmp + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/group/cmpluginpacketdata.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/group/cmpluginpacketdata.mmp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Project definition file for project cmpluginpacketdata +* +*/ + +#include +#include + +TARGET cmpluginpacketdata.dll +UID 0x10009D8D 0x1020737C + +TARGETTYPE PLUGIN + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src + +SOURCE cmpluginpacketdataproxy.cpp +SOURCE cmpluginpacketdata.cpp + +SOURCEPATH ../Data + +START RESOURCE 1020737C.rss +TARGET cmpluginpacketdata.rsc +END + +//USERINCLUDE ../../../Framework/SrcData +USERINCLUDE ../data + +// Component specific internal headers +USERINCLUDE ../inc +USERINCLUDE ../traces + +// ADO specific internal headers +SYSTEMINCLUDE ../../../../../inc + +//Macro to /epoc32 headers +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY cmmpluginbase.lib +LIBRARY commsdat.lib +LIBRARY etel.lib +LIBRARY etelpckt.lib +LIBRARY featmgr.lib +LIBRARY centralrepository.lib diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/inc/cmpluginpacketdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/inc/cmpluginpacketdata.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,443 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 packetdata interface implementation +* for "Packetdata" plugin +* +*/ + +#ifndef PACKETDATA_PLUGIN_H +#define PACKETDATA_PLUGIN_H + +#include +#include + +/** +* CCmPluginPacketData defines the functionality of packetdata bearer support. +* Most of the API is inherited from CCmPluginBaseEng class. +*/ +NONSHARABLE_CLASS( CCmPluginPacketData ) : public CCmPluginBaseEng + { + + public: + /** + * Two phased constructor. + * @return Returns the packetdata plugin object. + */ + static CCmPluginPacketData* NewL( TCmPluginInitParam* aInitParam ); + + /** + * Destructor. + */ + virtual ~CCmPluginPacketData(); + + public: // From CCmPluginBaseEng + /** + * Creates a new instance of packetdata bearer plugin. The instance + * created represents a bearer, not a connection method. + * @param aInitParam Initialization data. + * @return Returns CCmPluginBaseEng type pointer which represents pure + * bearer instance for the cmm server. + */ + virtual CCmPluginBaseEng* CreateInstanceL( + TCmPluginInitParam& aInitParam ) const; + + /** + * Following GetBearerInfoXXXL methods return the values of the + * requested attributes. These values are packetdata specific + * so they don't vary between packetdata Connection Methods. + * @param aAttribute An attribute identifier. + * @return Returns the value requested. If not found leaves with + * KErrNotFound error code. + */ + + virtual TUint32 GetBearerInfoIntL( TUint32 aAttribute ) const; + + virtual TBool GetBearerInfoBoolL( TUint32 aAttribute ) const; + + virtual HBufC* GetBearerInfoStringL( TUint32 aAttribute ) const; + + virtual HBufC8* GetBearerInfoString8L( TUint32 aAttribute ) const; + + /** + * Checks if the plug-in can handle the Connection Method identified + * with parameter aIapId. + * @param aIapId IAPId of the Connection Method to be checked. + * @return ETrue if plug-in can handle the IAP, otherwise EFalse. + */ + virtual TBool CanHandleIapIdL( TUint32 aIapId ) const; + + /** + * Checks if the plug-in can handle the given IAP record. + * @param aIapRecord IAP record to be checked + * @return ETrue if plug-in can handle the IAP, otherwise EFalse. + */ + virtual TBool CanHandleIapIdL( + CommsDat::CCDIAPRecord *aIapRecord ) const; + + public: // From CCmPluginBaseEng concerning a Connection Method + /** + * Before generic side starts to request plugins to load records + * it calls this to give a possibility make some preparations + * if needed. + */ + virtual void PreparePluginToLoadRecordsL(); + + /** + * Before generic side starts to request plugins to update records + * it calls this to give a possibility make some preparations + * if needed. + * @param aGenRecordArray An array of generic records to be updated. + * @param aBearerSpecRecordArray An array of bearer specific records + * to be updated. + */ + virtual void PreparePluginToUpdateRecordsL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Creates the CCDWCDMAPacketServiceRecord type service record. + */ + virtual void CreateServiceRecordL(); + + /** + * Loads the service record. Service record pointer is stored to + * plugins generic side implementation(CCmPluginBaseEng). + */ + virtual void LoadServiceRecordL(); + + /** + * Returns the service record id of this Connection Method. + * @return Returns the id of the service record id of this Connection Method. + */ + virtual TUint32 ServiceRecordId() const; + + /** + * Returns the service record name of the Connection Method. + * @param aServiceName Name of the service record which CM's iap record + * points to. + */ + virtual void ServiceRecordNameLC( HBufC* &aServiceName ); + + /** + * Writes the service record data to CommsDat. + * @param aGenRecordArray An array containing pointers to service + * record of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records of the Connection Method. + */ + virtual void UpdateServiceRecordL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Creates packetdata specific default records. + */ + virtual void CreateBearerRecordsL(); + + /** + * Loads packetdata specific records of the Connection Method. + */ + virtual void LoadBearerRecordsL(); + + /** + * Returns the bearer record id of the Connection Method. + * @param aRecordId Id of the bearer record this CM's iap record + * points to. + */ + virtual void BearerRecordIdL( TUint32& aRecordId ); + + /** + * Returns the bearer record name of the Connection Method. + * @param aBearerName Name of the bearer record this CM's iap record + * points to. + */ + virtual void BearerRecordNameLC( HBufC* &aBearerName ); + + /** + * Writes packetdata specific record data to CommsDat. + * @param aGenRecordArray An array containing pointers to generic records + * of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records to be written. + */ + virtual void UpdateBearerRecordsL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Deletes packetdata specific records of the Connection Method. + */ + void DeleteBearerRecordsL(); + + /** + * Releases the memory reserved by the packetdata specific records + * of the Connection Method. + */ + virtual void ResetBearerRecords(); + + /** + * Creates a copy of packetdata specific records and adds them to + * aRecordArray. + */ + virtual void GetBearerSpecificRecordsL( + RPointerArray& aRecordArray ); + + /** + * Following GetBearerXXXXAttribute methods get only the + * fields in records in pointer arrays(parameters). + * @param aAttribute Identifier of the requested value. + * @param aGenRecordArray An array containing pointers to generic + * records of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records of the Connection Method. aAttribute + * parameter should identify one field(integer, boolean string) + * in one of these records. + * @return Returns the requested value. In error case leaves with + * system-wide error code. + */ + + virtual TUint32 GetBearerIntAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual TBool GetBearerBoolAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + + virtual HBufC* GetBearerStringAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual HBufC8* GetBearerString8AttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Following SetBearerXXXXAttribute methods set only the + * fields in records in pointer arrays(parameters). They are not + * allowed to update the original records in plugins. + * @param aAttribute Identifier of the field to set. + * @param aValue The value to set. + * @param aGenRecordArray An array containing pointers to generic + * records of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records of the Connection Method. aAttribute + * parameter should identify one field(integer, boolean string) + * in one of these records. + * @return None. + */ + + virtual void SetBearerIntAttributeL( + TUint32 aAttribute, TUint32 aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual void SetBearerBoolAttributeL( + TUint32 aAttribute, TBool aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual void SetBearerStringAttributeL( + TUint32 aAttribute, const TDesC16& aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual void SetBearerString8AttributeL( + TUint32 aAttribute, const TDesC8& aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Bearer is requested by the server if it uses CommsDat tables which + * should be observed for possible changes to be able to keep the + * data in memory in up to date. + * @param aTableIdArray A reference to an array where to add those + * table ids. + */ + virtual void GetBearerTableIdsToBeObservedL( + RArray& aTableIdArray ) const; + + private: // Constructors + + /** + * Constructor + */ + CCmPluginPacketData( + TCmPluginInitParam* aInitParam, + TBool aOutgoing ); + + /** + * Second phase constructor + */ + void ConstructL(); + + private: + /** + * Adds Service record with default values to record array. + * @param aRecordArray The array where to add the service record. + */ + void GetDefaultServiceRecordL( + RPointerArray& aRecordArray ); + + /** + * Adds QoS record with default values to record array. + * @param aRecordArray The array where to add the QoS record. + */ + void GetDefaultQosRecordL( + RPointerArray& aRecordArray ); + + /** + * Returns a reference to service record of the Connection Method. + */ + CommsDat::CCDWCDMAPacketServiceRecord& ServiceRecord() const; + + /** + * Makes needed preparations before copying records. + * @param aCopyInstance Instance of the plugin where to copy. + */ + virtual void PrepareToCopyDataL( CCmPluginBaseEng* aCopyInstance ); + + /** + * Copies the service record. + * @return Returns a pointer to service record created. + */ + CommsDat::CCDRecordBase* CopyServiceRecordL(); + + /** + * Copies the bearer specific records to copy instance. + * @param aCopyInstance Instance of the plugin where to copy. + */ + virtual void CopyBearerRecordsL( CCmPluginBaseEng* aCopyInstance ); + + + /** + * Gets an integer value from service record. + * @param aAttribute An indentifier to know the field in the record. + * @param aGenRecordArray Array of records where the service record + * can be found. + * @return Returns an integer if the requested attribute + * is found. Otherwise leaves with error code KErrNotFound. + */ + TUint32 GetServiceIntAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray ); + + /** + * Gets a string value from service record. Ownership of the return + * value is passed to the caller. + * @param aAttribute An indentifier to know the field in the record. + * @param aGenRecordArray Array of records where the service record + * can be found. + * @return Returns a pointer to an buffer if the requested attribute + * is found. Otherwise leaves with error code KErrNotFound. + */ + HBufC* GetServiceStringAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray ); + + /** + * Sets integer value to service record. + * @param aAttribute An indentifier to know the field in the record. + * @param aValue A value to set. + * @param aGenRecordArray Array of records where the service record + * can be found. + */ + void SetServiceIntAttributeL( + TUint32 aAttribute, + TUint32 aValue, + RPointerArray& aGenRecordArray ); + + /** + * Gets an integer value from packetdata specific record. + * @param aAttribute An indentifier to know the field in the record. + * @param aBearerSpecRecordArray Array of records where the service + * record can be found. + * @return Returns an integer if the requested attribute + * is found. Otherwise leaves with error code KErrNotFound. + */ + TUint32 GetQosIntAttributeL( + TUint32 aAttribute, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Sets an integer value to packetdata specific record. + * @param aAttribute An indentifier to know the field in the record. + * @param aValue The value to be set. + * @param aBearerSpecRecordArray Array of records where the service + * record can be found. + * @return Returns an integer if the requested attribute + * is found. Otherwise leaves with error code KErrNotFound. + */ + void SetQosIntAttributeL( + TUint32 aAttribute, + TUint32 aValue, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Sets the PDP-type. + * @param aPdpType Pdp type to set. + * @param aServiceRecord Pointer to the service record where to save the + * pdp type. + */ + void SetPDPTypeL( RPacketContext::TProtocolType aPdpType, + CommsDat::CCDWCDMAPacketServiceRecord* aServiceRecord ); + + /** + * Sets the daemon name for the Connection Method. + * @param aGenRecordArray An array containing pointers to generic records + * of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records of the Connection Method. + */ + void SetDaemonNameL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + private: + /** + * Checks if the packetdata network is available. + * @return Returns ETrue if the network is available. Otherwise returns + * EFalse. + */ + TBool CheckNetworkCoverageL() const; + + private: // Data + /** + * Boolean to define if this is outgoing or incoming packetdata cm. + */ + TBool iOutgoing; + + /** + * Id of the bearer record of the iap. + */ + TUint32 iBearerRecordId; + + /** + * Name of the bearer record of the iap. + */ + HBufC* iBearerRecordName; + + /** + * pointer to the QoS record of the iap. + */ + CommsDat::CCDUmtsR99QoSAndOnTableRecord* iPacketDataQoSRecord; + }; + +#endif // PACKETDATA_PLUGIN_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/rom/cmmpluginpacketdata.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/rom/cmmpluginpacketdata.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* cmpluginpacketdata.dll to ROM. +* +*/ +#ifndef CMMPLUGINPACKETDATA_IBY__ +#define CMMPLUGINPACKETDATA_IBY__ + +ECOM_PLUGIN(cmpluginpacketdata.dll,1020737C.rsc) + + +#endif // CMMPLUGINPACKETDATA_IBY__ + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/src/cmpluginpacketdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/src/cmpluginpacketdata.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,2974 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 packetdata Plugin interface. +* +*/ + + +#include +#include +#include +#include + +#include "cmpluginpacketdata.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmpluginpacketdataTraces.h" +#endif + +using namespace CMManager; +using namespace CommsDat; + +// ================= CONSTANTS ======================= + +const TUint32 KDefaultPriorityPacketData = 1; + +/// Modem bearer names for GPRS/WCDMA Access Points +_LIT( KModemBearerPacketData, "GPRS Modem" ); +_LIT( KDefaultQosDataRecordName, "PRIMARY1" ); +_LIT( KDefaultQosDataRecordNamewithSpace, "PRIMARY1 " ); + +const TInt KQosRecordIndex = 0; + +// ======== MEMBER FUNCTIONS ======== +/** +* CCmPDCoverageCheck defines the functionality for packetdata service +* coverage checking. +*/ +class CCmPDCoverageCheck : public CActive + { + public: + /** + * Constructor. + */ + CCmPDCoverageCheck(); + + /** + * Destructor. + */ + ~CCmPDCoverageCheck(); + + /** + * Checks if the packet service is available(status is + * ERegisteredOnHomeNetwork or ERegisteredRoaming or + * ENotRegisteredButAvailable) + * @return Return ETrue if the status is one mentioned above. + * Otherwise returns EFalse. + */ + TBool IsThereCoverageL(); + + protected: // from CActive + virtual void DoCancel(); + virtual void RunL(); + + private: + /** + * Ckecks if the phode mode is offline. + * @return Returns ETrue if the phone is in offline mode. + * Otherwise returns EFalse. + */ + TBool IsPhoneOfflineL() const; + + private: + /** Boolean which has the latest coverage information */ + TBool iCoverage; + + /** Controller for single scheduling loop */ + CActiveSchedulerWait iWait; + + /** Handle to telephony server */ + RTelServer iServer; + + /** Handle to phone(needed for packet service) */ + RPhone iPhone; + + /** Handle to packet service */ + RPacketService iService; + + /** Network registration status information */ + RPacketService::TRegistrationStatus iNwRegStatus; + }; + +// ---------------------------------------------------------------------------- +// CCmPDCoverageCheck::CCmPDCoverageCheck() +// ---------------------------------------------------------------------------- +// +CCmPDCoverageCheck::CCmPDCoverageCheck() : CActive( EPriorityStandard ) + { + OstTraceFunctionEntry0( CCMPDCOVERAGECHECK_CCMPDCOVERAGECHECK_ENTRY ); + + CActiveScheduler::Add( this ); + + OstTraceFunctionExit0( CCMPDCOVERAGECHECK_CCMPDCOVERAGECHECK_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPDCoverageCheck::~CCmPDCoverageCheck() +// ---------------------------------------------------------------------------- +// +CCmPDCoverageCheck::~CCmPDCoverageCheck() + { + OstTraceFunctionEntry0( DUP1_CCMPDCOVERAGECHECK_CCMPDCOVERAGECHECK_ENTRY ); + + Cancel(); + + iService.Close(); + iPhone.Close(); + iServer.Close(); + + OstTraceFunctionExit0( DUP1_CCMPDCOVERAGECHECK_CCMPDCOVERAGECHECK_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPDCoverageCheck::DoCancel +// ---------------------------------------------------------------------------- +// +void CCmPDCoverageCheck::DoCancel() + { + OstTraceFunctionEntry0( CCMPDCOVERAGECHECK_DOCANCEL_ENTRY ); + + iWait.AsyncStop(); + + OstTraceFunctionExit0( CCMPDCOVERAGECHECK_DOCANCEL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPDCoverageCheck::RunL +// ---------------------------------------------------------------------------- +// +void CCmPDCoverageCheck::RunL() + { + OstTraceFunctionEntry0( CCMPDCOVERAGECHECK_RUNL_ENTRY ); + + if ( iStatus.Int() == KErrNone ) + { + if ( iNwRegStatus == RPacketService::ERegisteredOnHomeNetwork || + iNwRegStatus == RPacketService::ERegisteredRoaming || + iNwRegStatus == RPacketService::ENotRegisteredButAvailable ) + { + iCoverage = ETrue; + } + iWait.AsyncStop(); + } + else + // something went wrong -> no coverage. + { + iWait.AsyncStop(); + } + + OstTraceFunctionExit0( CCMPDCOVERAGECHECK_RUNL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPDCoverageCheck::IsThereCoverageL +// ---------------------------------------------------------------------------- +// +TBool CCmPDCoverageCheck::IsThereCoverageL() + { + OstTraceFunctionEntry0( CCMPDCOVERAGECHECK_ISTHERECOVERAGEL_ENTRY ); + + iCoverage = EFalse; + + if ( !IsPhoneOfflineL() ) + { + User::LeaveIfError( iServer.Connect() ); + + RTelServer::TPhoneInfo info; + User::LeaveIfError( iServer.GetPhoneInfo( 0, info ) ); + + User::LeaveIfError( iPhone.Open(iServer, info.iName ) ); + + User::LeaveIfError( iService.Open( iPhone ) ); + + iService.GetNtwkRegStatus( iStatus, iNwRegStatus ); + SetActive(); + iWait.Start(); + + User::LeaveIfError( iStatus.Int() ); + } + + OstTraceFunctionExit0( CCMPDCOVERAGECHECK_ISTHERECOVERAGEL_EXIT ); + return iCoverage; + } + +// ---------------------------------------------------------------------------- +// CCmPDCoverageCheck::IsPhoneOfflineL +// ---------------------------------------------------------------------------- +// +TBool CCmPDCoverageCheck::IsPhoneOfflineL() const + { + OstTraceFunctionEntry0( CCMPDCOVERAGECHECK_ISPHONEOFFLINEL_ENTRY ); + + if ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) ) + { + CRepository* repository = CRepository::NewLC( KCRUidCoreApplicationUIs ); + TInt connAllowed( ECoreAppUIsNetworkConnectionAllowed ); + + repository->Get( KCoreAppUIsNetworkConnectionAllowed, connAllowed ); + CleanupStack::PopAndDestroy( repository ); + + if ( !connAllowed ) + { + OstTraceFunctionExit0( CCMPDCOVERAGECHECK_ISPHONEOFFLINEL_EXIT ); + return ETrue; + } + } + + OstTraceFunctionExit0( DUP1_CCMPDCOVERAGECHECK_ISPHONEOFFLINEL_EXIT ); + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::NewL +// ---------------------------------------------------------------------------- +// +CCmPluginPacketData* CCmPluginPacketData::NewL( + TCmPluginInitParam* aInitParam ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_NEWL_ENTRY ); + + CCmPluginPacketData* self = new( ELeave ) CCmPluginPacketData( aInitParam, ETrue ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_NEWL_EXIT ); + return self; + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::~CCmPluginPacketData +// ---------------------------------------------------------------------------- +// +CCmPluginPacketData::~CCmPluginPacketData() + { + OstTraceFunctionEntry1( CCMPLUGINPACKETDATA_CCMPLUGINPACKETDATA_ENTRY, this ); + + ResetBearerRecords(); + + FeatureManager::UnInitializeLib(); + + OstTraceFunctionExit1( CCMPLUGINPACKETDATA_CCMPLUGINPACKETDATA_EXIT, this ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::CreateInstanceL +// ---------------------------------------------------------------------------- +// +CCmPluginBaseEng* CCmPluginPacketData::CreateInstanceL( TCmPluginInitParam& aInitParam ) const + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_CREATEINSTANCEL_ENTRY ); + + CCmPluginPacketData* self = new( ELeave ) CCmPluginPacketData( &aInitParam, ETrue ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_CREATEINSTANCEL_EXIT ); + return self; + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::CCmPluginPacketData +// ---------------------------------------------------------------------------- +// +CCmPluginPacketData::CCmPluginPacketData( + TCmPluginInitParam* aInitParam, + TBool aOutgoing ) + : + CCmPluginBaseEng( aInitParam ), + iOutgoing( aOutgoing ) + { + OstTraceFunctionEntry0( DUP1_CCMPLUGINPACKETDATA_CCMPLUGINPACKETDATA_ENTRY ); + + iBearerType = KUidPacketDataBearerType; + iBearerRecordId = 0; + iBearerRecordName = NULL; + iPacketDataQoSRecord = NULL; + + OstTraceFunctionExit0( DUP1_CCMPLUGINPACKETDATA_CCMPLUGINPACKETDATA_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::ConstructL +// ---------------------------------------------------------------------------- +// +void CCmPluginPacketData::ConstructL() + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_CONSTRUCTL_ENTRY ); + + FeatureManager::InitializeLibL(); + CCmPluginBaseEng::ConstructL(); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_CONSTRUCTL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::CanHandleIapIdL() +// ---------------------------------------------------------------------------- +// +TBool CCmPluginPacketData::CanHandleIapIdL( TUint32 aIapId ) const + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_CANHANDLEIAPIDL_ENTRY ); + + TBool retVal( EFalse ); + + CCDIAPRecord *iapRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); + + CleanupStack::PushL( iapRecord ); + iapRecord->SetRecordId( aIapId ); + + TRAPD( err, iapRecord->LoadL( iSession )); + + if ( !err ) + { + retVal = CanHandleIapIdL( iapRecord ); + } + + CleanupStack::PopAndDestroy( iapRecord ); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_CANHANDLEIAPIDL_EXIT ); + return retVal; + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::CanHandleIapIdL() +// ---------------------------------------------------------------------------- +// +TBool CCmPluginPacketData::CanHandleIapIdL( CCDIAPRecord *aIapRecord ) const + { + OstTraceFunctionEntry0( DUP1_CCMPLUGINPACKETDATA_CANHANDLEIAPIDL_ENTRY ); + + TBool retVal( EFalse ); + + if ( (TPtrC(aIapRecord->iServiceType) == TPtrC(KCDTypeNameOutgoingWCDMA) || + TPtrC(aIapRecord->iServiceType) == TPtrC(KCDTypeNameIncomingWCDMA)) && + TPtrC(aIapRecord->iBearerType) == TPtrC(KCDTypeNameModemBearer) ) + { + retVal = ETrue; + } + + + OstTraceFunctionExit0( DUP1_CCMPLUGINPACKETDATA_CANHANDLEIAPIDL_EXIT ); + return retVal; + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::PreparePluginToLoadRecordsL() +// ---------------------------------------------------------------------------- +// +void CCmPluginPacketData::PreparePluginToLoadRecordsL() + { + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::PreparePluginToUpdateRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::PreparePluginToUpdateRecordsL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_PREPAREPLUGINTOUPDATERECORDSL_ENTRY ); + + CCDIAPRecord* iapRecord = + static_cast( aGenRecordArray[KIapRecordIndex] ); + + CCDWCDMAPacketServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + + CheckIfNameModifiedL( iapRecord, serviceRecord ); + + CheckDNSServerAddressL( ETrue, + serviceRecord->iGPRSIP6NameServer1, + serviceRecord->iGPRSIP6NameServer2, + serviceRecord->iGPRSIP6DNSAddrFromServer ); + + CheckDNSServerAddressL( EFalse, + serviceRecord->iGPRSIPNameServer1, + serviceRecord->iGPRSIPNameServer2, + serviceRecord->iGPRSIPDNSAddrFromServer ); + + SetDaemonNameL( aGenRecordArray, aBearerSpecRecordArray ); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_PREPAREPLUGINTOUPDATERECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::SetDaemonNameL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::SetDaemonNameL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_SETDAEMONNAMEL_ENTRY ); + + // use DHCP if we can + TBool ipfromSrv = GetBearerBoolAttributeL( EPacketDataIPAddrFromServer, + aGenRecordArray, + aBearerSpecRecordArray ); + if ( ipfromSrv ) + { + SetBearerStringAttributeL( ECmConfigDaemonManagerName, + KDaemonManagerName, + aGenRecordArray, + aBearerSpecRecordArray ); + SetBearerStringAttributeL( ECmConfigDaemonName, + KConfigDaemonName, + aGenRecordArray, + aBearerSpecRecordArray ); + } + else + { + if ( FeatureManager::FeatureSupported( KFeatureIdIPv6 ) ) + { + SetBearerStringAttributeL( ECmConfigDaemonManagerName, + KDaemonManagerName, + aGenRecordArray, + aBearerSpecRecordArray ); + SetBearerStringAttributeL( ECmConfigDaemonName, + KConfigDaemonName, + aGenRecordArray, + aBearerSpecRecordArray ); + } + else + { + SetBearerStringAttributeL( ECmConfigDaemonManagerName, + KNullDesC(), + aGenRecordArray, + aBearerSpecRecordArray ); + SetBearerStringAttributeL( ECmConfigDaemonName, + KNullDesC(), + aGenRecordArray, + aBearerSpecRecordArray ); + } + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_SETDAEMONNAMEL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::LoadBearerRecordsL() +// ---------------------------------------------------------------------------- +// +void CCmPluginPacketData::LoadBearerRecordsL() + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_LOADBEARERRECORDSL_ENTRY ); + + if ( ServiceRecord().iUmtsR99QoSAndOnTable ) + { + iPacketDataQoSRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdUmtsR99QoSAndOnTableRecord ) ); + + iPacketDataQoSRecord->SetRecordId( ServiceRecord().iUmtsR99QoSAndOnTable ); + iPacketDataQoSRecord->LoadL( iSession ); + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_LOADBEARERRECORDSL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::LoadServiceRecordL() +// ---------------------------------------------------------------------------- +// +void CCmPluginPacketData::LoadServiceRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_LOADSERVICERECORDL_ENTRY ); + + if ( TPtrC( KCDTypeNameOutgoingWCDMA ) == iIapRecord->iServiceType ) + { + iServiceRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdOutgoingGprsRecord ) ); + iOutgoing = ETrue; + } + else if ( TPtrC( KCDTypeNameIncomingWCDMA ) == iIapRecord->iServiceType ) + { + iServiceRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdIncomingGprsRecord ) ); + iOutgoing = EFalse; + } + else + // this IAP service is not supported by this plugin. + { + User::Leave( KErrNotSupported ); + } + + iServiceRecord->SetRecordId( iIapRecord->iService ); + TRAPD( err, iServiceRecord->LoadL( iSession ) ); + if ( err == KErrNotFound ) + // record not found -> create a default one + { + CreateServiceRecordL(); + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_LOADSERVICERECORDL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::ServiceRecord() +// ---------------------------------------------------------------------------- +// +CCDWCDMAPacketServiceRecord& CCmPluginPacketData::ServiceRecord() const + { + return *static_cast( iServiceRecord ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::CreateServiceRecordL() +// ---------------------------------------------------------------------------- +// +void CCmPluginPacketData::CreateServiceRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_CREATESERVICERECORDL_ENTRY ); + + delete iServiceRecord; + iServiceRecord = NULL; + + if ( iOutgoing ) + { + iServiceRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdOutgoingGprsRecord ) ); + } + else + { + iServiceRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdIncomingGprsRecord ) ); + } + + ServiceRecord().iGPRSAPN.SetL( KNullDesC ); + ServiceRecord().iGPRSPDPType.SetL( RPacketContext::EPdpTypeIPv4 ); + ServiceRecord().iGPRSReqPrecedence = 0; + ServiceRecord().iGPRSReqDelay = 0; + ServiceRecord().iGPRSReqReliability = 0; + ServiceRecord().iGPRSReqPeakThroughput = 0; + ServiceRecord().iGPRSReqMeanThroughput = 0; + ServiceRecord().iGPRSMinPrecedence = 0; + ServiceRecord().iGPRSMinDelay = 0; + ServiceRecord().iGPRSMinReliability = 0; + ServiceRecord().iGPRSMinPeakThroughput = 0; + ServiceRecord().iGPRSMinMeanThroughput = 0; + ServiceRecord().iGPRSDataCompression = 0; + ServiceRecord().iGPRSHeaderCompression = 0; + ServiceRecord().iGPRSAnonymousAccess = 0; + ServiceRecord().iGPRSIfNetworks.SetL( KDefIspIfNetworksIPv4 ); + ServiceRecord().iGPRSIfPromptForAuth = EFalse; + ServiceRecord().iGPRSIfAuthRetries = 0; + ServiceRecord().iGPRSIPGateway.SetL( KUnspecifiedIPv4 ); + ServiceRecord().iGPRSIPAddrFromServer = ETrue; + ServiceRecord().iGPRSIPAddr.SetL( KUnspecifiedIPv4 ); + ServiceRecord().iGPRSIPDNSAddrFromServer = ETrue; + ServiceRecord().iGPRSIPNameServer1.SetL( KUnspecifiedIPv4 ); + ServiceRecord().iGPRSIPNameServer2.SetL( KUnspecifiedIPv4 ); + ServiceRecord().iGPRSIP6DNSAddrFromServer = ETrue; + ServiceRecord().iGPRSIP6NameServer1.SetL( KDynamicIpv6Address ); + ServiceRecord().iGPRSIP6NameServer2.SetL( KDynamicIpv6Address ); + ServiceRecord().iGPRSEnableLCPExtension = EFalse; + ServiceRecord().iGPRSDisablePlainTextAuth = ETrue; + ServiceRecord().iGPRSAPType = EPacketDataBoth; + ServiceRecord().iGPRSQOSWarningTimeOut = TUint32(-1); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_CREATESERVICERECORDL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::ServiceRecordId +// ---------------------------------------------------------------------------- +// +TUint32 CCmPluginPacketData::ServiceRecordId() const + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_SERVICERECORDID_ENTRY ); + + return ServiceRecord().RecordId(); + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::ServiceRecordIdLC +// ---------------------------------------------------------------------------- +// +void CCmPluginPacketData::ServiceRecordNameLC( HBufC* &aName ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_SERVICERECORDNAMELC_ENTRY ); + + if ( iOutgoing ) + { + aName = TPtrC( KCDTypeNameOutgoingWCDMA ).AllocLC(); + } + else + { + aName = TPtrC( KCDTypeNameIncomingWCDMA ).AllocLC(); + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_SERVICERECORDNAMELC_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::BearerRecordIdL() +// ---------------------------------------------------------------------------- +// +void CCmPluginPacketData::BearerRecordIdL( TUint32& aRecordId ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_BEARERRECORDIDL_ENTRY ); + + CMDBRecordSet* bearerRS = + new( ELeave ) CMDBRecordSet( KCDTIdModemBearerRecord ); + CleanupStack::PushL( bearerRS ); + + CCDModemBearerRecord* bearerRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdModemBearerRecord ) ); + + CleanupStack::PushL( bearerRecord ); + + bearerRecord->iRecordName.SetL( KModemBearerPacketData ); + bearerRS->iRecords.AppendL( bearerRecord ); + CleanupStack::Pop( bearerRecord ); + + if ( bearerRS->FindL( iSession ) ) + { + bearerRecord = static_cast( bearerRS->iRecords[0] ); + aRecordId = bearerRecord->RecordId(); + } + else + // bearer not found -> create dummy values + { + bearerRecord->SetRecordId( KCDNewRecordRequest ); + bearerRecord->StoreL( iSession ); + + aRecordId = bearerRecord->RecordId(); + } + + CleanupStack::PopAndDestroy( bearerRS ); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_BEARERRECORDIDL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::BearerRecordNameLC() +// ---------------------------------------------------------------------------- +// +void CCmPluginPacketData::BearerRecordNameLC( HBufC*& aBearerName ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_BEARERRECORDNAMELC_ENTRY ); + + aBearerName = TPtrC( KCDTypeNameModemBearer ).AllocLC(); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_BEARERRECORDNAMELC_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::CheckNetworkCoverageL() +// ---------------------------------------------------------------------------- +// +TBool CCmPluginPacketData::CheckNetworkCoverageL() const + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_CHECKNETWORKCOVERAGEL_ENTRY ); + + TBool retVal( EFalse ); + +#ifdef __WINS__ + retVal = ETrue; +#else + CCmPDCoverageCheck* coverage = new( ELeave ) CCmPDCoverageCheck; + CleanupStack::PushL( coverage ); + + retVal = coverage->IsThereCoverageL(); + + CleanupStack::PopAndDestroy( coverage ); + +#endif // __WINS + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_CHECKNETWORKCOVERAGEL_EXIT ); + return retVal; + } + +// ---------------------------------------------------------------------------- +// CCmPluginPacketData::SetPDPTypeL() +// ---------------------------------------------------------------------------- +// +void CCmPluginPacketData::SetPDPTypeL( + RPacketContext::TProtocolType aPdpType, + CCDWCDMAPacketServiceRecord* aServiceRecord ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_SETPDPTYPEL_ENTRY ); + + if ( aPdpType == RPacketContext::EPdpTypeIPv6 ) + { + aServiceRecord->iGPRSPDPType = RPacketContext::EPdpTypeIPv6; + aServiceRecord->iGPRSIfNetworks.SetL( KDefIspIfNetworksIPv6 ); + } + else if ( aPdpType == RPacketContext::EPdpTypeIPv4 ) + { + aServiceRecord->iGPRSIfNetworks.SetL( KDefIspIfNetworksIPv4 ); + aServiceRecord->iGPRSPDPType = RPacketContext::EPdpTypeIPv4; + } + else + { + User::Leave( KErrArgument ); + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_SETPDPTYPEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::CreateBearerRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::CreateBearerRecordsL() + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_CREATEBEARERRECORDSL_ENTRY ); + + delete iPacketDataQoSRecord; + iPacketDataQoSRecord = NULL; + + iPacketDataQoSRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdUmtsR99QoSAndOnTableRecord ) ); + + iPacketDataQoSRecord->iGPRSReqTrafficClass = RPacketQoS::ETrafficClassUnspecified; + iPacketDataQoSRecord->iGPRSMinTrafficClass = RPacketQoS::ETrafficClassUnspecified; + iPacketDataQoSRecord->iGPRSReqDeliveryOrder = RPacketQoS::EDeliveryOrderUnspecified; + iPacketDataQoSRecord->iGPRSMinDeliveryOrder = RPacketQoS::EDeliveryOrderUnspecified; + iPacketDataQoSRecord->iGPRSReqDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryUnspecified; + iPacketDataQoSRecord->iGPRSMinDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryUnspecified; + iPacketDataQoSRecord->iGPRSReqMaxSDUSize = 0; + iPacketDataQoSRecord->iGPRSMinAcceptableMaxSDUSize = 0; + iPacketDataQoSRecord->iGPRSReqMaxUplinkRate = 0; + iPacketDataQoSRecord->iGPRSReqMinUplinkRate = 0; + iPacketDataQoSRecord->iGPRSReqMaxDownlinkRate = 0; + iPacketDataQoSRecord->iGPRSReqMinDownlinkRate = 0; + iPacketDataQoSRecord->iGPRSReqBER = RPacketQoS::EBERUnspecified; + iPacketDataQoSRecord->iGPRSMaxBER = RPacketQoS::EBERUnspecified; + iPacketDataQoSRecord->iGPRSReqSDUErrorRatio = RPacketQoS::ESDUErrorRatioUnspecified; + iPacketDataQoSRecord->iGPRSMaxSDUErrorRatio = RPacketQoS::ESDUErrorRatioUnspecified; + iPacketDataQoSRecord->iGPRSReqTrafficHandlingPriority = RPacketQoS::ETrafficPriorityUnspecified; + iPacketDataQoSRecord->iGPRSMinTrafficHandlingPriority = RPacketQoS::ETrafficPriorityUnspecified; + iPacketDataQoSRecord->iGPRSReqTransferDelay = 0; + iPacketDataQoSRecord->iGPRSMaxTransferDelay = 0; + iPacketDataQoSRecord->iGPRSReqGuaranteedUplinkRate = 0; + iPacketDataQoSRecord->iGPRSMinGuaranteedUplinkRate = 0; + iPacketDataQoSRecord->iGPRSReqGuaranteedDownlinkRate = 0; + iPacketDataQoSRecord->iGPRSMinGuaranteedDownlinkRate = 0; + iPacketDataQoSRecord->iGPRSSignallingIndication = EFalse; + iPacketDataQoSRecord->iGPRS_ImCnSignallingIndication = EFalse; + iPacketDataQoSRecord->iGPRSSourceStatisticsDescriptor = RPacketQoS::ESourceStatisticsDescriptorUnknown; + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_CREATEBEARERRECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::UpdateServiceRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::UpdateServiceRecordL( + RPointerArray& aGenRecordArray, + RPointerArray& /*aBearerSpecRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_UPDATESERVICERECORDL_ENTRY ); + + // Delete the original record and create a copy from the parameter + delete iServiceRecord; + iServiceRecord = NULL; + + CCDWCDMAPacketServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + + if ( iOutgoing ) + { + iServiceRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdOutgoingGprsRecord ) ); + } + else + { + iServiceRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdIncomingGprsRecord ) ); + } + + CCDWCDMAPacketServiceRecord* origServiceRecord = + static_cast( iServiceRecord ); + + iServiceRecord->SetElementId( serviceRecord->ElementId() ); + iServiceRecord->iRecordName.SetL( serviceRecord->iRecordName ); + + if ( !serviceRecord->iServiceEnableLlmnr.IsNull() ) + { + origServiceRecord->iServiceEnableLlmnr.SetL( serviceRecord->iServiceEnableLlmnr ); + } + + if ( !serviceRecord->iGPRSAPN.IsNull() ) + { + origServiceRecord->iGPRSAPN.SetL( serviceRecord->iGPRSAPN ); + } + if ( !serviceRecord->iGPRSPDPType.IsNull() ) + { + origServiceRecord->iGPRSPDPType.SetL( serviceRecord->iGPRSPDPType ); + } + if ( !serviceRecord->iGPRSPDPAddress.IsNull() ) + { + origServiceRecord->iGPRSPDPAddress.SetL( serviceRecord->iGPRSPDPAddress ); + } + if ( !serviceRecord->iGPRSReqPrecedence.IsNull() ) + { + origServiceRecord->iGPRSReqPrecedence.SetL( serviceRecord->iGPRSReqPrecedence ); + } + if ( !serviceRecord->iGPRSReqDelay.IsNull() ) + { + origServiceRecord->iGPRSReqDelay.SetL( serviceRecord->iGPRSReqDelay ); + } + if ( !serviceRecord->iGPRSReqReliability.IsNull() ) + { + origServiceRecord->iGPRSReqReliability.SetL( serviceRecord->iGPRSReqReliability ); + } + if ( !serviceRecord->iGPRSReqPeakThroughput.IsNull() ) + { + origServiceRecord->iGPRSReqPeakThroughput.SetL( serviceRecord->iGPRSReqPeakThroughput ); + } + if ( !serviceRecord->iGPRSReqMeanThroughput.IsNull() ) + { + origServiceRecord->iGPRSReqMeanThroughput.SetL( serviceRecord->iGPRSReqMeanThroughput ); + } + if ( !serviceRecord->iGPRSMinPrecedence.IsNull() ) + { + origServiceRecord->iGPRSMinPrecedence.SetL( serviceRecord->iGPRSMinPrecedence ); + } + if ( !serviceRecord->iGPRSMinDelay.IsNull() ) + { + origServiceRecord->iGPRSMinDelay.SetL( serviceRecord->iGPRSMinDelay ); + } + if ( !serviceRecord->iGPRSMinReliability.IsNull() ) + { + origServiceRecord->iGPRSMinReliability.SetL( serviceRecord->iGPRSMinReliability ); + } + if ( !serviceRecord->iGPRSMinPeakThroughput.IsNull() ) + { + origServiceRecord->iGPRSMinPeakThroughput.SetL( serviceRecord->iGPRSMinPeakThroughput ); + } + if ( !serviceRecord->iGPRSMinMeanThroughput.IsNull() ) + { + origServiceRecord->iGPRSMinMeanThroughput.SetL( serviceRecord->iGPRSMinMeanThroughput ); + } + if ( !serviceRecord->iGPRSDataCompression.IsNull() ) + { + origServiceRecord->iGPRSDataCompression.SetL( serviceRecord->iGPRSDataCompression ); + } + if ( !serviceRecord->iGPRSHeaderCompression.IsNull() ) + { + origServiceRecord->iGPRSHeaderCompression.SetL( serviceRecord->iGPRSHeaderCompression ); + } + if ( !serviceRecord->iGPRSUseEdge.IsNull() ) + { + origServiceRecord->iGPRSUseEdge.SetL( serviceRecord->iGPRSUseEdge ); + } + if ( !serviceRecord->iGPRSAnonymousAccess.IsNull() ) + { + origServiceRecord->iGPRSAnonymousAccess.SetL( serviceRecord->iGPRSAnonymousAccess ); + } + if ( !serviceRecord->iGPRSIfParams.IsNull() ) + { + origServiceRecord->iGPRSIfParams.SetL( serviceRecord->iGPRSIfParams ); + } + if ( !serviceRecord->iGPRSIfNetworks.IsNull() ) + { + origServiceRecord->iGPRSIfNetworks.SetL( serviceRecord->iGPRSIfNetworks ); + } + if ( !serviceRecord->iGPRSIfPromptForAuth.IsNull() ) + { + origServiceRecord->iGPRSIfPromptForAuth.SetL( serviceRecord->iGPRSIfPromptForAuth ); + } + if ( !serviceRecord->iGPRSIfAuthName.IsNull() ) + { + origServiceRecord->iGPRSIfAuthName.SetL( serviceRecord->iGPRSIfAuthName ); + } + if ( !serviceRecord->iGPRSIfAuthPass.IsNull() ) + { + origServiceRecord->iGPRSIfAuthPass.SetL( serviceRecord->iGPRSIfAuthPass ); + } + if ( !serviceRecord->iGPRSIfAuthRetries.IsNull() ) + { + origServiceRecord->iGPRSIfAuthRetries.SetL( serviceRecord->iGPRSIfAuthRetries ); + } + if ( !serviceRecord->iGPRSIPNetMask.IsNull() ) + { + origServiceRecord->iGPRSIPNetMask.SetL( serviceRecord->iGPRSIPNetMask ); + } + if ( !serviceRecord->iGPRSIPGateway.IsNull() ) + { + origServiceRecord->iGPRSIPGateway.SetL( serviceRecord->iGPRSIPGateway ); + } + if ( !serviceRecord->iGPRSIPAddrFromServer.IsNull() ) + { + origServiceRecord->iGPRSIPAddrFromServer.SetL( serviceRecord->iGPRSIPAddrFromServer ); + } + if ( !serviceRecord->iGPRSIPAddr.IsNull() ) + { + origServiceRecord->iGPRSIPAddr.SetL( serviceRecord->iGPRSIPAddr ); + } + if ( !serviceRecord->iGPRSIPDNSAddrFromServer.IsNull() ) + { + origServiceRecord->iGPRSIPDNSAddrFromServer.SetL( serviceRecord->iGPRSIPDNSAddrFromServer ); + } + if ( !serviceRecord->iGPRSIPNameServer1.IsNull() ) + { + origServiceRecord->iGPRSIPNameServer1.SetL( serviceRecord->iGPRSIPNameServer1 ); + } + if ( !serviceRecord->iGPRSIPNameServer2.IsNull() ) + { + origServiceRecord->iGPRSIPNameServer2.SetL( serviceRecord->iGPRSIPNameServer2 ); + } + if ( !serviceRecord->iGPRSIP6DNSAddrFromServer.IsNull() ) + { + origServiceRecord->iGPRSIP6DNSAddrFromServer.SetL( serviceRecord->iGPRSIP6DNSAddrFromServer ); + } + if ( !serviceRecord->iGPRSIP6NameServer1.IsNull() ) + { + origServiceRecord->iGPRSIP6NameServer1.SetL( serviceRecord->iGPRSIP6NameServer1 ); + } + if ( !serviceRecord->iGPRSIP6NameServer2.IsNull() ) + { + origServiceRecord->iGPRSIP6NameServer2.SetL( serviceRecord->iGPRSIP6NameServer2 ); + } + if ( !serviceRecord->iGPRSIPAddrLeaseValidFrom.IsNull() ) + { + origServiceRecord->iGPRSIPAddrLeaseValidFrom.SetL( serviceRecord->iGPRSIPAddrLeaseValidFrom ); + } + if ( !serviceRecord->iGPRSIPAddrLeaseValidTo.IsNull() ) + { + origServiceRecord->iGPRSIPAddrLeaseValidTo.SetL( serviceRecord->iGPRSIPAddrLeaseValidTo ); + } + if ( !serviceRecord->iGPRSConfigDaemonManagerName.IsNull() ) + { + origServiceRecord->iGPRSConfigDaemonManagerName.SetL( serviceRecord->iGPRSConfigDaemonManagerName ); + } + if ( !serviceRecord->iGPRSConfigDaemonName.IsNull() ) + { + origServiceRecord->iGPRSConfigDaemonName.SetL( serviceRecord->iGPRSConfigDaemonName ); + } + if ( !serviceRecord->iGPRSEnableLCPExtension.IsNull() ) + { + origServiceRecord->iGPRSEnableLCPExtension.SetL( serviceRecord->iGPRSEnableLCPExtension ); + } + if ( !serviceRecord->iGPRSDisablePlainTextAuth.IsNull() ) + { + origServiceRecord->iGPRSDisablePlainTextAuth.SetL( serviceRecord->iGPRSDisablePlainTextAuth ); + } + if ( !serviceRecord->iGPRSAPType.IsNull() ) + { + origServiceRecord->iGPRSAPType.SetL( serviceRecord->iGPRSAPType ); + } + if ( !serviceRecord->iGPRSQOSWarningTimeOut.IsNull() ) + { + origServiceRecord->iGPRSQOSWarningTimeOut.SetL( serviceRecord->iGPRSQOSWarningTimeOut ); + } + if ( !serviceRecord->iGPRSR5DataCompression.IsNull() ) + { + origServiceRecord->iGPRSR5DataCompression.SetL( serviceRecord->iGPRSR5DataCompression ); + } + if ( !serviceRecord->iGPRSR5HeaderCompression.IsNull() ) + { + origServiceRecord->iGPRSR5HeaderCompression.SetL( serviceRecord->iGPRSR5HeaderCompression ); + } + if ( !serviceRecord->iGPRSPacketFlowIdentifier.IsNull() ) + { + origServiceRecord->iGPRSPacketFlowIdentifier.SetL( serviceRecord->iGPRSPacketFlowIdentifier ); + } + if ( !serviceRecord->iGPRSUmtsGprsRelease.IsNull() ) + { + origServiceRecord->iGPRSUmtsGprsRelease.SetL( serviceRecord->iGPRSUmtsGprsRelease ); + } + + if ( iPacketDataQoSRecord ) + { + origServiceRecord->iUmtsR99QoSAndOnTable = iPacketDataQoSRecord->RecordId(); + } + + if ( !iServiceRecord->RecordId() ) + { + iServiceRecord->SetRecordId( KCDNewRecordRequest ); + iServiceRecord->StoreL( iSession ); + serviceRecord->SetElementId( iServiceRecord->ElementId() ); + } + else + { + iServiceRecord->ModifyL( iSession ); + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_UPDATESERVICERECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::UpdateBearerRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::UpdateBearerRecordsL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_UPDATEBEARERRECORDSL_ENTRY ); + + delete iPacketDataQoSRecord; + iPacketDataQoSRecord = NULL; + + CCDUmtsR99QoSAndOnTableRecord* packetDataQoSRecord = + static_cast( aBearerSpecRecordArray[KQosRecordIndex] ); + + iPacketDataQoSRecord = static_cast( + CCDRecordBase::CreateCopyRecordL( *packetDataQoSRecord ) ); + + iPacketDataQoSRecord->SetElementId( aBearerSpecRecordArray[KQosRecordIndex]->ElementId() ); + + if ( !iPacketDataQoSRecord->RecordId() ) + { + iPacketDataQoSRecord->SetRecordId( KCDNewRecordRequest ); + iPacketDataQoSRecord->StoreL( iSession ); + packetDataQoSRecord->SetElementId( iPacketDataQoSRecord->ElementId() ); + + // Set service record to point to QoS record + ServiceRecord().iUmtsR99QoSAndOnTable = iPacketDataQoSRecord->RecordId(); + ServiceRecord().ModifyL( iSession ); + + CCDWCDMAPacketServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + serviceRecord->iUmtsR99QoSAndOnTable = iPacketDataQoSRecord->RecordId(); + } + else + { + iPacketDataQoSRecord->ModifyL( iSession ); + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_UPDATEBEARERRECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetBearerSpecificRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::GetBearerSpecificRecordsL( + RPointerArray& aRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETBEARERSPECIFICRECORDSL_ENTRY ); + + if ( !iPacketDataQoSRecord ) + { + // IAP not yet in CommDat + GetDefaultQosRecordL( aRecordArray ); + } + else + { + CCDUmtsR99QoSAndOnTableRecord* qosRecord = static_cast( + CCDRecordBase::CreateCopyRecordL( *iPacketDataQoSRecord ) ); + CleanupStack::PushL( qosRecord ); + qosRecord->SetElementId( iPacketDataQoSRecord->ElementId() ); + aRecordArray.AppendL( static_cast( qosRecord ) ); + CleanupStack::Pop( qosRecord ); + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETBEARERSPECIFICRECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetDefaultServiceRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::GetDefaultServiceRecordL( + RPointerArray& aRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETDEFAULTSERVICERECORDL_ENTRY ); + + CCDWCDMAPacketServiceRecord* serviceRecord( NULL ); + if ( iOutgoing ) + { + serviceRecord = + static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdOutgoingGprsRecord ) ); + } + else + { + serviceRecord = + static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdOutgoingGprsRecord ) ); + } + + CleanupStack::PushL( serviceRecord ); + serviceRecord->iGPRSAPN.SetL( KNullDesC ); + serviceRecord->iGPRSPDPType.SetL( RPacketContext::EPdpTypeIPv4 ); + serviceRecord->iGPRSReqPrecedence = 0; + serviceRecord->iGPRSReqDelay = 0; + serviceRecord->iGPRSReqReliability = 0; + serviceRecord->iGPRSReqPeakThroughput = 0; + serviceRecord->iGPRSReqMeanThroughput = 0; + serviceRecord->iGPRSMinPrecedence = 0; + serviceRecord->iGPRSMinDelay = 0; + serviceRecord->iGPRSMinReliability = 0; + serviceRecord->iGPRSMinPeakThroughput = 0; + serviceRecord->iGPRSMinMeanThroughput = 0; + serviceRecord->iGPRSDataCompression = EFalse; + serviceRecord->iGPRSHeaderCompression = EFalse; + serviceRecord->iGPRSAnonymousAccess = EFalse; + serviceRecord->iGPRSIfNetworks.SetL( KDefIspIfNetworksIPv4 ); + serviceRecord->iGPRSIfPromptForAuth = EFalse; + serviceRecord->iGPRSIfAuthRetries = 0; + serviceRecord->iGPRSIPGateway.SetL( KUnspecifiedIPv4 ); + serviceRecord->iGPRSIPAddrFromServer = ETrue; + serviceRecord->iGPRSIPAddr.SetL( KUnspecifiedIPv4 ); + serviceRecord->iGPRSIPDNSAddrFromServer = ETrue; + serviceRecord->iGPRSIPNameServer1.SetL( KUnspecifiedIPv4 ); + serviceRecord->iGPRSIPNameServer2.SetL( KUnspecifiedIPv4 ); + serviceRecord->iGPRSIP6DNSAddrFromServer = ETrue; + serviceRecord->iGPRSIP6NameServer1.SetL( KDynamicIpv6Address ); + serviceRecord->iGPRSIP6NameServer2.SetL( KDynamicIpv6Address ); + serviceRecord->iGPRSEnableLCPExtension = EFalse; + serviceRecord->iGPRSDisablePlainTextAuth = ETrue; + serviceRecord->iGPRSAPType = EPacketDataBoth; + serviceRecord->iGPRSQOSWarningTimeOut = TUint32(-1); + + aRecordArray.AppendL( static_cast( serviceRecord ) ); + CleanupStack::Pop( serviceRecord ); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETDEFAULTSERVICERECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetDefaultQosRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::GetDefaultQosRecordL( + RPointerArray& aRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETDEFAULTQOSRECORDL_ENTRY ); + + CCDUmtsR99QoSAndOnTableRecord* packetDataQoSRecord = + static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdUmtsR99QoSAndOnTableRecord ) ); + CleanupStack::PushL( packetDataQoSRecord ); + + packetDataQoSRecord->iGPRSReqTrafficClass = RPacketQoS::ETrafficClassUnspecified; + packetDataQoSRecord->iGPRSMinTrafficClass = RPacketQoS::ETrafficClassUnspecified; + packetDataQoSRecord->iGPRSReqDeliveryOrder = RPacketQoS::EDeliveryOrderUnspecified; + packetDataQoSRecord->iGPRSMinDeliveryOrder = RPacketQoS::EDeliveryOrderUnspecified; + packetDataQoSRecord->iGPRSReqDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryUnspecified; + packetDataQoSRecord->iGPRSMinDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryUnspecified; + packetDataQoSRecord->iGPRSReqMaxSDUSize = 0; + packetDataQoSRecord->iGPRSMinAcceptableMaxSDUSize = 0; + packetDataQoSRecord->iGPRSReqMaxUplinkRate = 0; + packetDataQoSRecord->iGPRSReqMinUplinkRate = 0; + packetDataQoSRecord->iGPRSReqMaxDownlinkRate = 0; + packetDataQoSRecord->iGPRSReqMinDownlinkRate = 0; + packetDataQoSRecord->iGPRSReqBER = RPacketQoS::EBERUnspecified; + packetDataQoSRecord->iGPRSMaxBER = RPacketQoS::EBERUnspecified; + packetDataQoSRecord->iGPRSReqSDUErrorRatio = RPacketQoS::ESDUErrorRatioUnspecified; + packetDataQoSRecord->iGPRSMaxSDUErrorRatio = RPacketQoS::ESDUErrorRatioUnspecified; + packetDataQoSRecord->iGPRSReqTrafficHandlingPriority = RPacketQoS::ETrafficPriorityUnspecified; + packetDataQoSRecord->iGPRSMinTrafficHandlingPriority = RPacketQoS::ETrafficPriorityUnspecified; + packetDataQoSRecord->iGPRSReqTransferDelay = 0; + packetDataQoSRecord->iGPRSMaxTransferDelay = 0; + packetDataQoSRecord->iGPRSReqGuaranteedUplinkRate = 0; + packetDataQoSRecord->iGPRSMinGuaranteedUplinkRate = 0; + packetDataQoSRecord->iGPRSReqGuaranteedDownlinkRate = 0; + packetDataQoSRecord->iGPRSMinGuaranteedDownlinkRate = 0; + packetDataQoSRecord->iGPRSSignallingIndication = EFalse; + packetDataQoSRecord->iGPRS_ImCnSignallingIndication = EFalse; + packetDataQoSRecord->iGPRSSourceStatisticsDescriptor = RPacketQoS::ESourceStatisticsDescriptorUnknown; + + aRecordArray.AppendL( static_cast( packetDataQoSRecord ) ); + CleanupStack::Pop( packetDataQoSRecord ); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETDEFAULTQOSRECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetBearerIntAttributeL +// --------------------------------------------------------------------------- +// +TUint32 CCmPluginPacketData::GetBearerIntAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETBEARERINTATTRIBUTEL_ENTRY ); + + TUint32 retVal( 0 ); + + CCDWCDMAPacketServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + + if ( aAttribute < ECmCommonAttributesEnd || + ( aAttribute > ECmBearerCreationCommonAttributes && + aAttribute < ECmBearerCreationCommonAttributesEnd ) ) + { + switch ( aAttribute ) + { + case ECmBearerType: + { + retVal = iBearerType; + } + break; + case ECmCommsDBBearerType: + { + retVal = KCommDbBearerWcdma; + } + break; + case ECmDefaultUiPriority: + case ECmDefaultPriority: + { + retVal = KDefaultPriorityPacketData; + } + break; + case ECmExtensionLevel: + { + retVal = KExtensionBaseLevel; + } + break; + case ECmInvalidAttribute: + { + retVal = 0; + } + break; + case ECmIFAuthRetries: + { + retVal = serviceRecord->iGPRSIfAuthRetries; + } + break; + default: + { + User::Leave( KErrNotFound ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETBEARERINTATTRIBUTEL_EXIT ); + return retVal; + } + + if ( aAttribute >= EPacketDataSpecificAttributes && + aAttribute < EPacketDataServiceEnableLLMNR ) + { + retVal = GetServiceIntAttributeL( aAttribute, aGenRecordArray ); + } + else if ( aAttribute >= EGPRSReqTrafficClass && + aAttribute <= EGPRSSourceStatisticsDescriptor ) + { + retVal = GetQosIntAttributeL( aAttribute, aBearerSpecRecordArray ); + } + else + { + User::Leave( KErrNotFound ); + } + + OstTraceFunctionExit0( DUP1_CCMPLUGINPACKETDATA_GETBEARERINTATTRIBUTEL_EXIT ); + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetServiceIntAttributeL +// --------------------------------------------------------------------------- +// +TUint32 CCmPluginPacketData::GetServiceIntAttributeL( TUint32 aAttribute, + RPointerArray& aGenRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETSERVICEINTATTRIBUTEL_ENTRY ); + + TUint32 retVal( 0 ); + + CCDWCDMAPacketServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + + switch ( aAttribute ) + { + case EPacketDataPDPType: + { + retVal = serviceRecord->iGPRSPDPType; + } + break; + + case EPacketDataReqPrecedence: + { + retVal = serviceRecord->iGPRSReqPrecedence; + } + break; + + case EPacketDataReqDelay: + { + retVal = serviceRecord->iGPRSReqDelay; + } + break; + + case EPacketDataReliability: + { + retVal = serviceRecord->iGPRSReqReliability; + } + break; + + case EPacketDataPeakThroughput: + { + retVal = serviceRecord->iGPRSReqPeakThroughput; + } + break; + + case EPacketDataMeanThroughput: + { + retVal = serviceRecord->iGPRSMinMeanThroughput; + } + break; + + case EPacketDataMinPrecedence: + { + retVal = serviceRecord->iGPRSMinPrecedence; + } + break; + + case EPacketDataMinDelay: + { + retVal = serviceRecord->iGPRSMinDelay; + } + break; + + case EPacketDataMinReliability: + { + retVal = serviceRecord->iGPRSMinReliability; + } + break; + + case EPacketDataMinPeakThroughput: + { + retVal = serviceRecord->iGPRSMinPeakThroughput; + } + break; + + case EPacketDataMinMeanThroughput: + { + retVal = serviceRecord->iGPRSMinMeanThroughput; + } + break; + + case EPacketDataIFAuthRetries: + { + retVal = serviceRecord->iGPRSIfAuthRetries; + } + break; + + case EPacketDataApType: + { + retVal = serviceRecord->iGPRSAPType; + } + break; + + case EPacketDataQoSWarningTimeOut: + { + retVal = serviceRecord->iGPRSQOSWarningTimeOut; + } + break; + default: + { + User::Leave( KErrNotFound ); + } + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETSERVICEINTATTRIBUTEL_EXIT ); + + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetQosIntAttributeL +// --------------------------------------------------------------------------- +// +TUint32 CCmPluginPacketData::GetQosIntAttributeL( TUint32 aAttribute, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETQOSINTATTRIBUTEL_ENTRY ); + + TUint32 retVal( 0 ); + + CCDUmtsR99QoSAndOnTableRecord* qosRecord = + static_cast( aBearerSpecRecordArray[KQosRecordIndex] ); + + switch ( aAttribute ) + { + case EGPRSReqTrafficClass: + { + retVal = qosRecord->iGPRSReqTrafficClass; + } + break; + + case EGPRSMinTrafficClass: + { + retVal = qosRecord->iGPRSMinTrafficClass; + } + break; + + case EGPRSReqDeliveryOrder: + { + retVal = qosRecord->iGPRSReqDeliveryOrder; + } + break; + + case GPRSMinDeliveryOrder: + { + retVal = qosRecord->iGPRSMinDeliveryOrder; + } + break; + case EGPRSReqDeliverErroneousSDU: + { + retVal = qosRecord->iGPRSReqDeliverErroneousSDU; + } + break; + case EGPRSMinDeliverErroneousSDU: + { + retVal = qosRecord->iGPRSMinDeliverErroneousSDU; + } + break; + case EGPRSReqMaxSDUSize: + { + retVal = qosRecord->iGPRSReqMaxSDUSize; + } + break; + + case EGPRSMinAcceptableMaxSDUSize: + { + retVal = qosRecord->iGPRSMinAcceptableMaxSDUSize; + } + break; + + case EGPRSReqMaxUplinkRate: + { + retVal = qosRecord->iGPRSReqMaxUplinkRate; + } + break; + + case EGPRSReqMinUplinkRate: + { + retVal = qosRecord->iGPRSReqMinUplinkRate; + } + break; + + case EGPRSReqMaxDownlinkRate: + { + retVal = qosRecord->iGPRSReqMaxDownlinkRate; + } + break; + + case EGPRSReqMinDownlinkRate: + { + retVal = qosRecord->iGPRSReqMinDownlinkRate; + } + break; + + case EGPRSReqBER: + { + retVal = qosRecord->iGPRSReqBER; + } + break; + + case EGPRSMaxBER: + { + retVal = qosRecord->iGPRSMaxBER; + } + break; + + case EGPRSReqSDUErrorRatio: + { + retVal = qosRecord->iGPRSReqSDUErrorRatio; + } + break; + + case EGPRSMaxSDUErrorRatio: + { + retVal = qosRecord->iGPRSMaxSDUErrorRatio; + } + break; + + case EGPRSReqTrafficHandlingPriority: + { + retVal = qosRecord->iGPRSReqTrafficHandlingPriority; + } + break; + + case EGPRSMinTrafficHandlingPriority: + { + retVal = qosRecord->iGPRSMinTrafficHandlingPriority; + } + break; + + case EGPRSReqTransferDelay: + { + retVal = qosRecord->iGPRSReqTransferDelay; + } + break; + + case EGPRSMaxTransferDelay: + { + retVal = qosRecord->iGPRSMaxTransferDelay; + } + break; + + case EGPRSReqGuaranteedUplinkRate: + { + retVal = qosRecord->iGPRSReqGuaranteedUplinkRate; + } + break; + + case EGPRSMinGuaranteedUplinkRate: + { + retVal = qosRecord->iGPRSMinGuaranteedUplinkRate; + } + break; + + case EGPRSReqGuaranteedDownlinkRate: + { + retVal = qosRecord->iGPRSReqGuaranteedDownlinkRate; + } + break; + + case EGPRSMinGuaranteedDownlinkRate: + { + retVal = qosRecord->iGPRSMinGuaranteedDownlinkRate; + } + break; + + case EGPRSSourceStatisticsDescriptor: + { + retVal = qosRecord->iGPRSSourceStatisticsDescriptor; + } + break; + + default: + { + User::Leave( KErrNotFound ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETQOSINTATTRIBUTEL_EXIT ); + + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetBearerBoolAttributeL +// --------------------------------------------------------------------------- +// +TBool CCmPluginPacketData::GetBearerBoolAttributeL( TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETBEARERBOOLATTRIBUTEL_ENTRY ); + + TBool retVal( EFalse ); + + switch( aAttribute ) + { + case EPacketDataOutGoing: + { + retVal = iOutgoing; + } + break; + case ECmCoverage: + { +#ifndef __WINS__ + CCmPDCoverageCheck* coverage = new (ELeave) CCmPDCoverageCheck; + CleanupStack::PushL( coverage ); + + retVal = coverage->IsThereCoverageL(); + + CleanupStack::PopAndDestroy( coverage ); +#else + retVal = ETrue; +#endif + } + break; + case ECmDestination: + { + retVal = EFalse; + } + break; + case ECmBearerHasUi: + { + retVal = ETrue; + } + break; + case ECmIPv6Supported: + { + retVal = FeatureManager::FeatureSupported( KFeatureIdIPv6 ); + } + break; + case EPacketDataDataCompression: + { + retVal = static_cast + ( aGenRecordArray[KServiceRecordIndex] )->iGPRSDataCompression; + } + break; + case EPacketDataHeaderCompression: + { + retVal = static_cast + ( aGenRecordArray[KServiceRecordIndex] )->iGPRSHeaderCompression; + } + break; + case EPacketDataUseEdge: + { + retVal = static_cast + ( aGenRecordArray[KServiceRecordIndex] )->iGPRSUseEdge; + } + break; + case EPacketDataAnonymousAccess: + { + retVal = static_cast + ( aGenRecordArray[KServiceRecordIndex] )->iGPRSAnonymousAccess; + } + break; + case ECmIFPromptForAuth: + case EPacketDataIFPromptForAuth: + { + retVal = static_cast + ( aGenRecordArray[KServiceRecordIndex] )->iGPRSIfPromptForAuth; + } + break; + case ECmIPAddFromServer: + case EPacketDataIPAddrFromServer: + { + retVal = static_cast + ( aGenRecordArray[KServiceRecordIndex] )->iGPRSIPAddrFromServer; + } + break; + case ECmIPDNSAddrFromServer: + case EPacketDataIPDNSAddrFromServer: + { + retVal = static_cast + ( aGenRecordArray[KServiceRecordIndex] )->iGPRSIPDNSAddrFromServer; + } + break; + case ECmIP6DNSAddrFromServer: + case EPacketDataIPIP6DNSAddrFromServer: + { + retVal = static_cast + ( aGenRecordArray[KServiceRecordIndex] )->iGPRSIP6DNSAddrFromServer; + } + break; + case ECmEnableLPCExtension: + case EPacketDataEnableLcpExtension: + { + retVal = static_cast + ( aGenRecordArray[KServiceRecordIndex] )->iGPRSEnableLCPExtension; + } + break; + case EPacketDataServiceEnableLLMNR: + { + retVal = static_cast + ( aGenRecordArray[KServiceRecordIndex] )->iServiceEnableLlmnr; + } + break; + case ECmDisablePlainTextAuth: + case EPacketDataDisablePlainTextAuth: + { + retVal = static_cast + ( aGenRecordArray[KServiceRecordIndex] )->iGPRSDisablePlainTextAuth; + } + break; + case EGPRSSignallingIndication: + { + retVal = static_cast + ( aBearerSpecRecordArray[KQosRecordIndex] )->iGPRSSignallingIndication; + } + break; + case EGPRS_ImCnSignallingIndication: + { + retVal = static_cast + ( aBearerSpecRecordArray[KQosRecordIndex] )->iGPRS_ImCnSignallingIndication; + } + break; + default: + { + User::Leave( KErrNotFound ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETBEARERBOOLATTRIBUTEL_EXIT ); + + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetBearerStringAttributeL +// --------------------------------------------------------------------------- +// +HBufC* CCmPluginPacketData::GetBearerStringAttributeL( TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& /*aBearerSpecRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETBEARERSTRINGATTRIBUTEL_ENTRY ); + + HBufC* retVal( NULL ); + if ( ( aAttribute > EPacketDataSpecificAttributes && aAttribute < EGPRSReqTrafficClass ) + || ( aAttribute > ECmCommonAttributesStart && aAttribute < ECmCommonAttributesEnd ) ) + { + retVal = GetServiceStringAttributeL( aAttribute, aGenRecordArray ); + } + else + { + User::Leave( KErrNotSupported ); + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETBEARERSTRINGATTRIBUTEL_EXIT ); + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetServiceStringAttributeL +// --------------------------------------------------------------------------- +// +HBufC* CCmPluginPacketData::GetServiceStringAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETSERVICESTRINGATTRIBUTEL_ENTRY ); + + HBufC* retVal = NULL; + + CCDWCDMAPacketServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + switch( aAttribute ) + { + case ECmIFName: + case EPacketDataAPName: + { + if ( !serviceRecord->iGPRSAPN.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSAPN ).AllocL(); + } + } + break; + case EPacketDataPDPAddress: + { + if ( !serviceRecord->iGPRSPDPAddress.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSPDPAddress ).AllocL(); + } + } + break; + case ECmIFParams: + case EPacketDataIFParams: + { + if ( !serviceRecord->iGPRSIfParams.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSIfParams ).AllocL(); + } + } + break; + case ECmIFNetworks: + case EPacketDataIFNetworks: + { + if ( !serviceRecord->iGPRSIfNetworks.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSIfNetworks ).AllocL(); + } + } + break; + case ECmIFAuthName: + case EPacketDataIFAuthName: + { + if ( !serviceRecord->iGPRSIfAuthName.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSIfAuthName ).AllocL(); + } + } + break; + case ECmIFAuthPass: + case EPacketDataIFAuthPass: + { + if ( !serviceRecord->iGPRSIfAuthPass.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSIfAuthPass ).AllocL(); + } + } + break; + case ECmIPNetmask: + case EPacketDataIPNetmask: + { + if ( !serviceRecord->iGPRSIPNetMask.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSIPNetMask ).AllocL(); + } + } + break; + case ECmIPGateway: + case EPacketDataIPGateway: + { + if ( !serviceRecord->iGPRSIPGateway.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSIPGateway ).AllocL(); + } + } + break; + case ECmIPAddress: + case EPacketDataIPAddr: + { + if ( !serviceRecord->iGPRSIPAddr.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSIPAddr ).AllocL(); + } + } + break; + case ECmIPNameServer1: + case EPacketDataIPNameServer1: + { + if ( !serviceRecord->iGPRSIPNameServer1.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSIPNameServer1 ).AllocL(); + } + } + break; + case ECmIPNameServer2: + case EPacketDataIPNameServer2: + { + if ( !serviceRecord->iGPRSIPNameServer2.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSIPNameServer2 ).AllocL(); + } + } + break; + case ECmIP6NameServer1: + case EPacketDataIPIP6NameServer1: + { + if ( !serviceRecord->iGPRSIP6NameServer1.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSIP6NameServer1 ).AllocL(); + } + } + break; + case ECmIP6NameServer2: + case EPacketDataIPIP6NameServer2: + { + if ( !serviceRecord->iGPRSIP6NameServer2.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSIP6NameServer2 ).AllocL(); + } + } + break; + case ECmIPAddrLeaseValidFrom: + case EPacketDataIPAddrLeaseValidFrom: + { + if ( !serviceRecord->iGPRSIPAddrLeaseValidFrom.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSIPAddrLeaseValidFrom ).AllocL(); + } + } + break; + case ECmIPAddrLeaseValidTo: + case EPacketDataIPAddrLeaseValidTo: + { + if ( !serviceRecord->iGPRSIPAddrLeaseValidTo.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSIPAddrLeaseValidTo ).AllocL(); + } + } + break; + case ECmConfigDaemonManagerName: + case EPacketDataConfigDaemonManagerName: + { + if ( !serviceRecord->iGPRSConfigDaemonManagerName.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSConfigDaemonManagerName ).AllocL(); + } + } + break; + case ECmConfigDaemonName: + case EPacketDataConfigDaemonName: + { + if ( !serviceRecord->iGPRSConfigDaemonName.IsNull() ) + { + retVal = TPtrC( serviceRecord->iGPRSConfigDaemonName ).AllocL(); + } + } + break; + + default: + { + User::Leave( KErrNotFound ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETSERVICESTRINGATTRIBUTEL_EXIT ); + + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetBearerString8AttributeL +// --------------------------------------------------------------------------- +// +HBufC8* CCmPluginPacketData::GetBearerString8AttributeL( TUint32 /*aAttribute*/, + RPointerArray& /*aGenRecordArray*/, + RPointerArray& /*aBearerSpecRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETBEARERSTRING8ATTRIBUTEL_ENTRY ); + + User::Leave( KErrNotSupported ); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETBEARERSTRING8ATTRIBUTEL_EXIT ); + + return NULL; + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::SetBearerIntAttributeL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::SetBearerIntAttributeL( TUint32 aAttribute, TUint32 aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_SETBEARERINTATTRIBUTEL_ENTRY ); + + if ( aAttribute >= EPacketDataSpecificAttributes && aAttribute < EPacketDataServiceEnableLLMNR ) + { + SetServiceIntAttributeL( aAttribute, aValue, aGenRecordArray ); + } + else if ( aAttribute >= EGPRSReqTrafficClass && aAttribute <= EGPRSSourceStatisticsDescriptor ) + { + SetQosIntAttributeL( aAttribute, aValue, aBearerSpecRecordArray ); + } + else + { + User::Leave( KErrNotFound ); + } + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_SETBEARERINTATTRIBUTEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::SetServiceIntAttributeL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::SetServiceIntAttributeL( + TUint32 aAttribute, + TUint32 aValue, + RPointerArray& aGenRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_SETSERVICEINTATTRIBUTEL_ENTRY ); + + CCDWCDMAPacketServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + + switch ( aAttribute ) + { + case EPacketDataPDPType: + { + SetPDPTypeL( static_cast( aValue ), + serviceRecord ); + } + break; + + case EPacketDataReqPrecedence: + { + serviceRecord->iGPRSReqPrecedence.SetL( aValue ); + } + break; + + case EPacketDataReqDelay: + { + serviceRecord->iGPRSReqDelay.SetL( aValue ); + } + break; + + case EPacketDataReliability: + { + serviceRecord->iGPRSReqReliability.SetL( aValue ); + } + break; + + case EPacketDataPeakThroughput: + { + serviceRecord->iGPRSReqPeakThroughput.SetL( aValue ); + } + break; + + case EPacketDataMeanThroughput: + { + serviceRecord->iGPRSMinMeanThroughput.SetL( aValue ); + } + break; + + case EPacketDataMinPrecedence: + { + serviceRecord->iGPRSMinPrecedence.SetL( aValue ); + } + break; + + case EPacketDataMinDelay: + { + serviceRecord->iGPRSMinDelay.SetL( aValue ); + } + break; + + case EPacketDataMinReliability: + { + serviceRecord->iGPRSMinReliability.SetL( aValue ); + } + break; + + case EPacketDataMinPeakThroughput: + { + serviceRecord->iGPRSMinPeakThroughput.SetL( aValue ); + } + break; + + case EPacketDataMinMeanThroughput: + { + serviceRecord->iGPRSMinMeanThroughput.SetL( aValue ); + } + break; + + case EPacketDataIFAuthRetries: + { + serviceRecord->iGPRSIfAuthRetries.SetL( aValue ); + } + break; + + case EPacketDataApType: + { + serviceRecord->iGPRSAPType.SetL( aValue ); + } + break; + + case EPacketDataQoSWarningTimeOut: + { + serviceRecord->iGPRSQOSWarningTimeOut.SetL( aValue ); + } + break; + default: + { + User::Leave( KErrNotFound ); + } + } + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_SETSERVICEINTATTRIBUTEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::SetQosIntAttributeL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::SetQosIntAttributeL( + TUint32 aAttribute, + TUint32 aValue, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_SETQOSINTATTRIBUTEL_ENTRY ); + + CCDUmtsR99QoSAndOnTableRecord* qosRecord = + static_cast( aBearerSpecRecordArray[KQosRecordIndex] ); + + switch ( aAttribute ) + { + case EGPRSReqTrafficClass: + { + qosRecord->iGPRSReqTrafficClass.SetL( static_cast( aValue ) ); + } + break; + + case EGPRSMinTrafficClass: + { + qosRecord->iGPRSMinTrafficClass.SetL( static_cast( aValue ) ); + } + break; + + case EGPRSReqDeliveryOrder: + { + qosRecord->iGPRSReqDeliveryOrder.SetL( static_cast( aValue ) ); + } + break; + + case GPRSMinDeliveryOrder: + { + qosRecord->iGPRSMinDeliveryOrder.SetL( static_cast( aValue ) ); + } + break; + case EGPRSReqDeliverErroneousSDU: + { + qosRecord->iGPRSReqDeliverErroneousSDU.SetL( static_cast( aValue ) ); + } + break; + case EGPRSMinDeliverErroneousSDU: + { + qosRecord->iGPRSMinDeliverErroneousSDU.SetL( static_cast( aValue ) ); + } + break; + case EGPRSReqMaxSDUSize: + { + qosRecord->iGPRSReqMaxSDUSize.SetL( aValue ); + } + break; + + case EGPRSMinAcceptableMaxSDUSize: + { + qosRecord->iGPRSMinAcceptableMaxSDUSize.SetL( aValue ); + } + break; + + case EGPRSReqMaxUplinkRate: + { + qosRecord->iGPRSReqMaxUplinkRate.SetL( aValue ); + } + break; + + case EGPRSReqMinUplinkRate: + { + qosRecord->iGPRSReqMinUplinkRate.SetL( aValue ); + } + break; + + case EGPRSReqMaxDownlinkRate: + { + qosRecord->iGPRSReqMaxDownlinkRate.SetL( aValue ); + } + break; + + case EGPRSReqMinDownlinkRate: + { + qosRecord->iGPRSReqMinDownlinkRate.SetL( aValue ); + } + break; + + case EGPRSReqBER: + { + qosRecord->iGPRSReqBER.SetL( static_cast( aValue ) ); + } + break; + + case EGPRSMaxBER: + { + qosRecord->iGPRSMaxBER.SetL( static_cast( aValue ) ); + } + break; + + case EGPRSReqSDUErrorRatio: + { + qosRecord->iGPRSReqSDUErrorRatio.SetL( static_cast( aValue ) ); + } + break; + + case EGPRSMaxSDUErrorRatio: + { + qosRecord->iGPRSMaxSDUErrorRatio.SetL( static_cast( aValue ) ); + } + break; + + case EGPRSReqTrafficHandlingPriority: + { + qosRecord->iGPRSReqTrafficHandlingPriority.SetL( static_cast( aValue ) ); + } + break; + + case EGPRSMinTrafficHandlingPriority: + { + qosRecord->iGPRSMinTrafficHandlingPriority.SetL( static_cast( aValue ) ); + } + break; + + case EGPRSReqTransferDelay: + { + qosRecord->iGPRSReqTransferDelay.SetL( aValue ); + } + break; + + case EGPRSMaxTransferDelay: + { + qosRecord->iGPRSMaxTransferDelay.SetL( aValue ); + } + break; + + case EGPRSReqGuaranteedUplinkRate: + { + qosRecord->iGPRSReqGuaranteedUplinkRate.SetL( aValue ); + } + break; + + case EGPRSMinGuaranteedUplinkRate: + { + qosRecord->iGPRSMinGuaranteedUplinkRate.SetL( aValue ); + } + break; + + case EGPRSReqGuaranteedDownlinkRate: + { + qosRecord->iGPRSReqGuaranteedDownlinkRate.SetL( aValue ); + } + break; + + case EGPRSMinGuaranteedDownlinkRate: + { + qosRecord->iGPRSMinGuaranteedDownlinkRate.SetL( aValue ); + } + break; + + case EGPRSSourceStatisticsDescriptor: + { + qosRecord->iGPRSSourceStatisticsDescriptor.SetL( static_cast( aValue ) ); + } + break; + + default: + { + User::Leave( KErrNotFound ); + } + break; + } + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_SETQOSINTATTRIBUTEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::SetBearerBoolAttributeL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::SetBearerBoolAttributeL( TUint32 aAttribute, TBool aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_SETBEARERBOOLATTRIBUTEL_ENTRY ); + + CCDWCDMAPacketServiceRecord* serviceRecord = + static_cast( aGenRecordArray[KServiceRecordIndex] ); + + switch( aAttribute ) + { + case EPacketDataOutGoing: + { + iOutgoing = aValue; + } + break; + case EPacketDataDataCompression: + { + serviceRecord->iGPRSDataCompression.SetL( aValue ); + } + break; + case EPacketDataHeaderCompression: + { + serviceRecord->iGPRSHeaderCompression.SetL( aValue ); + } + break; + case EPacketDataUseEdge: + { + serviceRecord->iGPRSUseEdge.SetL( aValue ); + } + break; + case EPacketDataAnonymousAccess: + { + serviceRecord->iGPRSAnonymousAccess.SetL( aValue ); + } + break; + case ECmIFPromptForAuth: + case EPacketDataIFPromptForAuth: + { + serviceRecord->iGPRSIfPromptForAuth.SetL( aValue ); + } + break; + case ECmIPAddFromServer: + case EPacketDataIPAddrFromServer: + { + serviceRecord->iGPRSIPAddrFromServer.SetL( aValue ); + } + break; + case ECmIPDNSAddrFromServer: + case EPacketDataIPDNSAddrFromServer: + { + serviceRecord->iGPRSIPDNSAddrFromServer.SetL( aValue ); + } + break; + case ECmIP6DNSAddrFromServer: + case EPacketDataIPIP6DNSAddrFromServer: + { + serviceRecord->iGPRSIP6DNSAddrFromServer.SetL( aValue ); + } + break; + case ECmEnableLPCExtension: + case EPacketDataEnableLcpExtension: + { + serviceRecord->iGPRSEnableLCPExtension.SetL( aValue ); + } + break; + case ECmDisablePlainTextAuth: + case EPacketDataDisablePlainTextAuth: + { + serviceRecord->iGPRSDisablePlainTextAuth.SetL( aValue ); + } + break; + case EGPRSSignallingIndication: + { + static_cast + ( aBearerSpecRecordArray[KQosRecordIndex] )->iGPRSSignallingIndication.SetL( aValue ); + } + break; + case EGPRS_ImCnSignallingIndication: + { + static_cast + ( aBearerSpecRecordArray[KQosRecordIndex] )->iGPRS_ImCnSignallingIndication.SetL( aValue ); + } + break; + case EPacketDataServiceEnableLLMNR: + { + serviceRecord->iServiceEnableLlmnr.SetL( aValue ); + } + break; + default: + { + User::Leave( KErrNotFound ); + } + break; + } + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_SETBEARERBOOLATTRIBUTEL_EXIT ); + } + + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::SetBearerStringAttributeL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::SetBearerStringAttributeL( + TUint32 aAttribute, + const TDesC16& aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_SETBEARERSTRINGATTRIBUTEL_ENTRY ); + + CCDWCDMAPacketServiceRecord* serviceRecord = + static_cast( + aGenRecordArray[KServiceRecordIndex] ); + + switch ( aAttribute ) + { + case EPacketDataAPName: + { + serviceRecord->iGPRSAPN.SetL( aValue ); + } + break; + + case EPacketDataPDPAddress: + { + serviceRecord->iGPRSPDPAddress.SetL( aValue ); + } + break; + + case ECmIFParams: + case EPacketDataIFParams: + { + serviceRecord->iGPRSIfParams.SetL( aValue ); + } + break; + + case ECmIFNetworks: + case EPacketDataIFNetworks: + { + serviceRecord->iGPRSIfNetworks.SetL( aValue ); + } + break; + + case ECmIFAuthName: + case EPacketDataIFAuthName: + { + serviceRecord->iGPRSIfAuthName.SetL( aValue ); + } + break; + + case ECmIFAuthPass: + case EPacketDataIFAuthPass: + { + serviceRecord->iGPRSIfAuthPass.SetL( aValue ); + } + break; + + case ECmIPNetmask: + case EPacketDataIPNetmask: + { + serviceRecord->iGPRSIPNetMask.SetL( aValue ); + } + break; + + case ECmIPGateway: + case EPacketDataIPGateway: + { + serviceRecord->iGPRSIPGateway.SetL( aValue ); + } + break; + + case ECmIPAddress: + case EPacketDataIPAddr: + { + if ( ( aValue.Compare( KUnspecifiedIPv4 ) == 0 ) || + ( aValue.Compare( KNullDesC ) == 0 ) ) + { + // If unspecified or NULL address is set dynamic + // IP must be enabled. + SetBearerBoolAttributeL( ECmIPAddFromServer, + ETrue, + aGenRecordArray, + aBearerSpecRecordArray ); + } + else + { + // If valid address is set dynamic IP is disabled. + SetBearerBoolAttributeL( ECmIPAddFromServer, + EFalse, + aGenRecordArray, + aBearerSpecRecordArray ); + } + serviceRecord->iGPRSIPAddr.SetL( aValue ); + } + break; + + case ECmIPNameServer1: + case EPacketDataIPNameServer1: + { + serviceRecord->iGPRSIPNameServer1.SetL( aValue ); + } + break; + + case ECmIPNameServer2: + case EPacketDataIPNameServer2: + { + serviceRecord->iGPRSIPNameServer2.SetL( aValue ); + } + break; + + case ECmIP6NameServer1: + case EPacketDataIPIP6NameServer1: + { + serviceRecord->iGPRSIP6NameServer1.SetL( aValue ); + } + break; + + case ECmIP6NameServer2: + case EPacketDataIPIP6NameServer2: + { + serviceRecord->iGPRSIP6NameServer2.SetL( aValue ); + } + break; + + case ECmIPAddrLeaseValidFrom: + case EPacketDataIPAddrLeaseValidFrom: + { + serviceRecord->iGPRSIPAddrLeaseValidFrom.SetL( aValue ); + } + break; + + case ECmIPAddrLeaseValidTo: + case EPacketDataIPAddrLeaseValidTo: + { + serviceRecord->iGPRSIPAddrLeaseValidTo.SetL( aValue ); + } + break; + + case ECmConfigDaemonManagerName: + case EPacketDataConfigDaemonManagerName: + { + serviceRecord->iGPRSConfigDaemonManagerName.SetL( aValue ); + } + break; + + case ECmConfigDaemonName: + case EPacketDataConfigDaemonName: + { + serviceRecord->iGPRSConfigDaemonName.SetL( aValue ); + } + break; + + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_SETBEARERSTRINGATTRIBUTEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::SetBearerString8AttributeL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::SetBearerString8AttributeL( TUint32 /*aAttribute*/, const TDesC8& /*aValue*/, + RPointerArray& /*aGenRecordArray*/, + RPointerArray& /*aBearerSpecRecordArray*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_SETBEARERSTRING8ATTRIBUTEL_ENTRY ); + + User::Leave( KErrNotSupported ); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_SETBEARERSTRING8ATTRIBUTEL_EXIT ); + + return; + } + + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetBearerInfoIntL +// --------------------------------------------------------------------------- +// +TUint32 CCmPluginPacketData::GetBearerInfoIntL( TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETBEARERINFOINTL_ENTRY ); + + TUint32 retVal( 0 ); + switch( aAttribute ) + { + case ECmBearerType: + { + retVal = iBearerType; + } + break; + case ECmCommsDBBearerType: + { + retVal = KCommDbBearerWcdma; + } + break; + + case ECmDefaultUiPriority: + case ECmDefaultPriority: + { + retVal = KDefaultPriorityPacketData; + } + break; + case ECmExtensionLevel: + { + retVal = KExtensionBaseLevel; + } + break; + + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETBEARERINFOINTL_EXIT ); + + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetBearerInfoBoolL +// --------------------------------------------------------------------------- +// +TBool CCmPluginPacketData::GetBearerInfoBoolL( TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETBEARERINFOBOOLL_ENTRY ); + + TBool retVal( EFalse ); + switch( aAttribute ) + { + case ECmCoverage: + { +#ifndef __WINS__ + CCmPDCoverageCheck* coverage = new (ELeave) CCmPDCoverageCheck; + CleanupStack::PushL( coverage ); + + retVal = coverage->IsThereCoverageL(); + + CleanupStack::PopAndDestroy( coverage ); +#else + retVal = ETrue; +#endif + } + break; + case ECmDestination: + { + retVal = EFalse; + } + break; + case ECmBearerHasUi: + { + retVal = EFalse; + } + break; + case ECmIPv6Supported: + { + retVal = FeatureManager::FeatureSupported( KFeatureIdIPv6 ); + } + break; + case ECmVirtual: + { + retVal = EFalse; + } + break; + + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETBEARERINFOBOOLL_EXIT ); + + return retVal; + } + + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetBearerInfoStringL +// --------------------------------------------------------------------------- +// +HBufC* CCmPluginPacketData::GetBearerInfoStringL( TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETBEARERINFOSTRINGL_ENTRY ); + + HBufC* retVal( NULL ); + switch( aAttribute ) + { + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETBEARERINFOSTRINGL_EXIT ); + + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetBearerInfoString8L +// --------------------------------------------------------------------------- +// +HBufC8* CCmPluginPacketData::GetBearerInfoString8L( TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETBEARERINFOSTRING8L_ENTRY ); + + HBufC8* retVal( NULL ); + switch( aAttribute ) + { + default: + { + + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETBEARERINFOSTRING8L_EXIT ); + + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::PrepareToCopyDataL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::PrepareToCopyDataL( CCmPluginBaseEng* aCopyInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_PREPARETOCOPYDATAL_ENTRY ); + + CCmPluginPacketData* plugin = static_cast( aCopyInstance ); + + plugin->iOutgoing = iOutgoing; + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_PREPARETOCOPYDATAL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::CopyServiceRecordL +// --------------------------------------------------------------------------- +// +CommsDat::CCDRecordBase* CCmPluginPacketData::CopyServiceRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_COPYSERVICERECORDL_ENTRY ); + + __ASSERT_ALWAYS( iServiceRecord != NULL, User::Leave( KErrNotFound )); + + CCDWCDMAPacketServiceRecord* origServiceRecord = + static_cast( iServiceRecord ); + + // New service record + CCDWCDMAPacketServiceRecord* serviceRecord = NULL; + if ( iOutgoing ) + { + serviceRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdOutgoingGprsRecord ) ); + } + else + { + serviceRecord = static_cast( + CCDRecordBase::RecordFactoryL( KCDTIdIncomingGprsRecord ) ); + } + + CleanupStack::PushL( serviceRecord ); + + serviceRecord->iRecordName.SetL( origServiceRecord->iRecordName ); + + if ( !origServiceRecord->iServiceEnableLlmnr.IsNull() ) + { + serviceRecord->iServiceEnableLlmnr.SetL( origServiceRecord->iServiceEnableLlmnr ); + } + + if ( !origServiceRecord->iGPRSAPN.IsNull() ) + { + serviceRecord->iGPRSAPN.SetL( origServiceRecord->iGPRSAPN ); + } + if ( !origServiceRecord->iGPRSPDPType.IsNull() ) + { + serviceRecord->iGPRSPDPType.SetL( origServiceRecord->iGPRSPDPType ); + } + if ( !origServiceRecord->iGPRSPDPAddress.IsNull() ) + { + serviceRecord->iGPRSPDPAddress.SetL( origServiceRecord->iGPRSPDPAddress ); + } + if ( !origServiceRecord->iGPRSReqPrecedence.IsNull() ) + { + serviceRecord->iGPRSReqPrecedence.SetL( origServiceRecord->iGPRSReqPrecedence ); + } + if ( !origServiceRecord->iGPRSReqDelay.IsNull() ) + { + serviceRecord->iGPRSReqDelay.SetL( origServiceRecord->iGPRSReqDelay ); + } + if ( !origServiceRecord->iGPRSReqReliability.IsNull() ) + { + serviceRecord->iGPRSReqReliability.SetL( origServiceRecord->iGPRSReqReliability ); + } + if ( !origServiceRecord->iGPRSReqPeakThroughput.IsNull() ) + { + serviceRecord->iGPRSReqPeakThroughput.SetL( origServiceRecord->iGPRSReqPeakThroughput ); + } + if ( !origServiceRecord->iGPRSReqMeanThroughput.IsNull() ) + { + serviceRecord->iGPRSReqMeanThroughput.SetL( origServiceRecord->iGPRSReqMeanThroughput ); + } + if ( !origServiceRecord->iGPRSMinPrecedence.IsNull() ) + { + serviceRecord->iGPRSMinPrecedence.SetL( origServiceRecord->iGPRSMinPrecedence ); + } + if ( !origServiceRecord->iGPRSMinDelay.IsNull() ) + { + serviceRecord->iGPRSMinDelay.SetL( origServiceRecord->iGPRSMinDelay ); + } + if ( !origServiceRecord->iGPRSMinReliability.IsNull() ) + { + serviceRecord->iGPRSMinReliability.SetL( origServiceRecord->iGPRSMinReliability ); + } + if ( !origServiceRecord->iGPRSMinPeakThroughput.IsNull() ) + { + serviceRecord->iGPRSMinPeakThroughput.SetL( origServiceRecord->iGPRSMinPeakThroughput ); + } + if ( !origServiceRecord->iGPRSMinMeanThroughput.IsNull() ) + { + serviceRecord->iGPRSMinMeanThroughput.SetL( origServiceRecord->iGPRSMinMeanThroughput ); + } + if ( !origServiceRecord->iGPRSDataCompression.IsNull() ) + { + serviceRecord->iGPRSDataCompression.SetL( origServiceRecord->iGPRSDataCompression ); + } + if ( !origServiceRecord->iGPRSHeaderCompression.IsNull() ) + { + serviceRecord->iGPRSHeaderCompression.SetL( origServiceRecord->iGPRSHeaderCompression ); + } + if ( !origServiceRecord->iGPRSUseEdge.IsNull() ) + { + serviceRecord->iGPRSUseEdge.SetL( origServiceRecord->iGPRSUseEdge ); + } + if ( !origServiceRecord->iGPRSAnonymousAccess.IsNull() ) + { + serviceRecord->iGPRSAnonymousAccess.SetL( origServiceRecord->iGPRSAnonymousAccess ); + } + if ( !origServiceRecord->iGPRSIfParams.IsNull() ) + { + serviceRecord->iGPRSIfParams.SetL( origServiceRecord->iGPRSIfParams ); + } + if ( !origServiceRecord->iGPRSIfNetworks.IsNull() ) + { + serviceRecord->iGPRSIfNetworks.SetL( origServiceRecord->iGPRSIfNetworks ); + } + if ( !origServiceRecord->iGPRSIfPromptForAuth.IsNull() ) + { + serviceRecord->iGPRSIfPromptForAuth.SetL( origServiceRecord->iGPRSIfPromptForAuth ); + } + if ( !origServiceRecord->iGPRSIfAuthName.IsNull() ) + { + serviceRecord->iGPRSIfAuthName.SetL( origServiceRecord->iGPRSIfAuthName ); + } + if ( !origServiceRecord->iGPRSIfAuthPass.IsNull() ) + { + serviceRecord->iGPRSIfAuthPass.SetL( origServiceRecord->iGPRSIfAuthPass ); + } + if ( !origServiceRecord->iGPRSIfAuthRetries.IsNull() ) + { + serviceRecord->iGPRSIfAuthRetries.SetL( origServiceRecord->iGPRSIfAuthRetries ); + } + if ( !origServiceRecord->iGPRSIPNetMask.IsNull() ) + { + serviceRecord->iGPRSIPNetMask.SetL( origServiceRecord->iGPRSIPNetMask ); + } + if ( !origServiceRecord->iGPRSIPGateway.IsNull() ) + { + serviceRecord->iGPRSIPGateway.SetL( origServiceRecord->iGPRSIPGateway ); + } + if ( !origServiceRecord->iGPRSIPAddrFromServer.IsNull() ) + { + serviceRecord->iGPRSIPAddrFromServer.SetL( origServiceRecord->iGPRSIPAddrFromServer ); + } + if ( !origServiceRecord->iGPRSIPAddr.IsNull() ) + { + serviceRecord->iGPRSIPAddr.SetL( origServiceRecord->iGPRSIPAddr ); + } + if ( !origServiceRecord->iGPRSIPDNSAddrFromServer.IsNull() ) + { + serviceRecord->iGPRSIPDNSAddrFromServer.SetL( origServiceRecord->iGPRSIPDNSAddrFromServer ); + } + if ( !origServiceRecord->iGPRSIPNameServer1.IsNull() ) + { + serviceRecord->iGPRSIPNameServer1.SetL( origServiceRecord->iGPRSIPNameServer1 ); + } + if ( !origServiceRecord->iGPRSIPNameServer2.IsNull() ) + { + serviceRecord->iGPRSIPNameServer2.SetL( origServiceRecord->iGPRSIPNameServer2 ); + } + if ( !origServiceRecord->iGPRSIP6DNSAddrFromServer.IsNull() ) + { + serviceRecord->iGPRSIP6DNSAddrFromServer.SetL( origServiceRecord->iGPRSIP6DNSAddrFromServer ); + } + if ( !origServiceRecord->iGPRSIP6NameServer1.IsNull() ) + { + serviceRecord->iGPRSIP6NameServer1.SetL( origServiceRecord->iGPRSIP6NameServer1 ); + } + if ( !origServiceRecord->iGPRSIP6NameServer2.IsNull() ) + { + serviceRecord->iGPRSIP6NameServer2.SetL( origServiceRecord->iGPRSIP6NameServer2 ); + } + if ( !origServiceRecord->iGPRSIPAddrLeaseValidFrom.IsNull() ) + { + serviceRecord->iGPRSIPAddrLeaseValidFrom.SetL( origServiceRecord->iGPRSIPAddrLeaseValidFrom ); + } + if ( !origServiceRecord->iGPRSIPAddrLeaseValidTo.IsNull() ) + { + serviceRecord->iGPRSIPAddrLeaseValidTo.SetL( origServiceRecord->iGPRSIPAddrLeaseValidTo ); + } + if ( !origServiceRecord->iGPRSConfigDaemonManagerName.IsNull() ) + { + serviceRecord->iGPRSConfigDaemonManagerName.SetL( origServiceRecord->iGPRSConfigDaemonManagerName ); + } + if ( !origServiceRecord->iGPRSConfigDaemonName.IsNull() ) + { + serviceRecord->iGPRSConfigDaemonName.SetL( origServiceRecord->iGPRSConfigDaemonName ); + } + if ( !origServiceRecord->iGPRSEnableLCPExtension.IsNull() ) + { + serviceRecord->iGPRSEnableLCPExtension.SetL( origServiceRecord->iGPRSEnableLCPExtension ); + } + if ( !origServiceRecord->iGPRSDisablePlainTextAuth.IsNull() ) + { + serviceRecord->iGPRSDisablePlainTextAuth.SetL( origServiceRecord->iGPRSDisablePlainTextAuth ); + } + if ( !origServiceRecord->iGPRSAPType.IsNull() ) + { + serviceRecord->iGPRSAPType.SetL( origServiceRecord->iGPRSAPType ); + } + if ( !origServiceRecord->iGPRSQOSWarningTimeOut.IsNull() ) + { + serviceRecord->iGPRSQOSWarningTimeOut.SetL( origServiceRecord->iGPRSQOSWarningTimeOut ); + } + if ( !origServiceRecord->iUmtsR99QoSAndOnTable.IsNull() ) + { + serviceRecord->iUmtsR99QoSAndOnTable.SetL( origServiceRecord->iUmtsR99QoSAndOnTable ); + } + if ( !origServiceRecord->iGPRSR5DataCompression.IsNull() ) + { + serviceRecord->iGPRSR5DataCompression.SetL( origServiceRecord->iGPRSR5DataCompression ); + } + if ( !origServiceRecord->iGPRSR5HeaderCompression.IsNull() ) + { + serviceRecord->iGPRSR5HeaderCompression.SetL( origServiceRecord->iGPRSR5HeaderCompression ); + } + if ( !origServiceRecord->iGPRSPacketFlowIdentifier.IsNull() ) + { + serviceRecord->iGPRSPacketFlowIdentifier.SetL( origServiceRecord->iGPRSPacketFlowIdentifier ); + } + if ( !origServiceRecord->iGPRSUmtsGprsRelease.IsNull() ) + { + serviceRecord->iGPRSUmtsGprsRelease.SetL( origServiceRecord->iGPRSUmtsGprsRelease ); + } + + CleanupStack::Pop( serviceRecord ); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_COPYSERVICERECORDL_EXIT ); + return serviceRecord; + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::ResetBearerRecords +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::ResetBearerRecords() + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_RESETBEARERRECORDS_ENTRY ); + + delete iPacketDataQoSRecord; + iPacketDataQoSRecord = NULL; + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_RESETBEARERRECORDS_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::DeleteBearerRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::DeleteBearerRecordsL() + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_DELETEBEARERRECORDSL_ENTRY ); + + if ( !TPtrC(iPacketDataQoSRecord->iRecordName).CompareF( KDefaultQosDataRecordName ) || + !TPtrC(iPacketDataQoSRecord->iRecordName).CompareF( KDefaultQosDataRecordNamewithSpace ) ) + { + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_DELETEBEARERRECORDSL_EXIT ); + return; + } + + iPacketDataQoSRecord->DeleteL( iSession ); + iPacketDataQoSRecord = NULL; + + OstTraceFunctionExit0( DUP1_CCMPLUGINPACKETDATA_DELETEBEARERRECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::CopyBearerRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::CopyBearerRecordsL( CCmPluginBaseEng* aCopyInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_COPYBEARERRECORDSL_ENTRY ); + + CCmPluginPacketData* plugin = static_cast( aCopyInstance ); + + plugin->iPacketDataQoSRecord = + static_cast( + CCDRecordBase::CreateCopyRecordL( *iPacketDataQoSRecord ) ); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_COPYBEARERRECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginPacketData::GetBearerTableIdsToBeObserved +// --------------------------------------------------------------------------- +// +void CCmPluginPacketData::GetBearerTableIdsToBeObservedL( + RArray& aTableIdArray ) const + { + OstTraceFunctionEntry0( CCMPLUGINPACKETDATA_GETBEARERTABLEIDSTOBEOBSERVEDL_ENTRY ); + + aTableIdArray.AppendL( KCDTIdOutgoingGprsRecord ); + aTableIdArray.AppendL( KCDTIdUmtsR99QoSAndOnTableRecord ); + + OstTraceFunctionExit0( CCMPLUGINPACKETDATA_GETBEARERTABLEIDSTOBEOBSERVEDL_EXIT ); + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/src/cmpluginpacketdataproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/src/cmpluginpacketdataproxy.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 packet data Plugin proxy table +* +*/ + + +#include +#include + +#include "cmpluginpacketdata.h" + +// Exported proxy for instantiation method resolution +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KUidPacketDataBearerType, CCmPluginPacketData::NewL) + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/traces/OstTraceDefinitions.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler +// REMOVE BEFORE CHECK-IN TO VERSION CONTROL +// #define OST_TRACE_COMPILER_IN_USE +#include +#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/traces/fixed_id.definitions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/traces/fixed_id.definitions Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,69 @@ +#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt. +[GROUP]TRACE_FLOW=0x7 +[TRACE]TRACE_FLOW[0x7]_CCMPDCOVERAGECHECK_CCMPDCOVERAGECHECK_ENTRY=0x2 +[TRACE]TRACE_FLOW[0x7]_CCMPDCOVERAGECHECK_CCMPDCOVERAGECHECK_EXIT=0x3 +[TRACE]TRACE_FLOW[0x7]_CCMPDCOVERAGECHECK_DOCANCEL_ENTRY=0x6 +[TRACE]TRACE_FLOW[0x7]_CCMPDCOVERAGECHECK_DOCANCEL_EXIT=0x7 +[TRACE]TRACE_FLOW[0x7]_CCMPDCOVERAGECHECK_ISTHERECOVERAGEL_ENTRY=0xa +[TRACE]TRACE_FLOW[0x7]_CCMPDCOVERAGECHECK_ISTHERECOVERAGEL_EXIT=0xb +[TRACE]TRACE_FLOW[0x7]_CCMPDCOVERAGECHECK_RUNL_ENTRY=0x8 +[TRACE]TRACE_FLOW[0x7]_CCMPDCOVERAGECHECK_RUNL_EXIT=0x9 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_ADDITIONALRESET_ENTRY=0x35 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_ADDITIONALRESET_EXIT=0x36 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_BEARERRECORDIDLC_ENTRY=0x2f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_BEARERRECORDIDLC_EXIT=0x30 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CANHANDLEIAPIDL_ENTRY=0x24 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CANHANDLEIAPIDL_EXIT=0x25 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CCMPLUGINPACKETDATA_ENTRY=0xe +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CCMPLUGINPACKETDATA_EXIT=0xf +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CHECKNETWORKCOVERAGEL_ENTRY=0x31 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CHECKNETWORKCOVERAGEL_EXIT=0x32 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CONSTRUCTL_ENTRY=0x14 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CONSTRUCTL_EXIT=0x15 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CREATEADDITIONALRECORDSL_ENTRY=0x3b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CREATEADDITIONALRECORDSL_EXIT=0x3c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CREATEINSTANCEL_ENTRY=0x10 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CREATEINSTANCEL_EXIT=0x11 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CREATENEWSERVICERECORDL_ENTRY=0x2b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_CREATENEWSERVICERECORDL_EXIT=0x2c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_DELETEADDITIONALRECORDSL_ENTRY=0x3d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_DELETEADDITIONALRECORDSL_EXIT=0x3e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_GETBOOLATTRIBUTEL_ENTRY=0x18 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_GETBOOLATTRIBUTEL_EXIT=0x19 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_GETINTATTRIBUTEL_ENTRY=0x16 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_GETINTATTRIBUTEL_EXIT=0x17 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_GETSTRINGATTRIBUTEL_ENTRY=0x1a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_GETSTRINGATTRIBUTEL_EXIT=0x1b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_LOADADDITIONALRECORDSL_ENTRY=0x40 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_LOADADDITIONALRECORDSL_EXIT=0x41 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_LOADSERVICESETTINGL_ENTRY=0x28 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_LOADSERVICESETTINGL_EXIT=0x29 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_NEWL_ENTRY=0xc +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_NEWL_EXIT=0xd +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_PREPARETOCOPYDATAL_ENTRY=0x37 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_PREPARETOCOPYDATAL_EXIT=0x38 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_PREPARETOUPDATERECORDSL_ENTRY=0x22 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_PREPARETOUPDATERECORDSL_EXIT=0x23 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_SERVICERECORDIDLC_ENTRY=0x2d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_SERVICERECORDIDLC_EXIT=0x2e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_SERVICERECORD_ENTRY=0x2a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_SETBOOLATTRIBUTEL_ENTRY=0x1e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_SETBOOLATTRIBUTEL_EXIT=0x1f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_SETDAEMONNAMEL_ENTRY=0x39 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_SETDAEMONNAMEL_EXIT=0x3a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_SETINTATTRIBUTEL_ENTRY=0x1c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_SETINTATTRIBUTEL_EXIT=0x1d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_SETPDPTYPEL_ENTRY=0x33 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_SETPDPTYPEL_EXIT=0x34 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_SETSTRINGATTRIBUTEL_ENTRY=0x20 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_SETSTRINGATTRIBUTEL_EXIT=0x21 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_UPDATEADDITIONALRECORDSL_ENTRY=0x42 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINPACKETDATA_UPDATEADDITIONALRECORDSL_EXIT=0x43 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPDCOVERAGECHECK_CCMPDCOVERAGECHECK_ENTRY=0x4 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPDCOVERAGECHECK_CCMPDCOVERAGECHECK_EXIT=0x5 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINPACKETDATA_CANHANDLEIAPIDL_ENTRY=0x26 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINPACKETDATA_CANHANDLEIAPIDL_EXIT=0x27 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINPACKETDATA_CCMPLUGINPACKETDATA_ENTRY=0x12 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINPACKETDATA_CCMPLUGINPACKETDATA_EXIT=0x13 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINPACKETDATA_DELETEADDITIONALRECORDSL_EXIT=0x3f +[TRACE]TRACE_FLOW[0x7]__SETPDPTYPEL_EXIT=0x1 diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginwlan/data/10281BB2.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginwlan/data/10281BB2.rss Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* WLAN PlugIn's resource file +* +* +*/ + +#include "ecom/RegistryInfo.rh" + +// Because attribute enums had to be added to namespace CMManager +// it's not possible to included cmpluginwlandef.h +// Thus bearer type id had to be redefine here. +#define KUidWlanBearerType 0x10281BB1 + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x10281BB2; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207377; // = KCMPluginInterfaceUid + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidWlanBearerType; + version_no = 1; + display_name = "Wlan"; + default_data = "Wlan"; + opaque_data = ""; + } + }; + } + }; + } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginwlan/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginwlan/group/bld.inf Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Build information for the WLAN plugin. +* +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// export iby files +../Rom/cmmpluginwlan.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cmmpluginwlan.iby) + + +PRJ_MMPFILES +cmpluginwlan.mmp diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginwlan/group/cmpluginwlan.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginwlan/group/cmpluginwlan.mmp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Project specification for LAN Plugin. +* +* +*/ + +#include +#include + +TARGET cmpluginwlan.dll +UID 0x10009D8D 0x10281BB2 + +TARGETTYPE PLUGIN + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src + +SOURCE cmpluginwlanproxy.cpp +SOURCE cmpluginwlan.cpp +SOURCE cmwlancoveragecheck.cpp + +SOURCEPATH ../data + +START RESOURCE 10281BB2.rss +TARGET cmpluginwlan.rsc +END + +// Component specific internal headers +USERINCLUDE ../inc +USERINCLUDE ../traces + +// ADO specific internal headers +SYSTEMINCLUDE ../../../../../inc + +//Macro to /epoc32 headers +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY commsdat.lib +LIBRARY cmmanagerdatabase.lib +LIBRARY featmgr.lib +LIBRARY cmmpluginbase.lib diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginwlan/inc/cmpluginwlan.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginwlan/inc/cmpluginwlan.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,403 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 WLAN interface implementation +* for WLAN plugin +* +*/ + + +#ifndef WLAN_PLUGIN_H +#define WLAN_PLUGIN_H + +#include +#include +#include + +class CCDWlanServiceRecord; + + +/** +* CCmPluginWlan defines the functionality of wlan bearer support. +* Most of the API is inherited from CCmPluginBaseEng class. +*/ +NONSHARABLE_CLASS( CCmPluginWlan ) : public CCmPluginBaseEng + { + + public: // Constructors and destructor + /** + * Two phased constructor. + * @return Returns the Wlan plugin object. + */ + static CCmPluginWlan* NewL( TCmPluginInitParam* aInitParam ); + + /** + * Destructor. + */ + virtual ~CCmPluginWlan(); + + public: // From CCmPluginBaseEng + /** + * Creates a new instance of Wlan bearer plugin. The instance + * created represents a bearer, not a connection method. + * @param aInitParam Initialization data. + * @return Returns CCmPluginBaseEng type pointer which represents pure + * bearer instance for the cmm server. + */ + + virtual CCmPluginBaseEng* CreateInstanceL( + TCmPluginInitParam& aInitParam ) const; + + /** + * Following GetBearerInfoXXXL methods return the values of the + * requested attributes. These values are Wlan specific + * so they don't vary between Wlan Connection Methods. + * @param aAttribute An attribute identifier. + * @return Returns the value requested. If not found leaves with + * KErrNotFound error code. + */ + + virtual TUint32 GetBearerInfoIntL( TUint32 aAttribute ) const; + + virtual TBool GetBearerInfoBoolL( TUint32 aAttribute ) const; + + virtual HBufC* GetBearerInfoStringL( TUint32 aAttribute ) const; + + virtual HBufC8* GetBearerInfoString8L( TUint32 aAttribute ) const; + + /** + * Checks if the plug-in can handle the Connection Method identified + * with parameter aIapId. + * @param aIapId IAPId of the Connection Method to be checked. + * @return ETrue if plug-in can handle the IAP, otherwise EFalse. + */ + TBool CanHandleIapIdL( TUint32 aIapId ) const; + + /** + * Checks if the plug-in can handle the given IAP record. + * @param aIapRecord IAP record to be checked + * @return ETrue if plug-in can handle the IAP, otherwise EFalse. + */ + TBool CanHandleIapIdL( CommsDat::CCDIAPRecord *aIapRecord ) const; + + public: // From CCmPluginBaseEng concerning a Connection Method + /** + * Before generic side starts to request plugins to load records + * it calls this to give a possibility make some preparations + * if needed. + */ + virtual void PreparePluginToLoadRecordsL(); + + /** + * Before generic side starts to request plugins to update records + * it calls this to give a possibility make some preparations + * if needed. + * @param aGenRecordArray An array of generic records to be updated. + * @param aBearerSpecRecordArray An array of bearer specific records + * to be updated. + */ + virtual void PreparePluginToUpdateRecordsL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Creates the CCDLANServiceRecord and CCDWlanServiceRecord type service + * records. + */ + virtual void CreateServiceRecordL(); + + /** + * Loads the service record(which is in wlan case LAN service type). + * Service record pointer is stored to plugins generic side + * implementation(CCmPluginBaseEng). + */ + void LoadServiceRecordL(); + + /** + * Returns the service record id of this Connection Method. + * @return Returns the id of the service record id of this Connection Method. + */ + virtual TUint32 ServiceRecordId() const; + + /** + * Returns the service record name of the Connection Method. + * @param aServiceName Name of the service record which CM's iap record + * points to. + */ + virtual void ServiceRecordNameLC( HBufC* &aServiceName ); + + /** + * Writes the service record data to CommsDat. + * @param aGenRecordArray An array containing pointers to service + * record of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records of the Connection Method. + */ + virtual void UpdateServiceRecordL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Loads Wlan specific records of the Connection Method. + */ + virtual void LoadBearerRecordsL(); + + /** + * Returns the bearer record id of the Connection Method. + * @param aRecordId Id of the bearer record this CM's iap record + * points to. + */ + virtual void BearerRecordIdL( TUint32& aRecordId ); + + /** + * Returns the bearer record name of the Connection Method. + * @param aBearerName Name of the bearer record this CM's iap record + * points to. + */ + virtual void BearerRecordNameLC( HBufC*& aBearerName ); + + /** + * Writes Wlan specific record data to CommsDat. + * @param aGenRecordArray An array containing pointer to service + * record of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records to be written. + */ + virtual void UpdateBearerRecordsL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Deletes Wlan specific records of the Connection Method. + */ + void DeleteBearerRecordsL(); + + /** + * Releases the memory reserved by the Wlan specific records + * of the Connection Method. + */ + virtual void ResetBearerRecords(); + + /** + * Creates a copy of Wlan specific records and adds them to + * aRecordArray. + * @param aRecordArray Pointer array where to add bearer specific + * records. + */ + virtual void GetBearerSpecificRecordsL( + RPointerArray& aRecordArray ); + + /** + * Following GetBearerXXXXAttribute methods get only the + * fields in records in pointer arrays(parameters). + * @param aAttribute Identifier of the requested value. + * @param aGenRecordArray An array containing pointers to generic + * records of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records of the Connection Method. aAttribute + * parameter should identify one field(integer, boolean string) + * in one of these records. + * @return Returns the requested value. In error case leaves with + * system-wide error code. + */ + + virtual TUint32 GetBearerIntAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual TBool GetBearerBoolAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual HBufC* GetBearerStringAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual HBufC8* GetBearerString8AttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Following SetBearerXXXXAttribute methods set only the + * fields in records in pointer arrays(parameters). They are not + * allowed to update the original records in plugins. + * @param aAttribute Identifier of the field to set. + * @param aValue The value to set. + * @param aGenRecordArray An array containing pointers to generic + * records of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records of the Connection Method. aAttribute + * parameter should identify one field(integer, boolean string) + * in one of these records. + * @return None. + */ + + virtual void SetBearerIntAttributeL( + TUint32 aAttribute, TUint32 aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual void SetBearerBoolAttributeL( + TUint32 aAttribute, TBool aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual void SetBearerStringAttributeL( + TUint32 aAttribute, const TDesC16& aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + virtual void SetBearerString8AttributeL( + TUint32 aAttribute, const TDesC8& aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Bearer is requested by the server if it uses CommsDat tables which + * should be observed for possible changes to be able to keep the + * data in memory in up to date. + * @param aTableIdArray A reference to an array where to add those + * table ids. + */ + virtual void GetBearerTableIdsToBeObservedL( + RArray& aTableIdArray ) const; + + private: // construction + /** + * Constructor. + */ + CCmPluginWlan( TCmPluginInitParam* aInitParam ); + + /** + * Second phase constructor. Leaves on failure. + */ + void ConstructL(); + + private: // from base class + + /** + * From CCmPluginBaseEng + * Creates the WLAN service record used by this WLAN + */ + void CreateWlanServiceRecordL(); + + private: // new functions + + /** + * Checks if there are any wlan networks awailable. + * @return Returns ETrue if any wlan networks found. Otherwise + * returns EFalse. + */ + TBool CheckNetworkCoverageL() const; + + /** + * Sets the daemon name for the Connection Method. + * @param aGenRecordArray An array containing pointers to generic + * records of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records of the Connection Method. + */ + void SetDaemonNameL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ); + + /** + * Returns a reference to service record of the Connection Method. + * @return Returns a reference to service record of the Connection + * Method. + */ + CommsDat::CCDLANServiceRecord& ServiceRecord() const; + + /** + * Makes needed preparations before copying records. + * @param aCopyInstance Instance of the plugin where to copy. + */ + virtual void PrepareToCopyDataL( CCmPluginBaseEng* aCopyInstance ); + + /** + * Copies the LAN service record. + * @return Returns a pointer to service record created. + */ + CommsDat::CCDRecordBase* CopyServiceRecordL(); + + /** + * Copies the Wlan service record. + * @param aSourceRecord A record where to copy from. + * @param aDestRecord A record where to copy to. + */ + void CopyWlanServiceRecordL( CCDWlanServiceRecord* aSourceRecord, + CCDWlanServiceRecord* aDestRecord); + + /** + * Copies the bearer specific records to copy instance. + * @param aCopyInstance Instance of the plugin where to copy. + */ + virtual void CopyBearerRecordsL( CCmPluginBaseEng* aCopyInstance ); + + /** + * Adds Wlan service record with default values to record array. + * @param aRecordArray The array where to add the record. + */ + void GetDefaultWlanServiceRecordL( + RPointerArray& aRecordArray ); + + /** + * Checks if the given attributes are in the correct range. + * @param aAttribute Identifies the attribute to be checked. + * @param aValue A value to be checked. + */ + void CheckSecurityAttributeValidityL( const TUint32 aAttribute, + const TUint32 aValue ); + + /** + * Convert a 8-bit string in ascii format to hex format. Ownership of + * new string is transfered. + */ + HBufC8* ConvertAsciiToHexL( const TDesC8& aSource ); + + /** + * Convert a 8-bit string in hex format to ascii format. Ownership of + * new string is transfered. + */ + HBufC8* ConvertHexToAsciiL( const TDesC8& aSource ); + + /** + * Translates a hex char (0-1, a-f, A-F) to its 10-base numerical + * value (0-15). + */ + TUint8 ConvertHexCharToNumberL( const TUint8 aHexChar ); + + private: // Data + + /** + * WLan service record. + */ + CCDWlanServiceRecord* iWlanServiceRecord; + + /** + * WLAN table id. + */ + CommsDat::TMDBElementId iWlanTableId; + + /** + * Boolean to save the WAPI support info. + */ + TBool iWAPISupported; + }; + +#endif // WLAN_PLUGIN_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginwlan/inc/cmwlancoveragecheck.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginwlan/inc/cmwlancoveragecheck.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 WLAN Coverage Check class +* +*/ + +#ifndef CMWLANCOVERAGECHECK_H +#define CMWLANCOVERAGECHECK_H + +// INCLUDES +#include +#include + +using namespace CMManager; + +/** + * WLAN Coverage Check + * + * ?more_complete_description + * + * @since S60 3.2 + */ +class CCmWlanCoverageCheck : public CActive + { + enum EWlanCoverageState + { + EServiceStatus, + EScanning, + EDone, + }; + + public: + + CCmWlanCoverageCheck(); + ~CCmWlanCoverageCheck(); + + TBool GetCoverageL(); + + /** + * Returns whether the passed ssid and length results in a hidden or + * a non-hidden ssid. + * + * @since S60 3.2 + * @param aSsidLength The length of the ssid + * @param aSsid The ssid + * @return ETrue if the ssid is hidden. + */ + TBool IsHiddenSsid( TUint aSsidLength, const TUint8* aSsid ) const; + + protected: // from CActive + + virtual void DoCancel(); + virtual void RunL(); + + private: + + TUint32 iProgState; + TBool iCoverage; + CActiveSchedulerWait iWait; + }; + + +#endif // CMWLANCOVERAGECHECK_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginwlan/rom/cmmpluginwlan.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginwlan/rom/cmmpluginwlan.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* cmpluginwlan.dll to ROM. +* +*/ +#ifndef CMMPLUGINWLAN_IBY__ +#define CMMPLUGINWLAN_IBY__ + +ECOM_PLUGIN(cmpluginwlan.dll,10281BB2.rsc) + + +#endif // CMMPLUGINWLAN_IBY__ + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginwlan/src/cmpluginwlan.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginwlan/src/cmpluginwlan.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,2432 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 WLAN Plugin interface implementation +* for WLAN Bearer +* +*/ + + +#include // For REComSession +#include +#include +#include +#include +#include + +#include "cmpluginwlan.h" +#include "cmwlancoveragecheck.h" +#include "cmmanagerdef.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmpluginwlanTraces.h" +#endif + +using namespace CMManager; + +enum TWlanWepKeyFormat + { + EWlanWepKeyFormatAscii = 0, + EWlanWepKeyFormatHex + }; + +// default values for fields... +// CONSTANTS +_LIT( KEmpty, ""); + +const TBool KDefIpAddrFromServer = ETrue; +const TBool KDefIpDnsAddrFromServer = ETrue; +const TBool KDefIp6DnsAddrFromServer = ETrue; + +const TInt KWlanServiceRecordIndex = 0; + +const TUint32 KDefaultPriorityWLan = 0; + +const TInt KWlanLastSocketActivityTimeout = -1; +const TInt KWlanLastSessionClosedTimeout = 1; +const TInt KWlanLastSocketClosedTimeout = -1; + +/// Modem bearer names for WLAN connection methods +_LIT( KModemBearerWLAN, "WLANBearer" ); + +_LIT( KWlanBearerName, "WLANBearer" ); +_LIT( KWlanBearerAgent, "wlanagt.agt" ); +_LIT( KWlanBearerNif, "wlannif" ); + +_LIT( KWlanLDDName, "not used" ); +_LIT( KWlanPDDName, "not used" ); + + +// -------------------------------------------------------------------------- +// CCmPluginWlan::NewL +// -------------------------------------------------------------------------- +// +CCmPluginWlan* CCmPluginWlan::NewL( TCmPluginInitParam* aInitParam ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_NEWL_ENTRY ); + + CCmPluginWlan* self = new( ELeave ) CCmPluginWlan( aInitParam ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMPLUGINWLAN_NEWL_EXIT ); + return self; + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::~CCmPluginWlan +// -------------------------------------------------------------------------- +// +CCmPluginWlan::~CCmPluginWlan() + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_CCMPLUGINWLAN_ENTRY ); + + ResetBearerRecords(); + FeatureManager::UnInitializeLib(); + + OstTraceFunctionExit0( CCMPLUGINWLAN_CCMPLUGINWLAN_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::CreateInstanceL +// -------------------------------------------------------------------------- +// +CCmPluginBaseEng* CCmPluginWlan::CreateInstanceL( TCmPluginInitParam& aInitParam ) const + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_CREATEINSTANCEL_ENTRY ); + + CCmPluginWlan* self = new( ELeave ) CCmPluginWlan( &aInitParam ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMPLUGINWLAN_CREATEINSTANCEL_EXIT ); + return self; + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::CCmPluginWlan +// -------------------------------------------------------------------------- +// +CCmPluginWlan::CCmPluginWlan( TCmPluginInitParam* aInitParam ) + : + CCmPluginBaseEng( aInitParam ) + { + OstTraceFunctionEntry0( DUP1_CCMPLUGINWLAN_CCMPLUGINWLAN_ENTRY ); + + iBearerType = KUidWlanBearerType; + iWlanServiceRecord = NULL; + iWlanTableId = 0; + iWAPISupported = EFalse; + + OstTraceFunctionExit0( DUP1_CCMPLUGINWLAN_CCMPLUGINWLAN_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::ConstructL +// -------------------------------------------------------------------------- +// +void CCmPluginWlan::ConstructL() + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_CONSTRUCTL_ENTRY ); + + FeatureManager::InitializeLibL(); + + if ( ! FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ) ) + { + FeatureManager::UnInitializeLib(); + + User::Leave( KErrNotSupported ); + } + + CCmPluginBaseEng::ConstructL(); + + // get WLAN table id + TRAP_IGNORE( iWlanTableId = CCDWlanServiceRecord::TableIdL( iSession ) ); + + if ( !iWlanTableId ) + { + iWlanTableId = CCDWlanServiceRecord::CreateTableL( iSession ); + + TMDBElementId tableId = 0; + + TRAP_IGNORE( tableId = CCDWlanDeviceSettingsRecord::TableIdL( iSession ) ); + if ( !tableId ) + { + CCDWlanDeviceSettingsRecord::CreateTableL( iSession ); + } + + TRAP_IGNORE( tableId = CCDWLANSecSSIDTable::TableIdL( iSession ) ); + if ( !tableId ) + { + CCDWLANSecSSIDTable::CreateTableL( iSession ); + } + + TRAP_IGNORE( tableId = CCDDestNWTable::TableIdL( iSession ) ); + if ( !tableId ) + { + CCDDestNWTable::CreateTableL( iSession ); + } + } + + iWAPISupported = FeatureManager::FeatureSupported( KFeatureIdFfWlanWapi ); + + OstTraceFunctionExit0( CCMPLUGINWLAN_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::ServiceRecord() +// --------------------------------------------------------------------------- +// +CCDLANServiceRecord& CCmPluginWlan::ServiceRecord() const + { + return *static_cast( iServiceRecord ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::ServiceRecordId +// --------------------------------------------------------------------------- +// +TUint32 CCmPluginWlan::ServiceRecordId() const + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_SERVICERECORDID_ENTRY ); + + return ServiceRecord().RecordId(); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::ServiceRecordIdLC +// --------------------------------------------------------------------------- +// +void CCmPluginWlan::ServiceRecordNameLC( HBufC* &aName ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_SERVICERECORDNAMELC_ENTRY ); + + aName = TPtrC( KCDTypeNameLANService ).AllocLC(); + + OstTraceFunctionExit0( CCMPLUGINWLAN_SERVICERECORDNAMELC_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::BearerRecordIdL() +// --------------------------------------------------------------------------- +// +void CCmPluginWlan::BearerRecordIdL( TUint32& aRecordId ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_BEARERRECORDIDL_ENTRY ); + + CCDLANBearerRecord* lanBearerRecord = static_cast + (CCDRecordBase::RecordFactoryL( KCDTIdLANBearerRecord )); + CleanupStack::PushL( lanBearerRecord ); + + lanBearerRecord->iRecordName.SetL( TPtrC( KModemBearerWLAN ) ); + if ( !lanBearerRecord->FindL( iSession ) ) + { // bearer not found -> create dummy values + lanBearerRecord->SetRecordId( KCDNewRecordRequest ); + lanBearerRecord->iBearerAgent = KWlanBearerAgent; + lanBearerRecord->iRecordName = KWlanBearerName; + lanBearerRecord->iLanBearerNifName = KWlanBearerNif; + lanBearerRecord->iLanBearerLddName = KWlanLDDName; + lanBearerRecord->iLanBearerPddName = KWlanPDDName; + lanBearerRecord->iLastSocketActivityTimeout = + (TUint32)KWlanLastSocketActivityTimeout; + lanBearerRecord->iLastSessionClosedTimeout = + (TUint32)KWlanLastSessionClosedTimeout; + lanBearerRecord->iLastSocketClosedTimeout = + (TUint32)KWlanLastSocketClosedTimeout; + + lanBearerRecord->StoreL( iSession ); + } + + aRecordId = lanBearerRecord->RecordId(); + + CleanupStack::PopAndDestroy( lanBearerRecord ); + + OstTraceFunctionExit0( CCMPLUGINWLAN_BEARERRECORDIDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::BearerRecordNameLC() +// --------------------------------------------------------------------------- +// +void CCmPluginWlan::BearerRecordNameLC( HBufC* &aBearerName ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_BEARERRECORDNAMELC_ENTRY ); + + aBearerName = TPtrC( KCDTypeNameLANBearer ).AllocLC(); + + OstTraceFunctionExit0( CCMPLUGINWLAN_BEARERRECORDNAMELC_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::GetBearerIntAttributeL +// -------------------------------------------------------------------------- +// +TUint32 CCmPluginWlan::GetBearerIntAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_GETBEARERINTATTRIBUTEL_ENTRY ); + + TUint32 retVal( 0 ); + + CCDLANServiceRecord* serviceRecord = + static_cast( + aGenRecordArray[KServiceRecordIndex] ); + + CCDWlanServiceRecord* wlanServiceRecord = + static_cast( + aBearerSpecRecordArray[KWlanServiceRecordIndex] ); + + switch ( aAttribute ) + { + case ECmInvalidAttribute: + { + retVal = 0; + } + break; + case ECmExtensionLevel: + { + // This is extension from LAN plugin + retVal = KExtensionBaseLevel + 1; + } + break; + case ECmCommsDBBearerType: + { + retVal = KCommDbBearerWLAN; + } + break; + case ECmDefaultUiPriority: + { + retVal = KDefaultPriorityWLan; + } + break; + case ECmDefaultPriority: + { + retVal = KDefaultPriorityWLan; + } + break; + case EWlanServiceId: + { + retVal = wlanServiceRecord->iWlanServiceId; + } + break; + case EWlanConnectionMode: + { + retVal = wlanServiceRecord->iWlanConnMode; + } + break; + case EWlanSecurityMode: + { + retVal = wlanServiceRecord->iWlanSecMode; + } + break; + case EWlanAuthenticationMode: + { + retVal = wlanServiceRecord->iWlanAuthMode; + } + break; + case EWlanChannelID: + { + retVal = wlanServiceRecord->iWlanChannelID; + } + break; + case EWlanServiceExtensionTableRecordId: + { + retVal = serviceRecord->iServiceExtensionTableRecordId; + } + break; + case EWlanWepKeyIndex: + { + retVal = wlanServiceRecord->iWlanWepIndex; + } + break; + case EWlanWapiPskFormat: + { + retVal = wlanServiceRecord->iWlanFormatKey1; + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_GETBEARERINTATTRIBUTEL_EXIT ); + return retVal; + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::GetBearerBoolAttributeL +// -------------------------------------------------------------------------- +// +TBool CCmPluginWlan::GetBearerBoolAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_GETBEARERBOOLATTRIBUTEL_ENTRY ); + + TBool retVal( EFalse ); + + CCDWlanServiceRecord* wlanServiceRecord = + static_cast( + aBearerSpecRecordArray[KWlanServiceRecordIndex] ); + + CCDLANServiceRecord* serviceRecord = + static_cast( + aGenRecordArray[KServiceRecordIndex] ); + + switch ( aAttribute ) + { + case ECmCoverage: + { +#ifndef __WINS__ + retVal = CheckNetworkCoverageL(); +#else + retVal = ETrue; +#endif + } + break; + case ECmDestination: + { + retVal = EFalse; + } + break; + case ECmBearerHasUi: + { + retVal = ETrue; + } + break; + case ECmIPv6Supported: + { + retVal = FeatureManager::FeatureSupported( KFeatureIdIPv6 ); + } + break; + case EWlanScanSSID: + { + retVal = wlanServiceRecord->iWlanScanSSID; + } + break; + case EWlanAllowSSIDRoaming: + { + retVal = wlanServiceRecord->iWlanAllowSSIDRoaming; + } + break; + case ECmIPAddFromServer: + case EWlanIpAddrFromServer: + { + retVal = serviceRecord->iIpAddrFromServer; + } + break; + case ECmIPDNSAddrFromServer: + case EWlanIpDNSAddrFromServer: + { + retVal = serviceRecord->iIpDnsAddrFromServer; + } + break; + case ECmIP6DNSAddrFromServer: + case EWlanIp6DNSAddrFromServer: + { + retVal = serviceRecord->iIp6DnsAddrFromServer; + } + break; + case EWlanEnableWpaPsk: + { + retVal = static_cast( wlanServiceRecord->iWlanEnableWpaPsk ); + } + break; + case EWlan802_1xAllowUnencrypted: + { + retVal = static_cast( wlanServiceRecord->iWlanWpaKeyLength ); + } + break; + default: + { + User::Leave( KErrNotSupported ); + break; + } + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_GETBEARERBOOLATTRIBUTEL_EXIT ); + return retVal; + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::GetBearerStringAttributeL +// -------------------------------------------------------------------------- +// +HBufC* CCmPluginWlan::GetBearerStringAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_GETBEARERSTRINGATTRIBUTEL_ENTRY ); + + HBufC* retVal = NULL; + + CCDWlanServiceRecord* wlanServiceRecord = + static_cast( + aBearerSpecRecordArray[KWlanServiceRecordIndex] ); + + CCDLANServiceRecord* serviceRecord = + static_cast( + aGenRecordArray[KServiceRecordIndex] ); + + switch ( aAttribute ) + { + case ECmIFNetworks: + case EWlanIfNetworks: + { + if ( !serviceRecord->iIfNetworks.IsNull() ) + { + retVal = ( serviceRecord->iIfNetworks.GetL() ).AllocL(); + } + } + break; + case ECmIPNetmask: + case EWlanIpNetMask: + { + if ( !serviceRecord->iIpNetmask.IsNull() ) + { + retVal = ( serviceRecord->iIpNetmask.GetL() ).AllocL(); + } + } + break; + case ECmIPGateway: + case EWlanIpGateway: + { + if ( !serviceRecord->iIpGateway.IsNull() ) + { + retVal = ( serviceRecord->iIpGateway.GetL() ).AllocL(); + } + } + break; + case ECmIPAddress: + case EWlanIpAddr: + { + if ( !serviceRecord->iIpAddr.IsNull() ) + { + retVal = ( serviceRecord->iIpAddr.GetL() ).AllocL(); + } + } + break; + case ECmIPNameServer1: + case EWlanIpNameServer1: + { + if ( !serviceRecord->iIpNameServer1.IsNull() ) + { + retVal = ( serviceRecord->iIpNameServer1.GetL() ).AllocL(); + } + } + break; + case ECmIPNameServer2: + case EWlanIpNameServer2: + { + if ( !serviceRecord->iIpNameServer2.IsNull() ) + { + retVal = ( serviceRecord->iIpNameServer2.GetL() ).AllocL(); + } + } + break; + case ECmIP6NameServer1: + case EWlanIp6NameServer1: + { + if ( !serviceRecord->iIp6NameServer1.IsNull() ) + { + retVal = ( serviceRecord->iIp6NameServer1.GetL() ).AllocL(); + } + } + break; + case ECmIP6NameServer2: + case EWlanIp6NameServer2: + { + if ( !serviceRecord->iIp6NameServer2.IsNull() ) + { + retVal = ( serviceRecord->iIp6NameServer2.GetL() ).AllocL(); + } + } + break; + case ECmIPAddrLeaseValidFrom: + case EWlanIpAddrLeaseValidFrom: + { + if ( !serviceRecord->iIpAddrLeaseValidFrom.IsNull() ) + { + retVal = ( serviceRecord->iIpAddrLeaseValidFrom.GetL() ).AllocL(); + } + } + break; + case ECmIPAddrLeaseValidTo: + case EWlanIpAddrLeaseValidTo: + { + if ( !serviceRecord->iIpAddrLeaseValidTo.IsNull() ) + { + retVal = ( serviceRecord->iIpAddrLeaseValidTo.GetL() ).AllocL(); + } + } + break; + case ECmConfigDaemonManagerName: + case EWlanConfigDaemonManagerName: + { + if ( !serviceRecord->iConfigDaemonManagerName.IsNull() ) + { + retVal = ( serviceRecord->iConfigDaemonManagerName.GetL() ).AllocL(); + } + } + break; + case ECmConfigDaemonName: + case EWlanConfigDaemonName: + { + if ( !serviceRecord->iConfigDaemonName.IsNull() ) + { + retVal = ( serviceRecord->iConfigDaemonName.GetL() ).AllocL(); + } + } + break; + case EWlanServiceExtensionTableName: + { + if ( !serviceRecord->iServiceExtensionTableName.IsNull() ) + { + retVal = ( serviceRecord->iServiceExtensionTableName.GetL() ).AllocL(); + } + } + break; + case EWlanSSID: + { + if ( !wlanServiceRecord->iWLanSSID.IsNull() ) + { + retVal = ( wlanServiceRecord->iWLanSSID.GetL() ).AllocL(); + } + } + break; + case EWlanUsedSSID: + { + if ( !wlanServiceRecord->iWLanUsedSSID.IsNull() ) + { + retVal = ( wlanServiceRecord->iWLanUsedSSID.GetL() ).AllocL(); + } + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_GETBEARERSTRINGATTRIBUTEL_EXIT ); + return retVal; + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::GetBearerString8AttributeL +// -------------------------------------------------------------------------- +// +HBufC8* CCmPluginWlan::GetBearerString8AttributeL( + TUint32 aAttribute, + RPointerArray& /*aGenRecordArray*/, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_GETBEARERSTRING8ATTRIBUTEL_ENTRY ); + + HBufC8* retVal( NULL ); + + CCDWlanServiceRecord* wlanServiceRecord = + static_cast( + aBearerSpecRecordArray[KWlanServiceRecordIndex] ); + + switch ( aAttribute ) + { + case EWlanWpaPreSharedKey: + { + if ( !wlanServiceRecord->iWLanWpaPreSharedKey.IsNull() ) + { + retVal = ( wlanServiceRecord->iWLanWpaPreSharedKey.GetL() ).AllocL(); + } + } + break; + case EWlanWepKey1InHex: + { + if ( !wlanServiceRecord->iWlanFormatKey1.IsNull() && + !wlanServiceRecord->iWLanWepKey1.IsNull() ) + { + if ( wlanServiceRecord->iWlanFormatKey1 == EWlanWepKeyFormatAscii ) + { + // Format is ascii. + retVal = ConvertAsciiToHexL( wlanServiceRecord->iWLanWepKey1.GetL() ); + } + else + { + // Format is hex. + retVal = ( wlanServiceRecord->iWLanWepKey1.GetL() ).AllocL(); + } + } + } + break; + case EWlanWepKey2InHex: + { + if ( !wlanServiceRecord->iWlanFormatKey2.IsNull() && + !wlanServiceRecord->iWLanWepKey2.IsNull() ) + { + if ( wlanServiceRecord->iWlanFormatKey2 == EWlanWepKeyFormatAscii ) + { + // Format is ascii. + retVal = ConvertAsciiToHexL( wlanServiceRecord->iWLanWepKey2.GetL() ); + } + else + { + // Format is hex. + retVal = ( wlanServiceRecord->iWLanWepKey2.GetL() ).AllocL(); + } + } + } + break; + case EWlanWepKey3InHex: + { + if ( !wlanServiceRecord->iWlanFormatKey3.IsNull() && + !wlanServiceRecord->iWLanWepKey3.IsNull() ) + { + if ( wlanServiceRecord->iWlanFormatKey3 == EWlanWepKeyFormatAscii ) + { + // Format is ascii. + retVal = ConvertAsciiToHexL( wlanServiceRecord->iWLanWepKey3.GetL() ); + } + else + { + // Format is hex. + retVal = ( wlanServiceRecord->iWLanWepKey3.GetL() ).AllocL(); + } + } + } + break; + case EWlanWepKey4InHex: + { + if ( !wlanServiceRecord->iWlanFormatKey4.IsNull() && + !wlanServiceRecord->iWLanWepKey4.IsNull() ) + { + if ( wlanServiceRecord->iWlanFormatKey4 == EWlanWepKeyFormatAscii ) + { + // Format is ascii. + retVal = ConvertAsciiToHexL( wlanServiceRecord->iWLanWepKey4.GetL() ); + } + else + { + // Format is hex. + retVal = ( wlanServiceRecord->iWLanWepKey4.GetL() ).AllocL(); + } + } + } + break; + case EWlanWepKey1InAscii: + { + if ( !wlanServiceRecord->iWlanFormatKey1.IsNull() && + !wlanServiceRecord->iWLanWepKey1.IsNull() ) + { + if ( wlanServiceRecord->iWlanFormatKey1 == EWlanWepKeyFormatAscii ) + { + // Format is ascii. + retVal = ( wlanServiceRecord->iWLanWepKey1.GetL() ).AllocL(); + } + else + { + // Format is hex. + retVal = ConvertHexToAsciiL( wlanServiceRecord->iWLanWepKey1.GetL() ); + } + } + } + break; + case EWlanWepKey2InAscii: + { + if ( !wlanServiceRecord->iWlanFormatKey2.IsNull() && + !wlanServiceRecord->iWLanWepKey2.IsNull() ) + { + if ( wlanServiceRecord->iWlanFormatKey2 == EWlanWepKeyFormatAscii ) + { + // Format is ascii. + retVal = ( wlanServiceRecord->iWLanWepKey2.GetL() ).AllocL(); + } + else + { + // Format is hex. + retVal = ConvertHexToAsciiL( wlanServiceRecord->iWLanWepKey2.GetL() ); + } + } + } + break; + case EWlanWepKey3InAscii: + { + if ( !wlanServiceRecord->iWlanFormatKey3.IsNull() && + !wlanServiceRecord->iWLanWepKey3.IsNull() ) + { + if ( wlanServiceRecord->iWlanFormatKey3 == EWlanWepKeyFormatAscii ) + { + // Format is ascii. + retVal = ( wlanServiceRecord->iWLanWepKey3.GetL() ).AllocL(); + } + else + { + // Format is hex. + retVal = ConvertHexToAsciiL( wlanServiceRecord->iWLanWepKey3.GetL() ); + } + } + } + break; + case EWlanWepKey4InAscii: + { + if ( !wlanServiceRecord->iWlanFormatKey4.IsNull() && + !wlanServiceRecord->iWLanWepKey4.IsNull() ) + { + if ( wlanServiceRecord->iWlanFormatKey4 == EWlanWepKeyFormatAscii ) + { + // Format is ascii. + retVal = ( wlanServiceRecord->iWLanWepKey4.GetL() ).AllocL(); + } + else + { + // Format is hex. + retVal = ConvertHexToAsciiL( wlanServiceRecord->iWLanWepKey4.GetL() ); + } + } + } + break; + case EWlanWapiPsk: + { + if ( !wlanServiceRecord->iWLanWpaPreSharedKey.IsNull() ) + { + retVal = ( wlanServiceRecord->iWLanWpaPreSharedKey.GetL() ).AllocL(); + } + } + break; + + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_GETBEARERSTRING8ATTRIBUTEL_EXIT ); + return retVal; + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::SetBearerIntAttributeL +// -------------------------------------------------------------------------- +// +void CCmPluginWlan::SetBearerIntAttributeL( + TUint32 aAttribute, + TUint32 aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_SETBEARERINTATTRIBUTEL_ENTRY ); + + CCDLANServiceRecord* serviceRecord = + static_cast( + aGenRecordArray[KServiceRecordIndex] ); + + CCDWlanServiceRecord* wlanServiceRecord = + static_cast( + aBearerSpecRecordArray[KWlanServiceRecordIndex] ); + + switch ( aAttribute ) + { + case ECmExtensionLevel: + case ECmCommsDBBearerType: + case ECmDefaultUiPriority: + case ECmDefaultPriority: + { + User::Leave( KErrArgument ); + } + break; + case EWlanServiceId: + { + wlanServiceRecord->iWlanServiceId.SetL( aValue ); + } + break; + case EWlanConnectionMode: + { + wlanServiceRecord->iWlanConnMode.SetL( aValue ); + } + break; + case EWlanSecurityMode: + { + CheckSecurityAttributeValidityL( aAttribute, aValue ); + wlanServiceRecord->iWlanSecMode.SetL( aValue ); + // When setting security mode, also reset authentication mode to open. + wlanServiceRecord->iWlanAuthMode.SetL( CMManager::EWlanAuthModeOpen ); + if ( aValue == EWlanSecMode802_1x ) + { + // By default, do not allow unencrypted mode for 802.1x (Korea). + wlanServiceRecord->iWlanWpaKeyLength.SetL( 0 ); + } + } + break; + case EWlanAuthenticationMode: + { + CheckSecurityAttributeValidityL( aAttribute, aValue ); + wlanServiceRecord->iWlanAuthMode.SetL( aValue ); + } + break; + case EWlanChannelID: + { + wlanServiceRecord->iWlanChannelID.SetL( aValue ); + } + break; + case EWlanServiceExtensionTableRecordId: + { + serviceRecord->iServiceExtensionTableRecordId.SetL( aValue ); + } + break; + case EWlanWepKeyIndex: + { + CheckSecurityAttributeValidityL( aAttribute, aValue ); + wlanServiceRecord->iWlanWepIndex.SetL( aValue ); + } + break; + case EWlanWapiPskFormat: + { + CheckSecurityAttributeValidityL( aAttribute, aValue ); + wlanServiceRecord->iWlanFormatKey1.SetL( aValue ); + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_SETBEARERINTATTRIBUTEL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::SetBearerBoolAttributeL +// -------------------------------------------------------------------------- +// +void CCmPluginWlan::SetBearerBoolAttributeL( + TUint32 aAttribute, + TBool aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_SETBEARERBOOLATTRIBUTEL_ENTRY ); + + CCDWlanServiceRecord* wlanServiceRecord = + static_cast( + aBearerSpecRecordArray[KWlanServiceRecordIndex] ); + + CCDLANServiceRecord* serviceRecord = + static_cast( + aGenRecordArray[KServiceRecordIndex] ); + + switch ( aAttribute ) + { + case EWlanScanSSID: + { + wlanServiceRecord->iWlanScanSSID.SetL( aValue ); + } + break; + case EWlanAllowSSIDRoaming: + { + wlanServiceRecord->iWlanAllowSSIDRoaming.SetL( aValue ); + } + break; + case ECmIPAddFromServer: + case EWlanIpAddrFromServer: + { + serviceRecord->iIpAddrFromServer.SetL( aValue ); + } + break; + case ECmIPDNSAddrFromServer: + case EWlanIpDNSAddrFromServer: + { + serviceRecord->iIpDnsAddrFromServer.SetL( aValue ); + } + break; + case ECmIP6DNSAddrFromServer: + case EWlanIp6DNSAddrFromServer: + { + serviceRecord->iIp6DnsAddrFromServer.SetL( aValue ); + } + break; + case EWlanEnableWpaPsk: + { + wlanServiceRecord->iWlanEnableWpaPsk.SetL( static_cast( aValue ) ); + } + break; + case EWlan802_1xAllowUnencrypted: + { + wlanServiceRecord->iWlanWpaKeyLength.SetL( static_cast( aValue ) ); + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_SETBEARERBOOLATTRIBUTEL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::SetBearerStringAttributeL +// -------------------------------------------------------------------------- +// +void CCmPluginWlan::SetBearerStringAttributeL( + TUint32 aAttribute, + const TDesC16& aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_SETBEARERSTRINGATTRIBUTEL_ENTRY ); + + CCDWlanServiceRecord* wlanServiceRecord = + static_cast( + aBearerSpecRecordArray[KWlanServiceRecordIndex] ); + + CCDLANServiceRecord* serviceRecord = + static_cast( + aGenRecordArray[KServiceRecordIndex] ); + + switch ( aAttribute ) + { + case ECmIFNetworks: + case EWlanIfNetworks: + { + serviceRecord->iIfNetworks.SetL( aValue ); + } + break; + case ECmIPNetmask: + case EWlanIpNetMask: + { + serviceRecord->iIpNetmask.SetL( aValue ); + } + break; + case ECmIPGateway: + case EWlanIpGateway: + { + serviceRecord->iIpGateway.SetL( aValue ); + } + break; + case ECmIPAddress: + case EWlanIpAddr: + { + if ( ( aValue.Compare( KUnspecifiedIPv4 ) == 0 ) || + ( aValue.Compare( KNullDesC ) == 0 ) ) + { + // If unspecified or NULL address is set dynamic + // IP must be enabled. + SetBearerBoolAttributeL( EWlanIpAddrFromServer, + ETrue, + aGenRecordArray, + aBearerSpecRecordArray ); + } + else + { + // If valid address is set dynamic IP is disabled. + SetBearerBoolAttributeL( EWlanIpAddrFromServer, + EFalse, + aGenRecordArray, + aBearerSpecRecordArray ); + } + serviceRecord->iIpAddr.SetL( aValue ); + } + break; + case ECmIPNameServer1: + case EWlanIpNameServer1: + { + serviceRecord->iIpNameServer1.SetL( aValue ); + } + break; + case ECmIPNameServer2: + case EWlanIpNameServer2: + { + serviceRecord->iIpNameServer2.SetL( aValue ); + } + break; + case ECmIP6NameServer1: + case EWlanIp6NameServer1: + { + serviceRecord->iIp6NameServer1.SetL( aValue ); + } + break; + case ECmIP6NameServer2: + case EWlanIp6NameServer2: + { + serviceRecord->iIp6NameServer2.SetL( aValue ); + } + break; + case ECmIPAddrLeaseValidFrom: + case EWlanIpAddrLeaseValidFrom: + { + serviceRecord->iIpAddrLeaseValidFrom.SetL( aValue ); + } + break; + case ECmIPAddrLeaseValidTo: + case EWlanIpAddrLeaseValidTo: + { + serviceRecord->iIpAddrLeaseValidTo.SetL( aValue ); + } + break; + case ECmConfigDaemonManagerName: + case EWlanConfigDaemonManagerName: + { + serviceRecord->iConfigDaemonManagerName.SetL( aValue ); + } + break; + case ECmConfigDaemonName: + case EWlanConfigDaemonName: + { + serviceRecord->iConfigDaemonName.SetL( aValue ); + } + break; + case EWlanServiceExtensionTableName: + { + serviceRecord->iServiceExtensionTableName.SetL( aValue ); + } + break; + case EWlanSSID: + { + wlanServiceRecord->iWLanSSID.SetL( aValue ); + } + break; + case EWlanUsedSSID: + { + wlanServiceRecord->iWLanUsedSSID.SetL( aValue ); + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_SETBEARERSTRINGATTRIBUTEL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::SetBearerString8AttributeL +// -------------------------------------------------------------------------- +// +void CCmPluginWlan::SetBearerString8AttributeL( + TUint32 aAttribute, + const TDesC8& aValue, + RPointerArray& /*aGenRecordArray*/, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_SETBEARERSTRING8ATTRIBUTEL_ENTRY ); + + CCDWlanServiceRecord* wlanServiceRecord = + static_cast( + aBearerSpecRecordArray[KWlanServiceRecordIndex] ); + + switch ( aAttribute ) + { + case EWlanWpaPreSharedKey: + { + wlanServiceRecord->iWLanWpaPreSharedKey.SetL( aValue ); + wlanServiceRecord->iWlanWpaKeyLength.SetL( static_cast( aValue.Length() ) ); + } + break; + case EWlanWepKey1InHex: + { + wlanServiceRecord->iWLanWepKey1.SetL( aValue ); + wlanServiceRecord->iWlanFormatKey1.SetL( EWlanWepKeyFormatHex ); + } + break; + case EWlanWepKey2InHex: + { + wlanServiceRecord->iWLanWepKey2.SetL( aValue ); + wlanServiceRecord->iWlanFormatKey2.SetL( EWlanWepKeyFormatHex ); + } + break; + case EWlanWepKey3InHex: + { + wlanServiceRecord->iWLanWepKey3.SetL( aValue ); + wlanServiceRecord->iWlanFormatKey3.SetL( EWlanWepKeyFormatHex ); + } + break; + case EWlanWepKey4InHex: + { + wlanServiceRecord->iWLanWepKey4.SetL( aValue ); + wlanServiceRecord->iWlanFormatKey4.SetL( EWlanWepKeyFormatHex ); + } + break; + case EWlanWepKey1InAscii: + { + HBufC8* valueInHex = ConvertAsciiToHexL( aValue ); + CleanupStack::PushL( valueInHex ); + wlanServiceRecord->iWLanWepKey1.SetL( *valueInHex ); + wlanServiceRecord->iWlanFormatKey1.SetL( EWlanWepKeyFormatHex ); + CleanupStack::PopAndDestroy( valueInHex ); + } + break; + case EWlanWepKey2InAscii: + { + HBufC8* valueInHex = ConvertAsciiToHexL( aValue ); + CleanupStack::PushL( valueInHex ); + wlanServiceRecord->iWLanWepKey2.SetL( *valueInHex ); + wlanServiceRecord->iWlanFormatKey2.SetL( EWlanWepKeyFormatHex ); + CleanupStack::PopAndDestroy( valueInHex ); + } + break; + case EWlanWepKey3InAscii: + { + HBufC8* valueInHex = ConvertAsciiToHexL( aValue ); + CleanupStack::PushL( valueInHex ); + wlanServiceRecord->iWLanWepKey3.SetL( *valueInHex ); + wlanServiceRecord->iWlanFormatKey3.SetL( EWlanWepKeyFormatHex ); + CleanupStack::PopAndDestroy( valueInHex ); + } + break; + case EWlanWepKey4InAscii: + { + HBufC8* valueInHex = ConvertAsciiToHexL( aValue ); + CleanupStack::PushL( valueInHex ); + wlanServiceRecord->iWLanWepKey4.SetL( *valueInHex ); + wlanServiceRecord->iWlanFormatKey4.SetL( EWlanWepKeyFormatHex ); + CleanupStack::PopAndDestroy( valueInHex ); + } + break; + case EWlanWapiPsk: + { + wlanServiceRecord->iWLanWpaPreSharedKey.SetL( aValue ); + } + break; + + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_SETBEARERSTRING8ATTRIBUTEL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::CanHandleIapIdL +// -------------------------------------------------------------------------- +// +TBool CCmPluginWlan::CanHandleIapIdL( TUint32 aIapId ) const + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_CANHANDLEIAPIDL_ENTRY ); + + TBool retVal( EFalse ); + + CCDIAPRecord *iapRecord = static_cast + ( CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord) ); + + CleanupStack::PushL( iapRecord ); + iapRecord->SetRecordId( aIapId ); + + TRAPD( err, iapRecord->LoadL( iSession ) ); + + if ( !err ) + { + retVal = CanHandleIapIdL( iapRecord ); + } + + CleanupStack::PopAndDestroy( iapRecord ); + + OstTraceFunctionExit0( CCMPLUGINWLAN_CANHANDLEIAPIDL_EXIT ); + return retVal; + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::CanHandleIapIdL +// -------------------------------------------------------------------------- +// +TBool CCmPluginWlan::CanHandleIapIdL( CCDIAPRecord *aIapRecord ) const + { + OstTraceFunctionEntry0( DUP1_CCMPLUGINWLAN_CANHANDLEIAPIDL_ENTRY ); + + TBool retVal( EFalse ); + + if ( (TPtrC(aIapRecord->iServiceType) == TPtrC(KCDTypeNameLANService) ) && + TPtrC(aIapRecord->iBearerType) == TPtrC(KCDTypeNameLANBearer) ) + { + // Check if there is a WLAN record with an iServiceId == iIapRecord->iService. + CCDWlanServiceRecord* tmprec = new( ELeave ) CCDWlanServiceRecord ( iWlanTableId ); + CleanupStack::PushL( tmprec ); + + TInt service = aIapRecord->iService; + + tmprec->iWlanServiceId.SetL( (TUint32)service ); + if ( tmprec->FindL( iSession ) ) + { + // we found at least one WLAN using this IAP, + retVal = ETrue; + } + + CleanupStack::PopAndDestroy(tmprec); + } + + OstTraceFunctionExit0( DUP1_CCMPLUGINWLAN_CANHANDLEIAPIDL_EXIT ); + return retVal; + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::DeleteBearerRecordsL +// -------------------------------------------------------------------------- +// +void CCmPluginWlan::DeleteBearerRecordsL() + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_DELETEBEARERRECORDSL_ENTRY ); + + // as base class deletes service record, in this case LAN, + // only WLAN related stuff needs to be deleted + iWlanServiceRecord->DeleteL( iSession ); + iWlanServiceRecord = NULL; + + OstTraceFunctionExit0( CCMPLUGINWLAN_DELETEBEARERRECORDSL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::LoadServiceRecordL +// -------------------------------------------------------------------------- +// +void CCmPluginWlan::LoadServiceRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_LOADSERVICERECORDL_ENTRY ); + + if ( TPtrC( KCDTypeNameLANService ) == iIapRecord->iServiceType ) + { + iServiceRecord = static_cast + ( CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord ) ); + + ServiceRecord().SetRecordId( iIapRecord->iService ); + ServiceRecord().LoadL( iSession ); + } + else + // this IAP service is not supported by this plugin. + { + User::Leave( KErrNotSupported ); + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_LOADSERVICERECORDL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::LoadBearerRecordsL +// -------------------------------------------------------------------------- +// +void CCmPluginWlan::LoadBearerRecordsL() + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_LOADBEARERRECORDSL_ENTRY ); + + if ( !iWlanServiceRecord ) + { + iWlanServiceRecord = new( ELeave ) CCDWlanServiceRecord ( iWlanTableId ); + } + iWlanServiceRecord->SetRecordId( 0 ); + + iWlanServiceRecord->iWlanServiceId.SetL( ( TUint32 )( iIapRecord->iService ) ); + + if ( iWlanServiceRecord->FindL( iSession ) ) + { + iWlanServiceRecord->LoadL( iSession ); + } + else + { + // not found -> error + User::Leave( KErrNotFound ); + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_LOADBEARERRECORDSL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::CreateServiceRecordL +// -------------------------------------------------------------------------- +// +void CCmPluginWlan::CreateServiceRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_CREATESERVICERECORDL_ENTRY ); + + delete iServiceRecord; + iServiceRecord = NULL; + + iServiceRecord = static_cast + (CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord ) ); + + CCDLANServiceRecord* lanServiceRecord = static_cast( iServiceRecord ); + + + if ( FeatureManager::FeatureSupported( KFeatureIdIPv6 ) ) + { + lanServiceRecord->iIfNetworks.SetL( KDefIspIfNetworksIPv4IPv6 ); + } + else + { + lanServiceRecord->iIfNetworks.SetL( KDefIspIfNetworksIPv4 ); + } + + lanServiceRecord->iIpGateway.SetL( KUnspecifiedIPv4 ); + lanServiceRecord->iIpAddrFromServer.SetL( KDefIpAddrFromServer ); + + lanServiceRecord->iIpAddr.SetL( KUnspecifiedIPv4 ); + + lanServiceRecord->iIpDnsAddrFromServer.SetL( KDefIpDnsAddrFromServer ); + + lanServiceRecord->iIpNameServer1.SetL( KUnspecifiedIPv4 ); + lanServiceRecord->iIpNameServer2.SetL( KUnspecifiedIPv4 ); + lanServiceRecord->iIp6DnsAddrFromServer.SetL( KDefIp6DnsAddrFromServer ); + lanServiceRecord->iIp6NameServer1.SetL( KDynamicIpv6Address ); + lanServiceRecord->iIp6NameServer2.SetL( KDynamicIpv6Address ); + + if ( KDefIpAddrFromServer ) + { + lanServiceRecord->iConfigDaemonManagerName.SetL( KDaemonManagerName ); + lanServiceRecord->iConfigDaemonName.SetL( KConfigDaemonName ); + } + else + { + lanServiceRecord->iConfigDaemonManagerName.SetL( KEmpty ); + lanServiceRecord->iConfigDaemonName.SetL( KEmpty ); + } + + // create WLAN service record + CreateWlanServiceRecordL(); + + OstTraceFunctionExit0( CCMPLUGINWLAN_CREATESERVICERECORDL_EXIT ); + } + +// -------------------------------------------------------------------------- +// CCmPluginWlan::CreateWlanServiceRecordL +// -------------------------------------------------------------------------- +// +void CCmPluginWlan::CreateWlanServiceRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_CREATEWLANSERVICERECORDL_ENTRY ); + + delete iWlanServiceRecord; + + iWlanServiceRecord = NULL; + + iWlanServiceRecord = new( ELeave ) CCDWlanServiceRecord ( iWlanTableId ); + iWlanServiceRecord->SetRecordId( KCDNewRecordRequest ); + + iWlanServiceRecord->iRecordName.SetL( iIapRecord->iRecordName ); + iWlanServiceRecord->iWlanConnMode.SetL( CMManager::EInfra ); + iWlanServiceRecord->iWlanSecMode.SetL( CMManager::EWlanSecModeOpen ); + iWlanServiceRecord->iWlanScanSSID.SetL( EFalse ); + + OstTraceFunctionExit0( CCMPLUGINWLAN_CREATEWLANSERVICERECORDL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginWlan::PreparePluginToUpdateRecordsL() +// ---------------------------------------------------------------------------- +// +void CCmPluginWlan::PreparePluginToLoadRecordsL() + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_PREPAREPLUGINTOLOADRECORDSL_ENTRY ); + + OstTraceFunctionExit0( CCMPLUGINWLAN_PREPAREPLUGINTOLOADRECORDSL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginWlan::PreparePluginToUpdateRecordsL() +// ---------------------------------------------------------------------------- +// +void CCmPluginWlan::PreparePluginToUpdateRecordsL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_PREPAREPLUGINTOUPDATERECORDSL_ENTRY ); + + CCDWlanServiceRecord* wlanServiceRecord = + static_cast( + aBearerSpecRecordArray[KWlanServiceRecordIndex] ); + + CCDIAPRecord* iapRecord = + static_cast( + aGenRecordArray[KIapRecordIndex] ); + + CheckIfNameModifiedL( iapRecord, wlanServiceRecord ); + wlanServiceRecord->iWlanServiceId.SetL( iapRecord->iService ); + + CCDLANServiceRecord* serviceRecord = + static_cast( + aGenRecordArray[KServiceRecordIndex] ); + + CheckIfNameModifiedL( iapRecord, serviceRecord ); + + CheckDNSServerAddressL( ETrue, + serviceRecord->iIp6NameServer1, + serviceRecord->iIp6NameServer2, + serviceRecord->iIp6DnsAddrFromServer ); + + CheckDNSServerAddressL( EFalse, + serviceRecord->iIpNameServer1, + serviceRecord->iIpNameServer2, + serviceRecord->iIpDnsAddrFromServer ); + + SetDaemonNameL( aGenRecordArray, aBearerSpecRecordArray ); + + OstTraceFunctionExit0( CCMPLUGINWLAN_PREPAREPLUGINTOUPDATERECORDSL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginWlan::UpdateServiceRecordL() +// ---------------------------------------------------------------------------- +// +void CCmPluginWlan::UpdateServiceRecordL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_UPDATESERVICERECORDL_ENTRY ); + + // Delete the original record and create a copy from the parameter + delete iServiceRecord; + iServiceRecord = NULL; + + iServiceRecord = static_cast + (CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord ) ); + + // LAN Service copy does not work so we have to copy it manually + + CCDLANServiceRecord* lanServiceRecordTo = + static_cast( + iServiceRecord ); + + CCDLANServiceRecord* lanServiceRecordFrom = + static_cast( + aGenRecordArray[KServiceRecordIndex] ); + + if ( !lanServiceRecordFrom->iRecordName.IsNull() ) + { + lanServiceRecordTo->iRecordName.SetL( lanServiceRecordFrom->iRecordName ); + } + if ( !lanServiceRecordFrom->iIfNetworks.IsNull() ) + { + lanServiceRecordTo->iIfNetworks.SetL( lanServiceRecordFrom->iIfNetworks ); + } + if ( !lanServiceRecordFrom->iIpGateway.IsNull() ) + { + lanServiceRecordTo->iIpGateway.SetL( lanServiceRecordFrom->iIpGateway ); + } + if ( !lanServiceRecordFrom->iIpAddrFromServer.IsNull() ) + { + lanServiceRecordTo->iIpAddrFromServer.SetL( lanServiceRecordFrom->iIpAddrFromServer ); + } + if ( !lanServiceRecordFrom->iIpAddr.IsNull() ) + { + lanServiceRecordTo->iIpAddr.SetL( lanServiceRecordFrom->iIpAddr ); + } + if ( !lanServiceRecordFrom->iIpDnsAddrFromServer.IsNull() ) + { + lanServiceRecordTo->iIpDnsAddrFromServer.SetL( lanServiceRecordFrom->iIpDnsAddrFromServer ); + } + if ( !lanServiceRecordFrom->iIpNameServer1.IsNull() ) + { + lanServiceRecordTo->iIpNameServer1.SetL( lanServiceRecordFrom->iIpNameServer1 ); + } + if ( !lanServiceRecordFrom->iIpNameServer2.IsNull() ) + { + lanServiceRecordTo->iIpNameServer2.SetL( lanServiceRecordFrom->iIpNameServer2 ); + } + if ( !lanServiceRecordFrom->iIp6DnsAddrFromServer.IsNull() ) + { + lanServiceRecordTo->iIp6DnsAddrFromServer.SetL( lanServiceRecordFrom->iIp6DnsAddrFromServer ); + } + if ( !lanServiceRecordFrom->iIp6NameServer1.IsNull() ) + { + lanServiceRecordTo->iIp6NameServer1.SetL( lanServiceRecordFrom->iIp6NameServer1 ); + } + if ( !lanServiceRecordFrom->iIp6NameServer2.IsNull() ) + { + lanServiceRecordTo->iIp6NameServer2.SetL( lanServiceRecordFrom->iIp6NameServer2 ); + } + if ( !lanServiceRecordFrom->iConfigDaemonManagerName.IsNull() ) + { + lanServiceRecordTo->iConfigDaemonManagerName.SetL( lanServiceRecordFrom->iConfigDaemonManagerName ); + } + if ( !lanServiceRecordFrom->iConfigDaemonName.IsNull() ) + { + lanServiceRecordTo->iConfigDaemonName.SetL( lanServiceRecordFrom->iConfigDaemonName ); + } + + lanServiceRecordTo->SetElementId( lanServiceRecordFrom->ElementId() ); + // this is shared between wlan iaps so it cannot be hidden or protected + lanServiceRecordTo->ClearAttributes( ECDHidden ); + lanServiceRecordTo->ClearAttributes( ECDProtectedWrite ); + + if ( !ServiceRecord().RecordId() ) + { + ServiceRecord().SetRecordId( KCDNewRecordRequest ); + ServiceRecord().StoreL( iSession ); + + // Update needed values to record tables too( lanservice and wlanservice ) + lanServiceRecordFrom->SetElementId( ServiceRecord().ElementId() ); + CCDWlanServiceRecord* wlanServiceRecord = + static_cast( + aBearerSpecRecordArray[KWlanServiceRecordIndex] ); + wlanServiceRecord->iWlanServiceId.SetL( ServiceRecord().RecordId() ); + } + else + { + ServiceRecord().ModifyL( iSession ); + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_UPDATESERVICERECORDL_EXIT ); + } + +// ---------------------------------------------------------------------------- +// CCmPluginWlan::UpdateBearerRecordsL() +// ---------------------------------------------------------------------------- +// +void CCmPluginWlan::UpdateBearerRecordsL( + RPointerArray& /*aGenRecordArray*/, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_UPDATEBEARERRECORDSL_ENTRY ); + + delete iWlanServiceRecord; + iWlanServiceRecord = NULL; + + CCDWlanServiceRecord* wlanServiceRecord = + static_cast( + aBearerSpecRecordArray[KWlanServiceRecordIndex] ); + + iWlanServiceRecord = new( ELeave ) CCDWlanServiceRecord ( iWlanTableId ); + + iWlanServiceRecord->SetElementId( wlanServiceRecord->ElementId() ); + iWlanServiceRecord->iRecordName.SetL( wlanServiceRecord->iRecordName ); + + iWlanServiceRecord->iWlanServiceId.SetL( wlanServiceRecord->iWlanServiceId ); + iWlanServiceRecord->iWlanConnMode.SetL( wlanServiceRecord->iWlanConnMode ); + if ( !wlanServiceRecord->iWLanSSID.IsNull() ) + { + iWlanServiceRecord->iWLanSSID.SetL( wlanServiceRecord->iWLanSSID ); + } + if ( !wlanServiceRecord->iWLanUsedSSID.IsNull() ) + { + iWlanServiceRecord->iWLanUsedSSID.SetL( wlanServiceRecord->iWLanUsedSSID ); + } + if ( !wlanServiceRecord->iWLanWepKey1.IsNull() ) + { + iWlanServiceRecord->iWLanWepKey1.SetL( wlanServiceRecord->iWLanWepKey1 ); + } + if ( !wlanServiceRecord->iWLanWepKey2.IsNull() ) + { + iWlanServiceRecord->iWLanWepKey2.SetL( wlanServiceRecord->iWLanWepKey2 ); + } + if ( !wlanServiceRecord->iWLanWepKey3.IsNull() ) + { + iWlanServiceRecord->iWLanWepKey3.SetL( wlanServiceRecord->iWLanWepKey3 ); + } + if ( !wlanServiceRecord->iWLanWepKey4.IsNull() ) + { + iWlanServiceRecord->iWLanWepKey4.SetL( wlanServiceRecord->iWLanWepKey4 ); + } + if ( !wlanServiceRecord->iWlanWepIndex.IsNull() ) + { + iWlanServiceRecord->iWlanWepIndex.SetL( wlanServiceRecord->iWlanWepIndex ); + } + if ( !wlanServiceRecord->iWlanSecMode.IsNull() ) + { + iWlanServiceRecord->iWlanSecMode.SetL( wlanServiceRecord->iWlanSecMode ); + } + if ( !wlanServiceRecord->iWlanAuthMode.IsNull() ) + { + iWlanServiceRecord->iWlanAuthMode.SetL( wlanServiceRecord->iWlanAuthMode ); + } + if ( !wlanServiceRecord->iWlanEnableWpaPsk.IsNull() ) + { + iWlanServiceRecord->iWlanEnableWpaPsk.SetL( wlanServiceRecord->iWlanEnableWpaPsk ); + } + if ( !wlanServiceRecord->iWLanWpaPreSharedKey.IsNull() ) + { + iWlanServiceRecord->iWLanWpaPreSharedKey.SetL( wlanServiceRecord->iWLanWpaPreSharedKey ); + } + if ( !wlanServiceRecord->iWlanWpaKeyLength.IsNull() ) + { + iWlanServiceRecord->iWlanWpaKeyLength.SetL( wlanServiceRecord->iWlanWpaKeyLength ); + } + if ( !wlanServiceRecord->iWLanEaps.IsNull() ) + { + iWlanServiceRecord->iWLanEaps.SetL( wlanServiceRecord->iWLanEaps ); + } + if ( !wlanServiceRecord->iWlanScanSSID.IsNull() ) + { + iWlanServiceRecord->iWlanScanSSID.SetL( wlanServiceRecord->iWlanScanSSID ); + } + if ( !wlanServiceRecord->iWlanChannelID.IsNull() ) + { + iWlanServiceRecord->iWlanChannelID.SetL( wlanServiceRecord->iWlanChannelID ); + } + if ( !wlanServiceRecord->iWlanFormatKey1.IsNull() ) + { + iWlanServiceRecord->iWlanFormatKey1.SetL( wlanServiceRecord->iWlanFormatKey1 ); + } + if ( !wlanServiceRecord->iWlanFormatKey2.IsNull() ) + { + iWlanServiceRecord->iWlanFormatKey2.SetL( wlanServiceRecord->iWlanFormatKey2 ); + } + if ( !wlanServiceRecord->iWlanFormatKey3.IsNull() ) + { + iWlanServiceRecord->iWlanFormatKey3.SetL( wlanServiceRecord->iWlanFormatKey3 ); + } + if ( !wlanServiceRecord->iWlanFormatKey4.IsNull() ) + { + iWlanServiceRecord->iWlanFormatKey4.SetL( wlanServiceRecord->iWlanFormatKey4 ); + } + if ( !wlanServiceRecord->iWlanAllowSSIDRoaming.IsNull() ) + { + iWlanServiceRecord->iWlanAllowSSIDRoaming.SetL( wlanServiceRecord->iWlanAllowSSIDRoaming ); + } + if ( !wlanServiceRecord->iWLanEnabledEaps.IsNull() ) + { + iWlanServiceRecord->iWLanEnabledEaps.SetL( wlanServiceRecord->iWLanEnabledEaps ); + } + if ( !wlanServiceRecord->iWLanDisabledEaps.IsNull() ) + { + iWlanServiceRecord->iWLanDisabledEaps.SetL( wlanServiceRecord->iWLanDisabledEaps ); + } + + if ( !iWlanServiceRecord->RecordId() ) + { + iWlanServiceRecord->SetRecordId( KCDNewRecordRequest ); + iWlanServiceRecord->StoreL( iSession ); + wlanServiceRecord->SetElementId( iWlanServiceRecord->ElementId() ); + } + else + { + iWlanServiceRecord->ModifyL( iSession ); + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_UPDATEBEARERRECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::GetBearerSpecificRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginWlan::GetBearerSpecificRecordsL( + RPointerArray& aRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_GETBEARERSPECIFICRECORDSL_ENTRY ); + + if ( !iWlanServiceRecord ) + { + // IAP not yet in CommDat + GetDefaultWlanServiceRecordL( aRecordArray ); + } + else + { + CCDWlanServiceRecord* wlanServiceRecord = new( ELeave ) CCDWlanServiceRecord ( iWlanTableId ); + CleanupStack::PushL( wlanServiceRecord ); + CopyWlanServiceRecordL( iWlanServiceRecord, wlanServiceRecord ); + wlanServiceRecord->SetElementId( iWlanServiceRecord->ElementId() ); + wlanServiceRecord->iWlanServiceId.SetL( iWlanServiceRecord->iWlanServiceId ); + aRecordArray.AppendL( wlanServiceRecord ); + CleanupStack::Pop( wlanServiceRecord ); + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_GETBEARERSPECIFICRECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::CopyServiceRecordL +// --------------------------------------------------------------------------- +// +CommsDat::CCDRecordBase* CCmPluginWlan::CopyServiceRecordL() + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_COPYSERVICERECORDL_ENTRY ); + + __ASSERT_DEBUG( iServiceRecord != NULL, User::Leave( KErrNotFound )); + + CCDRecordBase* serviceRecord = + static_cast( + CCDRecordBase::CreateCopyRecordL( *iServiceRecord ) ); + + OstTraceFunctionExit0( CCMPLUGINWLAN_COPYSERVICERECORDL_EXIT ); + return serviceRecord; + } + +// ---------------------------------------------------------------------------- +// CCmPluginWlan::CheckNetworkCoverageL() +// ---------------------------------------------------------------------------- +// +TBool CCmPluginWlan::CheckNetworkCoverageL() const + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_CHECKNETWORKCOVERAGEL_ENTRY ); + +#ifdef __WINS__ + OstTraceFunctionExit0( CCMPLUGINWLAN_CHECKNETWORKCOVERAGEL_EXIT ); + + return ETrue; +#else + CCmWlanCoverageCheck* coverage = new (ELeave) CCmWlanCoverageCheck; + CleanupStack::PushL( coverage ); + + TBool retVal( EFalse ); + retVal = coverage->GetCoverageL(); + + CleanupStack::PopAndDestroy( coverage ); + + OstTraceFunctionExit0( DUP1_CCMPLUGINWLAN_CHECKNETWORKCOVERAGEL_EXIT ); + + return retVal; +#endif // __WINS + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::SetDaemonNameL +// --------------------------------------------------------------------------- +// +void CCmPluginWlan::SetDaemonNameL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_SETDAEMONNAMEL_ENTRY ); + + // we have to check first that these values has not been + // set(or changed) by any 3rd party sw to ensure that + // we don't break their settings + HBufC* daemonName = GetBearerStringAttributeL( ECmConfigDaemonManagerName, + aGenRecordArray, + aBearerSpecRecordArray ); + if ( daemonName ) + { + if ( daemonName->Compare( KDaemonManagerName ) != 0 ) + { + delete daemonName; + + OstTraceFunctionExit0( CCMPLUGINWLAN_SETDAEMONNAMEL_EXIT ); + + return; + } + delete daemonName; + } + + // use DHCP if we can + TBool ipfromSrv = GetBearerBoolAttributeL( ECmIPAddFromServer, + aGenRecordArray, + aBearerSpecRecordArray ); + if ( ipfromSrv ) + { + SetBearerStringAttributeL( ECmConfigDaemonManagerName, + KDaemonManagerName, + aGenRecordArray, + aBearerSpecRecordArray ); + + SetBearerStringAttributeL( ECmConfigDaemonName, + KConfigDaemonName, + aGenRecordArray, + aBearerSpecRecordArray ); + + } + else + { + if ( FeatureManager::FeatureSupported( KFeatureIdIPv6 ) ) + { + SetBearerStringAttributeL( ECmConfigDaemonManagerName, + KDaemonManagerName, + aGenRecordArray, + aBearerSpecRecordArray ); + + SetBearerStringAttributeL( ECmConfigDaemonName, + KConfigDaemonName, + aGenRecordArray, + aBearerSpecRecordArray ); + } + else + { + SetBearerStringAttributeL( ECmConfigDaemonManagerName, + KNullDesC(), + aGenRecordArray, + aBearerSpecRecordArray ); + + SetBearerStringAttributeL( ECmConfigDaemonName, + KNullDesC(), + aGenRecordArray, + aBearerSpecRecordArray ); + } + } + + OstTraceFunctionExit0( DUP1_CCMPLUGINWLAN_SETDAEMONNAMEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::ResetBearerRecords +// --------------------------------------------------------------------------- +// +void CCmPluginWlan::ResetBearerRecords() + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_RESETBEARERRECORDS_ENTRY ); + + delete iWlanServiceRecord; + iWlanServiceRecord = NULL; + + OstTraceFunctionExit0( CCMPLUGINWLAN_RESETBEARERRECORDS_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::CopyWlanServiceRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginWlan::CopyWlanServiceRecordL( + CCDWlanServiceRecord* aSourceRecord, + CCDWlanServiceRecord* aDestRecord ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_COPYWLANSERVICERECORDL_ENTRY ); + + if ( !( aSourceRecord && aDestRecord ) ) + { + User::Leave( KErrArgument ); + } + + aDestRecord->iRecordName.SetL( aSourceRecord->iRecordName ); + aDestRecord->iRecordTag.SetL( aSourceRecord->iRecordTag ); + aDestRecord->iWlanConnMode.SetL( aSourceRecord->iWlanConnMode ); + + if ( !aSourceRecord->iWLanSSID.IsNull() ) + { + aDestRecord->iWLanSSID.SetL( aSourceRecord->iWLanSSID ); + } + if ( !aSourceRecord->iWLanUsedSSID.IsNull() ) + { + aDestRecord->iWLanUsedSSID.SetL( aSourceRecord->iWLanUsedSSID ); + } + if ( !aSourceRecord->iWLanWepKey1.IsNull() ) + { + aDestRecord->iWLanWepKey1.SetL( aSourceRecord->iWLanWepKey1 ); + } + if ( !aSourceRecord->iWLanWepKey2.IsNull() ) + { + aDestRecord->iWLanWepKey2.SetL( aSourceRecord->iWLanWepKey2 ); + } + if ( !aSourceRecord->iWLanWepKey3.IsNull() ) + { + aDestRecord->iWLanWepKey3.SetL( aSourceRecord->iWLanWepKey3 ); + } + if ( !aSourceRecord->iWLanWepKey4.IsNull() ) + { + aDestRecord->iWLanWepKey4.SetL( aSourceRecord->iWLanWepKey4 ); + } + if ( !aSourceRecord->iWlanWepIndex.IsNull() ) + { + aDestRecord->iWlanWepIndex.SetL( aSourceRecord->iWlanWepIndex ); + } + if ( !aSourceRecord->iWlanSecMode.IsNull() ) + { + aDestRecord->iWlanSecMode.SetL( aSourceRecord->iWlanSecMode ); + } + if ( !aSourceRecord->iWlanAuthMode.IsNull() ) + { + aDestRecord->iWlanAuthMode.SetL( aSourceRecord->iWlanAuthMode ); + } + if ( !aSourceRecord->iWlanEnableWpaPsk.IsNull() ) + { + aDestRecord->iWlanEnableWpaPsk.SetL( aSourceRecord->iWlanEnableWpaPsk ); + } + if ( !aSourceRecord->iWLanWpaPreSharedKey.IsNull() ) + { + aDestRecord->iWLanWpaPreSharedKey.SetL( aSourceRecord->iWLanWpaPreSharedKey ); + } + if ( !aSourceRecord->iWlanWpaKeyLength.IsNull() ) + { + aDestRecord->iWlanWpaKeyLength.SetL( aSourceRecord->iWlanWpaKeyLength ); + } + if ( !aSourceRecord->iWLanEaps.IsNull() ) + { + aDestRecord->iWLanEaps.SetL( aSourceRecord->iWLanEaps ); + } + if ( !aSourceRecord->iWlanScanSSID.IsNull() ) + { + aDestRecord->iWlanScanSSID.SetL( aSourceRecord->iWlanScanSSID ); + } + if ( !aSourceRecord->iWlanChannelID.IsNull() ) + { + aDestRecord->iWlanChannelID.SetL( aSourceRecord->iWlanChannelID ); + } + if ( !aSourceRecord->iWlanFormatKey1.IsNull() ) + { + aDestRecord->iWlanFormatKey1.SetL( aSourceRecord->iWlanFormatKey1 ); + } + if ( !aSourceRecord->iWlanFormatKey2.IsNull() ) + { + aDestRecord->iWlanFormatKey2.SetL( aSourceRecord->iWlanFormatKey2 ); + } + if ( !aSourceRecord->iWlanFormatKey3.IsNull() ) + { + aDestRecord->iWlanFormatKey3.SetL( aSourceRecord->iWlanFormatKey3 ); + } + if ( !aSourceRecord->iWlanFormatKey4.IsNull() ) + { + aDestRecord->iWlanFormatKey4.SetL( aSourceRecord->iWlanFormatKey4 ); + } + if ( !aSourceRecord->iWlanAllowSSIDRoaming.IsNull() ) + { + aDestRecord->iWlanAllowSSIDRoaming.SetL( aSourceRecord->iWlanAllowSSIDRoaming ); + } + if ( !aSourceRecord->iWLanEnabledEaps.IsNull() ) + { + aDestRecord->iWLanEnabledEaps.SetL( aSourceRecord->iWLanEnabledEaps ); + } + if ( !aSourceRecord->iWLanDisabledEaps.IsNull() ) + { + aDestRecord->iWLanDisabledEaps.SetL( aSourceRecord->iWLanDisabledEaps ); + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_COPYWLANSERVICERECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::GetDefaultWlanServiceRecordL +// --------------------------------------------------------------------------- +// +void CCmPluginWlan::GetDefaultWlanServiceRecordL( + RPointerArray& aRecordArray ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_GETDEFAULTWLANSERVICERECORDL_ENTRY ); + + CCDWlanServiceRecord* wlanServiceRecord = new( ELeave ) CCDWlanServiceRecord ( iWlanTableId ); + CleanupStack::PushL( wlanServiceRecord ); + + wlanServiceRecord->SetRecordId( KCDNewRecordRequest ); + + wlanServiceRecord->iRecordTag.SetL( 1 ); + wlanServiceRecord->iRecordName.SetL( iIapRecord->iRecordName ); + wlanServiceRecord->iWlanConnMode.SetL( CMManager::EInfra ); + wlanServiceRecord->iWlanSecMode.SetL( CMManager::EWlanSecModeOpen ); + wlanServiceRecord->iWlanScanSSID.SetL( EFalse ); + + aRecordArray.AppendL( wlanServiceRecord ); + + CleanupStack::Pop( wlanServiceRecord ); + + OstTraceFunctionExit0( CCMPLUGINWLAN_GETDEFAULTWLANSERVICERECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::GetBearerInfoIntL +// --------------------------------------------------------------------------- +// +TUint32 CCmPluginWlan::GetBearerInfoIntL( TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_GETBEARERINFOINTL_ENTRY ); + + TUint32 retVal( 0 ); + switch ( aAttribute ) + { + case ECmBearerType: + { + retVal = iBearerType; + } + break; + case ECmCommsDBBearerType: + { + retVal = KCommDbBearerWLAN; + } + break; + case ECmDefaultUiPriority: + case ECmDefaultPriority: + { + retVal = KDefaultPriorityWLan; + } + break; + case ECmExtensionLevel: + { + // This is extension from LAN plugin. + retVal = KExtensionBaseLevel + 1; + } + break; + case ECmSeamlessnessLevel: + { + retVal = ESeamlessnessShowprogress; + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_GETBEARERINFOINTL_EXIT ); + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::GetBearerInfoBoolL +// --------------------------------------------------------------------------- +// +TBool CCmPluginWlan::GetBearerInfoBoolL( TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_GETBEARERINFOBOOLL_ENTRY ); + + TBool retVal( EFalse ); + + switch ( aAttribute ) + { + case ECmCoverage: + { +#ifndef __WINS__ + retVal = CheckNetworkCoverageL(); +#else + retVal = ETrue; +#endif + } + break; + case ECmDestination: + { + retVal = EFalse; + } + break; + case ECmBearerHasUi: + { + retVal = EFalse; + } + break; + case ECmIPv6Supported: + { + retVal = FeatureManager::FeatureSupported( KFeatureIdIPv6 ); + } + break; + case ECmVirtual: + { + retVal = EFalse; + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_GETBEARERINFOBOOLL_EXIT ); + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::GetBearerInfoStringL +// --------------------------------------------------------------------------- +// +HBufC* CCmPluginWlan::GetBearerInfoStringL( TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_GETBEARERINFOSTRINGL_ENTRY ); + + HBufC* retVal( NULL ); + switch ( aAttribute ) + { + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_GETBEARERINFOSTRINGL_EXIT ); + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::GetBearerInfoString8L +// --------------------------------------------------------------------------- +// +HBufC8* CCmPluginWlan::GetBearerInfoString8L( TUint32 aAttribute ) const + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_GETBEARERINFOSTRING8L_ENTRY ); + + HBufC8* retVal( NULL ); + switch ( aAttribute ) + { + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_GETBEARERINFOSTRING8L_EXIT ); + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::CheckSecurityAttributeValidityL +// --------------------------------------------------------------------------- +// +void CCmPluginWlan::CheckSecurityAttributeValidityL( + const TUint32 aAttribute, + const TUint32 aValue ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_CHECKSECURITYATTRIBUTEVALIDITYL_ENTRY ); + + switch ( aAttribute ) + { + case CMManager::EWlanConnectionMode: + { + switch ( aValue ) + { + case CMManager::EAdhoc: + case CMManager::EInfra: + break; + default: + User::Leave( KErrArgument ); + break; + } + } + break; + + case CMManager::EWlanSecurityMode: + { + switch ( aValue ) + { + case CMManager::EWlanSecModeOpen: + case CMManager::EWlanSecModeWep: + case CMManager::EWlanSecMode802_1x: + case CMManager::EWlanSecModeWpa: + case CMManager::EWlanSecModeWpa2: + case CMManager::EWlanSecModeWAPI: + break; + default: + User::Leave( KErrArgument ); + break; + } + } + break; + + case CMManager::EWlanAuthenticationMode: + { + switch ( aValue ) + { + case CMManager::EWlanAuthModeOpen: + case CMManager::EWlanAuthModeShared: + break; + default: + User::Leave( KErrArgument ); + break; + } + } + break; + + case CMManager::EWlanEnableWpaPsk: // Boolean + case CMManager::EWlanWpaPreSharedKey: // Valid values: 0, 1, 8-64 + break; + + case CMManager::EWlanWepKey1InHex: // Length should be 10 or 26. + case CMManager::EWlanWepKey2InHex: + case CMManager::EWlanWepKey3InHex: + case CMManager::EWlanWepKey4InHex: + case CMManager::EWlanWepKey1InAscii: // Length should be 5 or 13. + case CMManager::EWlanWepKey2InAscii: + case CMManager::EWlanWepKey3InAscii: + case CMManager::EWlanWepKey4InAscii: + break; + + case CMManager::EWlanWepKeyIndex: + { + switch ( aValue ) + { + case CMManager::EWepKeyIndex1: + case CMManager::EWepKeyIndex2: + case CMManager::EWepKeyIndex3: + case CMManager::EWepKeyIndex4: + break; + default: + User::Leave( KErrArgument ); + break; + } + } + break; + + case CMManager::EWlanWapiPsk: + break; + + case CMManager::EWlanWapiPskFormat: + { + switch ( aValue ) + { + case CMManager::EWlanWapiPskFormatAscii: + case CMManager::EWlanWapiPskFormatHex: + break; + default: + User::Leave( KErrArgument ); + break; + } + } + break; + + case CMManager::EWlan802_1xAllowUnencrypted: // Boolean + break; + + default: + User::Leave( KErrArgument ); + break; + } + + OstTraceFunctionExit0( CCMPLUGINWLAN_CHECKSECURITYATTRIBUTEVALIDITYL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::CopyBearerRecordsL +// --------------------------------------------------------------------------- +// +void CCmPluginWlan::CopyBearerRecordsL( CCmPluginBaseEng* aCopyInstance ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_COPYBEARERRECORDSL_ENTRY ); + + CCmPluginWlan* plugin = static_cast( aCopyInstance ); + plugin->iWlanServiceRecord = new( ELeave ) CCDWlanServiceRecord ( iWlanTableId ); + + CopyWlanServiceRecordL( iWlanServiceRecord, plugin->iWlanServiceRecord ); + plugin->iWAPISupported = iWAPISupported; + + OstTraceFunctionExit0( CCMPLUGINWLAN_COPYBEARERRECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::PrepareToCopyDataL +// --------------------------------------------------------------------------- +// +void CCmPluginWlan::PrepareToCopyDataL( CCmPluginBaseEng* /*aCopyInstance*/ ) + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_PREPARETOCOPYDATAL_ENTRY ); + + OstTraceFunctionExit0( CCMPLUGINWLAN_PREPARETOCOPYDATAL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::GetBearerTableIdsToBeObserved +// --------------------------------------------------------------------------- +// +void CCmPluginWlan::GetBearerTableIdsToBeObservedL( + RArray& aTableIdArray ) const + { + OstTraceFunctionEntry0( CCMPLUGINWLAN_GETBEARERTABLEIDSTOBEOBSERVEDL_ENTRY ); + + aTableIdArray.AppendL( KCDTIdLANServiceRecord ); + aTableIdArray.AppendL( KCDTIdLANBearerRecord ); + aTableIdArray.AppendL( iWlanTableId ); + + OstTraceFunctionExit0( CCMPLUGINWLAN_GETBEARERTABLEIDSTOBEOBSERVEDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::ConvertAsciiToHexL +// --------------------------------------------------------------------------- +// +HBufC8* CCmPluginWlan::ConvertAsciiToHexL( const TDesC8& aSource ) + { + // Characters used in hex-format. + _LIT( hex, "0123456789ABCDEF" ); + + // Length of ascii-format source string. + TInt length = aSource.Length(); + //TInt length = aSource.Size(); + + if ( length <= 0 ) + { + HBufC8* result = KNullDesC8().AllocL(); + return result; + } + + HBufC8* result = HBufC8::NewLC( length * 2 ); + TPtr8 ptr = result->Des(); + + // Iterate for each character in ascii-format source string. + for ( TInt i = 0; i < length; i++ ) + { + // Next character in ascii-format source string to be converted. + TText8 ch = aSource[i]; + + // Convert and append the higher 4 bits of the character. + ptr.Append( hex()[ ( ch / 16 ) & 0x0f ] ); + + // Convert and append the lower 4 bits of the character. + ptr.Append( hex()[ ch & 0x0f ] ); + } + + CleanupStack::Pop( result ); + return result; // Ownership is transfered. + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::ConvertHexToAsciiL +// --------------------------------------------------------------------------- +// +HBufC8* CCmPluginWlan::ConvertHexToAsciiL( const TDesC8& aSource ) + { + // Length of hex-format source string. + TInt length = aSource.Length(); + + if ( length <= 0 ) + { + HBufC8* result = KNullDesC8().AllocL(); + return result; + } + + HBufC8* result = HBufC8::NewLC( ( length + 1 ) / 2 ); + TPtr8 ptr = result->Des(); + + TInt i( 0 ); + TUint8 ch( 0 ); + if ( length % 2 ) + { + ch = ConvertHexCharToNumberL( aSource[i] ); + ptr.Append( ch ); + i++; + } + for ( ; i < length; ) + { + ch = ConvertHexCharToNumberL( aSource[i] ) << 4; + i++; + ch += ConvertHexCharToNumberL( aSource[i] ); + i++; + ptr.Append( ch ); + } + + CleanupStack::Pop( result ); + return result; // Ownership is transfered. + } + +// --------------------------------------------------------------------------- +// CCmPluginWlan::ConvertHexCharToNumberL +// --------------------------------------------------------------------------- +// +TUint8 CCmPluginWlan::ConvertHexCharToNumberL( const TUint8 aHexChar ) + { + TUint8 result( 0 ); + if ( '0' <= aHexChar && aHexChar <= '9' ) + { + result = aHexChar - '0'; + } + else if ( 'a' <= aHexChar && aHexChar <= 'f' ) + { + result = aHexChar - 'a' + 10u; + } + else if ( 'A' <= aHexChar && aHexChar <= 'F' ) + { + result = aHexChar - 'A' + 10u; + } + else + { + User::Leave( KErrArgument ); + } + return result; + } + +// End of File diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginwlan/src/cmpluginwlanproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginwlan/src/cmpluginwlanproxy.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 WLan Plugin proxy table +* +*/ + +#include "cmpluginwlan.h" +#include +#include + +// Exported proxy for instantiation method resolution +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KUidWlanBearerType, CCmPluginWlan::NewL ) + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + return ImplementationTable; + } diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginwlan/src/cmwlancoveragecheck.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginwlan/src/cmwlancoveragecheck.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,239 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 WLAN Coverage Check class +* +*/ + + +#include + +#include "cmwlancoveragecheck.h" +#include "cmpluginwlan.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmwlancoveragecheckTraces.h" +#endif + + +/** +* Management frame information element IDs. +* needed to determine coverage +*/ +enum T802Dot11InformationElementID + { + E802Dot11SsidIE = 0, + E802Dot11SupportedRatesIE = 1, + E802Dot11FhParameterSetIE = 2, + E802Dot11DsParameterSetIE = 3, + E802Dot11CfParameterSetIE = 4, + E802Dot11TimIE = 5, + E802Dot11IbssParameterSetIE = 6, + E802Dot11CountryIE = 7, + E802Dot11HoppingPatternParamIE = 8, + E802Dot11HoppingPatternTableIE = 9, + E802Dot11RequestIE = 10, + + E802Dot11ChallengeTextIE = 16, + // Reserved for challenge text extension 17 - 31 + E802Dot11ErpInformationIE = 42, + E802Dot11ExtendedRatesIE = 50, + E802Dot11AironetIE = 133, + E802Dot11ApIpAddressIE = 149, + E802Dot11RsnIE = 221 + }; + + +// ======================= MEMBER FUNCTIONS ================================= + +// ---------------------------------------------------------------------------- +// CCmWlanCoverageCheck::CCmWlanCoverageCheck() +// ---------------------------------------------------------------------------- +// +CCmWlanCoverageCheck::CCmWlanCoverageCheck() : CActive( EPriorityStandard ) + { + OstTraceFunctionEntry1( CCMWLANCOVERAGECHECK_CCMWLANCOVERAGECHECK_ENTRY, this ); + CActiveScheduler::Add( this ); + OstTraceFunctionExit1( CCMWLANCOVERAGECHECK_CCMWLANCOVERAGECHECK_EXIT, this ); + } + +// ---------------------------------------------------------------------------- +// CCmWlanCoverageCheck::~CCmWlanCoverageCheck() +// ---------------------------------------------------------------------------- +// +CCmWlanCoverageCheck::~CCmWlanCoverageCheck() + { + OstTraceFunctionEntry1( DUP1_CCMWLANCOVERAGECHECK_CCMWLANCOVERAGECHECK_ENTRY, this ); + Cancel(); + OstTraceFunctionExit1( DUP1_CCMWLANCOVERAGECHECK_CCMWLANCOVERAGECHECK_EXIT, this ); + } + +// ---------------------------------------------------------------------------- +// CCmWlanCoverageCheck::DoCancel +// ---------------------------------------------------------------------------- +// +void CCmWlanCoverageCheck::DoCancel() + { + OstTraceFunctionEntry1( CCMWLANCOVERAGECHECK_DOCANCEL_ENTRY, this ); + iWait.AsyncStop(); + OstTraceFunctionExit1( CCMWLANCOVERAGECHECK_DOCANCEL_EXIT, this ); + } + +// ---------------------------------------------------------------------------- +// CCmWlanCoverageCheck::RunL +// ---------------------------------------------------------------------------- +// +void CCmWlanCoverageCheck::RunL() + { + OstTraceFunctionEntry1( CCMWLANCOVERAGECHECK_RUNL_ENTRY, this ); + + switch ( iProgState ) + { + case EScanning: + { + if ( iStatus.Int() == KErrNone ) + { + // The list is ready. + iProgState = EDone; + iWait.AsyncStop(); + } + else + { + // Something went wrong -> no coverage. + iWait.AsyncStop(); + } + } + break; + case EDone: + { + iWait.AsyncStop(); + } + break; + default: + { + User::Leave( KErrCorrupt ); + } + break; + } + + OstTraceFunctionExit1( CCMWLANCOVERAGECHECK_RUNL_EXIT, this ); + } + +// ---------------------------------------------------------------------------- +// CCmWlanCoverageCheck::GetCoverageL +// ---------------------------------------------------------------------------- +// +TBool CCmWlanCoverageCheck::GetCoverageL() + { + OstTraceFunctionEntry0( CCMWLANCOVERAGECHECK_GETCOVERAGEL_ENTRY ); + + iProgState = EServiceStatus; + iCoverage = EFalse; + + CWlanMgmtClient* wlanMgmt = CWlanMgmtClient::NewL(); + CleanupStack::PushL( wlanMgmt ); + + CWlanScanInfo* scanInfo = CWlanScanInfo::NewL(); + CleanupStack::PushL( scanInfo ); + + iProgState = EScanning; + + wlanMgmt->GetScanResults( iStatus, *scanInfo ); + + SetActive(); + iWait.Start(); + + // now we have the results and might start to work on them... + if ( iProgState == EDone ) + { //finished without error, work on the result... + + for ( scanInfo->First(); !scanInfo->IsDone(); scanInfo->Next() ) + { + TBool isHidden( EFalse ); + + TUint8 ieLen( 0 ); + const TUint8* ieData; + + TInt ret = scanInfo->InformationElement( E802Dot11SsidIE, ieLen, + &ieData ); + if ( ret == KErrNone ) + { + isHidden = IsHiddenSsid( ieLen, ieData ); + if ( !isHidden ) + { + // WLAN awailable...stop searching. + iCoverage = ETrue; + break; + } + } + else + { + User::Leave( ret ); + } + } + + CleanupStack::PopAndDestroy( 2, wlanMgmt ); + } + else + { + // Clean the cleanupstack in case status is KErrNone + CleanupStack::PopAndDestroy( scanInfo ); + CleanupStack::PopAndDestroy( wlanMgmt ); + + User::LeaveIfError( iStatus.Int() ); + } + + OstTraceFunctionExit0( CCMWLANCOVERAGECHECK_GETCOVERAGEL_EXIT ); + return iCoverage; + } + +// --------------------------------------------------------- +// CCmWlanCoverageCheck::IsHiddenSsid +// --------------------------------------------------------- +// +TBool CCmWlanCoverageCheck::IsHiddenSsid( + TUint aSsidLength, + const TUint8* aSsid ) const + { + OstTraceFunctionEntryExt( CCMWLANCOVERAGECHECK_ISHIDDENSSID_ENTRY, this ); + + const TUint8 CSPACE = 0x20; + TBool result( EFalse ); + TBool result2( ETrue ); + + if ( !aSsidLength ) + { + result = ETrue; + } + + TInt count( 0 ); + TUint8 temp( 0x00 ); + + for ( TUint i( 0 ); i < aSsidLength; ++i ) + { + temp = aSsid[i]; + count += temp; // in hidden networks characters are: 0x00 + result2 &= temp == CSPACE ; + } + + if ( !count || result2 ) + { + result = ETrue; + } + + OstTraceFunctionExitExt( CCMWLANCOVERAGECHECK_ISHIDDENSSID_EXIT, this, result ); + return result; + } + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginwlan/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginwlan/traces/OstTraceDefinitions.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler +// REMOVE BEFORE CHECK-IN TO VERSION CONTROL +// #define OST_TRACE_COMPILER_IN_USE +#include +#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/cmpluginwlan/traces/fixed_id.definitions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/cmpluginwlan/traces/fixed_id.definitions Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,81 @@ +#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt. +[GROUP]TRACE_FLOW=0x7 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLANDATA_CCMPLUGINWLANDATA_ENTRY=0x3a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLANDATA_CCMPLUGINWLANDATA_EXIT=0x3b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLANDATA_CONSTRUCTL_ENTRY=0x3e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLANDATA_CONSTRUCTL_EXIT=0x3f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLANDATA_NEWLC_ENTRY=0x38 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLANDATA_NEWLC_EXIT=0x39 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_ADDITIONALRESET_ENTRY=0x29 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_ADDITIONALRESET_EXIT=0x2a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_BEARERRECORDIDLC_ENTRY=0x2b +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_BEARERRECORDIDLC_EXIT=0x2c +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CANHANDLEIAPIDL_ENTRY=0x19 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CANHANDLEIAPIDL_EXIT=0x1a +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CCMPLUGINWLAN_ENTRY=0x3 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CCMPLUGINWLAN_EXIT=0x4 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CHECKNETWORKCOVERAGEL_ENTRY=0x31 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CHECKNETWORKCOVERAGEL_EXIT=0x32 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CONSTRUCTL_ENTRY=0x9 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CONSTRUCTL_EXIT=0xa +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_COPYADDITIONALDATAL_ENTRY=0x2d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_COPYADDITIONALDATAL_EXIT=0x2e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CREATEINSTANCEL_ENTRY=0x5 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CREATEINSTANCEL_EXIT=0x6 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CREATENEWSERVICERECORDL_ENTRY=0x23 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CREATENEWSERVICERECORDL_EXIT=0x24 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CREATEWLANSERVICERECORDL_ENTRY=0x25 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_CREATEWLANSERVICERECORDL_EXIT=0x26 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_DELETEADDITIONALRECORDSL_ENTRY=0x1d +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_DELETEADDITIONALRECORDSL_EXIT=0x1e +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_GETADDITIONALUIDS_ENTRY=0x36 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_GETADDITIONALUIDS_EXIT=0x37 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_GETBOOLATTRIBUTEL_ENTRY=0xd +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_GETBOOLATTRIBUTEL_EXIT=0xe +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_GETINTATTRIBUTEL_ENTRY=0xb +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_GETINTATTRIBUTEL_EXIT=0xc +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_GETSTRINGATTRIBUTEL_ENTRY=0xf +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_GETSTRINGATTRIBUTEL_EXIT=0x10 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_LOADADDITIONALRECORDSL_ENTRY=0x21 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_LOADADDITIONALRECORDSL_EXIT=0x22 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_LOADSERVICESETTINGL_ENTRY=0x1f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_LOADSERVICESETTINGL_EXIT=0x20 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_NEWL_ENTRY=0x1 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_NEWL_EXIT=0x2 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_PREPARETOUPDATERECORDSL_ENTRY=0x27 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_PREPARETOUPDATERECORDSL_EXIT=0x28 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_SETASCOPYOF_ENTRY=0x2f +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_SETASCOPYOF_EXIT=0x30 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_SETBOOLATTRIBUTEL_ENTRY=0x13 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_SETBOOLATTRIBUTEL_EXIT=0x14 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_SETDAEMONNAMEL_ENTRY=0x33 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_SETDAEMONNAMEL_EXIT=0x34 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_SETINTATTRIBUTEL_ENTRY=0x11 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_SETINTATTRIBUTEL_EXIT=0x12 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_SETSTRINGATTRIBUTEL_ENTRY=0x15 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_SETSTRINGATTRIBUTEL_EXIT=0x16 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_UPDATEADDITIONALRECORDSL_ENTRY=0x17 +[TRACE]TRACE_FLOW[0x7]_CCMPLUGINWLAN_UPDATEADDITIONALRECORDSL_EXIT=0x18 +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_ADDTOARRAYIFNEEDEDL=0x4c +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_ADDTOARRAYIFNEEDEDL_EXIT=0x4d +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_CCMWLANCOVERAGECHECK_ENTRY=0x40 +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_CCMWLANCOVERAGECHECK_EXIT=0x41 +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_DOCANCEL_ENTRY=0x44 +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_DOCANCEL_EXIT=0x45 +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_GETCOVERAGEL_ENTRY=0x48 +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_GETCOVERAGEL_EXIT=0x49 +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_ISHIDDENSSID_ENTRY=0x4a +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_ISHIDDENSSID_EXIT=0x4b +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_RUNL_ENTRY=0x46 +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_RUNL_EXIT=0x47 +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_SCANFORPROMPTEDSSIDL_ENTRY=0x4e +[TRACE]TRACE_FLOW[0x7]_CCMWLANCOVERAGECHECK_SCANFORPROMPTEDSSIDL_EXIT=0x4f +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINWLANDATA_CCMPLUGINWLANDATA_ENTRY=0x3c +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINWLANDATA_CCMPLUGINWLANDATA_EXIT=0x3d +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINWLAN_CANHANDLEIAPIDL_ENTRY=0x1b +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINWLAN_CANHANDLEIAPIDL_EXIT=0x1c +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINWLAN_CCMPLUGINWLAN_ENTRY=0x7 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINWLAN_CCMPLUGINWLAN_EXIT=0x8 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMPLUGINWLAN_SETDAEMONNAMEL_EXIT=0x35 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMWLANCOVERAGECHECK_CCMWLANCOVERAGECHECK_ENTRY=0x42 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMWLANCOVERAGECHECK_CCMWLANCOVERAGECHECK_EXIT=0x43 diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmplugins/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmplugins/group/bld.inf Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Build information for the Plugins +* +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +#include "../cmpluginpacketdata/group/bld.inf" +#include "../cmpluginlan/group/bld.inf" +#include "../cmpluginwlan/group/bld.inf" +//#include "../cmpluginembdestination/group/bld.inf" +//#include "../cmpluginvpn/group/bld.inf" + +// End of File diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/conf/cmmanager.confml Binary file cmmanager/cmmgr/cmmserver/conf/cmmanager.confml has changed diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/conf/cmmanager_10207376.crml Binary file cmmanager/cmmgr/cmmserver/conf/cmmanager_10207376.crml has changed diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/group/bld.inf Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This file provides the information required for building the module. +* +*/ + + +#include + +PRJ_PLATFORMS + +DEFAULT + +PRJ_EXPORTS +// export iby files +../rom/cmmserver.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cmmserver.iby) + +../conf/cmmanager.confml MW_LAYER_CONFML(cmmanager.confml) +../conf/cmmanager_10207376.crml MW_LAYER_CRML(cmmanager_10207376.crml) + + +PRJ_MMPFILES +cmmserver.mmp + +PRJ_TESTMMPFILES diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/group/cmmserver.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/group/cmmserver.mmp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Project definition file for Connection Method Manager server. +* +*/ + + +#include + +TARGET cmmserver.exe +TARGETTYPE exe +UID 0x1000008d 0x20016A7A + +CAPABILITY NetworkControl NetworkServices ProtServ WriteDeviceData +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE cmmsrvstatic.cpp +SOURCE cmmstarter.cpp +SOURCE cmmsession.cpp +SOURCE cmmserver.cpp +SOURCE cmmanagerimpl.cpp +SOURCE cmmtransactionhandler.cpp +SOURCE cmmdbchangelistener.cpp +SOURCE cmmlistenermanager.cpp +SOURCE cmmdestinationinstance.cpp +SOURCE cmmconnmethodinstance.cpp +SOURCE cmmcache.cpp +SOURCE cmmconnmethodstruct.cpp +SOURCE cmmdestinationstruct.cpp +SOURCE cmminstancemapping.cpp +SOURCE cmmbearerpriority.cpp +SOURCE cmmbearerprioritycache.cpp +SOURCE cmmconnmethoditem.cpp +SOURCE cmmanagertextresolver.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../cmmcommon/inc +USERINCLUDE ../traces + +// ADO specific internal headers +SYSTEMINCLUDE ../../../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY cmmanagerdatabase.lib +LIBRARY cmmpluginbase.lib +LIBRARY commsdat.lib +LIBRARY bafl.lib +LIBRARY ecom.lib +LIBRARY featmgr.lib +LIBRARY centralrepository.lib +LIBRARY esock.lib +LIBRARY hbcore.lib + +EPOCSTACKSIZE 0x4000 diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmanagerimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmanagerimpl.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2006-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 connection method manager. +* +*/ + + +#ifndef CMMANAGERIMPL_H +#define CMMANAGERIMPL_H + +#include +#include +#include + +#include "cmmserverdefs.h" + +class CCmmTransactionHandler; +class CCmPluginBaseEng; +class CCmmCache; + + +NONSHARABLE_CLASS( CCmManagerImpl ) : public CBase + { +public: + /** + * Two phased construction. + */ + static CCmManagerImpl* NewL(); + + /** + * Destructor. + */ + virtual ~CCmManagerImpl(); + +private: + /** + * Constructor. + */ + CCmManagerImpl(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + +public: + /** + * Check the existence of tables we need. Creates if it is not exist, get + * the table id otherwise. + */ + void CheckTablesL(); + + /** + * Query all of the supported bearer types. + * + * @param aArray List of all supported bearer types. + */ + void SupportedBearersL( RArray& aArray ) const; + + /** + * Return the requested table ID. + */ + CommsDat::TMDBElementId TableId( TCmmDbRecords aRecord ); + + /** + * Get a handle to the database cache manager. + */ + CCmmCache& Cache(); + + /** + * Get a handle to the database transaction handler. + */ + CCmmTransactionHandler* GetTransactionHandler(); + + /** + * Get a handle to database session. + */ + CommsDat::CMDBSession& Session() const; + + /** + * Return true is WLAN is supported on phone. + */ + TBool WlanSupported() const; + +private: + /** + * Build an array of all bearer specific plugins. + */ + void BuildPluginArrayL(); + +private: + // Database cache manager. + CCmmCache* iCache; //Owned. + + // Array for bearer plugins. + CArrayPtrFlat* iPlugins; // Owned. + + // Database transaction handler. + CCmmTransactionHandler* iTrans; //Owned. + + // Destination network table ID. + CommsDat::TMDBElementId iSnapTableId; + // Global bearer type priorization table ID. + CommsDat::TMDBElementId iBearerPriorityTableId; + // Destination metadata table ID. + CommsDat::TMDBElementId iDestMetadataTableId; + // Default connection table ID. + CommsDat::TMDBElementId iDefConnTableId; + + // Flag for feature manager initialization status. + TBool iIsFeatureManagerInitialised; + + // True if phone supports WLAN. + TBool iWLanSupport; + }; + +#endif // CMMANAGERIMPL_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmanagertextresolver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmanagertextresolver.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,36 @@ +/* +* 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: +* Provides functionality for text resolving +* +*/ + +#ifndef CMMANAGERTEXTRESOLVER_H +#define CMMANAGERTEXTRESOLVER_H + +/** + * Utility class for resolving localised text. + */ +class CCmManagerTextResolver + { +public: + /** + * Resolves localised text from cmmanager translation file. + * @param aTextId Text Id from TS file + * @return Resolved text + */ + static HBufC* ResolveTextL( const TDesC& aTextId ); + }; + +#endif // CMMANAGERTEXTRESOLVER_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmbearerpriority.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmbearerpriority.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2006-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 bearer priority structure. +* +*/ + + +#ifndef CMMBEARERPRIORITY_H_ +#define CMMBEARERPRIORITY_H_ + +#include + + +NONSHARABLE_CLASS( CCmmBearerPriority ) : public CBase + { +public: + /** + * Two phased constuction. + */ + static CCmmBearerPriority* NewL( + const TDesC& aServiceType, + const TUint& aPriority, + const TUint& aUiPriority ); + + /** + * Two phased constuction. + */ + static CCmmBearerPriority* NewLC( + const TDesC& aServiceType, + const TUint& aPriority, + const TUint& aUiPriority ); + + /** + * Destructor. + */ + ~CCmmBearerPriority(); + +private: + /** + * Constructor. + */ + CCmmBearerPriority( const TUint& aPriority, const TUint& aUiPriority ); + + /** + * 2nd phase constructor. + */ + void ConstructL( const TDesC& aServiceType ); + +public: + /** + * Get the service type. + */ + HBufC* ServiceType() const; + + /** + * Get the priority. + */ + TUint Priority() const; + + /** + * Get the UI priority. + */ + TUint UiPriority() const; + +private: + HBufC* iServiceType; // Owned. + TUint iPriority; + TUint iUiPriority; + }; + +#endif // CMMBEARERPRIORITY_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmbearerprioritycache.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmbearerprioritycache.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 bearer priority array cache. +* +*/ + + +#ifndef CMMBEARERPRIORITYCACHE_H_ +#define CMMBEARERPRIORITYCACHE_H_ + +#include +#include + +class CCmmBearerPriority; +class CCmmTransactionHandler; + + +NONSHARABLE_CLASS( CCmmBearerPriorityCache ) : public CBase + { +public: + /** + * Two phased constuction. + */ + static CCmmBearerPriorityCache* NewL( + CCmmTransactionHandler* aTrans, + CommsDat::TMDBElementId aBearerPriorityTableId ); + + /** + * Two phased constuction. + */ + static CCmmBearerPriorityCache* NewLC( + CCmmTransactionHandler* aTrans, + CommsDat::TMDBElementId aBearerPriorityTableId ); + + /** + * Destructor. + */ + ~CCmmBearerPriorityCache(); + +private: + /** + * Constructor. + */ + CCmmBearerPriorityCache( + CCmmTransactionHandler* aTrans, + CommsDat::TMDBElementId aBearerPriorityTableId ); + + /** + * 2nd phase constructor. + * Reads the bearer priorities from CommsDat and stores them to own array. + */ + void ConstructL(); + +public: + /** + * Updates the bearer priority array with the contents of aArray. + */ + void UpdateL( const RPointerArray& aArray ); + + /** + * Copies the cache's contents to aArray. + */ + void CopyL( RPointerArray& aArray ) const; + + /** + * Get the priority value for a service type from the bearer priority + * cache. + */ + TUint GetPriority( const TDesC& aServiceType ) const; + +private: + void ReadL(); + +private: + // Database transaction handler. + CCmmTransactionHandler* iTrans; // Not owned. + + // Cached contents of the bearer priority array. + RPointerArray iArray; // Owns contents. + + // Global bearer type priorization table ID. + CommsDat::TMDBElementId iBearerPriorityTableId; + }; + +#endif // CMMBEARERPRIORITYCACHE_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmcache.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmcache.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,615 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Database cache manager. +* +*/ + + +#ifndef CMMCACHE_H_ +#define CMMCACHE_H_ + +#include +#include +#include +#include + +#include "cmmserverdefs.h" +#include "cmmbearerpriority.h" +#include "cmmconnmethodstruct.h" +#include "cmmconnmethoditem.h" + +// Forward declarations. +class CCmmDestinationStruct; +class CCmPluginBaseEng; +class CCmmListenerManager; +class CCmmInstanceMapping; + +class CCmmDestinationInstance; +class CCmmConnMethodInstance; + +class CCmmTransactionHandler; +class CCmManagerImpl; +class CCmmBearerPriorityCache; + + +/** + * A simple class to group a temporary ID and a database assigned valid ID + * together as a single structure. + * + * Used e.g. when updating a newly received real ID to datastructures + * containing a certain temporary ID. + */ +NONSHARABLE_CLASS( TCmmIdStruct ) + { +public: + inline TCmmIdStruct() : iRealId( 0 ), iTemporaryId( 0 ) + { + } + inline TCmmIdStruct( TUint32 aRealId, TUint32 aTemporaryId ) + : + iRealId( aRealId ), + iTemporaryId( aTemporaryId ) + { + } +public: + TUint32 iRealId; + TUint32 iTemporaryId; + }; + + +/** + * The CmmCache-class oversees all database operations. + * + * It manages the cached database data and handles all interactions between + * that data and the client sessions. + * + * It provides access to the CCmmInstanceMapping-class, that keeps track of the + * overall structure of destinations and connection methods in the database. + * + * It also manages the database listeners that keep track of database changes + * caused by outside sources. + */ +NONSHARABLE_CLASS( CCmmCache ) : public CBase + { +public: + /** + * NewL. + */ + static CCmmCache* NewL( + CCmManagerImpl* aCmManagerImpl, + CArrayPtrFlat* aPlugins ); + + /** + * NewLC. + */ + static CCmmCache* NewLC( + CCmManagerImpl* aCmManagerImpl, + CArrayPtrFlat* aPlugins ); + + /** + * Destructor. + */ + ~CCmmCache(); + +private: + /** + * Constructor. + * + * @param aPlugins Reference to supported plugin array. + */ + CCmmCache( + CCmManagerImpl* aCmManagerImpl, + CArrayPtrFlat* aPlugins ); + + /** + * Second phase constructor. + */ + void ConstructL(); + +public: + void OpenDestinationL( + CCmmDestinationInstance& aDestinationInstance, + const TUint32& aId ); + + /** + * Refresh the data contained in aDestinationInstance. This means reloading + * the data from database if necessary. After this call the contents of + * aDestinationInstance will reflect the current state in the database. + */ + void RefreshDestinationL( + CCmmDestinationInstance& aDestinationInstance ); + + void CreateDestinationL( + CCmmDestinationInstance& aDestinationInstance, + const TDesC& aName, + const TUint32& aId ); + + void OpenConnMethodL( + CCmmConnMethodInstance& aConnMethodInstance, + CCmmDestinationInstance* aDestinationInstance, + const TUint32& aId ); + + /** + * Refresh the data contained in aConnMethodInstance. This means reloading + * the data from database if necessary. After this call the contents of + * aConnMethodInstance will reflect the current state in the database. + */ + void RefreshConnMethodL( + CCmmConnMethodInstance& aConnMethodInstance ); + + void CreateConnMethodL( + CCmmConnMethodInstance& aConnMethodInstance, + CCmmDestinationInstance* aDestinationInstance, + const TUint32& aBearerType, + const TUint32& aConnMethodId ); + + /** + * Creates a copy of the given client instance (copy of the connection + * method to the cache). The copy is created from the commsdat data + * (changes not updated will not be shown in the copy). + * @param aNewConnMethodInstance The copy instance to be created. + * @param aConnMethodInstance The source instance to be copied. + */ + void CreateCopyOfConnMethodL( + CCmmConnMethodInstance& aNewConnMethodInstance, + CCmmConnMethodInstance& aConnMethodInstance ); + + /** + * Re-loads a destination record if needed and copies the latest version to + * the session instance given as parameter. + */ + void LoadDestinationRecordL( + CCmmDestinationInstance& aDestinationInstance, + TCmmDbRecords aDestRecordType ); + + /** + * Saves the modifications in aDestinationInstance into the database. Also + * all connection methods inside this destination are updated (including + * any embedded destination). + */ + void UpdateDestinationL( CCmmDestinationInstance& aDestinationInstance ); + + /** + * Saves the modifications in aConnMethodInstance into database. The second + * attribute aTemporaryHandle must be true if the connection method + * instance is only a temporary one created for the duration of this update + * process only. + */ + void UpdateConnMethodL( + CCmmConnMethodInstance& aConnMethodInstance, + TBool aTemporaryHandle ); + + /** + * Deletes the destination refered by aDestinationInstance from the + * database. In case other sessions have open handles to the same + * destination, the status is updated to deleted state, but it is not yet + * removed from database. (ID must be kept reserved in commsdat until all + * handles are closed). + */ + void DeleteDestinationL( + CCmmDestinationInstance& aDestinationInstance, + TBool aForced = EFalse ); + + /** + * Deletes a connection method as part of destination update operation. It + * is already checked that the connection method given as parameter can be + * deleted and a transaction is already open. + */ + void DeleteConnMethodAsPartOfDestinationUpdateL( const TUint32& aConnMethodId ); + + /** + * Deletes a connection method as part of destination delete operation. It + * is already checked that the connection method given as parameter can be + * deleted and a transaction is already open. + */ + void DeleteConnMethodAsPartOfDestinationDeleteL( const TUint32& aConnMethodId ); + + /** + * Basic connection method delete. Removes a connection method from any + * destination it might belong to, and then deletes it. + */ + void DeleteConnMethodL( CCmmConnMethodInstance& aConnMethodInstance ); + + TBool DestinationExistsWithId( const TUint32& aId ); + TBool DestinationExistsWithNameL( const TDesC& aName, const TUint32& aDestinationId ); + TBool DestinationOpenWithId( const TUint32& aId ); + TBool NotSavedDestinationOpenWithNameL( const TDesC& aName, const TUint32& aDestinationId ); + + TBool ConnMethodExistsWithId( const TUint32& aConnMethodId ); + TBool ConnMethodOpenWithId( const TUint32& aConnMethodId ); + + TBool DestinationExistsWithMetadataLocalizedL( + CCmmDestinationInstance& aDestinationInstance, + const TUint32& aValue ); + TBool DestinationExistsWithMetadataPurposeL( + CCmmDestinationInstance& aDestinationInstance, + const TUint32& aValue ); + + void DbChangeDetected( const TUint32& aTableId ); + void DbChangeError( const TUint32& aTableId ); + + void CloseDestination( CCmmDestinationInstance& aDestinationInstance ); + void CloseConnMethod( CCmmConnMethodInstance& aConnMethodInstance ); + + /** + * Returns a reference to the CommsDat session. + */ + CommsDat::CMDBSession& Session() const; + + /** + * Finds out the bearer type and priority of the service type from given + * IAP record. + */ + void BearerInfoFromIapRecordL( + CommsDat::CCDIAPRecord* aIapRecord, + TUint32& aBearerType, + TUint& aBearerPriority ) const; + + /** + * Finds out the priority of the service type in given IAP record. + */ + void BearerPriorityFromIapRecordL( + CommsDat::CCDIAPRecord* aIapRecord, + TUint& aBearerPriority ) const; + + /** + * Finds out the bearer type of a connection method from given IAP record. + */ + void BearerTypeFromIapRecordL( + CommsDat::CCDIAPRecord* aIapRecord, + TUint32& aBearerType ) const; + + /** + * Loads and initializes a connection method instance. + * @param aConnMethodInstance Reference to connection method instance + * beeing initialized. + * @param aConnMethodId ID of the connection method beeing opened. + */ + void OpenConnectionMethodInstanceL( + CCmmConnMethodInstance& aConnMethodInstance, + const TUint32& aConnMethodId ); + + /** + * Returns Connection Method specific integer value. CM is loaded(if not loaded already) + * to get the value. + * @param aCmId Identifier of the Connection Method. + * @param aAttribute The identifier of the requested value. + * @return Returns the requested integer value if found. Otherwise leaves with error code + * KErrNotFound. + */ + TUint32 GetConnectionMethodInfoIntL( + const TUint32& aCmId, + const TUint32& aAttribute ); + + /** + * Returns Connection Method specific boolean value. CM is loaded(if not loaded already) + * to get the value. + * @param aCmId Identifier of the Connection Method. + * @param aAttribute The identifier of the requested value. + * @return Returns the requested boolean value if found. Otherwise leaves with error code + * KErrNotFound. + */ + TBool GetConnectionMethodInfoBoolL( + const TUint32& aCmId, + const TUint32& aAttribute ); + + /** + * Returns Connection Method specific 16 bit string value. + * CM is loaded(if not loaded already) to get the value. + * @param aCmId Identifier of the Connection Method. + * @param aAttribute The identifier of the requested value. + * @return Returns the requested string value if found. Otherwise leaves with error code + * KErrNotFound. + */ + HBufC* GetConnectionMethodInfoStringL( + const TUint32& aCmId, + const TUint32& aAttribute ); + + /** + * Returns Connection Method specific 8 bit string value. + * CM is loaded(if not loaded already) to get the value. + * @param aCmId Identifier of the Connection Method. + * @param aAttribute The identifier of the requested value. + * @return Returns the requested string value if found. Otherwise leaves with error code + * KErrNotFound. + */ + HBufC8* GetConnectionMethodInfoString8L( + const TUint32& aCmId, + const TUint32& aAttribute ); + + /** + * Returns bearer specific integer value. IAP does not need to be loaded for this. + * @param aBearerType The type of the plugin to be asked. + * @param aAttribute The identifier of the requested value. + * @return Returns the requested integer value if found. Otherwise leaves with error code + * KErrNotFound. + */ + TUint32 GetBearerInfoIntL( + const TUint32& aBearerType, + const TUint32& aAttribute ); + + /** + * Returns bearer specific boolean value. IAP does not need to be loaded for this. + * @param aBearerType The type of the plugin to be asked. + * @param aAttribute The identifier of the requested value. + * @return Returns the requested boolean value if found. Otherwise leaves with error code + * KErrNotFound. + */ + TBool GetBearerInfoBoolL( + const TUint32& aBearerType, + const TUint32& aAttribute ); + + /** + * Returns bearer specific 16 bit string value. IAP does not need to be loaded for this. + * @param aBearerType The type of the plugin to be asked. + * @param aAttribute The identifier of the requested value. + * @return Returns the requested string value if found. Otherwise leaves with error code + * KErrNotFound. + */ + HBufC* GetBearerInfoStringL( + const TUint32& aBearerType, + const TUint32& aAttribute ); + + /** + * Returns bearer specific 8 bit string value. IAP does not need to be loaded for this. + * @param aBearerType The type of the plugin to be asked. + * @param aAttribute The identifier of the requested value. + * @return Returns the requested string value if found. Otherwise leaves with error code + * KErrNotFound. + */ + HBufC8* GetBearerInfoString8L( + const TUint32& aBearerType, + const TUint32& aAttribute ); + + /** + * Returns all conenction method IDs. Unsupported connection methods are + * included if aCheckBearerType is set to EFalse. + */ + void GetAllConnMethodsL( + RArray& aConnMethodArray, + TBool aCheckBearerType ) const; + + /** + * Returns the number of destinations the provided connection method + * belongs to. + */ + TInt DestinationsContainingConnMethod( const TUint32& aConnMethodId ) const; + + /** + * Return the EasyWLAN IAP ID, zero if not found or WLAN not supported. + */ + TUint32 EasyWlanIdL() const; + + /** + * Check if WLAN is supported on phone. + */ + TBool WlanSupported() const; + + /** + * Find out the internet destination ID. Set to 0 if not found. + */ + void InternetDestinationIdL( TUint& aInternetDestinationId ) const; + + /** + * Return the number of destinations in database. + */ + TInt GetDestinationCount() const; + + /** + * Returns all the valid Destinations + */ + void GetDestinationsL( RArray& aDestinationArray ) const; + + /** + * Returns all the valid connection methods under given destination. + */ + void GetConnMethodsFromDestinationL( + const TUint32& aDestinationId, + RArray& aConnMethodArray ) const; + + /** + * Copies the bearer priority array's contents to aArray. + */ + void CopyBearerPriorityArrayL( RPointerArray& aArray ) const; + + /** + * Updates the bearer priority array with the contents of aArray. + */ + void UpdateBearerPriorityArrayL( const RPointerArray& aArray ); + + TBool ConnMethodInOtherDestination( + const TUint32& aConnMethodId, + const TUint32& aDestinationId ); + TUint32 NextFreeTemporaryId(); + + /** + * Read general connection settings from database. + */ + void ReadGenConnSettingsL( TCmGenConnSettings& aGenConnSettings ) const; + + /** + * Write general connection settings to database. + */ + void WriteGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings ); + + /** + * Enumerates connections and checks if the given connection method is + * connected. + * @param aCmId Id of the connection method to be checked. + * @return Returns ETrue if the CM is connected and EFalse if it's not + * connected. + */ + TBool CheckIfCmConnected( const TUint32& aCmId ) const; + + /** + * Enumerates connections and checks if any of the connection methods in + * the given destination is connected. + * //TODO, update comments with second parameter. + */ + TBool DestinationConnectedL( + const TUint32 aDestinationId, + CCmmDestinationInstance* aDestinationInstance = NULL ) const; + + /** + * Check from database if the given destination is an embedded destination + * in any other destination. + */ + TBool DestinationIsEmbedded( const TUint32& aDestinationId ) const; + + /** + * Check from database if the given destination has an embedded destination. + */ + TBool DestinationHasEmbedded( const TUint32& aDestinationId ) const; + + /** + * Check from database if the given destination is pointed to by any + * virtual IAP. + */ + TBool DestinationPointedToByVirtualIap( const TUint32& aDestinationId ) const; + + /** + * Check from database if the given connection method is pointed to by any + * virtual IAP. + */ + TBool ConnMethodPointedToByVirtualIap( const TUint32& aConnMethodId ) const; + + /** + * Check if the given connection method is the only connection method in + * the given destination and if a virtual IAP points to that destination. + */ + TBool ConnMethodInDestinationButLocked( + const TUint32& aConnMethodId, + const TUint32& aDestinationId ) const; + + /** + * Remove all references to the given connection method from the + * datamobility selection policy records. Then update instance mapping to + * reflect the current database state, and notify any possible client + * handles for the changed destinations. + */ + void RemoveAllReferencesToConnMethodL( + CCmmConnMethodInstance& aConnMethodInstance ); + + /** + * Update the ID of a new destination from temporary ID to real ID after a + * successful update to database. + */ + void RefreshDestinationId( const TCmmIdStruct& aIdStruct ); + + /** + * Update the ID of a new connection method from temporary ID to real ID + * after a successful update to database. + */ + void RefreshConnMethodId( const TCmmIdStruct& aIdStruct ); + + /** + * During destination update, after updating connection methods inside the + * destination, the database records containing the information of what + * connection methods are inside the destination need to be updated with + * real IDs for any newly created connection methods. These real IDs are + * held in the temporary array iUpdatedConnMethods until successful commit + * to database. This method is used to find out those real IDs before that. + */ + void TranslateTemporaryId( const TUint32& aTemporaryId, TUint32& aRealId ) const; + + /** + * Check if the given connection method can have all references removed and + * made into an uncategorized connection method. + */ + void CheckIfConnMethodReferencesCanBeRemovedL( const CCmmConnMethodInstance& aConnMethodInstance ); + + /** + * Check if the given connection method can be deleted. + */ + void CheckIfConnMethodCanBeDeletedL( const CCmmConnMethodInstance& aConnMethodInstance ); + + /** + * Check if the given destination can be deleted. + */ + void CheckIfDestinationCanBeDeletedL( const CCmmDestinationInstance& aDestinationInstance ); + + /** + * Return the requested table ID. + */ + CommsDat::TMDBElementId TableId( TCmmDbRecords aRecord ); + +private: + TInt FindDestinationFromCache( const TUint32& aId ); + TInt FindNotSavedDestinationFromCacheL( const TDesC& aName, const TUint32& aDestinationId ); + + TInt FindConnMethodFromCache( const TUint32& aConnMethodId ); + + void ReplaceGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings ); + + /** + * Opens a transaction and deletes the given connection method. + */ + void DeletePluginL( CCmmConnMethodStruct& aConnMethodStruct ); + + /** + * TODO + */ + void DeleteDestinationForcedL( CCmmDestinationInstance& aDestinationInstance ); + +private: + // Monitors changes in the database. + CCmmListenerManager* iListenerManager; // Owned. + + // Contains the current destination/connection method structure. + CCmmInstanceMapping* iInstanceMapping; // Owned. + + // Array of currently opened destinations. + RPointerArray iDestinationArray; // Owned. + + // Array of currently opened connection methods. + RPointerArray iConnMethodArray; // Owned. + + // Temporary array to hold information about connection methods that are + // deleted during a database transaction. This information is needed + // immediately when the database transaction is successfully commited. + RArray iDeletedConnMethods; // Owned. + + // Temporary arrays to hold information about connection methods that are + // updated during a database transaction. This information is needed + // immediately when the database transaction is successfully commited. + RArray iUpdatedConnMethods; // Owned. + RPointerArray iUpdatedConnMethods2; // Does not own contents. + + // Temporary arrays to hold information about destinations that are updated + // during a database transaction. This information is needed immediately + // when the database transaction is successfully commited. + RArray iUpdatedDestinations; // Owned. + RPointerArray iUpdatedDestinations2; // Does not own contents. + + // Transaction handler for CommsDat operations. Created and owned by + // CCmManagerImpl. + CCmmTransactionHandler* iTrans; // Not owned. + + // Pointer to bearer priority array. + CCmmBearerPriorityCache* iBearerPriorityCache; // Owned. + + CArrayPtrFlat* iPlugins; // Not owned. + + // Connection method manager. + CCmManagerImpl* iCmManagerImpl; // Not owned. + + // Counter to generate new unique IDs. These are used to link new objects + // without valid IDs between session side and cache. + TUint32 iCurrentTemporaryId; + }; + +#endif // CMMCACHE_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmconnmethodinstance.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmconnmethodinstance.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,271 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Session side object representing a connection method. +* +*/ + + +#ifndef CMMCONNMETHODINSTANCE_H_ +#define CMMCONNMETHODINSTANCE_H_ + +#include + +#include "cmmserverdefs.h" + +class CCmmSession; +class CCmmCache; +class CCmPluginBaseEng; +class CCmClientPluginInstance; +class CCmmConnMethodStruct; +class TCmmIdStruct; + + +/** + * TODO, see DestInstance + */ +NONSHARABLE_CLASS( CCmmConnMethodInstance ) : public CObject + { +public: + /** + * NewL. + */ + static CCmmConnMethodInstance* NewL( CCmmSession* aCmmSession, CCmmCache* aCache ); + + /** + * NewLC. + */ + static CCmmConnMethodInstance* NewLC( CCmmSession* aCmmSession, CCmmCache* aCache ); + + /** + * Destructor. + */ + ~CCmmConnMethodInstance(); + +private: + /** + * Constructor. + * + * @param aCache database cache. + */ + CCmmConnMethodInstance( CCmmSession* aCmmSession, CCmmCache* aCache ); + + /** + * Second phase constructor. + */ + void ConstructL(); + +public: + /** + * Set the plugin base pointer. + */ + void SetPlugin( CCmPluginBaseEng* aPlugin ); + + /** + * Get the plugin base pointer. + */ + CCmPluginBaseEng* GetPlugin() const; + + /** + * Get connection method ID. + */ + TUint32 GetId() const; + + /** + * Set connection method ID. + */ + void SetId( const TUint32& aConnMethodId ); + + /** + * Return bearer type. + */ + TUint32 GetBearerType() const; + + /** + * Set bearer type. + */ + void SetBearerType( const TUint32& aBearerType ); + + /** + * Get handle ID. + */ + TInt GetHandle() const; + + /** + * Set handle ID. + */ + void SetHandle( const TInt& aHandle ); + + /** + * Get pointer to the plugin data container. + */ + CCmClientPluginInstance* GetPluginDataInstance() const; + + /** + * Return ETrue, if this connection method represents an embedded destination. + */ + TBool IsEmbeddedDestination() const; + + /** + * Save the contents of this connection method into database. The attribute + * aTemporaryHandle must be true if this connection instance was + * temporarily created for the duration of this update operation only. + */ + void UpdateL( TBool aTemporaryHandle = EFalse ); + + /** + * Copy the relevant connection method information from cache side object. + */ + void CopyDataL( CCmmConnMethodStruct* aConnMethodStruct ); + + /** + * Returns integer value identified by aAttribute. Some special cases + * are handled in this module and the rest in plugin. + * @param aAttribute Parameter which specifies the requested attribute. + * @return Returns the value of the requested attribute if succees. Otherwise + * leaves with KErrArgument + */ + TUint32 GetIntAttributeL( const TUint32& aAttribute ); + + /** + * Returns integer value identified by aAttribute. Some special cases + * are handled in this module and the rest in plugin. + * @param aAttribute Parameter which specifies the requested attribute. + * @return Returns the value of the requested attribute if succees. Otherwise + * leaves with KErrArgument + */ + TBool GetBoolAttributeL( const TUint32& aAttribute ); + + /** + * Returns 16 bit string value identified by aAttribute. + * @param aAttribute Parameter which specifies the requested attribute. + * @return Returns the value of the requested attribute if succees. Otherwise + * leaves with KErrArgument + */ + HBufC* GetStringAttributeL( const TUint32& aAttribute ); + + /** + * Returns 8 bit string value identified by aAttribute. + * @param aAttribute Parameter which specifies the requested attribute. + * @return Returns the value of the requested attribute if succees. Otherwise + * leaves with KErrArgument + */ + HBufC8* GetString8AttributeL( const TUint32& aAttribute ); + + /** + * Sets the integer value identified by aAttribute. + * @param aAttribute Identifies the attribute to be set. + * @param aValue The value to be set. + * @return None + */ + void SetIntAttributeL( + const TUint32& aAttribute, + const TUint32& aValue ); + + /** + * Sets the integer value identified by aAttribute. + * @param aAttribute Identifies the attribute to be set. + * @param aValue The value to be set. + * @return None + */ + void SetBoolAttributeL( + const TUint32& aAttribute, + const TBool& aValue ); + + /** + * Sets the 16 bit string value identified by aAttribute. + * @param aAttribute Identifies the attribute to be set. + * @param aValue The value to be set. + * @return None + */ + void SetStringAttributeL( + const TUint32& aAttribute, + const TDesC16& aValue ); + + /** + * Sets the 8 bit string value identified by aAttribute. + * @param aAttribute Identifies the attribute to be set. + * @param aValue The value to be set. + * @return None + */ + void SetString8AttributeL( + const TUint32& aAttribute, + const TDesC8& aValue ); + + /** + * Gets the current status of this connection method instance. + */ + TCmmConnMethodStatus GetStatus() const; + + /** + * Sets a new status value. + */ + void SetStatus( const TCmmConnMethodStatus& aStatus ); + + /* + * Called after this connection method has been updated and database + * transaction has completed successfully. Sets the internal state of this + * connection method instance to reflect the new valid state. + */ + void UpdateSuccessful(); + + /** + * Called after this connection method has been deleted and database + * transaction has completed successfully. Sets the internal state of this + * connection method structure to reflect the new deleted state. + */ + void DeleteSuccessful( const TUint32& aNewSecondaryId ); + + /** + * After update/delete to database, refresh temporary ID to real ID if + * necessary and refresh status information for any related handles for + * all client sessions. + */ + void RefreshHandlesForAllSessions( const TCmmIdStruct& aIdStruct ); + + /** + * Removes a connection method from any open destination handle in the same + * session. + */ + void RemoveConnMethodFromSessionDestinationHandles( const TUint32& aConnMethodId ); + +private: + // Session that owns this instance. + CCmmSession* iCmmSession; // Not owned. + + // Database cache. + CCmmCache* iCache; // Not owned. + + // Pointer to original bearer plugin owned by cache. + CCmPluginBaseEng* iPlugin; // Not owned. + + // Object to contain the data of this connection method instance. + CCmClientPluginInstance* iPluginDataInstance; // Owned. + + // Connection method ID. + TUint32 iConnMethodId; + + // Connection method bearer type. + TUint32 iBearerType; + + // Connection method handle status. + TCmmConnMethodStatus iStatus; + + // Subsession handle ID. + TInt iHandle; + }; + +#endif // CMMCONNMETHODINSTANCE_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmconnmethoditem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmconnmethoditem.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 representing any kind on connection method, including embedded +* destination. Used for priority based ordering of connection methods inside +* destinations. +* +*/ + + +#ifndef CMMCONNMETHODITEM_H_ +#define CMMCONNMETHODITEM_H_ + +#include + + +NONSHARABLE_CLASS( TCmmConnMethodItem ) + { +public: + TCmmConnMethodItem(); + + TCmmConnMethodItem( + TUint32 aId, + TUint32 aBearerType, + TUint aBearerPriority, + TUint aPriority ); + + /** + * A comparison function. Uses priority since items are in priority order. + */ + static TInt Compare( + const TCmmConnMethodItem& aFirst, + const TCmmConnMethodItem& aSecond ); + + /** + * A comparison function to find a specific item by ID. (Items are not + * sorted by ID in the array.) + */ + static TBool FindCompare( + const TUint32* aKey, + const TCmmConnMethodItem& aEntry ); + +public: + // Connection method ID. + TUint32 iId; + + // Connection method bearer type. + TUint32 iBearerType; + + // Priority value of the bearer type. + TUint iBearerPriority; + + // Priority value in the CCDDataMobilitySelectionPolicy-record. Only used + // for sorting purposes when building an array ofTCmmConnMethodItem-objects. + TUint iPriority; + }; + +#endif // CMMCONNMETHODITEM_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmconnmethodstruct.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmconnmethodstruct.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Cache side object representing a connection method. +* +*/ + + +#ifndef CMMCONNMETHODSTRUCT_H_ +#define CMMCONNMETHODSTRUCT_H_ + +#include + +#include "cmmserverdefs.h" + +class CCmmConnMethodInstance; +class CCmPluginBaseEng; + + +/** + * TODO + */ +NONSHARABLE_CLASS( CCmmConnMethodStruct ) : public CBase + { +public: + static CCmmConnMethodStruct* NewL( const TUint32& aConnMethodId ); + static CCmmConnMethodStruct* NewLC( const TUint32& aConnMethodId ); + ~CCmmConnMethodStruct(); + +private: + CCmmConnMethodStruct( TUint32 aConnMethodId ); + void ConstructL(); + +public: + /** + * Return the reference count. + */ + TInt GetReferenceCounter(); + + /** + * Increase the reference counter by one. + */ + void IncrementReferenceCounter(); + + /** + * Return the connection method ID. + */ + TUint32 GetId() const; + + /** + * Set the connection method ID. + */ + void SetId( const TUint32& aConnMethodId ); + + /** + * Return bearer type. + */ + TUint32 GetBearerType() const; + + /** + * Gets the current status of this connection method struct. + */ + TCmmConnMethodStatus GetStatus() const; + + /** + * Sets a new status value. + */ + void SetStatus( const TCmmConnMethodStatus& aStatus ); + + /** + * TODO + * + */ + void RefreshConnMethodInstanceL( + CCmmConnMethodInstance& aConnMethodInstance ); + + /** + * Decrease the reference counter by one. Return the remaining number of + * references. + */ + TInt SessionInstanceClosed(); //TODO, rename to ConnMethodInstanceClosed ? + + /** + * Set the connection method plugin. Updates status and sets reference + * counter to 1. + */ + void SetPlugin( + CCmPluginBaseEng* aPlugin, + TUint32 aBearerType, + TCmmConnMethodStatus aStatus ); + + /** + * Returns the connection method plugin. + */ + CCmPluginBaseEng* GetPlugin(); + + /** + * Called after this connection method has been updated and database + * transaction has completed successfully. Sets the internal state of this + * connection method structure to reflect the new valid state. + */ + void UpdateSuccessful(); + + /** + * Called after this connection method has been deleted and database + * transaction has completed successfully. Sets the internal state of this + * connection method structure to reflect the new deleted state. + */ + void DeleteSuccessful( const TUint32& aNewSecondaryId ); + +private: + // The connection method plugin. + CCmPluginBaseEng* iConnMethodPlugin; // Owned. + + // Total number of handles that the clients have to this connection method. + TInt iReferenceCounter; + + // Connection method ID. + // For new connection methods, while no valid database ID is available, + // will be assigned a temporary ID that will have a value above + // above KTemporaryIdCounterStart. + TUint32 iConnMethodId; + + // Connection method bearer type. + TUint32 iBearerType; + + // Current status of this connection method. + TCmmConnMethodStatus iStatus; + + //TODO + //TCmmRecordStatus iRecordStatus; + }; + +#endif // CMMCONNMETHODSTRUCT_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmdbchangelistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmdbchangelistener.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Listens for changes in one CommsDat table through CenRep. +* +*/ + + +#ifndef CMMDBCHANGELISTENER_H_ +#define CMMDBCHANGELISTENER_H_ + +#include + +class CCmmListenerManager; +class CRepository; + +// Stop requesting new notifications after this many consecutive errors +const TInt KCmmCenRepErrorThreshold = 50; + + +NONSHARABLE_CLASS( CCmmDbChangeListener ) : public CActive + { +public: + static CCmmDbChangeListener* NewL( + CCmmListenerManager* aListenerManager, + TUint32 aTableId ); + + static CCmmDbChangeListener* NewLC( + CCmmListenerManager* aListenerManager, + TUint32 aTableId ); + + virtual ~CCmmDbChangeListener(); + +private: + CCmmDbChangeListener( + CCmmListenerManager* aListenerManager, + TUint32 aTableId ); + + void ConstructL(); + +public: + TUint32 GetTableId(); + TInt Start(); + +private: // Methods from base class + void DoCancel(); + void RunL(); // Don't leave, or implement RunError() //TODO, implement RunError() + +private: + TInt RequestNotification(); + +private: + // Manager object that handles all similar listeners. + CCmmListenerManager* iListenerManager; // Not owned + + // Central Repository handle. + CRepository* iRepository; // Owned + + // Table ID of the commsdat table to be listened. + TUint32 iTableId; + + // Safeguard in case of CenRep errors. + TInt iErrorCounter; + }; + +#endif // CMMDBCHANGELISTENER_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmdestinationinstance.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmdestinationinstance.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,338 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Session side object representing a destination. +* +*/ + + +#ifndef CMMDESTINATIONINSTANCE_H_ +#define CMMDESTINATIONINSTANCE_H_ + +#include +#include +#include + +#include "cmmserverdefs.h" + +class CCmmSession; +class CCmmCache; +class CCmmConnMethodInstance; +class TCmmIdStruct; +class TCmmConnMethodItem; +class CCDSNAPMetadataRecord; + + +/** + * Session side object representing a destination. Keeps track of any changes + * the client makes before they are updated to database. + */ +NONSHARABLE_CLASS( CCmmDestinationInstance ) : public CObject + { +public: + /** + * NewL. + */ + static CCmmDestinationInstance* NewL( CCmmSession* aCmmSession, CCmmCache* aCache ); + + /** + * NewLC. + */ + static CCmmDestinationInstance* NewLC( CCmmSession* aCmmSession, CCmmCache* aCache ); + + /** + * Destructor. + */ + ~CCmmDestinationInstance(); + +private: + /** + * Constructor. + * + * @param aCache CmmCache. + */ + CCmmDestinationInstance( CCmmSession* aCmmSession, CCmmCache* aCache ); + + /** + * Second phase constructor. + */ + void ConstructL(); + +public: + void SetId( const TUint32& aId ); + TUint32 GetId() const; + + /** + * Sets a new status value. + */ + void SetStatus( const TCmmDestinationStatus& aStatus ); + + /** + * Gets the current status of this destination instance. + */ + TCmmDestinationStatus GetStatus() const; + + /** + * Get handle ID. + */ + TInt GetHandle() const; + + /** + * Set handle ID. + */ + void SetHandle( const TInt& aHandle ); + + /** + * Set the record status for all records. + */ + void SetStatusForAllRecords( const TCmmRecordStatus& aStatus ); + + TUint32 GetElementIdL(); + TUint32 GetRecordTagFromApRecordL(); + + TInt SetRecordPointer( + const TCmmDbRecords& aDestRecord, + CommsDat::CCDRecordBase* aRecordPointer ); + TInt GetRecordPointer( + const TCmmDbRecords& aDestRecord, + CommsDat::CCDRecordBase*& aRecordPointer ); + + /** + * Save the contents of this destination into database. All connection + * methods including embedded destination, that the client has open handles + * to, are also updated. + */ + void UpdateL(); + + TDesC& GetDestinationNameL(); + HBufC* GetLocalisedDestinationNameL(); + void SetDestinationNameL( const TDesC& aDestinationName ); + + void GetMetadataL( + const CMManager::TSnapMetadataField& aMetadataField, + TUint32& aMetadata ); + void SetMetadataL( + const CMManager::TSnapMetadataField& aMetadataField, + const TUint32& aMetadata ); + + void GetProtectionL( CMManager::TProtectionLevel& aProtectionLevel ); + void SetProtectionL( CMManager::TProtectionLevel aProtectionLevel ); + + /** + * Return true if protection level has been changed. + */ + TBool ProtectionChanged(); + + /** + * Return the previous valid protection level of this connection method + * instance. + */ + CMManager::TProtectionLevel LastProtectionLevel(); + + /** + * Return the protection level currently set into this destination instance. + */ + CMManager::TProtectionLevel CurrentProtectionLevel(); + + /** + * Adds a connection method into this destination. Returns the index in + * the connection method array where the connection method was added. + */ + TInt AddConnMethodL( + const CCmmConnMethodInstance& aConnMethodInstance ); + + /** + * Adds an embedded destination into this destination. Returns the index in + * the connection method array where the connection method was added. + */ + TInt AddEmbeddedDestinationL( + const CCmmDestinationInstance& aEmbeddedDestinationInstance ); + + /** + * Delete a connection method that belongs to this destination. If the + * connection method belongs to any other destination, it is only removed + * from this destination and not deleted. Does not call update. + */ + void DeleteConnMethodFromDestinationL( + const CCmmConnMethodInstance& aConnMethodInstance ); + + /** + * Remove a connection method from this destination. If the second + * attribute aTestIfConnected is false, the test to check if connection + * method is in use is skipped. This is to avoid a duplicate check, so it + * should have been already tested by the caller. + */ + void RemoveConnMethodFromDestinationL( + const CCmmConnMethodInstance& aConnMethodInstance, + const TBool& aTestIfConnected = ETrue ); + + /** + * Modifies the priority of a connection method inside this destination. + */ + void ModifyConnMethodPriorityL( + const CCmmConnMethodInstance& aConnMethodInstance, + TUint aIndex ); + + /** + * Finds a connection method instance that belongs to the same session and + * matches the provided ID. Return NULL if no match is found. + */ + CCmmConnMethodInstance* FindConnMethodInstanceFromSessionById( + const TUint32& aConnMethodId ) const; + + /** + * Finds a destination instance that belongs to the same session and matches + * the provided ID. Return NULL if no match is found. + */ + CCmmDestinationInstance* FindDestinationInstanceFromSessionById( + const TUint32& aDestinationId ) const; + + /** + * Check from all open destination handles in the same session if the given + * connection method is inside any of them. The given destination is + * skipped. + */ + TBool ConnMethodInOtherDestinationInSession( + const TUint32& aConnMethodId, + const TUint32& aDestinationId ) const; + + /** + * Check if the given connection method is in this destination. Include + * embedded destinations. + */ + TBool ValidConnMethodIdInDestinationIncludeEmbedded( + const TUint32& aConnMethodId ) const; + + /** + * Check if the given connection method is inside this destination and if + * it is in a 'locked' status. A locked connection method can't be deleted + * nor removed from the destination. A connection method becomes locked + * if it is the only remaining connection method in a destination and a + * virtual IAP points into that destination. + */ + TBool ConnMethodInDestinationButLocked( const TUint32& aConnMethodId ) const; + + /** + * Counts how many connection methods that require priority information are + * currently in this destination. This excludes any virtual IAPs that point + * to a destination or any embedded destinations from the count. Assumes + * the connection method array is in order so all wildcard priority IAPs + * are at the end of the list. + */ + TUint NumberOfConnMethodsWithPriority() const; + + /** + * Check if this destination has an embedded destination. Checks the + * current (possibly unsaved) status of this destination handle, not the + * current status in database. + */ + TBool HasEmbedded() const; + + /** + * Check if this destination has an embedded destination with the specified + * ID. Checks the current (possibly unsaved) status of this destination + * handle, not the current status in database. + */ + TBool HasEmbeddedWithId( const TUint32& aDestinationId ) const; + + /** + * After update/delete to database, refresh temporary ID to real ID if + * necessary and refresh status information for any related handles for + * all client sessions. + */ + void RefreshHandlesForAllSessions( const TCmmIdStruct& aIdStruct ); + + /** + * If the destination contains a connection method with matching temporary + * ID, updates the ID to real ID. This is done after the connection method + * has been successfully saved into the database. + */ + void RefreshConnMethodId( const TCmmIdStruct& aIdStruct ); + + /** + * Called after this destination has been updated and database transaction + * has completed successfully. Sets the internal state of this destination + * instance to reflect the new valid state. + */ + void UpdateSuccessful(); + +private: + TBool AllMandatoryRecordsContainData() const; + void RefreshRecordL( TCmmDbRecords aRecordType ); + void LoadAllRecordsL(); + void SetMetadataInternetL( const TUint32& aMetadata ); + void SetMetadataHighlight( const TUint32& aMetadata ); + void SetMetadataHiddenAgentL( const TUint32& aMetadata ); + void SetMetadataLocalizationL( const TUint32& aMetadata ); + void SetMetadataPurposeL( const TUint32& aMetadata ); + + /** + * Checks the current metadata for this destination, and verifies there is + * no other conflicting destinations in the database. + */ + TBool ConflictingMetadataFoundL(); + +public: + // Array of connection method items that belong to this destination. Loaded + // and maintained in priority order. + RArray iConnMethodItemArray; // Owned. + + // Array of connection method IDs that should be deleted if UpdateL() is + // called for this destination instance. + RArray iConnMethodsToBeDeleted; // Owned. + +private: + // Session that owns this instance. + CCmmSession* iCmmSession; // Not owned. + + // Database cache. + CCmmCache* iCache; // Not owned. + + // The network record. + CommsDat::CCDNetworkRecord* iNetworkRecord; // Owned. + + // The access point record. + CommsDat::CCDAccessPointRecord* iDestApRecord; // Owned. + + // The metadata record. + CCDSNAPMetadataRecord* iMetadataRecord; // Owned. + + // Status flags for each record. + TCmmRecordStatus iNetworkRecordStatus; + TCmmRecordStatus iDestApRecordStatus; + TCmmRecordStatus iMetadataRecordStatus; + + // Destination handle status. + TCmmDestinationStatus iStatus; + + // Destination ID. If real ID is not available, contains a temporary ID. + TUint32 iId; + + // Subsession handle ID. + TInt iHandle; + + // True if protection value has been changed. Reset to false on update. + TBool iProtectionChanged; + + // The previous valid protection level of this connection method instance. + // Set correctly only if iProtectionChanged is true. + CMManager::TProtectionLevel iLastProtectionLevel; + + // The protection level currently set into this destination instance. + CMManager::TProtectionLevel iCurrentProtectionLevel; + }; + +#endif // CMMDESTINATIONINSTANCE_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmdestinationstruct.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmdestinationstruct.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,166 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Cache side object representing a destination. +* +*/ + + +#ifndef CMMDESTINATIONSTRUCT_H_ +#define CMMDESTINATIONSTRUCT_H_ + +#include +#include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#include +#include +#endif + +#include "cmmserverdefs.h" + +class CCmmTransactionHandler; +class CCmmDestinationInstance; +class CCmmCache; +class CCDSNAPMetadataRecord; + + +NONSHARABLE_CLASS( CCmmDestinationStruct ) : public CBase + { +public: + static CCmmDestinationStruct* NewL( + CCmmCache* aCache, + CCmmTransactionHandler* aTransactionHandler, + const TUint32& aId ); + static CCmmDestinationStruct* NewL( + CCmmCache* aCache, + CCmmTransactionHandler* aTransactionHandler, + const TDesC& aName, + const TUint32& aId ); + + static CCmmDestinationStruct* NewLC( + CCmmCache* aCache, + CCmmTransactionHandler* aTransactionHandler, + const TUint32& aId ); + static CCmmDestinationStruct* NewLC( + CCmmCache* aCache, + CCmmTransactionHandler* aTransactionHandler, + const TDesC& aName, + const TUint32& aId ); + + virtual ~CCmmDestinationStruct(); + +private: + CCmmDestinationStruct( CCmmCache* aCache, CCmmTransactionHandler* aTransactionHandler ); + + // Opens an existing destination, based on ID. + void ConstructL( const TUint32& aDestinationId ); + + // Creates a new destination. With name and optionally also with ID. + void ConstructL( const TDesC& aName, const TUint32& aId ); + +public: + void SetId( const TUint32& aId ); + TUint32 GetId() const; + + /** + * Get the destination ID from network record. To get a valid ID, this must + * be called only during or after a call to UpdateL(). + */ + TUint32 GetRealId() const; + TDesC& GetDestinationNameL(); + + /** + * Gets the current status of this destination struct. + */ + TCmmDestinationStatus GetStatus() const; + TInt GetReferenceCount() const; + + /** + * Sets a new status value. + */ + void SetStatus( const TCmmDestinationStatus& aStatus ); + + /** + * Set the record status for all records. + */ + void SetStatusForAllRecords( const TCmmRecordStatus& aStatus ); + + void CreateSessionInstanceL( //TODO, rename to CreateDestinationInstanceL ? + CCmmDestinationInstance& aDestinationInstance ); + void RefreshDestinationInstanceL( + CCmmDestinationInstance& aDestinationInstance ); + void LoadRecordL( + CCmmDestinationInstance& aDestinationInstance, + TCmmDbRecords aRecordType ); + void UpdateL( + CCmmDestinationInstance& aDestinationInstance, + CCmmCache* aCache ); + void DeleteL(); + TInt SessionInstanceClosed(); //TODO, rename to DestinationInstanceClosed ? + + /** + * Called after this destination has been updated and database transaction + * has completed successfully. Sets the internal state of this destination + * structure to reflect the new valid state. + */ + void UpdateSuccessful(); + +private: + void InitializeDestApRecordL(); + void SetDefaultTierManagerL(); + void SetDefaultMCprL(); + void SetDefaultCprL(); + void SetDefaultSCprL(); + void SetDefaultProtocolL(); + CommsDat::CCDRecordBase* CopyRecordL( + TCmmDbRecords aRecordType, + CommsDat::CCDRecordBase* aSource ); + +private: + // Database cache. + CCmmCache* iCache; // Not owned. + + // The transaction handler. + CCmmTransactionHandler* iTransactionHandler; // Not owned. + + // The access point record. + CommsDat::CCDAccessPointRecord* iDestApRecord; // Owned. + // The network record. + CommsDat::CCDNetworkRecord* iNetworkRecord; // Owned. + // The metadata record. + CCDSNAPMetadataRecord* iMetadataRecord; // Owned. + + // Record status variables. + TCmmRecordStatus iDestApRecordStatus; + TCmmRecordStatus iNetworkRecordStatus; + TCmmRecordStatus iMetadataRecordStatus; + + // Counts number of session side objects referring to this destination. + TInt iReferenceCounter; + + // Destination status. + TCmmDestinationStatus iStatus; + + // Destination ID. If real ID is not available, contains a temporary ID. + TUint32 iId; + + // Destination name for newly created destination. + // Only valid until destination is saved to database (status is ECmmDestinationStatusNotSaved). + HBufC* iName; // Owned. + }; + +#endif // CMMDESTINATIONSTRUCT_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmminstancemapping.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmminstancemapping.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,290 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Keeps track of the general destination/connection method structure in +* database. +* +*/ + + +#ifndef CMMINSTANCEMAPPING_H_ +#define CMMINSTANCEMAPPING_H_ + +#include + +#include "cmmcache.h" +#include "cmmconnmethoditem.h" + + +NONSHARABLE_CLASS( CDestination ) : public CBase + { +public: + static CDestination* NewL(); + static CDestination* NewLC(); + ~CDestination(); + +private: + CDestination(); + void ConstructL(); + +public: + // The destination ID. + TUint32 iId; + + // Array of connection methods inside this destination. Includes also + // embedded destinations. + RArray iConnMethodItemArray; + + // IDs for unsupported connection methods inside this destination. + RArray iUnsupportedConnMethods; + }; + + +NONSHARABLE_CLASS( CCmmInstanceMapping ) : public CBase + { +public: + /** + * NewL. + */ + static CCmmInstanceMapping* NewL( CCmmCache& aCache ); + + /** + * NewLC. + */ + static CCmmInstanceMapping* NewLC( CCmmCache& aCache ); + + /** + * Destructor. + */ + ~CCmmInstanceMapping(); + +private: + /** + * Constructor. + * + * @param aCache database cache object. + */ + CCmmInstanceMapping( CCmmCache& aCache ); + + /** + * Second phase constructor. + */ + void ConstructL(); + +public: //TODO, sort methods, they are currently in mixed order in .cpp file. + /** + * Update the connection method and destination structures to current state. + */ + void RefreshL(); + + /** + * Check if the given ID is a valid existing destination ID. + */ + TBool ValidDestinationId( const TUint32& aId ) const; + + /** + * Check if the given ID is a valid existing connection method ID. + */ + TBool ValidConnMethodId( const TUint32& aId ) const; + + /** + * Check from database if the given destination is an embedded destination + * in any other destination. + */ + TBool DestinationIsEmbedded( const TUint32& aDestinationId ) const; + + /** + * Check from database if the given destination has an embedded destination. + */ + TBool DestinationHasEmbedded( const TUint32& aDestinationId ) const; + + /** + * Check from database if the given destination is pointed to by any + * virtual IAP. + */ + TBool DestinationPointedToByVirtualIap( const TUint32& aDestinationId ) const; + + /** + * Check from database if the given connection method is pointed to by any + * virtual IAP. + */ + TBool ConnMethodPointedToByVirtualIap( const TUint32& aConnMethodId ) const; + + /** + * Check if the given connection method is the only connection method in + * the given destination and if a virtual IAP points to that destination. + */ + TBool ConnMethodInDestinationButLocked( + const TUint32& aConnMethodId, + const TUint32& aDestinationId ) const; + + /** + * Get bearer type of connection method matching given ID. + * Return KErrNone if ID is found, KErrNotFound if not. + */ + TInt GetConnMethodBearerType( const TUint32& aConnMethodId, TUint32& bearerType ) const; + + /** + * Returns the number of destinations the provided connection method + * belongs to. + */ + TInt DestinationsContainingConnMethod( const TUint32& aConnMethodId ) const; + + /** + * Returns all conenction method IDs. Unsupported connection methods are + * included if aCheckBearerType is set to EFalse. + */ + void GetAllConnMethodsL( + RArray& aConnMethodArray, + TBool aCheckBearerType = ETrue ) const; + + /** + * Returns the number of destinations. + */ + TInt GetDestinationCount() const; + + /** + * Returns all the valid destinations. + */ + void GetDestinationsL( RArray& aDestinationArray ) const; + + /** + * Inserts all the valid connection methods inside the given destination + * into the provided connection method item array. The array is reset first. + */ + void GetConnMethodsFromDestinationL( + const TUint32& aDestinationId, + RArray& aConnMethodArray ) const; + + /** + * Returns ETrue if the provided connection method belongs to any other + * destination than the one given. + */ + TBool ConnMethodInOtherDestination( + const TUint32& aConnMethodId, + const TUint32& aDestinationId ); + + /** + * Return the EasyWLAN IAP ID, zero if not found or WLAN not supported. + */ + TUint32 EasyWlanIdL(); + + /** + * Find out the internet destination ID. ID is set to 0 if not found. + */ + void InternetDestinationIdL( TUint& aInternetDestinationId ); + + /** + * Add a connection method ID to deleted list. Ignores any duplicates. Also + * removes the connection method from destination/connection method + * structures so Refresh()-call is not needed. + */ + void AddConnMethodToDeletedListL( const TUint& aConnMethodId ); + + /** + * Remove a connection method ID from deleted list. Nothing happens if ID + * is not found from the list. + */ + void RemoveConnMethodFromDeletedList( const TUint& aConnMethodId ); + + /** + * Add a destination ID to deleted list. Ignores any duplicates. Also + * removes the destination from destination/connection method structures + * so Refresh()-call is not needed. + */ + void AddDestinationToDeletedListL( const TUint& aDestinationId ); + + /** + * Remove a destination ID from deleted list. Nothing happens if ID is not + * found from the list. + */ + void RemoveDestinationFromDeletedList( const TUint& aDestinationId ); + + /** + * Remove the connection method from current destination/connection method + * structures. This is a lot faster than calling Refresh(). + */ + void RemoveConnMethod( const TUint32& aConnMethodId ); + + /** + * Remove the connection method from current destination/connection method + * structures. This is a lot faster than calling Refresh(). The ID of any + * changed destination is added to the aChangedDestinations-array. + */ + void RemoveConnMethod( + const TUint32& aConnMethodId, + RArray& aChangedDestinations ); + + /** + * Remove the destination from current destination/connection method + * structures. This is a lot faster than calling Refresh(). + */ + void RemoveDestination( const TUint32& aDestinationId ); + + /** + * Remove the connection method from all destinations in the current + * destination/connection method structures. This is a lot faster than + * calling Refresh(). The ID of any changed destination is added to the + * aChangedDestinations-array. + */ + void RemoveConnMethodFromDestinations( + const TUint32& aConnMethodId, + RArray& aChangedDestinations ); + +private: + /** + * Reads all connection methods from database. + */ + void ReadAndValidateConnMethodsL(); + + /** + * Reads all destinations and the connection methods inside them. + */ + void ReadAndValidateDestinationsL(); + + /** + * Returns the reference to shared CommsDat session handle. + */ + CommsDat::CMDBSession& Session() const; + +private: + // The database cache object. + CCmmCache& iCache; + + // All supported connection methods. Does not include any embedded destinations. + RArray iConnMethodItemArray; + + // IDs for all unsupported connection methods. + RArray iUnsupportedConnMethods; + + // All destinations. + RPointerArray iDestinations; + + // Connection methods that are deleted, but not removed from database yet + // because some handles are still open to them and ID needs to be kept + // reserved. Kept in unsigned integer order. + RArray iDeletedConnMethods; + + // Destinations that are deleted, but not removed from database yet because + // some handles are still open to them and ID needs to be kept reserved. + // Kept in unsigned integer order. + RArray iDeletedDestinations; + + // EasyWLAN IAP ID, KMaxTUint32 if not known. + TUint32 iEasyWlanId; + }; + +#endif // CMMINSTANCEMAPPING_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmlistenermanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmlistenermanager.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Manages all CommsDat table specific CenRep listeners. +* +*/ + + +#ifndef CMMLISTENERMANAGER_H_ +#define CMMLISTENERMANAGER_H_ + +#include + +#include "cmmdbchangelistener.h" + +class CCmmCache; + +// Repository for CommsDat +const TUid KCDCommsRepositoryId = { 0xCCCCCC00 }; + + +NONSHARABLE_CLASS( CCmmListenerManager ) : public CBase + { +public: + /** + * NewL. + */ + static CCmmListenerManager* NewL( CCmmCache* aCache ); + + /** + * NewLC. + */ + static CCmmListenerManager* NewLC( CCmmCache* aCache ); + + /** + * Destructor. + */ + ~CCmmListenerManager(); + +private: + /** + * Constructor. + */ + CCmmListenerManager( CCmmCache* aCache ); + + /** + * Second phase constructor. + */ + void ConstructL(); + +public: + void AddListenerL( TUint32 aIdentifier ); + TInt RemoveListener( TUint32 aIdentifier ); + void DbChangeDetected( TUint32 aIdentifier ); + void DbChangeError( TUint32 aIdentifier ); + +private: + // The database cache. + CCmmCache* iCache; // Not owned + + // Array for listener active objects. + RPointerArray iListeners; + }; + +#endif // CMMLISTENERMANAGER_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmserver.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Connection method manager server. +* +*/ + + +#ifndef CMMSERVER_H_ +#define CMMSERVER_H_ + +#include + +#include "cmmserverdefs.h" +#include "cmmanagerimpl.h" + +class CCmmDelayedShutdown; + + +/** + * The main server class + */ +NONSHARABLE_CLASS( CCmmServer ) : public CPolicyServer + { +public: + + /** + * Two phased construction. + */ + static CCmmServer* NewL(); + + /** + * Two phased construction. + */ + static CCmmServer* NewLC(); + + /** + * Destroy the object and release all memory objects + */ + ~CCmmServer(); + + /** + * Increments the count of the active sessions for this server + */ + void IncrementSessions(); + + /** + * Decrements the count of the active sessions for this server. + * If no more sessions are in use the server terminates. + */ + void DecrementSessions(); + + /** + * Produces object containers (needed by subsessions) with unique ids within the server. + * @return A object container. + */ + CObjectCon* NewContainerL(); + + /** + * Removes from index and deletes the object container. + * @param aContainer The container to be deleted. + * @return A object container. + */ + void RemoveContainer( CObjectCon* aContainer ); + + CCmManagerImpl* CmManager(); + + /** + * Check for restrictions for adding an embedded destination from destination + * instances of all clients. + * @param aDestinationId The ID of the destination where a destination is + * beeing embedded. + * @param aEmbeddedDestinationId The ID of the destination that is beeing + * embedded. + */ + TBool EmbeddedDestinationConflictsFromAllSessions( + const TUint32& aDestinationId, + const TUint32& aEmbeddedDestinationId ); + + /** + * Notify each session about a destination/connection method that has been + * updated to, or deleted from, database. + */ + void RefreshHandlesForAllSessions( const TUint32& aId ); + + /** + * Custom security checking for IPCs marked with TSpecialCase::ECustomCheck. + * @param aMsg The IPC message from the client. + * @return The result of the security check (TCustomResult::EPass/TCustomResult::EFail). + */ + TCustomResult CustomSecurityCheckL( + const RMessage2& aMsg, + TInt& aAction, + TSecurityInfo& aMissing ); + + +protected: // From CActive + /** + * Process any errors + * + * @param aError the leave code reported + */ + TInt RunError( TInt aError ); + +private: + + /** + * Perform the first phase of two phase construction + * + * @param Priority for this thread + */ + CCmmServer( TInt aPriority ); + + /** + * Perform the second phase construction + */ + void ConstructL() ; + +private: // From CServer + + /** + * Create a time server session, and return a pointer to the + * created object + * + * @param Version + * + * @result Pointer to the new session + */ + CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) const; + +private: + /** The number of client-server sessions */ + TInt iSessionCount; + + static const TUint iCmmRangeCount; + static const TInt iCmmRanges[]; + static const TUint8 iCmmElementIndex[]; + + static const CPolicyServer::TPolicyElement iCmmElements[]; + static const CPolicyServer::TPolicy iCmmPolicy; + + CCmManagerImpl* iCmManager; + + // Object container index + CObjectConIx* iContainerIndex; + + // Pointer to the shutdown timer object + CCmmDelayedShutdown* iShutdown; + }; + +/** +* CCmmDelayedShutdown +* Shutdown timer that closes Connection Method Manager server after a period. +*/ +NONSHARABLE_CLASS( CCmmDelayedShutdown ) : public CActive + { +public: + CCmmDelayedShutdown( CCmmServer* aServer ); + void ConstructL(); + ~CCmmDelayedShutdown(); + +public: + /** + * Starts shutdown timer. + * @return KErrNone if OK, otherwise a system wide error code. + */ + void Start(); + +private: + /** + * From CActive Cancels the shutdown timer. + */ + void DoCancel(); + + /** + * From CActive Shuts the server down. + */ + void RunL(); + +private: // Data + RTimer iTimer; + CCmmServer* iServer; + }; + + +#endif // CMMSERVER_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmsession.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,272 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Handles client requests. +* +*/ + + +#ifndef CMMSESSION_H_ +#define CMMSESSION_H_ + +#include + +#include "cmmcache.h" + +class CCmmServer; +class CCmmConnMethodInstance; +class CCmmDestinationInstance; + + +/** + * A handler for the service requests received from clients. + */ +class CCmmSession : public CSession2 + { +public: + /** + * Creates a CVpnManagerSession object using two phase construction, + * and returns a pointer to the created object + * + * @param Client's thread + * @param The server + * + * @result Pointer to the new session + */ + static CCmmSession* NewL( CCmmServer& aServer, CCmmCache& aCache ); + + /** + * Creates a CVpnManagerSession object using two phase construction, + * and returns a pointer to the created object + * (leaving a pointer to the object on the cleanup stack) + * + * @param Client's thread + * @param The server + * + * @result Pointer to the new session + */ + static CCmmSession* NewLC( CCmmServer& aServer, CCmmCache& aCache ); + + /** + * Destroy the object and release all memory objects. + */ + ~CCmmSession(); + +public: + /** + * Service request from client. + * + * @param aMessage Message from client (containing requested operation and + * any relevant data). + */ + void ServiceL( const RMessage2& aMessage ); + + /** + * Finds a connection method instance that belongs to this session and + * matches the provided ID. Return NULL if no match is found. + */ + CCmmConnMethodInstance* FindConnMethodInstanceById( + const TUint32& aConnMethodId ); + + /** + * Finds a destination instance that belongs to this session and matches + * the provided handle. + */ + CCmmDestinationInstance* FindDestinationInstanceByHandleL( + const TInt& aDestinationHandle ); + + /** + * Finds a destination instance that belongs to this session and matches + * the provided ID. Return NULL if no match is found. + */ + CCmmDestinationInstance* FindDestinationInstanceById( + const TUint32& aDestinationId ); + + /** + * Check from all open destination handles in this session if the given + * connection method is inside any of them. The given destination is + * skipped. + */ + TBool ConnMethodInOtherDestination( + const TUint32& aConnMethodId, + const TUint32& aDestinationId ); + + /** + * Check for restrictions for adding an embedded destination from destination + * instances of all clients. + * @param aDestinationId The ID of the destination where a destination is + * beeing embedded. + * @param aEmbeddedDestinationId The ID of the destination that is beeing + * embedded. + */ + TBool EmbeddedDestinationConflictsFromAllSessions( + const TUint32& aDestinationId, + const TUint32& aEmbeddedDestinationId ); + + /** + * Check for restrictions for adding an embedded destination from destination + * instances of this session. + * @param aDestinationId The ID of the destination where a destination is + * beeing embedded. + * @param aEmbeddedDestinationId The ID of the destination that is beeing + * embedded. + */ + TBool EmbeddedDestinationConflicts( + const TUint32& aDestinationId, + const TUint32& aEmbeddedDestinationId ); + + /** + * After update to database, refresh temporary ID to real ID if necessary + * and refresh status information for any related handles for all client + * sessions. + */ + void RefreshHandlesForAllSessions( const TCmmIdStruct& aIdStruct ); + + /** + * Removes a connection method from any open destination handle in this + * session. + */ + void RemoveConnMethodFromDestinationHandles( + const TUint32& aConnMethodId ); + + /** + * Notify this sessions destination/connection method handles about an + * updated/deleted destination/connection method. + */ + void RefreshHandles( const TUint32& aId ) const; + +private: + /** + * The first phase of two phase construction. + * + * @param Client's thread + * @param The server + */ + CCmmSession( CCmmServer& aServer, CCmmCache& aCache ); + + /** + * Destination specific service dispatcher. + * @param aMessage Message sent by the plugin + */ + void ServiceDestinationL( const RMessage2& aMessage ); + + /** + * Connection Method specific service dispatcher. + * @param aMessage Message sent by the plugin + */ + void ServiceConnMethodL( const RMessage2& aMessage ); + + /** + * The second phase of two phase construction. + */ + void ConstructL() ; + + void GetBearerInfoIntL( const RMessage2& aMessage ); + void GetBearerInfoBoolL( const RMessage2& aMessage ); + void GetBearerInfoStringL( const RMessage2& aMessage ); + void GetBearerInfoString8L( const RMessage2& aMessage ); + void GetConnMethodInfoIntL( const RMessage2& aMessage ); + void GetConnMethodInfoBoolL( const RMessage2& aMessage ); + void GetConnMethodInfoStringL( const RMessage2& aMessage ); + void GetConnMethodInfoString8L( const RMessage2& aMessage ); + void GetConnMethodArrayL( const RMessage2& aMessage ); + void GetAllDestinationsL( const RMessage2& aMessage ); + void GetEasyWLANIdL( const RMessage2& aMessage ); + void GetSupportedBearersL( const RMessage2& aMessage ); + void ReadDefaultConnectionL( const RMessage2& aMessage ); + void ReadGenConnSettingsL( const RMessage2& aMessage ); + void WriteGenConnSettingsL( const RMessage2& aMessage ); + void GetBearerPriorityArrayL( const RMessage2& aMessage ); + void UpdateBearerPriorityArrayL( const RMessage2& aMessage ); + void CopyConnMethodL( const RMessage2& aMessage ); + void MoveConnMethodL( const RMessage2& aMessage ); + void RemoveConnMethodL( const RMessage2& aMessage ); + + void RemoveAllReferencesL( const RMessage2& aMessage ); + + void GetDestinationL( const RMessage2& aMessage ); + void RefreshDestinationL( const RMessage2& aMessage ); + void CreateDestinationWithNameL( const RMessage2& aMessage ); + void CreateDestinationWithNameAndIdL( const RMessage2& aMessage ); + void CloseDestination( const RMessage2& aMessage ); + void GetConnectionMehodCountL( const RMessage2& aMessage ); + void GetConnMethodPriorityL( const RMessage2& aMessage ); + void GetDestinationNameL( const RMessage2& aMessage ); + void GetDestinationIdL( const RMessage2& aMessage ); + void GetDestinationElementIdL( const RMessage2& aMessage ); + void GetDestinationMetadataL( const RMessage2& aMessage ); + void GetDestinationProtectionLevelL( const RMessage2& aMessage ); + void IsDestinationConnectedL( const RMessage2& aMessage ); + void IsDestinationHiddenL( const RMessage2& aMessage ); + void DestinationIsEqualL( const RMessage2& aMessage ); + + void DestAddConnMethodL( const RMessage2& aMessage ); + void DestAddEmbeddedDestinationL( const RMessage2& aMessage ); + void DestDeleteConnMethodL( const RMessage2& aMessage ); + void DestRemoveConnMethodL( const RMessage2& aMessage ); + + void ModifyConnMethodPriorityL( const RMessage2& aMessage ); + void SetDestinationNameL( const RMessage2& aMessage ); + void SetDestinationMetadataL( const RMessage2& aMessage ); + void SetDestinationProtectionL( const RMessage2& aMessage ); + void SetDestinationHiddenL( const RMessage2& aMessage ); + void UpdateDestinationL( const RMessage2& aMessage ); + void DeleteDestinationL( const RMessage2& aMessage ); + + void CreateConnMethodL( const RMessage2& aMessage ); + void UpdateConnMethodL( const RMessage2& aMessage ); + void CloseConnMethod( const RMessage2& aMessage ); + void DeleteConnMethodL( const RMessage2& aMessage ); + void GetConnMethodWithIdL( const RMessage2& aMessage ); + void RefreshConnMethodL( const RMessage2& aMessage ); + void GetIntAttributeL( const RMessage2& aMessage ); + void GetBoolAttributeL( const RMessage2& aMessage ); + void GetStringAttributeL( const RMessage2& aMessage ); + void GetString8AttributeL( const RMessage2& aMessage ); + void SetIntAttributeL( const RMessage2& aMessage ); + void SetBoolAttributeL( const RMessage2& aMessage ); + void SetStringAttributeL( const RMessage2& aMessage ); + void SetString8AttributeL( const RMessage2& aMessage ); + void CreateConnMethodWithIdL( const RMessage2& aMessage ); + void GetConnMethodFromDestWithIndexL( const RMessage2& aMessage ); + void GetConnMethodFromDestWithIdL( const RMessage2& aMessage ); + void CreateConnMethodToDestL( const RMessage2& aMessage ); + void CreateConnMethodToDestWithIdL( const RMessage2& aMessage ); + void CmIsEqualL( const RMessage2& aMessage ); + void CreateCopyOfExistingL( const RMessage2& aMessage ); + void GetEmbeddedDestinationL( const RMessage2& aMessage ); + +private: + RMessage2 iMessage; + + CCmmServer& iServer; + + // Object container for this session (our handles) + CObjectCon* iDestinationContainer; + + // Object index which stores objects for this session + CObjectIx* iDestinationObjects; + + // Object container for this session (our handles) + CObjectCon* iConnMethodContainer; + + // Object index which stores objects for this session + CObjectIx* iConnMethodObjects; + + CCmmCache& iCache; // Not owned + }; + +#endif // CMMSESSION_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmstarter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmstarter.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Creates and starts the connection method manager (CMM) server. +* +*/ + + +#ifndef CMMSTARTER_H_ +#define CMMSTARTER_H_ + +#include + + +NONSHARABLE_CLASS( CCmmStarter ) : public CBase + { +public: + static CServer2* CreateAndStartServerL(); + static TPtrC ServerName(); + }; + +#endif // CMMSTARTER_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/inc/cmmtransactionhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/inc/cmmtransactionhandler.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 transaction handler. +* +*/ + + +#ifndef CMMTRANSACTIONHANDLER_H_ +#define CMMTRANSACTIONHANDLER_H_ + +#include +#include + + +/** + * Transaction handler. + */ +NONSHARABLE_CLASS( CCmmTransactionHandler ) : public CBase + { +public: + /** + * NewL. + * Takes ownership of aDb. + */ + static CCmmTransactionHandler* NewL( CommsDat::CMDBSession& aDb ); + + /** + * Destructor. + * Intentionally not virtual. + */ + ~CCmmTransactionHandler(); + +private: + /** + * Constructor. + */ + CCmmTransactionHandler( CommsDat::CMDBSession& aDb ); + + /** + * Second phase constructor. Leaves on failure. + */ + void ConstructL(); + +public: + /** + * Return the CommsDat session. + */ + CommsDat::CMDBSession& Session() const; + + /** + * Opens a CommsDat transaction if it is not already open. Reference + * counter is inreased by one. + */ + void OpenTransactionLC(); + + /** + * Decreases the reference counter by one. If it reaches zero, commits the + * open CommsDat transaction. If an error code is given as argument, the + * CommsDat transaction is rolled back instead. + */ + void CommitTransactionL( TInt aError = KErrNone ); + + /** + * Performs RollbackTransactionL(). + */ + void Close(); + + /** + * Return the current reference count. Transaction is currently open if the + * count above 0. + */ + TUint32 GetReferenceCount(); + +private: + // CommsDat session pointer. + CommsDat::CMDBSession& iDb; // Owned. + + // Reference counter. + TUint32 iRefCount; + }; + +#endif // CMMTRANSACTIONHANDLER_H_ + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/rom/cmmserver.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/rom/cmmserver.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* cmmserver.exe to ROM. +* +*/ + +#ifndef CMMSERVER_IBY__ +#define CMMSERVER_IBY__ + +file=ABI_DIR\BUILD_DIR\cmmserver.exe PROGRAMS_DIR\cmmserver.exe + + +#endif // CMMSERVER_IBY__ + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmanagerimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmanagerimpl.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,351 @@ +/* +* Copyright (c) 2006-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 CCmManagerImpl. +* +*/ + + +#include +#include +#include // KUidEmbeddedDestination + +#include "cmmanagerimpl.h" +#include "cmmtransactionhandler.h" +#include "cmmcache.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmanagerimplTraces.h" +#endif + +const TInt KPluginGranularity = 3; + + +//----------------------------------------------------------------------------- +// CCmManagerImpl::NewL() +//----------------------------------------------------------------------------- +// +CCmManagerImpl* CCmManagerImpl::NewL() + { + OstTraceFunctionEntry0( CCMMANAGERIMPL_NEWL_ENTRY ); + + CCmManagerImpl* self = new( ELeave ) CCmManagerImpl(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMMANAGERIMPL_NEWL_EXIT ); + return self; + } + +//----------------------------------------------------------------------------- +// CCmManagerImpl::CCmManagerImpl() +//----------------------------------------------------------------------------- +// +CCmManagerImpl::~CCmManagerImpl() + { + OstTraceFunctionEntry0( DUP1_CCMMANAGERIMPL_CCMMANAGERIMPL_ENTRY ); + + delete iCache; + + if ( iPlugins ) + { + iPlugins->ResetAndDestroy(); + delete iPlugins; + } + + delete iTrans; + + if ( iIsFeatureManagerInitialised ) + { + FeatureManager::UnInitializeLib(); + } + + REComSession::FinalClose(); + + OstTraceFunctionExit0( DUP1_CCMMANAGERIMPL_CCMMANAGERIMPL_EXIT ); + } + +//----------------------------------------------------------------------------- +// CCmManagerImpl::CCmManagerImpl() +//----------------------------------------------------------------------------- +// +CCmManagerImpl::CCmManagerImpl() + { + OstTraceFunctionEntry0( CCMMANAGERIMPL_CCMMANAGERIMPL_ENTRY ); + + iCache = NULL; + iPlugins = NULL; + iTrans = NULL; + iSnapTableId = 0; + iBearerPriorityTableId = 0; + iDestMetadataTableId = 0; + iDefConnTableId = 0; + iIsFeatureManagerInitialised = EFalse; + iWLanSupport = ETrue; + + OstTraceFunctionExit0( CCMMANAGERIMPL_CCMMANAGERIMPL_EXIT ); + } + +//----------------------------------------------------------------------------- +// CCmManagerImpl::ConstructL() +//----------------------------------------------------------------------------- +// +void CCmManagerImpl::ConstructL() + { + OstTraceFunctionEntry0( CCMMANAGERIMPL_CONSTRUCTL_ENTRY ); + + FeatureManager::InitializeLibL(); + iIsFeatureManagerInitialised = ETrue; + iWLanSupport = FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ); + + CommsDat::CMDBSession* db = CommsDat::CMDBSession::NewLC( KCDVersion1_2 ); + iTrans = CCmmTransactionHandler::NewL( *db ); // Ownership of db transferred. + CleanupStack::Pop( db ); + + CheckTablesL(); + BuildPluginArrayL(); + + iCache = CCmmCache::NewL( this, iPlugins ); + + OstTraceFunctionExit0( CCMMANAGERIMPL_CONSTRUCTL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmManagerImpl::CheckTablesL() +// ----------------------------------------------------------------------------- +// +void CCmManagerImpl::CheckTablesL() + { + OstTraceFunctionEntry0( CCMMANAGERIMPL_CHECKTABLESL_ENTRY ); + + TInt err( 0 ); + + TRAP( err, iSnapTableId = CCDDataMobilitySelectionPolicyRecord::TableIdL( iTrans->Session() )); + if ( err == KErrNotFound ) + { + iSnapTableId = CCDDataMobilitySelectionPolicyRecord::CreateTableL( iTrans->Session() ); + } + else + { + User::LeaveIfError( err ); + } + + TRAP( err, iBearerPriorityTableId = + CCDGlobalBearerTypePriorizationRecord::TableIdL( iTrans->Session() ) ); + if ( err == KErrNotFound ) + { + iBearerPriorityTableId = + CCDGlobalBearerTypePriorizationRecord::CreateTableL( iTrans->Session() ); + } + else + { + User::LeaveIfError( err ); + } + + TRAP( err, iDestMetadataTableId = CCDSNAPMetadataRecord::TableIdL( iTrans->Session() ) ); + if ( err == KErrNotFound ) + { + iDestMetadataTableId = CCDSNAPMetadataRecord::CreateTableL( iTrans->Session() ); + } + else + { + User::LeaveIfError( err ); + } + + TRAP( err, iDefConnTableId = CCDDefConnRecord::TableIdL( iTrans->Session() ) ); + if ( err == KErrNotFound ) + { + iDefConnTableId = CCDDefConnRecord::CreateTableL( iTrans->Session() ); + } + else + { + User::LeaveIfError( err ); + } + + OstTraceFunctionExit0( CCMMANAGERIMPL_CHECKTABLESL_EXIT ); + } + +//----------------------------------------------------------------------------- +// Return an array containing the supported bearer types (embedded destination +// excluded). +//----------------------------------------------------------------------------- +// +void CCmManagerImpl::SupportedBearersL( RArray& aArray ) const + { + OstTraceFunctionEntry0( CCMMANAGERIMPL_SUPPORTEDBEARERSL_ENTRY ); + + aArray.Reset(); + for ( TInt i = 0; i < iPlugins->Count(); i++ ) + { + TUint32 bearerType( (*iPlugins)[i]->GetBearerInfoIntL( CMManager::ECmBearerType ) ); + if ( KUidEmbeddedDestination != bearerType ) + { + aArray.AppendL( bearerType ); + } + } + OstTraceFunctionExit0( CCMMANAGERIMPL_SUPPORTEDBEARERSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// Return the requested table ID. +//----------------------------------------------------------------------------- +// +CommsDat::TMDBElementId CCmManagerImpl::TableId( TCmmDbRecords aRecord ) + { + CommsDat::TMDBElementId tableId( 0 ); + switch ( aRecord ) + { + case ECmmDestNetworkRecord: + tableId = CommsDat::KCDTIdNetworkRecord; + break; + case ECmmDestApRecord: + tableId = CommsDat::KCDTIdAccessPointRecord; + break; + case ECmmDestMetadataRecord: + tableId = iDestMetadataTableId; + break; + case ECmmDbSnapRecord: + tableId = iSnapTableId; + break; + case ECmmDbBearerPriorityRecord: + tableId = iBearerPriorityTableId; + break; + case ECmmDbDefConnRecord: + tableId = iDefConnTableId; + break; + default: + break; + } + return tableId; + } + +// ----------------------------------------------------------------------------- +// Get a handle to the database cache manager. +// ----------------------------------------------------------------------------- +// +CCmmCache& CCmManagerImpl::Cache() + { + return *iCache; + } + +//----------------------------------------------------------------------------- +// Get a handle to the database transaction handler. +//----------------------------------------------------------------------------- +// +CCmmTransactionHandler* CCmManagerImpl::GetTransactionHandler() + { + return iTrans; + } + +//----------------------------------------------------------------------------- +// Get a handle to database session. +//----------------------------------------------------------------------------- +// +CommsDat::CMDBSession& CCmManagerImpl::Session() const + { + OstTraceFunctionEntry0( CCMMANAGERIMPL_SESSION_ENTRY ); + return iTrans->Session(); + } + +// --------------------------------------------------------------------------- +// Return true is WLAN is supported on phone. +// --------------------------------------------------------------------------- +// +TBool CCmManagerImpl::WlanSupported() const + { + OstTraceFunctionEntry0( CCMMANAGERIMPL_WLANSUPPORTED_ENTRY ); + OstTraceFunctionExit0( CCMMANAGERIMPL_WLANSUPPORTED_EXIT ); + return iWLanSupport; + } + +// ----------------------------------------------------------------------------- +// CCmManagerImpl::BuildPluginArrayL() +// ----------------------------------------------------------------------------- +// +void CCmManagerImpl::BuildPluginArrayL() + { + OstTraceFunctionEntry0( CCMMANAGERIMPL_BUILDPLUGINARRAYL_ENTRY ); + + iPlugins = new( ELeave ) CArrayPtrFlat( KPluginGranularity ); + + // Get a list of all the bearer types. + RPointerArray implArray; + CmmCleanupResetAndDestroyPushL( implArray ); + REComSession::ListImplementationsL( TUid::Uid( KCMPluginInterfaceUid ), implArray ); + + CCmPluginBaseEng* plugin = NULL; + for ( TInt i = 0; i < implArray.Count(); i++ ) + { + TCmPluginInitParam params( iTrans->Session() ); + + // This is the Util implementation. + // Trap it to be able to work even if there's a faulty plugin installed + // in the phone. + TRAPD( err, plugin = STATIC_CAST( CCmPluginBaseEng*, REComSession::CreateImplementationL( + ( implArray )[i]->ImplementationUid(), + _FOFF( CCmPluginBaseEng, iDtor_ID_Key ), + ( TAny* )¶ms ) ) ); + + if ( !err ) + { + CleanupStack::PushL( plugin ); + + TBool inserted( EFalse ); + //TODO, Implement plugin sorting by priority later. + /* + TInt defaultPriority( KDataMobilitySelectionPolicyPriorityWildCard ); + + // No UI priority -> wildcard + TRAP_IGNORE( defaultPriority = plugin->GetIntAttributeL( ECmDefaultUiPriority ) ); + + for ( TInt j( 0 ); j < iPlugins->Count(); ++j ) + { + if ( defaultPriority > (*iPlugins)[j]->GetIntAttributeL( ECmDefaultUiPriority ) ) + { + continue; + } + else if ( defaultPriority == (*iPlugins)[j]->GetIntAttributeL( ECmDefaultUiPriority ) ) + { + if ( plugin->GetIntAttributeL( ECmExtensionLevel ) > + (*iPlugins)[j]->GetIntAttributeL( ECmExtensionLevel ) ) + { + iPlugins->InsertL( j, plugin ); + inserted = ETrue; + break; + } + } + else + { + iPlugins->InsertL( j, plugin ); + inserted = ETrue; + break; + } + }*/ + + if ( !inserted ) + { + iPlugins->AppendL( plugin ); + } + CleanupStack::Pop( plugin ); + } + } + + CleanupStack::PopAndDestroy( &implArray ); + + OstTraceFunctionExit0( CCMMANAGERIMPL_BUILDPLUGINARRAYL_EXIT ); + } + +// Enf of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmanagertextresolver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmanagertextresolver.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Provides functionality for text resolving +* +*/ + +#include +#include "cmmanagertextresolver.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmanagertextresolverTraces.h" +#endif + + +HBufC* CCmManagerTextResolver::ResolveTextL( const TDesC& aTextId ) + { + _LIT(KCMManagerTranslationFile, "cmmanager_"); + _LIT(KTranslationPath, "\\resource\\qt\\translations"); + + TBool result = HbTextResolverSymbian::Init( KCMManagerTranslationFile, + KTranslationPath ); + if ( result ) + { + OstTrace0( TRACE_ERROR, CCMMANAGERTEXTRESOLVER_RESOLVETEXTL, "CCmManagerTextResolver::ResolveTextL" ); + } + + return HbTextResolverSymbian::LoadL( aTextId ); + } + + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmbearerpriority.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmbearerpriority.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 bearer priority array cache. +* +*/ + + +#include "cmmbearerpriority.h" + + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmBearerPriority* CCmmBearerPriority::NewL( + const TDesC& aServiceType, + const TUint& aPriority, + const TUint& aUiPriority ) + { + CCmmBearerPriority* self = CCmmBearerPriority::NewLC( aServiceType, aPriority, aUiPriority ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmBearerPriority* CCmmBearerPriority::NewLC( + const TDesC& aServiceType, + const TUint& aPriority, + const TUint& aUiPriority ) + { + CCmmBearerPriority* self = new( ELeave ) CCmmBearerPriority( aPriority, aUiPriority ); + CleanupStack::PushL( self ); + self->ConstructL( aServiceType ); + return self; + } + +// --------------------------------------------------------------------------- +// Constructor. Note: aServiceType is not copied here because constructor +// cannot leave. +// --------------------------------------------------------------------------- +// +CCmmBearerPriority::CCmmBearerPriority( + const TUint& aPriority, + const TUint& aUiPriority ) + : + iPriority( aPriority ), + iUiPriority( aUiPriority ) + { + iServiceType = NULL; + } + +// --------------------------------------------------------------------------- +// 2nd phase constructor. +// --------------------------------------------------------------------------- +// +void CCmmBearerPriority::ConstructL( const TDesC& aServiceType ) + { + iServiceType = aServiceType.AllocL(); + } + +// --------------------------------------------------------------------------- +// Get the service type. +// --------------------------------------------------------------------------- +// +HBufC* CCmmBearerPriority::ServiceType() const + { + return iServiceType; + } + +// --------------------------------------------------------------------------- +// Get the priority. +// --------------------------------------------------------------------------- +// +TUint CCmmBearerPriority::Priority() const + { + return iPriority; + } + +// --------------------------------------------------------------------------- +// Get the UI priority. +// --------------------------------------------------------------------------- +// +TUint CCmmBearerPriority::UiPriority() const + { + return iUiPriority; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CCmmBearerPriority::~CCmmBearerPriority() + { + delete iServiceType; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmbearerprioritycache.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmbearerprioritycache.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,276 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 bearer priority array cache. +* +*/ + + +#include +#include + +#include "cmmbearerprioritycache.h" +#include "cmmbearerpriority.h" +#include "cmmtransactionhandler.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmbearerprioritycacheTraces.h" +#endif + + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmBearerPriorityCache* CCmmBearerPriorityCache::NewL( + CCmmTransactionHandler* aTrans, + CommsDat::TMDBElementId aBearerPriorityTableId ) + { + OstTraceFunctionEntry0( CCMMBEARERPRIORITYCACHE_NEWL_ENTRY ); + + CCmmBearerPriorityCache* self = + CCmmBearerPriorityCache::NewLC( aTrans, aBearerPriorityTableId ); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMMBEARERPRIORITYCACHE_NEWL_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmBearerPriorityCache* CCmmBearerPriorityCache::NewLC( + CCmmTransactionHandler* aTrans, + CommsDat::TMDBElementId aBearerPriorityTableId ) + { + OstTraceFunctionEntry0( CCMMBEARERPRIORITYCACHE_NEWLC_ENTRY ); + + CCmmBearerPriorityCache* self = + new( ELeave ) CCmmBearerPriorityCache( aTrans, aBearerPriorityTableId ); + CleanupStack::PushL( self ); + self->ConstructL(); + + OstTraceFunctionExit0( CCMMBEARERPRIORITYCACHE_NEWLC_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CCmmBearerPriorityCache::~CCmmBearerPriorityCache() + { + OstTraceFunctionEntry0( CCMMBEARERPRIORITYCACHE_CCMMBEARERPRIORITYCACHE_ENTRY ); + iArray.ResetAndDestroy(); + OstTraceFunctionExit0( CCMMBEARERPRIORITYCACHE_CCMMBEARERPRIORITYCACHE_EXIT ); + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CCmmBearerPriorityCache::CCmmBearerPriorityCache( + CCmmTransactionHandler* aTrans, + CommsDat::TMDBElementId aBearerPriorityTableId ) + : + iTrans( aTrans ), + iArray(), + iBearerPriorityTableId( aBearerPriorityTableId ) + { + OstTraceFunctionEntry0( DUP1_CCMMBEARERPRIORITYCACHE_CCMMBEARERPRIORITYCACHE_ENTRY ); + OstTraceFunctionExit0( DUP1_CCMMBEARERPRIORITYCACHE_CCMMBEARERPRIORITYCACHE_EXIT ); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// +void CCmmBearerPriorityCache::ConstructL() + { + OstTraceFunctionEntry0( CCMMBEARERPRIORITYCACHE_CONSTRUCTL_ENTRY ); + + // Read initial bearer priority array from commsdat. + ReadL(); + + OstTraceFunctionExit0( CCMMBEARERPRIORITYCACHE_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Updates the bearer priority array with the contents of aArray. +// --------------------------------------------------------------------------- +// +void CCmmBearerPriorityCache::UpdateL( const RPointerArray& aArray ) + { + OstTraceFunctionEntry0( CCMMBEARERPRIORITYCACHE_UPDATEL_ENTRY ); + + iTrans->OpenTransactionLC(); + + CommsDat::CMDBRecordSet* bpRS = + new( ELeave ) CommsDat::CMDBRecordSet( + iBearerPriorityTableId ); + CleanupStack::PushL( bpRS ); + + // Delete the old records. + TRAP_IGNORE( bpRS->LoadL( iTrans->Session() ) ); + for ( TInt i = 0; i < bpRS->iRecords.Count(); i++ ) + { + bpRS->iRecords[i]->DeleteL( iTrans->Session() ); + } + CleanupStack::PopAndDestroy( bpRS ); + bpRS = NULL; + + iArray.ResetAndDestroy(); + + // Add new content. + const TInt count( aArray.Count() ); + for ( TInt i = 0; i < count; i++ ) + { + if ( aArray[i]->ServiceType() && aArray[i]->ServiceType()->Length() > 0 ) + { + CCDGlobalBearerTypePriorizationRecord* bpRcd = + new( ELeave ) CCDGlobalBearerTypePriorizationRecord( + iBearerPriorityTableId ); + CleanupStack::PushL( bpRcd ); + + HBufC* serviceType = aArray[i]->ServiceType()->AllocLC(); + TUint priority = aArray[i]->Priority(); + TUint uiPriority = aArray[i]->UiPriority(); + + bpRcd->SetRecordId( KCDNewRecordRequest ); + bpRcd->iServiceType.SetL( *serviceType ); + bpRcd->iPriority.SetL( priority ); + bpRcd->iUIPriority.SetL( uiPriority ); + bpRcd->StoreL( iTrans->Session() ); + + TPtrC tempServiceType( serviceType->Des() ); + CCmmBearerPriority* item = CCmmBearerPriority::NewLC( + tempServiceType, + priority, + uiPriority ); + iArray.AppendL( item ); // Ownership transferred. + CleanupStack::Pop( item ); + CleanupStack::PopAndDestroy( serviceType ); + CleanupStack::PopAndDestroy( bpRcd ); + } + } + iTrans->CommitTransactionL(); + + OstTraceFunctionExit0( CCMMBEARERPRIORITYCACHE_UPDATEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CopyL() +// --------------------------------------------------------------------------- +// +void CCmmBearerPriorityCache::CopyL( RPointerArray& aArray ) const + { + OstTraceFunctionEntry0( CCMMBEARERPRIORITYCACHE_COPYL_ENTRY ); + + const TInt count( iArray.Count() ); + for ( TInt i = 0; i < count; i++ ) + { + if ( iArray[i]->ServiceType() ) + { + TPtrC tempServiceType( iArray[i]->ServiceType()->Des() ); + if ( tempServiceType.Length() > 0 ) + { + CCmmBearerPriority* item = CCmmBearerPriority::NewLC( + tempServiceType, + iArray[i]->Priority(), + iArray[i]->UiPriority() ); + aArray.AppendL( item ); + CleanupStack::Pop( item ); + } + } + } + + OstTraceFunctionExit0( CCMMBEARERPRIORITYCACHE_COPYL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Get the priority value for a service type from the bearer priority cache. +// --------------------------------------------------------------------------- +// +TUint CCmmBearerPriorityCache::GetPriority( const TDesC& aServiceType ) const + { + TUint priority = CMManager::KDataMobilitySelectionPolicyPriorityWildCard; + + if ( aServiceType.Length() > 0 ) + { + for ( TInt i = 0; i < iArray.Count(); i++ ) + { + if ( iArray[i]->ServiceType()->Compare( aServiceType ) == 0 ) + { + priority = iArray[i]->Priority(); + break; + } + } + } + + return priority; + } + +// --------------------------------------------------------------------------- +// Reads the bearer priority array from CommsDat. +// --------------------------------------------------------------------------- +// +void CCmmBearerPriorityCache::ReadL() + { + OstTraceFunctionEntry0( CCMMBEARERPRIORITYCACHE_READL_ENTRY ); + + CommsDat::CMDBRecordSet* bpRS = + new( ELeave ) CommsDat::CMDBRecordSet( + iBearerPriorityTableId ); + CleanupStack::PushL( bpRS ); + + CCDGlobalBearerTypePriorizationRecord* bpRcd = + new( ELeave ) CCDGlobalBearerTypePriorizationRecord( + iBearerPriorityTableId ); + CleanupStack::PushL( bpRcd ); + + TRAP_IGNORE( bpRS->LoadL( iTrans->Session() ) ); + + // Read every record and store to cache. + const TInt bpCount = bpRS->iRecords.Count(); + for ( TInt i = 0; i < bpCount; i++ ) + { + bpRcd->SetElementId( bpRS->iRecords[i]->ElementId() ); + bpRcd->LoadL( iTrans->Session() ); + + if ( !bpRcd->iServiceType.IsNull() ) + { + TPtrC serviceType( bpRcd->iServiceType ); + TUint priority = bpRcd->iPriority; + TUint uiPriority = bpRcd->iUIPriority; + + if ( serviceType.Length() > 0 ) + { + CCmmBearerPriority* item = CCmmBearerPriority::NewLC( + serviceType, + priority, + uiPriority ); + iArray.AppendL( item ); + CleanupStack::Pop( item ); + } + } + } + CleanupStack::PopAndDestroy( bpRcd ); + CleanupStack::PopAndDestroy( bpRS ); + + OstTraceFunctionExit0( CCMMBEARERPRIORITYCACHE_READL_EXIT ); + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmcache.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmcache.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,3053 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Database cache manager. +* +*/ + + +#include +#include +#include +#include + +#include // RSocketServ, RConnection +#include // KAfInet +#include // TConnectionInfo + +#include "cmmdestinationstruct.h" +#include "cmmlistenermanager.h" +#include "cmminstancemapping.h" + +#include "cmmcache.h" + +#include "cmmdestinationinstance.h" +#include "cmmconnmethodinstance.h" + +#include "cmmtransactionhandler.h" +#include "cmmanagerimpl.h" +#include "cmmbearerprioritycache.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmcacheTraces.h" +#endif + + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmCache* CCmmCache::NewL( + CCmManagerImpl* aCmManagerImpl, + CArrayPtrFlat* aPlugins ) + { + OstTraceFunctionEntry0( CCMMCACHE_NEWL_ENTRY ); + + CCmmCache* self = CCmmCache::NewLC( aCmManagerImpl, aPlugins ); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMMCACHE_NEWL_EXIT ); + + return self; + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmCache* CCmmCache::NewLC( + CCmManagerImpl* aCmManagerImpl, + CArrayPtrFlat* aPlugins ) + { + OstTraceFunctionEntry0( CCMMCACHE_NEWLC_ENTRY ); + + CCmmCache* self = new( ELeave ) CCmmCache( aCmManagerImpl, aPlugins ); + CleanupStack::PushL( self ); + self->ConstructL(); + + OstTraceFunctionExit0( CCMMCACHE_NEWLC_EXIT ); + + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CCmmCache::~CCmmCache() + { + OstTraceFunctionEntry0( CCMMCACHE_CCMMCACHE_ENTRY ); + + delete iBearerPriorityCache; + delete iListenerManager; + delete iInstanceMapping; + + iConnMethodArray.ResetAndDestroy(); + iDestinationArray.ResetAndDestroy(); + + iDeletedConnMethods.Close(); + iUpdatedConnMethods.Close(); + iUpdatedConnMethods2.Close(); // Does not own contents. + iUpdatedDestinations.Close(); + iUpdatedDestinations2.Close(); // Does not own contents. + + OstTraceFunctionExit0( CCMMCACHE_CCMMCACHE_EXIT ); + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CCmmCache::CCmmCache( + CCmManagerImpl* aCmManagerImpl, + CArrayPtrFlat* aPlugins ) + : + iPlugins( aPlugins ), + iCmManagerImpl( aCmManagerImpl ) + { + OstTraceFunctionEntry0( DUP1_CCMMCACHE_CCMMCACHE_ENTRY ); + + iListenerManager = NULL; + iInstanceMapping = NULL; + iTrans = NULL; + iBearerPriorityCache = NULL; + iCurrentTemporaryId = KTemporaryIdCounterStart; + + OstTraceFunctionExit0( DUP1_CCMMCACHE_CCMMCACHE_EXIT ); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// +void CCmmCache::ConstructL() + { + OstTraceFunctionEntry0( CCMMCACHE_CONSTRUCTL_ENTRY ); + + iTrans = iCmManagerImpl->GetTransactionHandler(); + + iBearerPriorityCache = CCmmBearerPriorityCache::NewL( + iTrans, + iCmManagerImpl->TableId( ECmmDbBearerPriorityRecord ) ); + iListenerManager = CCmmListenerManager::NewL( this ); + iInstanceMapping = CCmmInstanceMapping::NewL( *this ); + + OstTraceFunctionExit0( CCMMCACHE_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Opens a destination with given ID (if not already opened), then copies the +// relevant data to the session instance. Checks that destination ID is valid. +// --------------------------------------------------------------------------- +// +void CCmmCache::OpenDestinationL( + CCmmDestinationInstance& aDestinationInstance, + const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( CCMMCACHE_OPENDESTINATIONL_ENTRY ); + + if ( !iInstanceMapping->ValidDestinationId( aDestinationId ) ) + { + User::Leave( KErrNotFound ); + } + + TInt index = FindDestinationFromCache( aDestinationId ); + if ( index == KErrNotFound ) + { + // Cache does not have a handle open to this destination. A new handle + // needs to be created first. + CCmmDestinationStruct* destination = CCmmDestinationStruct::NewLC( + this, + iTrans, + aDestinationId ); + + // Now that cache has a handle on this destination, copy the relevant + // data to the session instance. + destination->CreateSessionInstanceL( aDestinationInstance ); + + iDestinationArray.AppendL( destination ); + CleanupStack::Pop( destination ); + } + else + { + // Cache already has a handle on this destination. Copy the relevant + // data to the session instance. + iDestinationArray[index]->CreateSessionInstanceL( aDestinationInstance ); + } + + // Add list of currently contained connection methods. + iInstanceMapping->GetConnMethodsFromDestinationL( + aDestinationId, + aDestinationInstance.iConnMethodItemArray ); + + OstTraceFunctionExit0( CCMMCACHE_OPENDESTINATIONL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Refresh the data contained in aDestinationInstance. This means reloading +// the data from database if necessary. After this call the contents of +// aDestinationInstance will reflect the current state in the database. +// --------------------------------------------------------------------------- +// +void CCmmCache::RefreshDestinationL( CCmmDestinationInstance& aDestinationInstance ) + { + OstTraceFunctionEntry0( CCMMCACHE_REFRESHDESTINATIONL_ENTRY ); + + TInt index = FindDestinationFromCache( aDestinationInstance.GetId() ); + if ( index == KErrNotFound ) + { + index = FindNotSavedDestinationFromCacheL( aDestinationInstance.GetDestinationNameL(), 0 ); + if ( index == KErrNotFound ) + { + User::Leave( KErrNotFound ); + } + } + + // If this destination is a newly created one that doesn't yet exist in + // database, just return silently. + if ( iDestinationArray[index]->GetStatus() == ECmmDestinationStatusNotSaved ) + { + OstTraceFunctionExit0( CCMMCACHE_REFRESHDESTINATIONL_EXIT ); + return; + } + + iDestinationArray[index]->RefreshDestinationInstanceL( aDestinationInstance ); + + OstTraceFunctionExit0( DUP1_CCMMCACHE_REFRESHDESTINATIONL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Create a new destination into cache (with name and ID) and copy the data +// into session side handle. +// --------------------------------------------------------------------------- +// +void CCmmCache::CreateDestinationL( + CCmmDestinationInstance& aDestinationInstance, + const TDesC& aName, + const TUint32& aId ) + { + OstTraceFunctionEntry0( CCMMCACHE_CREATEDESTINATIONL_ENTRY ); + + // Create a new destination with given name. + CCmmDestinationStruct* destination = CCmmDestinationStruct::NewLC( this, iTrans, aName, aId ); + + destination->CreateSessionInstanceL( aDestinationInstance ); + + iDestinationArray.AppendL( destination ); + CleanupStack::Pop( destination ); + + OstTraceFunctionExit0( CCMMCACHE_CREATEDESTINATIONL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Opens a connection method with given ID (if not already opened), then +// creates and passes an instance of it to the caller. +// If aDestinationInstance is not NULL, connection method is opened from +// destination. +// --------------------------------------------------------------------------- +// +void CCmmCache::OpenConnMethodL( + CCmmConnMethodInstance& aConnMethodInstance, + CCmmDestinationInstance* aDestinationInstance, + const TUint32& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMCACHE_OPENCONNMETHODL_ENTRY ); + + // Check connection method ID. + TBool validAttributes( EFalse ); + if ( !aDestinationInstance ) + { + // Check connection method exists in database. + validAttributes = iInstanceMapping->ValidConnMethodId( aConnMethodId ); // Embedded destinations not included. + } + else + { + // Check connection method is inside the destination. + if ( aDestinationInstance->ValidConnMethodIdInDestinationIncludeEmbedded( aConnMethodId ) ) + { + // Check connection method (can be embedded destination too) exists in database. + if ( iInstanceMapping->ValidConnMethodId( aConnMethodId ) || + iInstanceMapping->ValidDestinationId( aConnMethodId ) ) + { + validAttributes = ETrue; + } + } + } + if ( !validAttributes ) + { + User::Leave( KErrNotFound ); + } + + // Create the connection method instance. + + // Check if connection method is already opened in cache. + TInt index = FindConnMethodFromCache( aConnMethodId ); + if ( index != KErrNotFound ) + { + // Already open in cache. Copy the connection method data to session + // instance. + aConnMethodInstance.CopyDataL( iConnMethodArray[index] ); // Will increase reference counter. + } + else + { + // Not yet open in cache, open now. + OpenConnectionMethodInstanceL( aConnMethodInstance, aConnMethodId ); + } + + OstTraceFunctionExit0( CCMMCACHE_OPENCONNMETHODL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Refresh the data contained in aConnMethodInstance. This means reloading the +// data from database if necessary. After this call the contents of +// aConnMethodInstance will reflect the current state in the database. +// --------------------------------------------------------------------------- +// +void CCmmCache::RefreshConnMethodL( CCmmConnMethodInstance& aConnMethodInstance ) + { + OstTraceFunctionEntry0( CCMMCACHE_REFRESHCONNMETHODL_ENTRY ); + + //TODO, what to do with embedded? + + TInt index = FindConnMethodFromCache( aConnMethodInstance.GetId() ); + if ( index == KErrNotFound ) + { + User::Leave( KErrNotFound ); + } + + // If this connection method is a newly created one that doesn't yet exist + // in database, just return silently. + if ( iConnMethodArray[index]->GetStatus() == ECmmConnMethodStatusNotSaved ) + { + OstTraceFunctionExit0( CCMMCACHE_REFRESHCONNMETHODL_EXIT ); + return; + } + + iConnMethodArray[index]->RefreshConnMethodInstanceL( aConnMethodInstance ); + + OstTraceFunctionExit0( DUP1_CCMMCACHE_REFRESHCONNMETHODL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Creates a new connection method (not embedded destinations) into database +// with the given bearer type and optionally ID, then creates and passes an +// instance of it to the caller. +// If destination instance is provided (not NULL), connection method is +// created in that destination. +// If connection method ID is provided, it's availability is verified. +// --------------------------------------------------------------------------- +// +void CCmmCache::CreateConnMethodL( + CCmmConnMethodInstance& aConnMethodInstance, + CCmmDestinationInstance* aDestinationInstance, + const TUint32& aBearerType, + const TUint32& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMCACHE_CREATECONNMETHODL_ENTRY ); + + // Check that the bearer type is not embedded destination. + if ( aBearerType == KUidEmbeddedDestination ) + { + User::Leave( KErrArgument ); + } + + TUint32 connMethodId( aConnMethodId ); + if ( aConnMethodId ) + { + // Check if a connection method with given ID exists (or is already + // created but not saved). + if ( iInstanceMapping->ValidConnMethodId( aConnMethodId ) || + ConnMethodOpenWithId( aConnMethodId ) ) + { + User::Leave( KErrAlreadyExists ); + } + } + else + { + // Use a temporary ID until a real one is received from database. + connMethodId = NextFreeTemporaryId(); + } + + + // Check bearer type support and create plugin instance. + CCmPluginBaseEng* plugin = NULL; + for ( TInt i = 0; i < iPlugins->Count(); i++ ) + { + if ( ( *iPlugins )[i]->GetBearerInfoIntL( CMManager::ECmBearerType ) == aBearerType ) + { + TCmPluginInitParam pluginParams( Session() ); + plugin = ( *iPlugins )[i]->CreateInstanceL( pluginParams ); + CleanupStack::PushL( plugin ); + plugin->CreateNewL( aConnMethodId ); // Use aConnMethodId here, so ID is either a real ID or 0. + break; + } + } + if ( !plugin ) + { + User::Leave( KErrArgument ); + } + + + // Store the connection method into cache. + CCmmConnMethodStruct* connMethodStruct = CCmmConnMethodStruct::NewLC( connMethodId ); // Use connMethodId here, so ID is either a real ID or a temporary ID. + connMethodStruct->SetPlugin( plugin, aBearerType, ECmmConnMethodStatusNotSaved ); + iConnMethodArray.AppendL( connMethodStruct ); + CleanupStack::Pop( connMethodStruct ); + CleanupStack::Pop( plugin ); //TODO, pop after SetPlugin()-call? + + // Copy the connection method data to session instance. + aConnMethodInstance.CopyDataL( connMethodStruct ); // Will increase reference counter. + + + if ( aDestinationInstance ) + { + // Add connection method to destination. + aDestinationInstance->AddConnMethodL( aConnMethodInstance ); + } + OstTraceFunctionExit0( CCMMCACHE_CREATECONNMETHODL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Creates a new connection method into cache as a copy of an existing +// connection method (exists in cache, not necessarily in database), and opens +// a client side handle to it. The new connection method will get a new ID when +// updated to database. +// --------------------------------------------------------------------------- +// +void CCmmCache::CreateCopyOfConnMethodL( + CCmmConnMethodInstance& aNewConnMethodInstance, + CCmmConnMethodInstance& aConnMethodInstance ) + { + OstTraceFunctionEntry0( CCMMCACHE_CREATECOPYOFCONNMETHODL_ENTRY ); + + // Check bearer type support and create plugin instance. + TInt index = FindConnMethodFromCache( aConnMethodInstance.GetId() ); + if ( index == KErrNotFound ) + { + User::Leave( index ); + } + + CCmPluginBaseEng* plugin = iConnMethodArray[index]->GetPlugin(); + if ( !plugin ) + { + User::Leave( KErrNotFound ); + } + + CCmPluginBaseEng* pluginCopy = plugin->CreateCopyL( aConnMethodInstance.GetPluginDataInstance() ); + CleanupStack::PushL( pluginCopy ); + + // Store the connection method into cache. + CCmmConnMethodStruct* connMethodStruct = CCmmConnMethodStruct::NewLC( NextFreeTemporaryId() ); + connMethodStruct->SetPlugin( pluginCopy, aConnMethodInstance.GetBearerType(), ECmmConnMethodStatusNotSaved ); + iConnMethodArray.AppendL( connMethodStruct ); + CleanupStack::Pop( connMethodStruct ); + CleanupStack::Pop( pluginCopy ); //TODO, pop after SetPlugin()-call? + + // Copy the connection method data to session instance. + aNewConnMethodInstance.CopyDataL( connMethodStruct ); // Will increase reference counter. + + OstTraceFunctionExit0( CCMMCACHE_CREATECOPYOFCONNMETHODL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Re-loads a destination record if needed and copies the latest version to +// the session instance given as parameter. +// --------------------------------------------------------------------------- +// +void CCmmCache::LoadDestinationRecordL( + CCmmDestinationInstance& aDestinationInstance, + TCmmDbRecords aDestRecordType ) + { + OstTraceFunctionEntry0( CCMMCACHE_LOADDESTINATIONRECORDL_ENTRY ); + + TUint32 id = aDestinationInstance.GetId(); + // If ID is not in the valid range, it means the destination is a newly + // created one, and doesn't yet exist in database. Thus, record data exists + // only in session side and can't be loaded from cache. So this is an error. + if ( id >= KTemporaryIdCounterStart ) + { + User::Leave( KErrCorrupt ); + } + TInt index = FindDestinationFromCache( id ); + if ( index < 0 ) + { + User::Leave( index ); + } + + iDestinationArray[index]->LoadRecordL( aDestinationInstance, aDestRecordType ); + + OstTraceFunctionExit0( CCMMCACHE_LOADDESTINATIONRECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Saves the modifications in aDestinationInstance into the database. Also all +// connection methods inside this destination are updated (including any +// embedded destination). +// --------------------------------------------------------------------------- +// +void CCmmCache::UpdateDestinationL( CCmmDestinationInstance& aDestinationInstance ) + { + OstTraceFunctionEntry0( CCMMCACHE_UPDATEDESTINATIONL_ENTRY ); + + // Arrays to temporarily store information of updated destinations and + // connection methods. Used to update status and ID information after + // successful commit to database. + if ( iTrans->GetReferenceCount() == 0 ) + { + iDeletedConnMethods.Reset(); + iUpdatedConnMethods.Reset(); + iUpdatedConnMethods2.Reset(); + iUpdatedDestinations.Reset(); + iUpdatedDestinations2.Reset(); + } + + TInt index = FindDestinationFromCache( aDestinationInstance.GetId() ); + if ( index < 0 ) + { + User::Leave( index ); + } + + iTrans->OpenTransactionLC(); + + // Check that the connection methods marked for deletion can be deleted. + for ( TInt i = 0; i < aDestinationInstance.iConnMethodsToBeDeleted.Count(); i++ ) + { + TUint32 id = aDestinationInstance.iConnMethodsToBeDeleted[i]; + + // Remove connection method from delete list if ID is not valid or if + // referenced from any other destination (in database or in any other + // client-side destination handles). + if ( !iInstanceMapping->ValidConnMethodId( id ) || + iInstanceMapping->ConnMethodInOtherDestination( id, aDestinationInstance.GetId() ) || + aDestinationInstance.ConnMethodInOtherDestinationInSession( id, 0 ) ) + { + aDestinationInstance.iConnMethodsToBeDeleted.Remove( i ); + i--; // Adjust array index counter. + } + else if ( iInstanceMapping->ConnMethodPointedToByVirtualIap( id ) ) + { + aDestinationInstance.iConnMethodsToBeDeleted.Remove( i ); + User::Leave( KErrLocked ); + } + else if ( CheckIfCmConnected( id ) ) + { + User::Leave( KErrInUse ); + } + } + // Delete connection methods marked for deletion. + for ( TInt i = 0; i < aDestinationInstance.iConnMethodsToBeDeleted.Count(); i++ ) + { + DeleteConnMethodAsPartOfDestinationUpdateL( + aDestinationInstance.iConnMethodsToBeDeleted[i] ); + } + + // Update the connection methods inside this destination. + for ( TInt i = 0; i < aDestinationInstance.iConnMethodItemArray.Count(); i++ ) + { + if ( aDestinationInstance.iConnMethodItemArray[i].iBearerType == KUidEmbeddedDestination ) + { + // Embedded destination. + + //TODO, Maybe check other restrictions on embedded destination. + // - Only one embedded destination per destination. Check. + // - No embedded destinations in embedded destination. Check. + + TUint32 id( aDestinationInstance.iConnMethodItemArray[i].iId ); + CCmmDestinationInstance* destinationInstance = + aDestinationInstance.FindDestinationInstanceFromSessionById( id ); + + if ( destinationInstance ) + { + // Client has a handle open to this destination, update it. + destinationInstance->UpdateL(); + } + else + { + // TODO: Or, should we update the embedded destination if the + // client has an open handle to any of the embedded + // destinations connection methods. + // + // Skip update since client doesn't have an open handle to this + // destination. + if ( id >= KTemporaryIdCounterStart || !iInstanceMapping->ValidDestinationId( id ) ) + { + // Remove destination item from array if: + // - New destination, but client has already closed the handle for it. + // - Destination ID was valid before, but it does not exist anymore. + aDestinationInstance.iConnMethodItemArray.Remove( i ); + i--; // Adjust array index counter. + } + } + } + else + { + TBool temporaryConnMethodInstance( EFalse ); + TBool connMethodProtectionMustBeSet( EFalse ); + TBool cmProtected( EFalse ); + + TUint32 id( aDestinationInstance.iConnMethodItemArray[i].iId ); + CCmmConnMethodInstance* connMethodInstance = + aDestinationInstance.FindConnMethodInstanceFromSessionById( id ); + + if ( !connMethodInstance ) + { + // Remove connection method item from the array if it is a new + // connection method but client has already closed the handle + // for it, or the connection method ID was valid before but + // does not exist anymore. + if ( id >= KTemporaryIdCounterStart || !iInstanceMapping->ValidConnMethodId( id ) ) + { + aDestinationInstance.iConnMethodItemArray.Remove( i ); + i--; // Adjust array index counter. + continue; // Jump to next connection method. + } + } + + if ( aDestinationInstance.ProtectionChanged() ) + { + // Check if the connection method protection level needs to be set. + switch ( aDestinationInstance.CurrentProtectionLevel() ) + { + case CMManager::EProtLevel0: + case CMManager::EProtLevel2: + { + if ( aDestinationInstance.LastProtectionLevel() == CMManager::EProtLevel1 || + aDestinationInstance.LastProtectionLevel() == CMManager::EProtLevel3 ) + { + connMethodProtectionMustBeSet = ETrue; + cmProtected = EFalse; + } + } + break; + case CMManager::EProtLevel1: + case CMManager::EProtLevel3: + { + connMethodProtectionMustBeSet = ETrue; + cmProtected = ETrue; + } + break; + default: + break; + } + } + + if ( connMethodProtectionMustBeSet && !connMethodInstance ) + { + // Client doesn't have an open handle to this connection method, + // but it still needs to be updated because the destination's + // protection level has been changed in such a way that + // requires a change in all contained connection methods also. + temporaryConnMethodInstance = ETrue; + connMethodInstance = CCmmConnMethodInstance::NewLC( NULL, this ); + OpenConnMethodL( *connMethodInstance, NULL, id ); + + // Read current protection level. + TBool current = connMethodInstance->GetBoolAttributeL( CMManager::ECmProtected ); + if ( cmProtected == current ) + { + // If the connection method already has the correct + // protection setting, skip the unnecessary update. + connMethodProtectionMustBeSet = EFalse; + temporaryConnMethodInstance = EFalse; + CleanupStack::PopAndDestroy( connMethodInstance ); + connMethodInstance = NULL; + } + } + + // Update the connection method. + if ( connMethodInstance ) + { + if ( connMethodProtectionMustBeSet ) + { + connMethodInstance->SetBoolAttributeL( CMManager::ECmProtected, cmProtected ); + } + connMethodInstance->UpdateL( temporaryConnMethodInstance ); + } + + // Cleanup connection method handle, if it was temporary. + if ( temporaryConnMethodInstance ) + { + CleanupStack::PopAndDestroy( connMethodInstance ); + } + connMethodInstance = NULL; + } + } + // All connection methods requiring update in the destination should have + // been updated to database now. + + iDestinationArray[index]->UpdateL( aDestinationInstance, this ); + iTrans->CommitTransactionL(); + + TCmmIdStruct idStruct( iDestinationArray[index]->GetRealId(), 0 ); + if ( aDestinationInstance.GetId() >= KTemporaryIdCounterStart ) + { + idStruct.iTemporaryId = aDestinationInstance.GetId(); + } + iUpdatedDestinations.AppendL( idStruct ); + iUpdatedDestinations2.AppendL( &aDestinationInstance ); + + // Check transaction handler reference count. + if ( iTrans->GetReferenceCount() == 0 ) + { + // Successful commit to database. Refresh instance mapping and all + // necessary status information. + for ( TInt i = 0; i < iUpdatedConnMethods.Count(); i++ ) + { + aDestinationInstance.RefreshHandlesForAllSessions( iUpdatedConnMethods[i] ); + } + for ( TInt i = 0; i < iUpdatedConnMethods2.Count(); i++ ) + { + iUpdatedConnMethods2[i]->UpdateSuccessful(); + + TInt cacheIndex = FindConnMethodFromCache( iUpdatedConnMethods2[i]->GetId() ); + if ( cacheIndex >= 0 ) + { + iConnMethodArray[cacheIndex]->UpdateSuccessful(); + } + } + for ( TInt i = 0; i < iDeletedConnMethods.Count(); i++ ) + { + TInt cacheIndex = FindConnMethodFromCache( iDeletedConnMethods[i].iRealId ); + if ( cacheIndex >= 0 ) + { + aDestinationInstance.RefreshHandlesForAllSessions( iDeletedConnMethods[i] ); + iConnMethodArray[cacheIndex]->SetStatus( ECmmConnMethodStatusToBeDeleted ); + iInstanceMapping->AddConnMethodToDeletedListL( iDeletedConnMethods[i].iRealId ); + } + } + for ( TInt i = 0; i < iUpdatedDestinations.Count(); i++ ) + { + aDestinationInstance.RefreshHandlesForAllSessions( iUpdatedDestinations[i] ); + } + for ( TInt i = 0; i < iUpdatedDestinations2.Count(); i++ ) + { + iUpdatedDestinations2[i]->UpdateSuccessful(); + + TInt cacheIndex = FindDestinationFromCache( iUpdatedDestinations2[i]->GetId() ); + if ( cacheIndex >= 0 ) + { + iDestinationArray[cacheIndex]->UpdateSuccessful(); + } + } + iDeletedConnMethods.Reset(); + iUpdatedConnMethods.Reset(); + iUpdatedConnMethods2.Reset(); + iUpdatedDestinations.Reset(); + iUpdatedDestinations2.Reset(); + + iInstanceMapping->RefreshL(); + } + + OstTraceFunctionExit0( CCMMCACHE_UPDATEDESTINATIONL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Saves the modifications in aConnMethodInstance into database. +// The second attribute aTemporaryHandle must be true if the connection method +// instance is only a temporary one created for the duration of this update +// process only. +// --------------------------------------------------------------------------- +// +void CCmmCache::UpdateConnMethodL( + CCmmConnMethodInstance& aConnMethodInstance, + TBool aTemporaryHandle ) + { + OstTraceFunctionEntry0( CCMMCACHE_UPDATECONNMETHODL_ENTRY ); + + // Find connection method from cache. + TUint32 connMethodId( aConnMethodInstance.GetId() ); + TInt index = FindConnMethodFromCache( connMethodId ); + if ( index < 0 ) + { + // Should never end up here. + User::Leave( index ); + } + + iTrans->OpenTransactionLC(); + iConnMethodArray[index]->GetPlugin()->UpdateL( aConnMethodInstance.GetPluginDataInstance() ); + iTrans->CommitTransactionL(); + + TCmmIdStruct idStruct( aConnMethodInstance.GetPluginDataInstance()->iIapId, 0 ); + if ( connMethodId >= KTemporaryIdCounterStart ) + { + idStruct.iTemporaryId = connMethodId; + } + + if ( iTrans->GetReferenceCount() == 0 ) + { + // Writing to database is completed, refresh instance mapping and all + // necessary status information. + iInstanceMapping->RefreshL(); + aConnMethodInstance.RefreshHandlesForAllSessions( idStruct ); + aConnMethodInstance.UpdateSuccessful(); + iConnMethodArray[index]->UpdateSuccessful(); + } + else + { + // Update request came from destination update. Add connection method + // information to temporary arrays so it's status information can be + // updated after successful commit to database. + iUpdatedConnMethods.AppendL( idStruct ); + if ( !aTemporaryHandle ) + { + // A temporary handle will be destroyed after update, and so won't + // need any status updates after commit. + iUpdatedConnMethods2.AppendL( &aConnMethodInstance ); + } + } + + OstTraceFunctionExit0( CCMMCACHE_UPDATECONNMETHODL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Deletes the destination refered by aDestinationInstance from the database. +// In case other sessions have open handles to the same destination, the status +// is updated to deleted state, but it is not yet removed from database. +// (ID must be kept reserved in commsdat until all handles are closed). The +// same is done for the connection methods inside this destination. +// --------------------------------------------------------------------------- +// +void CCmmCache::DeleteDestinationL( CCmmDestinationInstance& aDestinationInstance, TBool aForced ) + { + OstTraceFunctionEntry0( CCMMCACHE_DELETEDESTINATIONL_ENTRY ); + + TUint32 destinationId( aDestinationInstance.GetId() ); + + // Array to temporarily store deleted connection method IDs. Status + // information for these connection methods is updated after successful + // commit to database. + iDeletedConnMethods.Reset(); + + // Find destination from cache. + TInt index = FindDestinationFromCache( destinationId ); + if ( index == KErrNotFound ) + { + User::Leave( KErrBadHandle ); + } + + // If not forced, check if the destination is already marked to be deleted. + if ( !aForced && iDestinationArray[index]->GetStatus() == ECmmDestinationStatusToBeDeleted ) + { + OstTraceFunctionExit0( CCMMCACHE_DELETEDESTINATIONL_EXIT ); + return; + } + + // Check if there are any additional handles open. If yes, can't delete + // detination from database just yet. + if ( iDestinationArray[index]->GetReferenceCount() <= 1 ) + { + // No other client handles open to this destination. + + // Get the connection methods in this destination, and then go through + // them removing those that can't be deleted. + RArray connMethodArray; + CleanupClosePushL( connMethodArray ); + if ( !aForced ) + { + iInstanceMapping->GetConnMethodsFromDestinationL( destinationId, connMethodArray ); + } + else + { + for ( TInt i = 0; i < aDestinationInstance.iConnMethodItemArray.Count() ; i++ ) + { + connMethodArray.AppendL( aDestinationInstance.iConnMethodItemArray[i] ); + } + } + + // Remove embedded destination from list if found. + TInt count( connMethodArray.Count() ); + if ( count ) + { + if ( connMethodArray[count - 1].iBearerType == KUidEmbeddedDestination ) + { + connMethodArray.Remove( count - 1 ); + } + } + // Remove any connection method that belongs to any other destination. + for ( TInt i = 0; i < connMethodArray.Count(); i++ ) + { + if ( iInstanceMapping->ConnMethodInOtherDestination( connMethodArray[i].iId, destinationId ) ) + { + connMethodArray.Remove( i ); + i--; + } + } + // Remove any connection method that has a virtual IAP pointing to it. + for ( TInt i = 0; i < connMethodArray.Count(); i++ ) + { + if ( iInstanceMapping->ConnMethodPointedToByVirtualIap( connMethodArray[i].iId ) ) + { + connMethodArray.Remove( i ); + i--; + } + } + + iTrans->OpenTransactionLC(); + + // Delete each connection method inside this destination. + for ( TInt i = 0; i < connMethodArray.Count(); i++ ) + { + DeleteConnMethodAsPartOfDestinationDeleteL( connMethodArray[i].iId ); + } + + // Delete the destination. + iDestinationArray[index]->DeleteL(); + + iTrans->CommitTransactionL(); + CleanupStack::PopAndDestroy( &connMethodArray ); + + for ( TInt i = 0; i < iDeletedConnMethods.Count(); i++ ) + { + TInt index = FindConnMethodFromCache( iDeletedConnMethods[i].iRealId ); + if ( index == KErrNotFound ) + { + // No handles open to this deleted connection method, so it was + // removed from database. Remove it from instance mapping + // structures. Refreshing instance mapping would do the same, + // but more slowly. + iInstanceMapping->RemoveConnMethod( iDeletedConnMethods[i].iRealId ); + } + else + { + // There is at least one handle open to this deleted connection + // method, so it still exists in database for now. Remove it + // from instance mapping structures and add it to the instance + // mapping's deleted list, so the connection method is ignored + // if refreshing structures from database. Also mark the + // connection method handle on cache side as 'to be deleted'. + // + // If the connection method is updated from another existing + // handle after this, the connection method is restored as + // uncategorized. + iInstanceMapping->AddConnMethodToDeletedListL( iDeletedConnMethods[i].iRealId ); + aDestinationInstance.RefreshHandlesForAllSessions( iDeletedConnMethods[i] ); + iConnMethodArray[index]->SetStatus( ECmmConnMethodStatusToBeDeleted ); + } + } + iInstanceMapping->RemoveDestination( destinationId ); + } + else + { + // There are additional client handles open to this destination. Mark + // the destination as 'to be deleted'. When the other handles are + // closed and reference count goes to 0, the destination will be + // removed from database. + // If the destination is updated from another existing handle after + // this, the destination is restored to normal. + iDestinationArray[index]->SetStatus( ECmmDestinationStatusToBeDeleted ); + iInstanceMapping->AddDestinationToDeletedListL( destinationId ); + } + + // Update status for ALL related destination handles on client side to + // ECmmDestinationStatusChanged. + TCmmIdStruct idStruct( destinationId, 0 ); + aDestinationInstance.RefreshHandlesForAllSessions( idStruct ); + + iDeletedConnMethods.Reset(); + OstTraceFunctionExit0( DUP1_CCMMCACHE_DELETEDESTINATIONL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Deletes a connection method as part of destination delete operation. It is +// already checked that the connection method given as parameter can be deleted +// and a transaction is already open. +// If there are client side handles open to the connection method, the +// connection method is marked as deleted, but the actual database removal will +// be done after the last handle is closed. Updating a connection method marked +// as deleted (through an already open handle) will restore it. +// --------------------------------------------------------------------------- +// +void CCmmCache::DeleteConnMethodAsPartOfDestinationDeleteL( const TUint32& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMCACHE_DELETECONNMETHODASPARTOFDESTINATIONDELETEL_ENTRY ); + + // Find connection method from cache side. + TInt index = FindConnMethodFromCache( aConnMethodId ); + if ( index == KErrNotFound ) + { + // There is no open handles to this connection method. Open a temporary + // handle and delete it. + + // Find out the connection method bearer type. + TUint32 bearerType( 0 ); + TInt err = iInstanceMapping->GetConnMethodBearerType( aConnMethodId, bearerType ); + if ( err || bearerType == KUidEmbeddedDestination ) + { + // If this is an embedded destination, or the bearer is not + // supported, skip. The connection method is simply removed from + // destination. + OstTraceFunctionExit0( CCMMCACHE_DELETECONNMETHODASPARTOFDESTINATIONDELETEL_EXIT ); + return; + } + + // Check bearer type support, create plugin instance and delete the + // connection method. + CCmPluginBaseEng* plugin = NULL; + for ( TInt i = 0; i < iPlugins->Count(); i++ ) + { + if ( ( *iPlugins )[i]->GetBearerInfoIntL( CMManager::ECmBearerType ) == bearerType ) + { + TCmPluginInitParam pluginParams( Session() ); + plugin = ( *iPlugins )[i]->CreateInstanceL( pluginParams ); + CleanupStack::PushL( plugin ); + + // Transaction is already open. + plugin->LoadL( aConnMethodId ); + plugin->DeleteL(); + + CleanupStack::Pop( plugin ); + break; + } + } + if ( !plugin ) + { + // Skip, if bearer is unsupported. Connection method is simply + // removed from destination. + OstTraceFunctionExit0( DUP1_CCMMCACHE_DELETECONNMETHODASPARTOFDESTINATIONDELETEL_EXIT ); + return; + } + delete plugin; + plugin = NULL; + } + else + { + // If the connection method is already open in cache side, we can't + // delete it from database just yet. It will only be marked as 'to be + // deleted' after a successful commit. When the other handles are + // closed and reference count goes to 0, the connection method will be + // removed from database. + + // Check destination status in cache. + switch ( iConnMethodArray[index]->GetStatus() ) + { + case ECmmConnMethodStatusNotSaved: + { + // The connection methods that are deleted with the destination + // are retrieved through instance mapping, so there can't be + // any newly created unsaved connection methods among them. + User::Leave( KErrCorrupt ); + } + break; + case ECmmConnMethodStatusValid: + // Proceed. + break; + case ECmmConnMethodStatusToBeDeleted: + // Connection method has already been deleted. + return; + case ECmmConnMethodStatusChanged: + default: + { + ASSERT( 0 ); // Error, illegal status. + User::Leave( KErrCorrupt ); + } + break; + } + } + + // Add connection method ID to temporary array so it's status information + // can be updated after successful commit to database. + TCmmIdStruct idStruct( aConnMethodId, 0 ); + iDeletedConnMethods.AppendL( idStruct ); + + OstTraceFunctionExit0( DUP2_CCMMCACHE_DELETECONNMETHODASPARTOFDESTINATIONDELETEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Deletes a connection method as part of destination update operation. It is +// already checked that the connection method given as parameter can be deleted +// and a transaction is already open. +// If there are client side handles open to the connection method, the +// connection method is marked as deleted, but the actual database removal will +// be done after the last handle is closed. Updating a connection method marked +// as deleted (through an already open handle) will restore it. +// --------------------------------------------------------------------------- +// +void CCmmCache::DeleteConnMethodAsPartOfDestinationUpdateL( + const TUint32& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMCACHE_DELETECONNMETHODASPARTOFDESTINATIONUPDATEL_ENTRY ); + + // Find connection method from cache side. If not found, open a temporary handle. + TInt index = FindConnMethodFromCache( aConnMethodId ); + if ( index == KErrNotFound ) + { + // There are no open handles to this connection method. Open a + // temporary handle and delete it. + + // Find out the connection method bearer type. + TUint32 bearerType( 0 ); + TInt err = iInstanceMapping->GetConnMethodBearerType( aConnMethodId, bearerType ); + if ( err || bearerType == KUidEmbeddedDestination ) + { + // If this is an embedded destination, or the bearer is not + // supported, skip. The connection method is simply removed from + // destination. + OstTraceFunctionExit0( CCMMCACHE_DELETECONNMETHODASPARTOFDESTINATIONUPDATEL_EXIT ); + return; + } + + // Check bearer type support, create plugin instance and delete the connection method. + CCmPluginBaseEng* plugin = NULL; + for ( TInt i = 0; i < iPlugins->Count(); i++ ) + { + if ( ( *iPlugins )[i]->GetBearerInfoIntL( CMManager::ECmBearerType ) == bearerType ) + { + TCmPluginInitParam pluginParams( Session() ); + plugin = ( *iPlugins )[i]->CreateInstanceL( pluginParams ); + CleanupStack::PushL( plugin ); + iTrans->OpenTransactionLC(); + + plugin->LoadL( aConnMethodId ); + plugin->DeleteL(); + + iTrans->CommitTransactionL(); + CleanupStack::Pop( plugin ); + break; + } + } + if ( !plugin ) + { + // Skip, if bearer is unsupported. Connection method is simply + // removed from destination. + OstTraceFunctionExit0( DUP1_CCMMCACHE_DELETECONNMETHODASPARTOFDESTINATIONUPDATEL_EXIT ); + return; + } + delete plugin; + plugin = NULL; + + // Destination update will refresh instance mapping anyway at the end, + // so no need to add this connection method to the temporary + // iDeletedConnMethods-array here. + } + else + { + // There is one or more open handles to this connection method. We + // can't delete it from database just yet. It will only be marked as + // 'to be deleted' after a successful commit. When the other handles + // are closed and reference count goes to 0, the connection method will + // be removed from database. + + // Check connection method status. + switch ( iConnMethodArray[index]->GetStatus() ) + { + case ECmmConnMethodStatusNotSaved: + { + // Destination update will not attempt to delete any non-valid + // connection methods. + User::Leave( KErrCorrupt ); + } + break; + case ECmmConnMethodStatusValid: + // Proceed. + break; + case ECmmConnMethodStatusToBeDeleted: + // Connection method has already been deleted. + return; + case ECmmConnMethodStatusChanged: + default: + { + ASSERT( 0 ); // Error, illegal status. + User::Leave( KErrCorrupt ); + } + break; + } + // Add connection method ID to temporary array so it's status + // information can be updated after successful commit to database. + TCmmIdStruct idStruct( aConnMethodId, 0 ); + iDeletedConnMethods.AppendL( idStruct ); + } + + OstTraceFunctionExit0( DUP2_CCMMCACHE_DELETECONNMETHODASPARTOFDESTINATIONUPDATEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Basic connection method delete. Removes a connection method from any +// destination it might belong to, and then deletes it. +// --------------------------------------------------------------------------- +// +void CCmmCache::DeleteConnMethodL( CCmmConnMethodInstance& aConnMethodInstance ) + { + OstTraceFunctionEntry0( DUP1_CCMMCACHE_DELETECONNMETHODL_ENTRY ); + + TUint32 cmId = aConnMethodInstance.GetId(); + + // Find connection method from cache. + TInt index = FindConnMethodFromCache( cmId ); + if ( index == KErrNotFound ) + { + User::Leave( KErrBadHandle ); + } + + // Check if the connection method is already deleted. + if ( iConnMethodArray[index]->GetStatus() == ECmmConnMethodStatusToBeDeleted ) + { + OstTraceFunctionExit0( DUP1_CCMMCACHE_DELETECONNMETHODL_EXIT ); + return; + } + + // Check if there are any additional handles open. If yes, can't delete + // connection method from database just yet. + if ( iConnMethodArray[index]->GetReferenceCounter() <= 1 ) + { + // No other client handles open to this connection method. + + // Remove connection method from any destination in database and then delete it. + iTrans->OpenTransactionLC(); + RemoveAllReferencesToConnMethodL( aConnMethodInstance ); + iConnMethodArray[index]->GetPlugin()->DeleteL(); + iTrans->CommitTransactionL(); + + // Update instance mapping to reflect the current database state, and + // notify any possible client handles for the changed destinations. + RArray changedDestinations; + iInstanceMapping->RemoveConnMethod( cmId, changedDestinations ); + for ( TInt i = 0; i < changedDestinations.Count(); i++ ) + { + TCmmIdStruct idStruct( changedDestinations[i], 0 ); + aConnMethodInstance.RefreshHandlesForAllSessions( idStruct ); + } + changedDestinations.Close(); + + // Set status for cache and client handles. + TUint32 newSecondaryId( NextFreeTemporaryId() ); + aConnMethodInstance.DeleteSuccessful( newSecondaryId ); + iConnMethodArray[index]->DeleteSuccessful( newSecondaryId ); + } + else + { + // There are additional client handles open to this connection method. + // Mark the connection method as 'to be deleted' and remove it from any + // destinations in database. When the other handles are closed and + // reference count goes to 0, the connection method will be removed + // from database. + RemoveAllReferencesToConnMethodL( aConnMethodInstance ); + iInstanceMapping->AddConnMethodToDeletedListL( cmId ); + TCmmIdStruct idStruct( cmId, 0 ); + aConnMethodInstance.RefreshHandlesForAllSessions( idStruct ); + iConnMethodArray[index]->SetStatus( ECmmConnMethodStatusToBeDeleted ); + } + + OstTraceFunctionExit0( DUP2_CCMMCACHE_DELETECONNMETHODL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Check if the given ID belongs to a valid existing destination. Attribute +// aId needs to be in the current valid range (0x1001 - 0x10FF atm). +// --------------------------------------------------------------------------- +// +TBool CCmmCache::DestinationExistsWithId( const TUint32& aId ) + { + OstTraceFunctionEntry0( CCMMCACHE_DESTINATIONEXISTSWITHID_ENTRY ); + + TBool exists = iInstanceMapping->ValidDestinationId( aId ); + + OstTraceFunctionExit0( CCMMCACHE_DESTINATIONEXISTSWITHID_EXIT ); + return exists; + } + +// --------------------------------------------------------------------------- +// Check if the given name belongs to an existing destination. +// If a destination ID is given, that destination is skipped. +// --------------------------------------------------------------------------- +// +TBool CCmmCache::DestinationExistsWithNameL( const TDesC& aName, const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( CCMMCACHE_DESTINATIONEXISTSWITHNAMEL_ENTRY ); + + TBool found( EFalse ); + + // Check AccessPoint-table. + CommsDat::CCDAccessPointRecord* destApRecord = static_cast( + CommsDat::CCDRecordBase::RecordFactoryL( CommsDat::KCDTIdAccessPointRecord ) ); + CleanupStack::PushL( destApRecord ); + destApRecord->iRecordName.SetL( aName ); + if ( destApRecord->FindL( iTrans->Session() ) ) // Names should be unique. + { + if ( aDestinationId ) + { + // Check the ID is different. + destApRecord->LoadL( iTrans->Session() ); + if ( aDestinationId != destApRecord->iRecordTag ) + { + found = ETrue; + } + } + else + { + found = ETrue; + } + } + CleanupStack::PopAndDestroy( destApRecord ); + + // Check also DataMobilitySelectionPolicy-table. + if ( !found ) + { + CCDDataMobilitySelectionPolicyRecord* snapRecord = + new( ELeave ) CCDDataMobilitySelectionPolicyRecord( + iCmManagerImpl->TableId( ECmmDbSnapRecord ) ); + CleanupStack::PushL( snapRecord ); + snapRecord->iRecordName.SetL( aName ); + if ( snapRecord->FindL( iTrans->Session() ) ) // Names should be unique. + { + if ( aDestinationId ) + { + // Check the ID is different. + snapRecord->LoadL( iTrans->Session() ); + if ( aDestinationId != snapRecord->iSNAP ) + { + found = ETrue; + } + } + else + { + found = ETrue; + } + } + CleanupStack::PopAndDestroy( snapRecord ); + } + + OstTraceFunctionExit0( CCMMCACHE_DESTINATIONEXISTSWITHNAMEL_EXIT ); + + return found; + } + +// --------------------------------------------------------------------------- +// Check if the given ID belongs to a destination that the cache has an open +// handle on. This will include any destinations created by any client, that +// are not yet saved to database. +// With this check, we can prevent two clients from creating a new destination +// with the same ID (The UpdateL() operation would fail for one of them anyway). +// --------------------------------------------------------------------------- +// +TBool CCmmCache::DestinationOpenWithId( const TUint32& aId ) + { + OstTraceFunctionEntry0( CCMMCACHE_DESTINATIONOPENWITHID_ENTRY ); + + TBool result( EFalse ); + TInt index = FindDestinationFromCache( aId ); + if ( index != KErrNotFound ) + { + result = ETrue; + } + OstTraceFunctionExit0( CCMMCACHE_DESTINATIONOPENWITHID_EXIT ); + + return result; + } + +// --------------------------------------------------------------------------- +// Check if the given name belongs to any new unsaved destinations in the +// cache. This includes any destinations created byany client, that are not +// yet saved to database. +// If a destination ID is provided, the search will exclude the relevant +// destination. +// With this check, we can prevent two clients from creating a new destination +// with the same name (The UpdateL() operation would fail for one of them +// anyway). +// --------------------------------------------------------------------------- +// +TBool CCmmCache::NotSavedDestinationOpenWithNameL( + const TDesC& aName, + const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( CCMMCACHE_NOTSAVEDDESTINATIONOPENWITHNAMEL_ENTRY ); + + TBool res( EFalse ); + TInt index = FindNotSavedDestinationFromCacheL( aName, aDestinationId ); + if ( index != KErrNotFound ) + { + res = ETrue; + } + OstTraceFunctionExit0( CCMMCACHE_NOTSAVEDDESTINATIONOPENWITHNAMEL_EXIT ); + + return res; + } + +// --------------------------------------------------------------------------- +// Check if the given ID belongs to a valid existing connection method. +// --------------------------------------------------------------------------- +// +TBool CCmmCache::ConnMethodExistsWithId( const TUint32& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMCACHE_CONNMETHODEXISTSWITHID_ENTRY ); + + TBool exists = iInstanceMapping->ValidConnMethodId( aConnMethodId ); + + OstTraceFunctionExit0( CCMMCACHE_CONNMETHODEXISTSWITHID_EXIT ); + + return exists; + } + +// --------------------------------------------------------------------------- +// Check if the given ID belongs to a connection method that the cache has an +// open handle on. This will include any connection methods created by any +// client, that are not yet saved to database. +// With this check, we can prevent two clients from creating a new connection +// method with the same ID (The UpdateL() operation would fail for one of them +// anyway). +// --------------------------------------------------------------------------- +// +TBool CCmmCache::ConnMethodOpenWithId( const TUint32& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMCACHE_CONNMETHODOPENWITHID_ENTRY ); + + TBool result( EFalse ); + TInt index = FindConnMethodFromCache( aConnMethodId ); + if ( index != KErrNotFound ) + { + result = ETrue; + } + OstTraceFunctionExit0( CCMMCACHE_CONNMETHODOPENWITHID_EXIT ); + + return result; + } + +// --------------------------------------------------------------------------- +// Checks if there are any destinations with metadata localization +// (ESnapMetadataDestinationIsLocalised) set to aValue. Also checks the +// relevant metadata purpose (ESnapMetadataPurpose) values. +// The destination connected to parameter aDestinationInstance is skipped. +// --------------------------------------------------------------------------- +// +TBool CCmmCache::DestinationExistsWithMetadataLocalizedL( + CCmmDestinationInstance& aDestinationInstance, + const TUint32& aValue ) + { + OstTraceFunctionEntry0( CCMMCACHE_DESTINATIONEXISTSWITHMETADATALOCALIZEDL_ENTRY ); + + TBool result( EFalse ); + + if ( aValue != CMManager::ENotLocalisedDest ) + { + // Check there is no destination in database that already has the same + // localization metadata value. Also checks metadata purpose. + CommsDat::CMDBRecordSet* metaSet = + new( ELeave )CommsDat::CMDBRecordSet( + iCmManagerImpl->TableId( ECmmDestMetadataRecord ) ); + CleanupStack::PushL( metaSet ); + TRAP_IGNORE( metaSet->LoadL( iTrans->Session() ) ); + for ( TInt i = 0; i < metaSet->iRecords.Count(); i++ ) + { + TInt id = ( ( CCDSNAPMetadataRecord* )metaSet->iRecords[i] )->iSNAP; + TUint32 metadata = ( ( CCDSNAPMetadataRecord* )metaSet->iRecords[i] )->iMetadata; + TUint32 localizationValue = + ( metadata & CMManager::ESnapMetadataDestinationIsLocalised ) >> 4; + TUint32 purposeValue = ( metadata & CMManager::ESnapMetadataPurpose ) >> 8; + + if ( aDestinationInstance.GetId() != id ) + { + if ( aValue == localizationValue ) + { + result = ETrue; + } + switch ( aValue ) + { + case CMManager::ELocalisedDestInternet: + { + if ( purposeValue == CMManager::ESnapPurposeInternet || + ( metadata & CMManager::ESnapMetadataInternet ) ) + { + result = ETrue; + } + } + break; + case CMManager::ELocalisedDestWap: + { + if ( purposeValue == CMManager::ESnapPurposeOperator ) + { + result = ETrue; + } + } + break; + case CMManager::ELocalisedDestMMS: + { + if ( purposeValue == CMManager::ESnapPurposeMMS ) + { + result = ETrue; + } + } + break; + case CMManager::ELocalisedDestIntranet: + { + if ( purposeValue == CMManager::ESnapPurposeIntranet ) + { + result = ETrue; + } + } + break; + default: + break; + } + } + } + CleanupStack::PopAndDestroy( metaSet ); + } + OstTraceFunctionExit0( CCMMCACHE_DESTINATIONEXISTSWITHMETADATALOCALIZEDL_EXIT ); + + return result; + } + +// --------------------------------------------------------------------------- +// Checks if there are any destinations with metadata purpose +// (ESnapMetadataPurpose) set to aValue. Also checks the relevant metadata +// localization (ESnapMetadataDestinationIsLocalised) values. +// The destination connected to parameter aDestinationInstance is skipped. +// --------------------------------------------------------------------------- +// +TBool CCmmCache::DestinationExistsWithMetadataPurposeL( + CCmmDestinationInstance& aDestinationInstance, + const TUint32& aValue ) + { + OstTraceFunctionEntry0( CCMMCACHE_DESTINATIONEXISTSWITHMETADATAPURPOSEL_ENTRY ); + + TBool result( EFalse ); + + if ( aValue != CMManager::ESnapPurposeUnknown ) + { + // Check there is no destination in database that already has the same + // metadata purpose value. Also checks localization metadata. + CommsDat::CMDBRecordSet* metaSet = + new( ELeave )CommsDat::CMDBRecordSet( + iCmManagerImpl->TableId( ECmmDestMetadataRecord ) ); + CleanupStack::PushL( metaSet ); + TRAP_IGNORE( metaSet->LoadL( iTrans->Session() ) ); + for ( TInt i = 0; i < metaSet->iRecords.Count(); i++ ) + { + TInt id = ( ( CCDSNAPMetadataRecord* )metaSet->iRecords[i] )->iSNAP; + TUint32 metadata = ( ( CCDSNAPMetadataRecord* )metaSet->iRecords[i] )->iMetadata; + TUint32 localizationValue = + ( metadata & CMManager::ESnapMetadataDestinationIsLocalised ) >> 4; + TUint32 purposeValue = ( metadata & CMManager::ESnapMetadataPurpose ) >> 8; + + if ( aDestinationInstance.GetId() != id ) + { + if ( aValue == purposeValue ) + { + result = ETrue; + } + switch ( aValue ) + { + case CMManager::ESnapPurposeInternet: + { + if ( localizationValue == CMManager::ELocalisedDestInternet || + ( metadata & CMManager::ESnapMetadataInternet ) ) + { + result = ETrue; + } + } + break; + case CMManager::ESnapPurposeOperator: + { + if ( localizationValue == CMManager::ELocalisedDestWap ) + { + result = ETrue; + } + } + break; + case CMManager::ESnapPurposeMMS: + { + if ( localizationValue == CMManager::ELocalisedDestMMS ) + { + result = ETrue; + } + } + break; + case CMManager::ESnapPurposeIntranet: + { + if ( localizationValue == CMManager::ELocalisedDestIntranet ) + { + result = ETrue; + } + } + break; + default: + break; + } + } + } + CleanupStack::PopAndDestroy( metaSet ); + } + OstTraceFunctionExit0( CCMMCACHE_DESTINATIONEXISTSWITHMETADATAPURPOSEL_EXIT ); + + return result; + } + +// --------------------------------------------------------------------------- +// Tells the cache that a database table has changed. If the SNAP/IAP structure +// has possibly changed, the cache will refresh that information immediately. +// For other database tables, the tables are flagged and will be refreshed when +// needed. +// --------------------------------------------------------------------------- +// +void CCmmCache::DbChangeDetected( const TUint32& aTableId ) + { + OstTraceFunctionEntry0( CCMMCACHE_DBCHANGEDETECTED_ENTRY ); + + (void)aTableId; //TODO + // Flag the table as: currently not up-to-date + OstTraceFunctionExit0( CCMMCACHE_DBCHANGEDETECTED_EXIT ); + } + +// --------------------------------------------------------------------------- +// Tells the cache that an error has occured with a database listener. Any +// reads to this table need go through the database, since cache can't know if +// it has up-to-date information. +// --------------------------------------------------------------------------- +// +void CCmmCache::DbChangeError( const TUint32& aTableId ) + { + OstTraceFunctionEntry0( CCMMCACHE_DBCHANGEERROR_ENTRY ); + + (void)aTableId; //TODO + // Flag the table as: permanently not up-to-date + OstTraceFunctionExit0( CCMMCACHE_DBCHANGEERROR_EXIT ); + } + +// --------------------------------------------------------------------------- +// Tells the cache that a hadle to a destination was closed. The cache will +// decrement the related reference counter and perform any cleanup if necessary. +// This should be called automatically from the destructor of +// CCmmDestinationInstance-class. +// --------------------------------------------------------------------------- +// +void CCmmCache::CloseDestination( CCmmDestinationInstance& aDestinationInstance ) + { + OstTraceFunctionEntry0( CCMMCACHE_CLOSEDESTINATION_ENTRY ); + + TInt index = FindDestinationFromCache( aDestinationInstance.GetId() ); + + if ( index >= 0 ) + { + TInt remainingSessionInstances = iDestinationArray[index]->SessionInstanceClosed(); + if ( remainingSessionInstances <= 0) + { + // If status is 'to be deleted', then the last handle keeping this + // destination 'alive' was closed and it can now be deleted from + // database. + if ( iDestinationArray[index]->GetStatus() == ECmmDestinationStatusToBeDeleted ) + { + // Delete the destination unless an active connection is using + // one of it's connection methods. + TRAP_IGNORE( DeleteDestinationForcedL( aDestinationInstance ) ); + //{ + //if ( !DestinationConnectedL( aDestinationInstance.GetId() ) ) DeleteDestinationL( aDestinationInstance, ETrue ); + //} ); //TODO, make helper function + + // Destination is now removed from database. Tell instance + // mapping to stop ignoring the related ID. + iInstanceMapping->RemoveDestinationFromDeletedList( aDestinationInstance.GetId() ); + } + + // No more references, no client has an open handle to this, delete it. + delete iDestinationArray[index]; + iDestinationArray.Remove( index ); + } + } + + OstTraceFunctionExit0( CCMMCACHE_CLOSEDESTINATION_EXIT ); + } + +// --------------------------------------------------------------------------- +// Tells the cache that a hadle to a connection method was closed. The cache +// will decrement the related reference counter and perform any cleanup if +// necessary. +// This should be called automatically from the destructor of +// CCmmConnMethodInstance-class. +// --------------------------------------------------------------------------- +// +void CCmmCache::CloseConnMethod( CCmmConnMethodInstance& aConnMethodInstance ) + { + OstTraceFunctionEntry0( CCMMCACHE_CLOSECONNMETHOD_ENTRY ); + + TInt index = FindConnMethodFromCache( aConnMethodInstance.GetId() ); + + if ( index >= 0 ) + { + TInt remainingSessionInstances = iConnMethodArray[index]->SessionInstanceClosed(); + if ( remainingSessionInstances <= 0 ) + { + // If status is 'to be deleted', then the last handle keeping this + // connection method 'alive' was closed and it can now be deleted + // from database. + if ( iConnMethodArray[index]->GetStatus() == ECmmConnMethodStatusToBeDeleted ) + { + // Can't remove a connection method that is in use. + if ( !CheckIfCmConnected( aConnMethodInstance.GetId() ) ) + { + // Can't leave here. + TRAP_IGNORE( DeletePluginL( *( iConnMethodArray[index] ) ) ); + } + + // Connection method is now removed from database. Tell + // instance mapping to stop ignoring the related ID. + iInstanceMapping->RemoveConnMethodFromDeletedList( aConnMethodInstance.GetId() ); + } + + // No more references, no client has an open handle to this, delete it. + delete iConnMethodArray[index]; + iConnMethodArray.Remove( index ); + } + } + OstTraceFunctionExit0( CCMMCACHE_CLOSECONNMETHOD_EXIT ); + } + +//----------------------------------------------------------------------------- +// Returns a reference to the CommsDat session. +//----------------------------------------------------------------------------- +// +CommsDat::CMDBSession& CCmmCache::Session() const + { + OstTraceFunctionEntry0( CCMMCACHE_SESSION_ENTRY ); + + return iTrans->Session(); + } + +//----------------------------------------------------------------------------- +// Finds out the bearer type and priority of the service type from given IAP +// record. +//----------------------------------------------------------------------------- +// +void CCmmCache::BearerInfoFromIapRecordL( + CommsDat::CCDIAPRecord* aIapRecord, + TUint32& aBearerType, + TUint& aBearerPriority ) const + { + OstTraceFunctionEntry0( CCMMCACHE_BEARERINFOFROMIAPRECORDL_ENTRY ); + + // Load the IAP record from IAP table. This is an optimization that plugins + // doesn't have to do it every time the CanHandleIapIdL() is called. + aIapRecord->LoadL( Session() ); + BearerPriorityFromIapRecordL( aIapRecord, aBearerPriority ); + BearerTypeFromIapRecordL( aIapRecord, aBearerType ); + + OstTraceFunctionExit0( CCMMCACHE_BEARERINFOFROMIAPRECORDL_EXIT ); + } + +//----------------------------------------------------------------------------- +// Finds out the priority of the service type in given IAP record. +//----------------------------------------------------------------------------- +// +void CCmmCache::BearerPriorityFromIapRecordL( + CommsDat::CCDIAPRecord* aIapRecord, + TUint& aBearerPriority ) const + { + OstTraceFunctionEntry0( CCMMCACHE_BEARERPRIORITYFROMIAPRECORDL_ENTRY ); + + aBearerPriority = CMManager::KDataMobilitySelectionPolicyPriorityWildCard; + if ( !aIapRecord->iServiceType.IsNull() ) + { + aBearerPriority = iBearerPriorityCache->GetPriority( aIapRecord->iServiceType.GetL() ); + } + + OstTraceFunctionExit0( CCMMCACHE_BEARERPRIORITYFROMIAPRECORDL_EXIT ); + } + +//----------------------------------------------------------------------------- +// Finds out the bearer type of a connection method from given IAP record. +//----------------------------------------------------------------------------- +// +void CCmmCache::BearerTypeFromIapRecordL( + CommsDat::CCDIAPRecord* aIapRecord, + TUint32& aBearerType ) const + { + OstTraceFunctionEntry0( CCMMCACHE_BEARERTYPEFROMIAPRECORDL_ENTRY ); + + TInt err( KErrNone ); + TUint32 extLevel( 0 ); + TBool canHandle( EFalse ); + + TInt foundIndex( KErrNotFound ); + + // Check which bearer handles the given IAP ID. + for ( TInt i = 0; i < iPlugins->Count(); i++ ) + { + TRAP( err, canHandle = (*iPlugins)[i]->CanHandleIapIdL( aIapRecord ) ); //TODO, check leave, trap needed? + if ( !err && canHandle ) + { + TUint32 thisExtLevel = (*iPlugins)[i]->GetBearerInfoIntL( ECmExtensionLevel ); + if ( extLevel < thisExtLevel ) + { + extLevel = thisExtLevel; + foundIndex = i; + } + } + } + if ( foundIndex == KErrNotFound ) + { + // No supporting plugin found. + User::Leave( KErrNotSupported ); + } + aBearerType = (*iPlugins)[foundIndex]->GetBearerInfoIntL( CMManager::ECmBearerType ); + + OstTraceFunctionExit0( CCMMCACHE_BEARERTYPEFROMIAPRECORDL_EXIT ); + } + +//----------------------------------------------------------------------------- +// Returns all conenction method IDs. Unsupported connection methods are +// included if aCheckBearerType is set to EFalse. +//----------------------------------------------------------------------------- +// +void CCmmCache::GetAllConnMethodsL( + RArray& aConnMethodArray, + TBool aCheckBearerType ) const + { + OstTraceFunctionEntry0( CCMMCACHE_GETALLCONNMETHODSL_ENTRY ); + + iInstanceMapping->GetAllConnMethodsL( aConnMethodArray, aCheckBearerType ); + + OstTraceFunctionExit0( CCMMCACHE_GETALLCONNMETHODSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// Returns the number of destinations the provided connection method belongs to. +//----------------------------------------------------------------------------- +// +TInt CCmmCache::DestinationsContainingConnMethod( const TUint32& aConnMethodId ) const + { + OstTraceFunctionEntry0( CCMMCACHE_CONNMETHODREFERENCECOUNT_ENTRY ); + + TInt count = iInstanceMapping->DestinationsContainingConnMethod( aConnMethodId ); + + OstTraceFunctionExit0( CCMMCACHE_CONNMETHODREFERENCECOUNT_EXIT ); + return count; + } + +//----------------------------------------------------------------------------- +// Return the EasyWLAN IAP ID, zero if not found or WLAN not supported. +//----------------------------------------------------------------------------- +// +TUint32 CCmmCache::EasyWlanIdL() const + { + OstTraceFunctionEntry0( CCMMCACHE_EASYWLANIDL_ENTRY ); + + TUint32 easyWlanId = iInstanceMapping->EasyWlanIdL(); + + OstTraceFunctionExit0( CCMMCACHE_EASYWLANIDL_EXIT ); + return easyWlanId; + } + +//----------------------------------------------------------------------------- +// Check if WLAN is supported on phone. +//----------------------------------------------------------------------------- +// +TBool CCmmCache::WlanSupported() const + { + OstTraceFunctionEntry0( CCMMCACHE_WLANSUPPORTED_ENTRY ); + + TBool supported = iCmManagerImpl->WlanSupported(); + + OstTraceFunctionExit0( CCMMCACHE_WLANSUPPORTED_EXIT ); + return supported; + } + +//----------------------------------------------------------------------------- +// Find out the internet destination ID. Set to 0 if not found. +//----------------------------------------------------------------------------- +// +void CCmmCache::InternetDestinationIdL( TUint& aInternetDestinationId ) const + { + OstTraceFunctionEntry0( CCMMCACHE_INTERNETDESTINATIONIDL_ENTRY ); + + iInstanceMapping->InternetDestinationIdL( aInternetDestinationId ); + + OstTraceFunctionExit0( CCMMCACHE_INTERNETDESTINATIONIDL_EXIT ); + } + +//----------------------------------------------------------------------------- +// Return the number of destinations in database. +//----------------------------------------------------------------------------- +// +TInt CCmmCache::GetDestinationCount() const + { + OstTraceFunctionEntry0( CCMMCACHE_GETDESTINATIONCOUNT_ENTRY ); + + TInt count = iInstanceMapping->GetDestinationCount(); + + OstTraceFunctionExit0( CCMMCACHE_GETDESTINATIONCOUNT_EXIT ); + return count; + } + +//----------------------------------------------------------------------------- +// Return an array containing all destination IDs. +//----------------------------------------------------------------------------- +// +void CCmmCache::GetDestinationsL( RArray& aDestinationArray ) const + { + OstTraceFunctionEntry0( CCMMCACHE_GETDESTINATIONSL_ENTRY ); + + iInstanceMapping->GetDestinationsL( aDestinationArray ); + + OstTraceFunctionExit0( CCMMCACHE_GETDESTINATIONSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// Returns all the valid connection methods under given destination. +//----------------------------------------------------------------------------- +// +void CCmmCache::GetConnMethodsFromDestinationL( + const TUint32& aDestinationId, + RArray& aConnMethodArray ) const + { + OstTraceFunctionEntry0( CCMMCACHE_GETCONNMETHODSFROMDESTINATIONL_ENTRY ); + + iInstanceMapping->GetConnMethodsFromDestinationL( + aDestinationId, aConnMethodArray ); + + OstTraceFunctionExit0( CCMMCACHE_GETCONNMETHODSFROMDESTINATIONL_EXIT ); + } + +//----------------------------------------------------------------------------- +// Copies the bearer priority array's contents to aArray. +//----------------------------------------------------------------------------- +// +void CCmmCache::CopyBearerPriorityArrayL( RPointerArray& aArray ) const + { + OstTraceFunctionEntry0( CCMMCACHE_COPYBEARERPRIORITYARRAYL_ENTRY ); + + iBearerPriorityCache->CopyL( aArray ); + + OstTraceFunctionExit0( CCMMCACHE_COPYBEARERPRIORITYARRAYL_EXIT ); + } + +//----------------------------------------------------------------------------- +// Updates the bearer priority array with the contents of aArray. +//----------------------------------------------------------------------------- +// +void CCmmCache::UpdateBearerPriorityArrayL( const RPointerArray& aArray ) + { + OstTraceFunctionEntry0( CCMMCACHE_UPDATEBEARERPRIORITYARRAYL_ENTRY ); + + iBearerPriorityCache->UpdateL( aArray ); + + OstTraceFunctionExit0( CCMMCACHE_UPDATEBEARERPRIORITYARRAYL_EXIT ); + } + +//----------------------------------------------------------------------------- +// Check from database if the given connection method belongs to any other +// destination than the one provided. +//----------------------------------------------------------------------------- +// +TBool CCmmCache::ConnMethodInOtherDestination( + const TUint32& aConnMethodId, + const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( CCMMCACHE_CONNMETHODINOTHERDESTINATION_ENTRY ); + + TBool cmInOtherDestination = iInstanceMapping-> + ConnMethodInOtherDestination( aConnMethodId, aDestinationId ); + + OstTraceFunctionExit0( CCMMCACHE_CONNMETHODINOTHERDESTINATION_EXIT ); + return cmInOtherDestination; + } + +//----------------------------------------------------------------------------- +// Get the next free temporary ID. +//----------------------------------------------------------------------------- +// +TUint32 CCmmCache::NextFreeTemporaryId() + { + OstTraceFunctionEntry0( CCMMCACHE_NEXTFREETEMPORARYID_ENTRY ); + + // Zero is not a valid ID. + if ( iCurrentTemporaryId == KMaxTUint32 ) + { + //TODO, add flag to indicate a rollover has occured. after that need to check if temp ID is free before giving it out. + + iCurrentTemporaryId = KTemporaryIdCounterStart; + } + + iCurrentTemporaryId++; + + OstTraceFunctionExit0( CCMMCACHE_NEXTFREETEMPORARYID_EXIT ); + return iCurrentTemporaryId; + } + +//----------------------------------------------------------------------------- +// Find an open destination matching the give ID from cache. +// Returns either a valid array index or KErrNotFound. +//----------------------------------------------------------------------------- +// +TInt CCmmCache::FindDestinationFromCache( const TUint32& aId ) + { + OstTraceFunctionEntry0( CCMMCACHE_FINDDESTINATIONFROMCACHE_ENTRY ); + + TInt result( KErrNotFound ); + + // Skip if ID is 0. + if ( aId ) + { + for ( TInt i = 0; i < iDestinationArray.Count(); i++ ) + { + if ( aId == iDestinationArray[i]->GetId() ) + { + result = i; + break; + } + } + } + + OstTraceFunctionExit0( CCMMCACHE_FINDDESTINATIONFROMCACHE_EXIT ); + return result; + } + +//----------------------------------------------------------------------------- +// Find an open destination matching the given name from cache. If a destination +// ID is provided, the search will exclude the relevant destination. +// Returns either a valid array index or KErrNotFound. +//----------------------------------------------------------------------------- +// +TInt CCmmCache::FindNotSavedDestinationFromCacheL( const TDesC& aName, const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( CCMMCACHE_FINDNOTSAVEDDESTINATIONFROMCACHEL_ENTRY ); + + TInt result( KErrNotFound ); + + // Go through destination array. + for ( TInt i = 0; i < iDestinationArray.Count(); i++ ) + { + // Only check new destinations that are not yet in database. + if ( iDestinationArray[i]->GetStatus() == ECmmDestinationStatusNotSaved ) + { + if ( aDestinationId ) + { + if ( aDestinationId != iDestinationArray[i]->GetId() ) + { + if ( !aName.Compare( iDestinationArray[i]->GetDestinationNameL() ) ) + { + result = i; + break; + } + } + } + else + { + if ( !aName.Compare( iDestinationArray[i]->GetDestinationNameL() ) ) + { + result = i; + break; + } + } + } + } + + OstTraceFunctionExit0( CCMMCACHE_FINDNOTSAVEDDESTINATIONFROMCACHEL_EXIT ); + return result; + } + +//----------------------------------------------------------------------------- +// Find an open connection method matching the given ID from cache. +// Returns either a valid array index or KErrNotFound. +//----------------------------------------------------------------------------- +// +TInt CCmmCache::FindConnMethodFromCache( const TUint32& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMCACHE_FINDCONNMETHODFROMCACHE_ENTRY ); + + TInt result( KErrNotFound ); + + // Skip if ID is 0. + if ( aConnMethodId ) + { + for ( TInt i = 0; i < iConnMethodArray.Count(); i++ ) + { + if ( aConnMethodId == iConnMethodArray[i]->GetId() ) + { + result = i; + break; + } + } + } + + OstTraceFunctionExit0( CCMMCACHE_FINDCONNMETHODFROMCACHE_EXIT ); + return result; + } + +//----------------------------------------------------------------------------- +// Loads and initializes a connection method instance. +//----------------------------------------------------------------------------- +// +void CCmmCache::OpenConnectionMethodInstanceL( + CCmmConnMethodInstance& aConnMethodInstance, + const TUint32& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMCACHE_OPENCONNECTIONMETHODINSTANCEL_ENTRY ); + + // Find out the connection method bearer type. + TUint32 bearerType( 0 ); + User::LeaveIfError( iInstanceMapping->GetConnMethodBearerType( aConnMethodId, bearerType ) ); + + // Check bearer type support and create plugin instance. + CCmPluginBaseEng* plugin = NULL; + for ( TInt i = 0; i < iPlugins->Count(); i++ ) + { + if ( ( *iPlugins )[i]->GetBearerInfoIntL( CMManager::ECmBearerType ) == bearerType ) + { + TCmPluginInitParam pluginParams( Session() ); + plugin = ( *iPlugins )[i]->CreateInstanceL( pluginParams ); + CleanupStack::PushL( plugin ); + plugin->LoadL( aConnMethodId ); + break; + } + } + if ( !plugin ) + { + User::Leave( KErrNotSupported ); + } + + // Store the connection method into cache. + CCmmConnMethodStruct* connMethodStruct = CCmmConnMethodStruct::NewLC( aConnMethodId ); + connMethodStruct->SetPlugin( plugin, bearerType, ECmmConnMethodStatusValid ); + iConnMethodArray.AppendL( connMethodStruct ); + CleanupStack::Pop( connMethodStruct ); + CleanupStack::Pop( plugin ); //TODO, pop after SetPlugin()-call? + + // Copy the connection method data to session instance. + aConnMethodInstance.CopyDataL( connMethodStruct ); // Will increase reference counter. + + OstTraceFunctionExit0( CCMMCACHE_OPENCONNECTIONMETHODINSTANCEL_EXIT ); + } + +//----------------------------------------------------------------------------- +// CCmmCache::GetConnectionMethodInfoIntL +//----------------------------------------------------------------------------- +// +TUint32 CCmmCache::GetConnectionMethodInfoIntL( + const TUint32& aCmId, + const TUint32& aAttribute ) + { + OstTraceFunctionEntry0( CCMMCACHE_GETCONNECTIONMETHODINFOINTL_ENTRY ); + + TUint32 retVal( 0 ); + + CCmmConnMethodInstance* cmInstance = CCmmConnMethodInstance::NewLC( NULL, this ); + + // Check if connection method is already opened in cache. + TInt index = FindConnMethodFromCache( aCmId ); + if ( index != KErrNotFound ) + { + // Already open in cache. Copy the connection method to session instance. + cmInstance->CopyDataL( iConnMethodArray[index] ); // Will increase reference counter. + } + else + { + OpenConnectionMethodInstanceL( *cmInstance, aCmId ); + } + + retVal = cmInstance->GetIntAttributeL( aAttribute ); + + CloseConnMethod( *cmInstance ); + CleanupStack::PopAndDestroy( cmInstance ); + + OstTraceFunctionExit0( CCMMCACHE_GETCONNECTIONMETHODINFOINTL_EXIT ); + return retVal; + } + +//----------------------------------------------------------------------------- +// CCmmCache::GetConnectionMethodInfoBoolL +//----------------------------------------------------------------------------- +// +TBool CCmmCache::GetConnectionMethodInfoBoolL( + const TUint32& aCmId, + const TUint32& aAttribute ) + { + OstTraceFunctionEntry0( CCMMCACHE_GETCONNECTIONMETHODINFOBOOLL_ENTRY ); + + TBool retVal( EFalse ); + + CCmmConnMethodInstance* cmInstance = CCmmConnMethodInstance::NewLC( NULL, this ); + + // Check if connection method is already opened in cache. + TInt index = FindConnMethodFromCache( aCmId ); + if ( index != KErrNotFound ) + { + // Already open in cache. Copy the connection method to session instance. + cmInstance->CopyDataL( iConnMethodArray[index] ); // Will increase reference counter. + } + else + { + OpenConnectionMethodInstanceL( *cmInstance, aCmId ); + } + + retVal = cmInstance->GetBoolAttributeL( aAttribute ); + + CloseConnMethod( *cmInstance ); + CleanupStack::PopAndDestroy( cmInstance ); + + OstTraceFunctionExit0( CCMMCACHE_GETCONNECTIONMETHODINFOBOOLL_EXIT ); + return retVal; + } + +//----------------------------------------------------------------------------- +// CCmmCache::GetConnectionMethodInfoStringL +//----------------------------------------------------------------------------- +// +HBufC* CCmmCache::GetConnectionMethodInfoStringL( + const TUint32& aCmId, + const TUint32& aAttribute ) + { + OstTraceFunctionEntry0( CCMMCACHE_GETCONNECTIONMETHODINFOSTRINGL_ENTRY ); + + HBufC* retVal( NULL ); + + CCmmConnMethodInstance* cmInstance = CCmmConnMethodInstance::NewLC( NULL, this ); + + // Check if connection method is already opened in cache. + TInt index = FindConnMethodFromCache( aCmId ); + if ( index != KErrNotFound ) + { + // Already open in cache. Copy the connection method to session instance. + cmInstance->CopyDataL( iConnMethodArray[index] ); // Will increase reference counter. + } + else + { + OpenConnectionMethodInstanceL( *cmInstance, aCmId ); + } + + retVal = cmInstance->GetStringAttributeL( aAttribute ); + + CloseConnMethod( *cmInstance ); + CleanupStack::PopAndDestroy( cmInstance ); + + OstTraceFunctionExit0( CCMMCACHE_GETCONNECTIONMETHODINFOSTRINGL_EXIT ); + return retVal; + } + +//----------------------------------------------------------------------------- +// CCmmCache::GetConnectionMethodInfoString8L +//----------------------------------------------------------------------------- +// +HBufC8* CCmmCache::GetConnectionMethodInfoString8L( + const TUint32& aCmId, + const TUint32& aAttribute ) + { + OstTraceFunctionEntry0( CCMMCACHE_GETCONNECTIONMETHODINFOSTRING8L_ENTRY ); + + HBufC8* retVal( NULL ); + + CCmmConnMethodInstance* cmInstance = CCmmConnMethodInstance::NewLC( NULL, this ); + + // Check if connection method is already opened in cache. + TInt index = FindConnMethodFromCache( aCmId ); + if ( index != KErrNotFound ) + { + // Already open in cache. Copy the connection method to session instance. + cmInstance->CopyDataL( iConnMethodArray[index] ); // Will increase reference counter. + } + else + { + OpenConnectionMethodInstanceL( *cmInstance, aCmId ); + } + + retVal = cmInstance->GetString8AttributeL( aAttribute ); + + CloseConnMethod( *cmInstance ); + CleanupStack::PopAndDestroy( cmInstance ); + + OstTraceFunctionExit0( CCMMCACHE_GETCONNECTIONMETHODINFOSTRING8L_EXIT ); + return retVal; + } + + +//----------------------------------------------------------------------------- +// CCmmCache::GetBearerInfoIntL +//----------------------------------------------------------------------------- +// +TUint32 CCmmCache::GetBearerInfoIntL( + const TUint32& aBearerType, + const TUint32& aAttribute ) + { + OstTraceFunctionEntry0( CCMMCACHE_GETBEARERINFOINTL_ENTRY ); + + TUint32 retVal( 0 ); + TBool found( EFalse ); + + for ( TInt i = 0; i < iPlugins->Count(); i++ ) + { + if ( ( *iPlugins )[i]->GetBearerInfoIntL( CMManager::ECmBearerType ) == aBearerType ) + { + found = ETrue; + retVal = ( *iPlugins )[i]->GetBearerInfoIntL( aAttribute ); + break; + } + } + if ( !found ) + { + User::Leave( KErrArgument ); + } + + OstTraceFunctionExit0( CCMMCACHE_GETBEARERINFOINTL_EXIT ); + return retVal; + } + +//----------------------------------------------------------------------------- +// CCmmCache::GetBearerInfoBoolL +//----------------------------------------------------------------------------- +// +TBool CCmmCache::GetBearerInfoBoolL( + const TUint32& aBearerType, + const TUint32& aAttribute ) + { + OstTraceFunctionEntry0( CCMMCACHE_GETBEARERINFOBOOLL_ENTRY ); + + TBool retVal( EFalse ); + TBool found( EFalse ); + + for ( TInt i = 0; i < iPlugins->Count(); i++ ) + { + if ( ( *iPlugins )[i]->GetBearerInfoIntL( CMManager::ECmBearerType ) == aBearerType ) + { + found = ETrue; + retVal = ( *iPlugins )[i]->GetBearerInfoBoolL( aAttribute ); + break; + } + } + if ( !found ) + { + User::Leave( KErrArgument ); + } + + OstTraceFunctionExit0( CCMMCACHE_GETBEARERINFOBOOLL_EXIT ); + return retVal; + } + +//----------------------------------------------------------------------------- +// CCmmCache::GetBearerInfoStringL +//----------------------------------------------------------------------------- +// +HBufC* CCmmCache::GetBearerInfoStringL( + const TUint32& aBearerType, + const TUint32& aAttribute ) + { + OstTraceFunctionEntry0( CCMMCACHE_GETBEARERINFOSTRINGL_ENTRY ); + + HBufC* retVal( NULL ); + TBool found( EFalse ); + + for ( TInt i = 0; i < iPlugins->Count(); i++ ) + { + if ( ( *iPlugins )[i]->GetBearerInfoIntL( CMManager::ECmBearerType ) == aBearerType ) + { + found = ETrue; + retVal = ( *iPlugins )[i]->GetBearerInfoStringL( aAttribute ); + break; + } + } + if ( !found ) + { + User::Leave( KErrArgument ); + } + + OstTraceFunctionExit0( CCMMCACHE_GETBEARERINFOSTRINGL_EXIT ); + return retVal; + } + +//----------------------------------------------------------------------------- +// CCmmCache::GetBearerInfoString8L +//----------------------------------------------------------------------------- +// +HBufC8* CCmmCache::GetBearerInfoString8L( + const TUint32& aBearerType, + const TUint32& aAttribute ) + { + OstTraceFunctionEntry0( CCMMCACHE_GETBEARERINFOSTRING8L_ENTRY ); + + HBufC8* retVal( NULL ); + TBool found( EFalse ); + + for ( TInt i = 0; i < iPlugins->Count(); i++ ) + { + if ( ( *iPlugins )[i]->GetBearerInfoIntL( CMManager::ECmBearerType ) == aBearerType ) + { + found = ETrue; + retVal = ( *iPlugins )[i]->GetBearerInfoString8L( aAttribute ); + break; + } + } + if ( !found ) + { + User::Leave( KErrArgument ); + } + + OstTraceFunctionExit0( CCMMCACHE_GETBEARERINFOSTRING8L_EXIT ); + return retVal; + } + +//----------------------------------------------------------------------------- +// Read general connection settings from database. +//----------------------------------------------------------------------------- +// +void CCmmCache::ReadGenConnSettingsL( TCmGenConnSettings& aGenConnSettings ) const + { + OstTraceFunctionEntry0( CCMMCACHE_READGENCONNSETTINGSL_ENTRY ); + + CommsDat::CMDBRecordSet* defConnRecordSet = + new( ELeave ) CommsDat::CMDBRecordSet( + iCmManagerImpl->TableId( ECmmDbDefConnRecord ) ); + CleanupStack::PushL( defConnRecordSet ); + + CCDDefConnRecord* defConnRecord = + new( ELeave ) CCDDefConnRecord( + iCmManagerImpl->TableId( ECmmDbDefConnRecord ) ); + CleanupStack::PushL( defConnRecord ); + + TRAP_IGNORE( defConnRecordSet->LoadL( Session() ) ); + if ( defConnRecordSet->iRecords.Count() > 0 ) + { + defConnRecord->SetElementId( defConnRecordSet->iRecords[0]->ElementId() ); + defConnRecord->LoadL( Session() ); + + aGenConnSettings.iUsageOfWlan = + TCmUsageOfWlan( ( TInt )defConnRecord->iUsageOfWlan ); + aGenConnSettings.iCellularDataUsageHome = + TCmCellularDataUsage( ( TInt )defConnRecord->iCellularDataUsageHome ); + aGenConnSettings.iCellularDataUsageVisitor = + TCmCellularDataUsage( ( TInt )defConnRecord->iCellularDataUsageVisitor ); + } + else + { + iTrans->OpenTransactionLC(); + + TUint defConnType( 0 ); + TUint internetSnapId( 0 ); + iInstanceMapping->InternetDestinationIdL( internetSnapId ); + if ( internetSnapId ) + { + defConnType = ECmDefConnDestination; + } + + aGenConnSettings.iUsageOfWlan = ECmUsageOfWlanKnown; + aGenConnSettings.iCellularDataUsageHome = ECmCellularDataUsageAutomatic; + aGenConnSettings.iCellularDataUsageVisitor = ECmCellularDataUsageConfirm; + + defConnRecord->SetRecordId( KCDNewRecordRequest ); + defConnRecord->iDefConnType = defConnType; + defConnRecord->iDefConnUid = internetSnapId; + defConnRecord->iUsageOfWlan = ( TUint )aGenConnSettings.iUsageOfWlan; + defConnRecord->iCellularDataUsageHome = ( TUint )aGenConnSettings.iCellularDataUsageHome; + defConnRecord->iCellularDataUsageVisitor = ( TUint )aGenConnSettings.iCellularDataUsageVisitor; + defConnRecord->StoreL( Session() ); + + iTrans->CommitTransactionL(); + } + + CleanupStack::PopAndDestroy( defConnRecord ); + CleanupStack::PopAndDestroy( defConnRecordSet ); + + OstTraceFunctionExit0( CCMMCACHE_READGENCONNSETTINGSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// Write general connection settings to database. +//----------------------------------------------------------------------------- +// +void CCmmCache::WriteGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings ) + { + OstTraceFunctionEntry0( CCMMCACHE_WRITEGENCONNSETTINGSL_ENTRY ); + + iTrans->OpenTransactionLC(); + + ReplaceGenConnSettingsL( aGenConnSettings ); + + iTrans->CommitTransactionL(); + + OstTraceFunctionExit0( CCMMCACHE_WRITEGENCONNSETTINGSL_EXIT ); + } + +//----------------------------------------------------------------------------- +// CCmmCache::ReplaceGenConnSettingsL() +//----------------------------------------------------------------------------- +// +void CCmmCache::ReplaceGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings ) + { + OstTraceFunctionEntry0( CCMMCACHE_REPLACEGENCONNSETTINGSL_ENTRY ); + TBool oldRecordExists( EFalse ); + + CommsDat::CMDBRecordSet* defConnRecordSet = + new( ELeave ) CommsDat::CMDBRecordSet( + iCmManagerImpl->TableId( ECmmDbDefConnRecord ) ); + CleanupStack::PushL( defConnRecordSet ); + + CCDDefConnRecord* defConnRecord = + new( ELeave ) CCDDefConnRecord( + iCmManagerImpl->TableId( ECmmDbDefConnRecord ) ); + CleanupStack::PushL( defConnRecord ); + + TRAPD( err, defConnRecordSet->LoadL( Session() ) ); + if ( err == KErrNone ) + { + defConnRecord->SetElementId( defConnRecordSet->iRecords[0]->ElementId() ); + defConnRecord->LoadL( Session() ); + oldRecordExists = ETrue; + } + else if ( err == KErrNotFound ) + { + defConnRecord->SetRecordId( KCDNewRecordRequest ); + } + else + { + User::Leave( err ); + } + + defConnRecord->iUsageOfWlan = ( TUint )aGenConnSettings.iUsageOfWlan; + defConnRecord->iCellularDataUsageHome = ( TUint )aGenConnSettings.iCellularDataUsageHome; + defConnRecord->iCellularDataUsageVisitor = ( TUint )aGenConnSettings.iCellularDataUsageVisitor; + + if ( oldRecordExists ) + { + defConnRecord->ModifyL( Session() ); + } + else + { + defConnRecord->StoreL( Session() ); + } + + CleanupStack::PopAndDestroy( defConnRecord ); + CleanupStack::PopAndDestroy( defConnRecordSet ); + + OstTraceFunctionExit0( CCMMCACHE_REPLACEGENCONNSETTINGSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Opens a transaction and deletes the given connection method. +// --------------------------------------------------------------------------- +// +void CCmmCache::DeletePluginL( CCmmConnMethodStruct& aConnMethodStruct ) + { + iTrans->OpenTransactionLC(); + aConnMethodStruct.GetPlugin()->DeleteL(); + iTrans->CommitTransactionL(); + } + +// --------------------------------------------------------------------------- +// Enumerates connections and checks if the given connection method is +// connected. +// --------------------------------------------------------------------------- +// +TBool CCmmCache::CheckIfCmConnected( const TUint32& aCmId ) const + { + OstTraceFunctionEntry0( CCMMCACHE_CHECKIFCMCONNECTED_ENTRY ); + + TBool result( EFalse ); + RSocketServ ss; + RConnection connection; + TUint connectionCount( 0 ); + + if ( ss.Connect() == KErrNone ) + { + if ( connection.Open( ss, KAfInet ) == KErrNone ) + { + if ( connection.EnumerateConnections( connectionCount ) == KErrNone ) + { + TPckgBuf connInfo; + + for ( TInt i = 1; i <= connectionCount; i++ ) + { + connection.GetConnectionInfo( i, connInfo ); + + if ( connInfo().iIapId == aCmId ) + { + result = ETrue; + break; + } + } + + } + connection.Close(); + } + ss.Close(); + } + + OstTraceFunctionExit0( CCMMCACHE_CHECKIFCMCONNECTED_EXIT ); + + return result; + } + +// --------------------------------------------------------------------------- +// Enumerates connections and checks if any of the connection methods in the +// given destination is connected. +// --------------------------------------------------------------------------- +// +TBool CCmmCache::DestinationConnectedL( + const TUint32 aDestinationId, + CCmmDestinationInstance* aDestinationInstance ) const + { + OstTraceFunctionEntry0( CCMMCACHE_DESTINATIONCONNECTEDL_ENTRY ); + + TBool result( EFalse ); + RSocketServ ss; + RConnection connection; + TUint connectionCount( 0 ); + + if ( ss.Connect() == KErrNone ) + { + if ( connection.Open( ss, KAfInet ) == KErrNone ) + { + if ( connection.EnumerateConnections( connectionCount ) == KErrNone ) + { + RArray connMethodArray; + CleanupClosePushL( connMethodArray ); + + // If destination instance provided, take the destination's + // connection methods from there. Otherwise get the connection + // methods from instance mapping. (If the destination is marked + // to be deleted, instance mapping won't have information about + // it.) + if ( aDestinationInstance ) + { + for ( TInt i = 0; i < aDestinationInstance->iConnMethodItemArray.Count(); i++ ) + { + connMethodArray.AppendL( aDestinationInstance->iConnMethodItemArray[i] ); + } + } + else + { + iInstanceMapping->GetConnMethodsFromDestinationL( aDestinationId, connMethodArray ); + } + + // Iterate through all connections. + TPckgBuf connInfo; + for ( TUint i = 1; i <= connectionCount; i++ ) + { + connection.GetConnectionInfo( i, connInfo ); + + // Iterate through all connection methods in destinations. + for ( TInt j = 0; j < connMethodArray.Count(); j++ ) + { + if ( connInfo().iIapId == connMethodArray[j].iId ) + { + result = ETrue; + break; + } + } + if ( result ) + { + break; + } + } + + CleanupStack::PopAndDestroy( &connMethodArray ); + } + connection.Close(); + } + ss.Close(); + } + + OstTraceFunctionExit0( CCMMCACHE_DESTINATIONCONNECTEDL_EXIT ); + return result; + } + +// --------------------------------------------------------------------------- +// Check from database if the given destination is an embedded destination in +// any other destination. +// --------------------------------------------------------------------------- +// +TBool CCmmCache::DestinationIsEmbedded( const TUint32& aDestinationId ) const + { + OstTraceFunctionEntry0( CCMMCACHE_DESTINATIONISEMBEDDED_ENTRY ); + + TBool isEmbedded = iInstanceMapping->DestinationIsEmbedded( aDestinationId ); + + OstTraceFunctionExit0( CCMMCACHE_DESTINATIONISEMBEDDED_EXIT ); + + return isEmbedded; + } + +// --------------------------------------------------------------------------- +// Check from database if the given destination has an embedded destination. +// --------------------------------------------------------------------------- +// +TBool CCmmCache::DestinationHasEmbedded( const TUint32& aDestinationId ) const + { + OstTraceFunctionEntry0( CCMMCACHE_DESTINATIONHASEMBEDDED_ENTRY ); + + TBool hasEmbedded = iInstanceMapping->DestinationHasEmbedded( aDestinationId ); + + OstTraceFunctionExit0( CCMMCACHE_DESTINATIONHASEMBEDDED_EXIT ); + + return hasEmbedded; + } + +// --------------------------------------------------------------------------- +// Check from database if the given destination is pointed to by any virtual +// IAP. +// --------------------------------------------------------------------------- +// +TBool CCmmCache::DestinationPointedToByVirtualIap( const TUint32& aDestinationId ) const + { + OstTraceFunctionEntry0( CCMMCACHE_DESTINATIONPOINTEDTOBYVIRTUALIAP_ENTRY ); + + TBool pointedByVirtual = + iInstanceMapping->DestinationPointedToByVirtualIap( aDestinationId ); + + OstTraceFunctionExit0( CCMMCACHE_DESTINATIONPOINTEDTOBYVIRTUALIAP_EXIT ); + + return pointedByVirtual; + } + +// --------------------------------------------------------------------------- +// Check from database if the given connection method is pointed to by any +// virtual IAP. +// --------------------------------------------------------------------------- +// +TBool CCmmCache::ConnMethodPointedToByVirtualIap( const TUint32& aConnMethodId ) const + { + + TBool pointedByVirtual = + iInstanceMapping->ConnMethodPointedToByVirtualIap( aConnMethodId ); + + return pointedByVirtual; + } + +// --------------------------------------------------------------------------- +// Check if the given connection method is the only connection method in the +// given destination and if a virtual IAP points to that destination. +// --------------------------------------------------------------------------- +// +TBool CCmmCache::ConnMethodInDestinationButLocked( + const TUint32& aConnMethodId, const TUint32& aDestinationId ) const + { + OstTraceFunctionEntry0( CCMMCACHE_CONNMETHODINDESTINATIONBUTLOCKED_ENTRY ); + + TBool inAndlocked = iInstanceMapping-> + ConnMethodInDestinationButLocked( aConnMethodId, aDestinationId ); + + OstTraceFunctionExit0( CCMMCACHE_CONNMETHODINDESTINATIONBUTLOCKED_EXIT ); + + return inAndlocked; + } + +// --------------------------------------------------------------------------- +// Remove all references to the given connection method from the datamobility +// selection policy records. Then update instance mapping to reflect the +// current database state, and notify any possible client handles for the +// changed destinations. Also removes the connection method from any +// destination handles the client has open. +// --------------------------------------------------------------------------- +// +void CCmmCache::RemoveAllReferencesToConnMethodL( + CCmmConnMethodInstance& aConnMethodInstance ) + { + OstTraceFunctionEntry0( CCMMCACHE_REMOVEALLREFERENCESTOCONNMETHODL_ENTRY ); + + TUint32 connMethodId( aConnMethodInstance.GetId() ); + + iTrans->OpenTransactionLC(); + + // Create DataMobilitySelectionPolicy-record set. + CommsDat::CMDBRecordSet* snapRecordSet = + new( ELeave ) CommsDat::CMDBRecordSet( + iCmManagerImpl->TableId( ECmmDbSnapRecord ) ); + CleanupStack::PushL( snapRecordSet ); + + // Create a DataMobilitySelectionPolicy-record. + CCDDataMobilitySelectionPolicyRecord* snapRecord = + new( ELeave ) CCDDataMobilitySelectionPolicyRecord( + iCmManagerImpl->TableId( ECmmDbSnapRecord ) ); + CleanupStack::PushL( snapRecord ); + + TRAP_IGNORE( snapRecordSet->LoadL( iTrans->Session() ) ); + + // Read IAP ID from each record and delete any that match the connection + // method we are removing all references for. + TUint32 connMethodIdInRecord( 0 ); + TInt snapRecordCount( snapRecordSet->iRecords.Count() ); + for ( TInt i = 0; i < snapRecordCount; i++ ) + { + snapRecord->SetElementId( snapRecordSet->iRecords[i]->ElementId() ); + snapRecord->LoadL( iTrans->Session() ); + + connMethodIdInRecord = ( snapRecord->iIAP & KCDMaskShowRecordId ) >> 8; + if ( connMethodIdInRecord == connMethodId ) + { + snapRecord->DeleteL( iTrans->Session() ); + } + } + CleanupStack::PopAndDestroy( snapRecord ); + CleanupStack::PopAndDestroy( snapRecordSet ); + + iTrans->CommitTransactionL(); + + // Reference count will be zero if this method call is not part of some + // bigger operation (e.g. connection method delete). + if ( iTrans->GetReferenceCount() == 0 ) + { + // Update instance mapping to reflect the current database state, and + // notify any possible client handles for the changed destinations. + RArray changedDestinations; + iInstanceMapping->RemoveConnMethodFromDestinations( connMethodId, changedDestinations ); + for ( TInt i = 0; i < changedDestinations.Count(); i++ ) + { + TCmmIdStruct idStruct( changedDestinations[i], 0 ); + aConnMethodInstance.RefreshHandlesForAllSessions( idStruct ); + } + changedDestinations.Close(); + + // Remove the connection method from any destination handles the client + // has open. + aConnMethodInstance.RemoveConnMethodFromSessionDestinationHandles( connMethodId ); + } + + OstTraceFunctionExit0( CCMMCACHE_REMOVEALLREFERENCESTOCONNMETHODL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Update the ID of a new destination from temporary ID to real ID after a +// successful update to database. +// --------------------------------------------------------------------------- +// +void CCmmCache::RefreshDestinationId( const TCmmIdStruct& aIdStruct ) + { + OstTraceFunctionEntry0( CCMMCACHE_REFRESHDESTINATIONID_ENTRY ); + + // Iterate destinations in cache and update the ID if match found. + for ( TInt i = 0; i < iDestinationArray.Count(); i++ ) + { + if ( iDestinationArray[i]->GetId() == aIdStruct.iTemporaryId ) + { + iDestinationArray[i]->SetId( aIdStruct.iRealId ); + break; + } + } + OstTraceFunctionExit0( CCMMCACHE_REFRESHDESTINATIONID_EXIT ); + } + +// --------------------------------------------------------------------------- +// Update the ID of a new connection method from temporary ID to real ID after +// a successful update to database. +// --------------------------------------------------------------------------- +// +void CCmmCache::RefreshConnMethodId( const TCmmIdStruct& aIdStruct ) + { + OstTraceFunctionEntry0( CCMMCACHE_REFRESHCONNMETHODID_ENTRY ); + + // Iterate connection methods in cache and update the ID if match found. + for ( TInt i = 0; i < iConnMethodArray.Count(); i++ ) + { + if ( iConnMethodArray[i]->GetId() == aIdStruct.iTemporaryId ) + { + iConnMethodArray[i]->SetId( aIdStruct.iRealId ); + break; // Can only be 1 match. + } + } + OstTraceFunctionExit0( CCMMCACHE_REFRESHCONNMETHODID_EXIT ); + } + +// --------------------------------------------------------------------------- +// During destination update, after updating connection methods inside the +// destination, the database records containing the information of what +// connection methods are inside the destination need to be updated with real +// IDs for any newly created connection methods. These real IDs are held in the +// temporary array iUpdatedConnMethods until successful commit to database. +// This method is used to find out those real IDs before that. +// --------------------------------------------------------------------------- +// +void CCmmCache::TranslateTemporaryId( const TUint32& aTemporaryId, TUint32& aRealId ) const + { + OstTraceFunctionEntry0( CCMMCACHE_TRANSLATETEMPORARYID_ENTRY ); + + aRealId = 0; + + for ( TInt i = 0; i < iUpdatedConnMethods.Count(); i++ ) + { + if ( iUpdatedConnMethods[i].iTemporaryId == aTemporaryId ) + { + aRealId = iUpdatedConnMethods[i].iRealId; + break; + } + } + if ( !aRealId ) + { + ASSERT( 0 ); + } + OstTraceFunctionExit0( CCMMCACHE_TRANSLATETEMPORARYID_EXIT ); + } + +// --------------------------------------------------------------------------- +// Check if the given connection method can have all references removed and +// made into an uncategorized connection method. +// --------------------------------------------------------------------------- +// +void CCmmCache::CheckIfConnMethodReferencesCanBeRemovedL( + const CCmmConnMethodInstance& aConnMethodInstance ) + { + TUint32 connMethodId( aConnMethodInstance.GetId() ); + + // Check that connection method exists in database. + if ( !iInstanceMapping->ValidConnMethodId( connMethodId ) ) + { + User::Leave( KErrNotFound ); + } + + // Can't remove an embedded destination this way. + if ( aConnMethodInstance.IsEmbeddedDestination() ) + { + User::Leave( KErrArgument ); + } + + //TODO, what if protected? + + // Iterate all destinations in database and check if possible reference can + // be removed. + RArray dbDestinations; + CleanupClosePushL( dbDestinations ); + iInstanceMapping->GetDestinationsL( dbDestinations ); + for ( TInt i = 0; i < dbDestinations.Count(); i++ ) + { + if ( iInstanceMapping->ConnMethodInDestinationButLocked( connMethodId, dbDestinations[i] ) ) + { + User::Leave( KErrLocked ); + } + } + CleanupStack::PopAndDestroy( &dbDestinations ); + + // Can't remove a connection method that is in use. + if ( CheckIfCmConnected( connMethodId ) ) + { + User::Leave( KErrInUse ); + } + } + +// --------------------------------------------------------------------------- +// Check if the given connection method can be deleted. +// --------------------------------------------------------------------------- +// +void CCmmCache::CheckIfConnMethodCanBeDeletedL( + const CCmmConnMethodInstance& aConnMethodInstance ) + { + TUint32 connMethodId( aConnMethodInstance.GetId() ); + + // Find connection method from cache. + TInt index = FindConnMethodFromCache( connMethodId ); + if ( index == KErrNotFound ) + { + User::Leave( KErrBadHandle ); + } + + // Check connection method status at cache side. + switch ( iConnMethodArray[index]->GetStatus() ) + { + case ECmmConnMethodStatusNotSaved: + { + // Connection method is not in database, nothing to delete. + User::Leave( KErrNotFound ); + } + break; + case ECmmConnMethodStatusValid: + // Proceed. + break; + case ECmmConnMethodStatusToBeDeleted: + // Connection method has already been deleted. + return; + case ECmmConnMethodStatusChanged: + default: + { + ASSERT( 0 ); // Error, illegal status. + User::Leave( KErrCorrupt ); + } + break; + } + + // Removing all references is part of deleting a connection method. Check + // if can do that. + CheckIfConnMethodReferencesCanBeRemovedL( aConnMethodInstance ); + + // Check that no virtual IAP points to this connection method. + if ( iInstanceMapping->ConnMethodPointedToByVirtualIap( connMethodId ) ) + { + User::Leave( KErrLocked ); + } + } + +// --------------------------------------------------------------------------- +// Check if the given destination can be deleted. +// --------------------------------------------------------------------------- +// +void CCmmCache::CheckIfDestinationCanBeDeletedL( + const CCmmDestinationInstance& aDestinationInstance ) + { + TUint32 destinationId( aDestinationInstance.GetId() ); + + // Find destination from cache. + TInt index = FindDestinationFromCache( destinationId ); + if ( index == KErrNotFound ) + { + User::Leave( KErrBadHandle ); + } + + // Check destination status in cache. + switch ( iDestinationArray[index]->GetStatus() ) + { + case ECmmDestinationStatusNotSaved: + { + User::Leave( KErrNotFound ); + } + break; + case ECmmDestinationStatusValid: + // Proceed. + break; + case ECmmDestinationStatusToBeDeleted: + // Destination has already been deleted. + return; + case ECmmDestinationStatusChanged: + default: + { + ASSERT( 0 ); // Error, illegal status. + User::Leave( KErrCorrupt ); + } + break; + } + + // Check destination exists in database. + if ( !iInstanceMapping->ValidDestinationId( destinationId ) ) + { + User::Leave( KErrNotFound ); + } + + // Check if any virtual IAP points to this destination. Don't check session side. + if ( iInstanceMapping->DestinationPointedToByVirtualIap( destinationId ) ) + { + User::Leave( KErrLocked ); + } + + // Check if any of the connection methods in this destination are currently in use. + if ( DestinationConnectedL( destinationId ) ) + { + User::Leave( KErrInUse ); + } + } + +// --------------------------------------------------------------------------- +// Return the requested table ID. +// --------------------------------------------------------------------------- +// +CommsDat::TMDBElementId CCmmCache::TableId( TCmmDbRecords aRecord ) + { + return iCmManagerImpl->TableId( aRecord ); + } + +// --------------------------------------------------------------------------- +// TODO +// --------------------------------------------------------------------------- +// +void CCmmCache::DeleteDestinationForcedL( CCmmDestinationInstance& aDestinationInstance ) //TODO, OST + { + //TODO + if ( !DestinationConnectedL( 0, &aDestinationInstance ) ) + //if ( !DestinationConnectedL( aDestinationInstance.GetId() ) ) //TODO + { + DeleteDestinationL( aDestinationInstance, ETrue ); + } + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmconnmethodinstance.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmconnmethodinstance.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,584 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Session side object representing a connection method. +* +*/ + + +#include +#include +#include + +#include "cmmconnmethodinstance.h" +#include "cmmsession.h" +#include "cmmcache.h" +#include "cmmconnmethodstruct.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmconnmethodinstanceTraces.h" +#endif + + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmConnMethodInstance* CCmmConnMethodInstance::NewL( CCmmSession* aCmmSession, CCmmCache* aCache ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_NEWL_ENTRY ); + + CCmmConnMethodInstance* self = CCmmConnMethodInstance::NewLC( aCmmSession, aCache ); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_NEWL_EXIT ); + + return self; + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmConnMethodInstance* CCmmConnMethodInstance::NewLC( CCmmSession* aCmmSession, CCmmCache* aCache ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_NEWLC_ENTRY ); + + CCmmConnMethodInstance* self = new( ELeave ) CCmmConnMethodInstance( aCmmSession, aCache ); + CleanupClosePushL( *self ); + self->ConstructL(); + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_NEWLC_EXIT ); + + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CCmmConnMethodInstance::~CCmmConnMethodInstance() + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_CCMMCONNMETHODINSTANCE_ENTRY ); + + // Tell cache this handle is beeing closed. Cache will update own bookkeeping. + if ( iCache ) + { + iCache->CloseConnMethod( *this ); + } + + delete iPluginDataInstance; + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_CCMMCONNMETHODINSTANCE_EXIT ); + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CCmmConnMethodInstance::CCmmConnMethodInstance( CCmmSession* aCmmSession, CCmmCache* aCache ) + : + iCmmSession( aCmmSession ), + iCache( aCache ) + { + OstTraceFunctionEntry0( DUP1_CCMMCONNMETHODINSTANCE_CCMMCONNMETHODINSTANCE_ENTRY ); + + iPlugin = NULL; + iPluginDataInstance = NULL; + iConnMethodId = 0; + iBearerType = 0; + iStatus = ECmmConnMethodStatusChanged; + iHandle = 0; + + OstTraceFunctionExit0( DUP1_CCMMCONNMETHODINSTANCE_CCMMCONNMETHODINSTANCE_EXIT ); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::ConstructL() + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_CONSTRUCTL_ENTRY ); + + iPluginDataInstance = CCmClientPluginInstance::NewL(); + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Set the plugin base pointer. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::SetPlugin( CCmPluginBaseEng* aPlugin ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETPLUGIN_ENTRY ); + + iPlugin = aPlugin; + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETPLUGIN_EXIT ); + } + +// --------------------------------------------------------------------------- +// Get the plugin base pointer. +// --------------------------------------------------------------------------- +// +CCmPluginBaseEng* CCmmConnMethodInstance::GetPlugin() const + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETPLUGIN_ENTRY ); + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_GETPLUGIN_EXIT ); + return iPlugin; + } + +// --------------------------------------------------------------------------- +// Get pointer to the plugin data container. +// --------------------------------------------------------------------------- +// +CCmClientPluginInstance* CCmmConnMethodInstance::GetPluginDataInstance() const + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETPLUGINDATAINSTANCE_ENTRY ); + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_GETPLUGINDATAINSTANCE_EXIT ); + return iPluginDataInstance; + } + +// --------------------------------------------------------------------------- +// Get connection method ID. +// --------------------------------------------------------------------------- +// +TUint32 CCmmConnMethodInstance::GetId() const + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETID_ENTRY ); + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_GETID_EXIT ); + + return iConnMethodId; + } + +// --------------------------------------------------------------------------- +// Set connection method ID. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::SetId( const TUint32& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETID_ENTRY ); + + iConnMethodId = aConnMethodId; + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETID_EXIT ); + } + +// --------------------------------------------------------------------------- +// Return bearer type. +// --------------------------------------------------------------------------- +// +TUint32 CCmmConnMethodInstance::GetBearerType() const + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETBEARERTYPE_ENTRY ); + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_GETBEARERTYPE_EXIT ); + + return iBearerType; + } + +// --------------------------------------------------------------------------- +// Get bearer type. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::SetBearerType( const TUint32& aBearerType ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETBEARERTYPE_ENTRY ); + + iBearerType = aBearerType; + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETBEARERTYPE_EXIT ); + } + +// --------------------------------------------------------------------------- +// Get handle ID. +// --------------------------------------------------------------------------- +// +TInt CCmmConnMethodInstance::GetHandle() const + { + return iHandle; + } + +// --------------------------------------------------------------------------- +// Set handle ID. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::SetHandle( const TInt& aHandle ) + { + iHandle = aHandle; + } + +// --------------------------------------------------------------------------- +// Return ETrue, if this connection method represents an embedded destination. +// --------------------------------------------------------------------------- +// +TBool CCmmConnMethodInstance::IsEmbeddedDestination() const + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_ISEMBEDDEDDESTINATION_ENTRY ); + + TBool result( EFalse ); + if ( iBearerType == KUidEmbeddedDestination ) + { + result = ETrue; + } + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_ISEMBEDDEDDESTINATION_EXIT ); + return result; + } + +// --------------------------------------------------------------------------- +// Save the contents of this connection method into database. The attribute +// aTemporaryHandle must be true if this connection instance was temporarily +// created for the duration of this update operation only. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::UpdateL( TBool aTemporaryHandle ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_UPDATEL_ENTRY ); + + if ( iCache ) + { + iCache->UpdateConnMethodL( *this, aTemporaryHandle ); + } + else + { + User::Leave( KErrBadHandle ); + } + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_UPDATEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Copy the relevant connection method information from cache side object. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::CopyDataL( CCmmConnMethodStruct* aConnMethodStruct ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_COPYDATAL_ENTRY ); + + if ( !aConnMethodStruct ) + { + User::Leave( KErrCorrupt ); + } + + iConnMethodId = aConnMethodStruct->GetId(); + iBearerType = aConnMethodStruct->GetBearerType(); + + iPlugin = aConnMethodStruct->GetPlugin(); + if ( !iPlugin ) + { + User::Leave( KErrCorrupt ); + } + + iPlugin->GetPluginDataL( iPluginDataInstance ); //TODO, check deletes for iPluginDataInstance + aConnMethodStruct->IncrementReferenceCounter(); + + switch ( aConnMethodStruct->GetStatus() ) + { + case ECmmConnMethodStatusNotSaved: + case ECmmConnMethodStatusToBeDeleted: + { + iStatus = ECmmConnMethodStatusChanged; + } + break; + case ECmmConnMethodStatusValid: + { + iStatus = ECmmConnMethodStatusValid; + } + break; + case ECmmConnMethodStatusChanged: + default: + User::Leave( KErrCorrupt ); // Error, invalid status. + break; + } + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_COPYDATAL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Refresh the relevant connection method data in cache side object to be in +// synch with database and copy that data back to this session side connection +// method object. +// --------------------------------------------------------------------------- +// +//TODO, cleanup +/* +void CCmmConnMethodInstance::RefreshDataL( CCmmConnMethodStruct* aConnMethodStruct ) //TODO, remove + { + + //TODO + //if ( !aConnMethodStruct ) + //{ + //User::Leave( KErrCorrupt ); + //} + if ( !iPlugin ) + { + User::Leave( KErrCorrupt ); + } + + switch ( aConnMethodStruct->GetStatus() ) + { + case ECmmConnMethodStatusValid: + case ECmmConnMethodStatusToBeDeleted: + { + //TODO, add record status check later and only call Reload() if necessary. TCmmRecordStatus + //if ( !aConnMethodStruct->UpToDate() ) + // { + iPlugin->ReLoadL(); + // } + iPlugin->GetPluginDataL( iPluginDataInstance ); + } + break; + case ECmmConnMethodStatusNotSaved: // This is checked before. + case ECmmConnMethodStatusChanged: + default: + User::Leave( KErrCorrupt ); // Error, invalid status. + break; + } + + // Internal state need to be set to the same state as after a successfull update. + UpdateSuccessful(); + + }*/ + +// --------------------------------------------------------------------------- +// CCmmConnMethodInstance::GetIntAttributeL +// --------------------------------------------------------------------------- +// +TUint32 CCmmConnMethodInstance::GetIntAttributeL( const TUint32& aAttribute ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETINTATTRIBUTEL_ENTRY ); + + __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); + + return iPlugin->GetIntAttributeL( aAttribute, iPluginDataInstance ); + } + +// --------------------------------------------------------------------------- +// CCmmConnMethodInstance::GetBoolAttributeL +// --------------------------------------------------------------------------- +// +TBool CCmmConnMethodInstance::GetBoolAttributeL( const TUint32& aAttribute ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETBOOLATTRIBUTEL_ENTRY ); + + __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); + + TBool retVal( EFalse ); + + switch ( aAttribute ) + { + case CMManager::ECmConnected: + { + if ( GetId() > 0 ) + { + if ( iCache ) + { + retVal = iCache->CheckIfCmConnected( GetId() ); + } + } + } + break; + case CMManager::ECmIsLinked: + { + //TODO + } + break; + default: + { + retVal = iPlugin->GetBoolAttributeL( aAttribute, iPluginDataInstance ); + } + } + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_GETBOOLATTRIBUTEL_EXIT ); + return retVal; + } + +// --------------------------------------------------------------------------- +// CCmmConnMethodInstance::GetStringAttributeL +// --------------------------------------------------------------------------- +// +HBufC* CCmmConnMethodInstance::GetStringAttributeL( const TUint32& aAttribute ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETSTRINGATTRIBUTEL_ENTRY ); + + __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); + + return iPlugin->GetStringAttributeL( aAttribute, iPluginDataInstance ); + } + +// --------------------------------------------------------------------------- +// CCmmConnMethodInstance::GetString8AttributeL +// --------------------------------------------------------------------------- +// +HBufC8* CCmmConnMethodInstance::GetString8AttributeL( const TUint32& aAttribute ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETSTRING8ATTRIBUTEL_ENTRY ); + + __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); + + return iPlugin->GetString8AttributeL( aAttribute, iPluginDataInstance ); + } + +// --------------------------------------------------------------------------- +// CCmmConnMethodInstance::SetIntAttributeL +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::SetIntAttributeL( + const TUint32& aAttribute, + const TUint32& aValue ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETINTATTRIBUTEL_ENTRY ); + + __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); + + iPlugin->SetIntAttributeL( aAttribute, aValue, iPluginDataInstance ); + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETINTATTRIBUTEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmmConnMethodInstance::SetBoolAttributeL +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::SetBoolAttributeL( + const TUint32& aAttribute, + const TBool& aValue ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETBOOLATTRIBUTEL_ENTRY ); + + __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); + + iPlugin->SetBoolAttributeL( aAttribute, aValue, iPluginDataInstance ); + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETBOOLATTRIBUTEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmmConnMethodInstance::SetStringAttributeL +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::SetStringAttributeL( + const TUint32& aAttribute, + const TDesC16& aValue ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETSTRINGATTRIBUTEL_ENTRY ); + + __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); + + iPlugin->SetStringAttributeL( aAttribute, aValue, iPluginDataInstance ); + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETSTRINGATTRIBUTEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// CCmmConnMethodInstance::SetString8AttributeL +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::SetString8AttributeL( + const TUint32& aAttribute, + const TDesC8& aValue ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETSTRING8ATTRIBUTEL_ENTRY ); + + __ASSERT_DEBUG( iPlugin != NULL, User::Leave( KErrNotFound ) ); + + iPlugin->SetString8AttributeL( aAttribute, aValue, iPluginDataInstance ); + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETSTRING8ATTRIBUTEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Gets the current status of this connection method instance. +// --------------------------------------------------------------------------- +// +TCmmConnMethodStatus CCmmConnMethodInstance::GetStatus() const + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_GETSTATUS_ENTRY ); + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_GETSTATUS_EXIT ); + return iStatus; + } + +// --------------------------------------------------------------------------- +// Sets a new status value. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::SetStatus( const TCmmConnMethodStatus& aStatus ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETSTATUS_ENTRY ); + + iStatus = aStatus; + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETSTATUS_EXIT ); + } + +// --------------------------------------------------------------------------- +// Called after this connection method has been updated and database +// transaction has completed successfully. Sets the internal state of this +// connection method instance to reflect the new valid state. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::UpdateSuccessful() + { + SetStatus( ECmmConnMethodStatusValid ); + } + +// --------------------------------------------------------------------------- +// Called after this connection method has been deleted and database +// transaction has completed successfully. Sets the internal state of this +// connection method structure to reflect the new deleted state. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::DeleteSuccessful( const TUint32& aNewSecondaryId ) + { + SetStatus( ECmmConnMethodStatusChanged ); + SetId( aNewSecondaryId ); + } + +// --------------------------------------------------------------------------- +// After update/delete to database, refresh temporary ID to real ID if +// necessary and refresh status information for any related handles for +// all client sessions. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::RefreshHandlesForAllSessions( + const TCmmIdStruct& aIdStruct ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_REFRESHHANDLESFORALLSESSIONS_ENTRY ); + + if ( iCmmSession ) + { + iCmmSession->RefreshHandlesForAllSessions( aIdStruct ); + } + + OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_REFRESHHANDLESFORALLSESSIONS_EXIT ); + } + +// --------------------------------------------------------------------------- +// Removes a connection method from any open destination handle in the same +// session. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodInstance::RemoveConnMethodFromSessionDestinationHandles( + const TUint32& aConnMethodId ) + { + if ( iCmmSession ) + { + iCmmSession->RemoveConnMethodFromDestinationHandles( aConnMethodId ); + } + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmconnmethoditem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmconnmethoditem.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 representing any kind on connection method, including embedded +* destination. Used for priority based ordering of connection methods inside +* destinations. +* +*/ + + +#include "cmmconnmethoditem.h" + + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +TCmmConnMethodItem::TCmmConnMethodItem() + { + iId = 0; + iBearerType = 0; + iBearerPriority = 0; + iPriority = 0; + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +TCmmConnMethodItem::TCmmConnMethodItem( + TUint32 aId, + TUint32 aBearerType, + TUint aBearerPriority, + TUint aPriority ) + : + iId( aId ), + iBearerType( aBearerType ), + iBearerPriority( aBearerPriority ), + iPriority( aPriority ) + { + } + +// --------------------------------------------------------------------------- +// A comparison function. Uses priority since items are in priority order. +// --------------------------------------------------------------------------- +// +TInt TCmmConnMethodItem::Compare( + const TCmmConnMethodItem& aFirst, + const TCmmConnMethodItem& aSecond ) + { + // Zero if match, negative if first is smaller, positive otherwise. + return ( TInt )aFirst.iPriority - ( TInt )aSecond.iPriority; + } + +// --------------------------------------------------------------------------- +// A comparison function to find a specific item by ID. +// (Items are not sorted by ID in the array.) +// --------------------------------------------------------------------------- +// +TBool TCmmConnMethodItem::FindCompare( + const TUint32* aKey, + const TCmmConnMethodItem& aEntry ) + { + // True if match, false otherwise. + TBool result( EFalse ); + if ( *aKey == aEntry.iId ) + { + result = ETrue; + } + return result; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmconnmethodstruct.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmconnmethodstruct.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,315 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Cache side object representing a connection method. +* +*/ + + +#include +#include + +#include "cmmconnmethodstruct.h" +#include "cmmconnmethodinstance.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmconnmethodstructTraces.h" +#endif + + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmConnMethodStruct* CCmmConnMethodStruct::NewL( + const TUint32& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODSTRUCT_NEWL_ENTRY ); + + CCmmConnMethodStruct* self = CCmmConnMethodStruct::NewLC( aConnMethodId ); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMMCONNMETHODSTRUCT_NEWL_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmConnMethodStruct* CCmmConnMethodStruct::NewLC( + const TUint32& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODSTRUCT_NEWLC_ENTRY ); + + CCmmConnMethodStruct* self = new( ELeave ) CCmmConnMethodStruct( aConnMethodId ); + CleanupStack::PushL( self ); + self->ConstructL(); + + OstTraceFunctionExit0( CCMMCONNMETHODSTRUCT_NEWLC_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CCmmConnMethodStruct::~CCmmConnMethodStruct() + { + OstTraceFunctionEntry0( CCMMCONNMETHODSTRUCT_CCMMCONNMETHODSTRUCT_ENTRY ); + + if ( iConnMethodPlugin ) + { + delete iConnMethodPlugin; + iConnMethodPlugin = NULL; + } + + OstTraceFunctionExit0( CCMMCONNMETHODSTRUCT_CCMMCONNMETHODSTRUCT_EXIT ); + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CCmmConnMethodStruct::CCmmConnMethodStruct( TUint32 aConnMethodId ) + : + iConnMethodId( aConnMethodId ) + { + OstTraceFunctionEntry0( DUP1_CCMMCONNMETHODSTRUCT_CCMMCONNMETHODSTRUCT_ENTRY ); + + iConnMethodPlugin = NULL; + iBearerType = 0; + iStatus = ECmmConnMethodStatusNotSaved; + iReferenceCounter = 0; + + OstTraceFunctionExit0( DUP1_CCMMCONNMETHODSTRUCT_CCMMCONNMETHODSTRUCT_EXIT ); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodStruct::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// Return the reference count. +// --------------------------------------------------------------------------- +// +TInt CCmmConnMethodStruct::GetReferenceCounter() + { + return iReferenceCounter; + } + +// --------------------------------------------------------------------------- +// Increase the reference counter by one. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodStruct::IncrementReferenceCounter() + { + OstTraceFunctionEntry0( CCMMCONNMETHODSTRUCT_INCREMENTREFERENCECOUNTER_ENTRY ); + iReferenceCounter++; + OstTraceFunctionExit0( CCMMCONNMETHODSTRUCT_INCREMENTREFERENCECOUNTER_EXIT ); + } + +// --------------------------------------------------------------------------- +// Return the connection method ID. +// --------------------------------------------------------------------------- +// +TUint32 CCmmConnMethodStruct::GetId() const + { + return iConnMethodId; + } + +// --------------------------------------------------------------------------- +// Set the connection method ID. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodStruct::SetId( const TUint32& aConnMethodId ) + { + iConnMethodId = aConnMethodId; + } + +// --------------------------------------------------------------------------- +// Return bearer type. +// --------------------------------------------------------------------------- +// +TUint32 CCmmConnMethodStruct::GetBearerType() const + { + return iBearerType; + } + +// --------------------------------------------------------------------------- +// Gets the current status of this connection method struct. +// --------------------------------------------------------------------------- +// +TCmmConnMethodStatus CCmmConnMethodStruct::GetStatus() const + { + return iStatus; + } + + +// --------------------------------------------------------------------------- +// Sets a new status value. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodStruct::SetStatus( const TCmmConnMethodStatus& aStatus ) + { + iStatus = aStatus; + } + +// --------------------------------------------------------------------------- +// TODO +// +// Refresh the relevant connection method data in cache side object to be in +// synch with database and copy that data back to this session side connection +// method object. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodStruct::RefreshConnMethodInstanceL( + CCmmConnMethodInstance& aConnMethodInstance ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODSTRUCT_REFRESHCONNMETHODINSTANCEL_ENTRY ); + + if ( !iConnMethodPlugin ) + { + User::Leave( KErrCorrupt ); + } + + switch ( iStatus ) + { + case ECmmConnMethodStatusValid: + case ECmmConnMethodStatusToBeDeleted: + { + //TODO, add record status check later and only call Reload() if necessary. TCmmRecordStatus + //if ( !aConnMethodStruct->UpToDate() ) + // { + iConnMethodPlugin->ReLoadL(); + // } + iConnMethodPlugin->GetPluginDataL( aConnMethodInstance.GetPluginDataInstance() ); + } + break; + case ECmmConnMethodStatusNotSaved: // This is checked before. + case ECmmConnMethodStatusChanged: + default: + User::Leave( KErrCorrupt ); // Error, invalid status. + break; + } + + // Internal state need to be set to the same state as after a successfull update. + aConnMethodInstance.UpdateSuccessful(); + + OstTraceFunctionExit0( CCMMCONNMETHODSTRUCT_REFRESHCONNMETHODINSTANCEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Decrease the reference counter by one. Return the remaining number of +// references. +// --------------------------------------------------------------------------- +// +TInt CCmmConnMethodStruct::SessionInstanceClosed() + { + OstTraceFunctionEntry0( CCMMCONNMETHODSTRUCT_SESSIONINSTANCECLOSED_ENTRY ); + + iReferenceCounter--; + if ( iReferenceCounter < 0 ) + { + ASSERT( 0 ); + iReferenceCounter = 0; + } + + OstTraceFunctionExit0( CCMMCONNMETHODSTRUCT_SESSIONINSTANCECLOSED_EXIT ); + return iReferenceCounter; + } + +// --------------------------------------------------------------------------- +// Set the connection method plugin. Updates status and sets reference +// counter to 1. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodStruct::SetPlugin( + CCmPluginBaseEng* aPlugin, + TUint32 aBearerType, + TCmmConnMethodStatus aStatus ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODSTRUCT_SETPLUGIN_ENTRY ); + + // Only check reference counter, it is incremented by session side instance + // when data is copied into it. + if ( iReferenceCounter != 0 ) + { + ASSERT( 0 ); // Error. + } + + iConnMethodPlugin = aPlugin; + iBearerType = aBearerType; + + switch ( aStatus ) //TODO, add missing status + { + // Fallthrough intended + case ECmmConnMethodStatusNotSaved: + case ECmmConnMethodStatusValid: + iStatus = aStatus; + break; + case ECmmConnMethodStatusChanged: + default: + iStatus = ECmmConnMethodStatusChanged; + ASSERT( 0 ); // Error, invalid status. + break; + } + + OstTraceFunctionExit0( CCMMCONNMETHODSTRUCT_SETPLUGIN_EXIT ); + } + +// --------------------------------------------------------------------------- +// Returns the connection method plugin. +// --------------------------------------------------------------------------- +// +CCmPluginBaseEng* CCmmConnMethodStruct::GetPlugin() + { + return iConnMethodPlugin; + } + +// --------------------------------------------------------------------------- +// Called after this connection method has been deleted and database +// transaction has completed successfully. Sets the internal state of this +// connection method structure to reflect the new deleted state. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodStruct::DeleteSuccessful( const TUint32& aNewSecondaryId ) + { + OstTraceFunctionEntry0( CCMMCONNMETHODSTRUCT_DELETESUCCESSFUL_ENTRY ); + + iConnMethodId = aNewSecondaryId; + iStatus = ( ECmmConnMethodStatusNotSaved ); + + OstTraceFunctionExit0( CCMMCONNMETHODSTRUCT_DELETESUCCESSFUL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Called after this connection method has been updated and database +// transaction has completed successfully. Sets the internal state of this +// connection method structure to reflect the new valid state. +// --------------------------------------------------------------------------- +// +void CCmmConnMethodStruct::UpdateSuccessful() + { + OstTraceFunctionEntry0( CCMMCONNMETHODSTRUCT_UPDATESUCCESSFUL_ENTRY ); + iStatus = ECmmConnMethodStatusValid; + OstTraceFunctionExit0( CCMMCONNMETHODSTRUCT_UPDATESUCCESSFUL_EXIT ); + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmdbchangelistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmdbchangelistener.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,220 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Listens for changes in one CommsDat table through CenRep. +* +*/ + + +#include +#include + +#include "cmmdbchangelistener.h" +#include "cmmlistenermanager.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmdbchangelistenerTraces.h" +#endif + + + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmDbChangeListener* CCmmDbChangeListener::NewL( + CCmmListenerManager* aListenerManager, + TUint32 aTableId ) + { + OstTraceFunctionEntry0( CCMMDBCHANGELISTENER_NEWL_ENTRY ); + + CCmmDbChangeListener* self = CCmmDbChangeListener::NewLC( aListenerManager, aTableId ); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMMDBCHANGELISTENER_NEWL_EXIT ); + + return self; + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmDbChangeListener* CCmmDbChangeListener::NewLC( + CCmmListenerManager* aListenerManager, + TUint32 aTableId ) + { + OstTraceFunctionEntry0( CCMMDBCHANGELISTENER_NEWLC_ENTRY ); + + CCmmDbChangeListener* self = new( ELeave ) CCmmDbChangeListener( aListenerManager, aTableId ); + CleanupStack::PushL( self ); + self->ConstructL(); + + OstTraceFunctionExit0( CCMMDBCHANGELISTENER_NEWLC_EXIT ); + + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// Cancels any active requests. +// --------------------------------------------------------------------------- +// +CCmmDbChangeListener::~CCmmDbChangeListener() + { + OstTraceFunctionEntry0( CCMMDBCHANGELISTENER_CCMMDBCHANGELISTENER_ENTRY ); + + // Cancel outstanding request, if exists + Cancel(); + delete iRepository; + + OstTraceFunctionExit0( CCMMDBCHANGELISTENER_CCMMDBCHANGELISTENER_EXIT ); + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CCmmDbChangeListener::CCmmDbChangeListener( + CCmmListenerManager* aListenerManager, + TUint32 aTableId ) + : + CActive( 0 ), + iListenerManager( aListenerManager ), + iTableId( aTableId ) + { + OstTraceFunctionEntry0( DUP1_CCMMDBCHANGELISTENER_CCMMDBCHANGELISTENER_ENTRY ); + + iRepository = NULL; + iErrorCounter = 0; + + OstTraceFunctionExit0( DUP1_CCMMDBCHANGELISTENER_CCMMDBCHANGELISTENER_EXIT ); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// +void CCmmDbChangeListener::ConstructL() + { + OstTraceFunctionEntry0( CCMMDBCHANGELISTENER_CONSTRUCTL_ENTRY ); + + iRepository = CRepository::NewL( KCDCommsRepositoryId ); + CActiveScheduler::Add( this ); + // Not started yet. + OstTraceFunctionExit0( CCMMDBCHANGELISTENER_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Get the database table ID that this listener is monitoring. +// --------------------------------------------------------------------------- +// +TUint32 CCmmDbChangeListener::GetTableId() + { + OstTraceFunctionEntry0( CCMMDBCHANGELISTENER_GETTABLEID_ENTRY ); + OstTraceFunctionExit0( CCMMDBCHANGELISTENER_GETTABLEID_EXIT ); + + return iTableId; + } + +// --------------------------------------------------------------------------- +// Start the listener if not yet started. +// --------------------------------------------------------------------------- +// +TInt CCmmDbChangeListener::Start() + { + OstTraceFunctionEntry0( CCMMDBCHANGELISTENER_START_ENTRY ); + + TInt err( KErrNone ); + if ( !IsActive() ) + { + err = RequestNotification(); + } + OstTraceFunctionExit0( CCMMDBCHANGELISTENER_START_EXIT ); + + return err; + } + +// --------------------------------------------------------------------------- +// Cancels an outstanding request. +// --------------------------------------------------------------------------- +// +void CCmmDbChangeListener::DoCancel() + { + OstTraceFunctionEntry0( CCMMDBCHANGELISTENER_DOCANCEL_ENTRY ); + + iRepository->NotifyCancel( iTableId, KCDMaskShowRecordType ); + + OstTraceFunctionExit0( CCMMDBCHANGELISTENER_DOCANCEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Handles the asynchronous request completion event. +// --------------------------------------------------------------------------- +// +void CCmmDbChangeListener::RunL() + { + OstTraceFunctionEntry0( CCMMDBCHANGELISTENER_RUNL_ENTRY ); + + // Don't leave, or implement RunError() + if ( iStatus.Int() < KErrNone ) + { + // Error: iStatus.Int() + iErrorCounter++; + if ( iErrorCounter > KCmmCenRepErrorThreshold ) + { + // Too many errors + iListenerManager->DbChangeError( iTableId ); + OstTraceFunctionExit0( CCMMDBCHANGELISTENER_RUNL_EXIT ); + return; + } + } + else + { + iErrorCounter = 0; + } + + TInt err = RequestNotification(); // Start to listen for next change. + + // React to current change notification + iListenerManager->DbChangeDetected( iTableId ); + + if ( err ) + { + iListenerManager->DbChangeError( iTableId ); + } + OstTraceFunctionExit0( DUP1_CCMMDBCHANGELISTENER_RUNL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Initiates an asynchronous request to be notified of any change in the +// monitored database table. +// --------------------------------------------------------------------------- +// +TInt CCmmDbChangeListener::RequestNotification() + { + OstTraceFunctionEntry0( CCMMDBCHANGELISTENER_REQUESTNOTIFICATION_ENTRY ); + + TInt err( KErrNone ); + err = iRepository->NotifyRequest( iTableId, KCDMaskShowRecordType, iStatus ); + if ( !err ) + { + SetActive(); + } + OstTraceFunctionExit0( CCMMDBCHANGELISTENER_REQUESTNOTIFICATION_EXIT ); + + return err; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmdestinationinstance.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmdestinationinstance.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,1683 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Session side object representing a destination. +* +*/ + + +#include +#include +#include + +#include "cmmdestinationinstance.h" +#include "cmmsession.h" +#include "cmmcache.h" +#include "cmmconnmethodinstance.h" +#include "cmmconnmethoditem.h" +#include "cmmanagertextresolver.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmdestinationinstanceTraces.h" +#endif + + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmDestinationInstance* CCmmDestinationInstance::NewL( CCmmSession* aCmmSession, CCmmCache* aCache ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_NEWL_ENTRY ); + + CCmmDestinationInstance* self = CCmmDestinationInstance::NewLC( aCmmSession, aCache ); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_NEWL_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmDestinationInstance* CCmmDestinationInstance::NewLC( CCmmSession* aCmmSession, CCmmCache* aCache ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_NEWLC_ENTRY ); + + CCmmDestinationInstance* self = new( ELeave ) CCmmDestinationInstance( aCmmSession, aCache ); + CleanupClosePushL( *self ); + self->ConstructL(); + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_NEWLC_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CCmmDestinationInstance::~CCmmDestinationInstance() + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_CCMMDESTINATIONINSTANCE_ENTRY ); + + // Tell cache this handle is beeing closed. Cache will update it's own + // bookkeeping accordingly. + if ( iCache ) + { + iCache->CloseDestination( *this ); + } + delete iNetworkRecord; + delete iDestApRecord; + delete iMetadataRecord; + + iConnMethodItemArray.Close(); + iConnMethodsToBeDeleted.Close(); + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_CCMMDESTINATIONINSTANCE_EXIT ); + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CCmmDestinationInstance::CCmmDestinationInstance( + CCmmSession* aCmmSession, + CCmmCache* aCache ) + : + iCmmSession( aCmmSession ), + iCache( aCache ) + { + OstTraceFunctionEntry0( DUP1_CCMMDESTINATIONINSTANCE_CCMMDESTINATIONINSTANCE_ENTRY ); + + iNetworkRecord = NULL; + iDestApRecord = NULL; + iMetadataRecord = NULL; + + iNetworkRecordStatus = ECmmRecordStatusBlank; + iDestApRecordStatus = ECmmRecordStatusBlank; + iMetadataRecordStatus = ECmmRecordStatusBlank; + + iStatus = ECmmDestinationStatusChanged; + iId = 0; + iHandle = 0; + + iProtectionChanged = EFalse; + iLastProtectionLevel = CMManager::EProtLevel0; + iCurrentProtectionLevel = CMManager::EProtLevel0; + + OstTraceFunctionExit0( DUP1_CCMMDESTINATIONINSTANCE_CCMMDESTINATIONINSTANCE_EXIT ); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::ConstructL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_CONSTRUCTL_ENTRY ); + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Set the destination ID. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::SetId( const TUint32& aId ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_SETID_ENTRY ); + + iId = aId; + + // If this is the real ID (not the temporary ID of a new unsaved destination), + // write it also into network record. + if ( aId > KCmmDestIdIntervalMin && aId < KCmmDestIdIntervalMax ) + { + iNetworkRecord->SetRecordId( aId - KCmDefaultDestinationAPTagId ); + iDestApRecord->iRecordTag = aId; + iDestApRecord->iCustomSelectionPolicy = ( aId - KCmDefaultDestinationAPTagId ); + iMetadataRecord->iSNAP = aId; + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_SETID_EXIT ); + } + +// --------------------------------------------------------------------------- +// Get the destination ID. +// --------------------------------------------------------------------------- +// +TUint32 CCmmDestinationInstance::GetId() const + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_GETID_ENTRY ); + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_GETID_EXIT ); + return iId; + } + +// --------------------------------------------------------------------------- +// Set the current status of this destination. +// ECmmDestinationStatusValid: Contents in sync with database. +// ECmmDestinationStatusChanged: Contents differ from database contents. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::SetStatus( const TCmmDestinationStatus& aStatus ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_SETSTATUS_ENTRY ); + + switch ( aStatus ) + { + // Fallthrough intended + case ECmmDestinationStatusValid: + case ECmmDestinationStatusChanged: + iStatus = aStatus; + break; + default: + ASSERT(0); // Error, invalid status. + break; + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_SETSTATUS_EXIT ); + } + +// --------------------------------------------------------------------------- +// Gets the current status of this destination instance. +// --------------------------------------------------------------------------- +// +TCmmDestinationStatus CCmmDestinationInstance::GetStatus() const + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_GETSTATUS_ENTRY ); + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_GETSTATUS_EXIT ); + return iStatus; + } + +// --------------------------------------------------------------------------- +// Get handle ID. +// --------------------------------------------------------------------------- +// +TInt CCmmDestinationInstance::GetHandle() const + { + return iHandle; + } + +// --------------------------------------------------------------------------- +// Set handle ID. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::SetHandle( const TInt& aHandle ) + { + iHandle = aHandle; + } + +// --------------------------------------------------------------------------- +// Set the record status for all records. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::SetStatusForAllRecords( const TCmmRecordStatus& aStatus ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_SETSTATUSFORALLRECORDS_ENTRY ); + + iDestApRecordStatus = aStatus; + iNetworkRecordStatus = aStatus; + iMetadataRecordStatus = aStatus; + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_SETSTATUSFORALLRECORDS_EXIT ); + } + +// --------------------------------------------------------------------------- +// Get the destination element ID. +// --------------------------------------------------------------------------- +// +TUint32 CCmmDestinationInstance::GetElementIdL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_GETELEMENTIDL_ENTRY ); + + RefreshRecordL( ECmmDestNetworkRecord ); + + if ( !iNetworkRecord ) + { + User::Leave( KErrCorrupt ); + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_GETELEMENTIDL_EXIT ); + return iNetworkRecord->ElementId() & KCDMaskShowField; + } + +// --------------------------------------------------------------------------- +// Get the destination access point record's record tag (destination ID). +// --------------------------------------------------------------------------- +// +TUint32 CCmmDestinationInstance::GetRecordTagFromApRecordL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_GETRECORDTAGFROMAPRECORDL_ENTRY ); + + RefreshRecordL( ECmmDestApRecord ); + + if ( !iDestApRecord ) + { + User::Leave( KErrCorrupt ); + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_GETRECORDTAGFROMAPRECORDL_EXIT ); + return iDestApRecord->iRecordTag; + } + +// --------------------------------------------------------------------------- +// Sets a record pointer to the one given as parameter, Ownership is +// transfered. Also deletes the previous pointer and sets the record status +// to 'ECmmRecordStatusLoaded'. +// --------------------------------------------------------------------------- +// +TInt CCmmDestinationInstance::SetRecordPointer( + const TCmmDbRecords& aDestRecord, + CommsDat::CCDRecordBase* aRecordPointer ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_SETRECORDPOINTER_ENTRY ); + + TInt ret( KErrNone ); + switch ( aDestRecord ) + { + case ECmmDestNetworkRecord: + { + delete iNetworkRecord; + iNetworkRecord = static_cast( aRecordPointer ); + iNetworkRecordStatus = ECmmRecordStatusLoaded; + } + break; + case ECmmDestApRecord: + { + delete iDestApRecord; + iDestApRecord = static_cast( aRecordPointer ); + iDestApRecordStatus = ECmmRecordStatusLoaded; + } + break; + case ECmmDestMetadataRecord: + { + delete iMetadataRecord; + iMetadataRecord = static_cast( aRecordPointer ); + iMetadataRecordStatus = ECmmRecordStatusLoaded; + } + break; + default: + { + ret = KErrNotFound; + } + break; + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_SETRECORDPOINTER_EXIT ); + return ret; + } + +// --------------------------------------------------------------------------- +// Gets a reference to the requested record pointer. +// --------------------------------------------------------------------------- +// +TInt CCmmDestinationInstance::GetRecordPointer( + const TCmmDbRecords& aDestRecord, + CommsDat::CCDRecordBase*& aRecordPointer ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_GETRECORDPOINTER_ENTRY ); + + TInt ret( KErrNone ); + aRecordPointer = NULL; + switch ( aDestRecord ) + { + case ECmmDestNetworkRecord: + { + aRecordPointer = static_cast( iNetworkRecord ); + } + break; + case ECmmDestApRecord: + { + aRecordPointer = static_cast( iDestApRecord ); + } + break; + case ECmmDestMetadataRecord: + { + aRecordPointer = static_cast( iMetadataRecord ); + } + break; + default: + { + ASSERT( 0 ); + ret = KErrNotFound; + } + break; + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_GETRECORDPOINTER_EXIT ); + return ret; + } + +// --------------------------------------------------------------------------- +// Save the contents of this destination into database. All connection methods +// including embedded destination, that the client has open handles to, are +// also updated. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::UpdateL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_UPDATEL_ENTRY ); + + if ( AllMandatoryRecordsContainData() ) + { + // Check for metadata conflicts. + if ( ConflictingMetadataFoundL() ) + { + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_UPDATEL_EXIT ); + + User::Leave( KErrAlreadyExists ); + } + + // Check that the destination name is still valid and not in use already. + if ( iCache->DestinationExistsWithNameL( iNetworkRecord->iRecordName.GetL(), iId ) ) + { + OstTraceFunctionExit0( DUP1_CCMMDESTINATIONINSTANCE_UPDATEL_EXIT ); + + User::Leave( KErrAlreadyExists ); + } + + iCache->UpdateDestinationL( *this ); + } + else + { + User::Leave( KErrCorrupt ); + } + + OstTraceFunctionExit0( DUP2_CCMMDESTINATIONINSTANCE_UPDATEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Get the destination name. +// --------------------------------------------------------------------------- +// +TDesC& CCmmDestinationInstance::GetDestinationNameL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_GETDESTINATIONNAMEL_ENTRY ); + + RefreshRecordL( ECmmDestNetworkRecord ); + + if ( !iNetworkRecord ) + { + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_GETDESTINATIONNAMEL_EXIT ); + + User::Leave( KErrCorrupt ); + } + + OstTraceFunctionExit0( DUP1_CCMMDESTINATIONINSTANCE_GETDESTINATIONNAMEL_EXIT ); + return iNetworkRecord->iRecordName.GetL(); + } + +// --------------------------------------------------------------------------- +// Get the localised destination name. +// --------------------------------------------------------------------------- +// +HBufC* CCmmDestinationInstance::GetLocalisedDestinationNameL() + { + RefreshRecordL( ECmmDestNetworkRecord ); + + if ( !iNetworkRecord ) + { + User::Leave( KErrCorrupt ); + } + + TUint32 purpose( 0 ); + GetMetadataL( CMManager::ESnapMetadataPurpose, purpose ); + HBufC* resolvedText( NULL ); + TBool isLocalised( EFalse ); + switch ( purpose ) + { + case CMManager::ESnapPurposeInternet: + { + _LIT( KDestinationTextId, "txt_occ_dblist_internet"); + resolvedText = CCmManagerTextResolver::ResolveTextL( KDestinationTextId ); + isLocalised = ETrue; + } + break; + case CMManager::ESnapPurposeOperator: + { + _LIT( KDestinationTextId, "txt_occ_dblist_operator_services"); + resolvedText = CCmManagerTextResolver::ResolveTextL( KDestinationTextId ); + isLocalised = ETrue; + } + break; + case CMManager::ESnapPurposeIntranet: + { + _LIT( KDestinationTextId, "txt_occ_dblist_intranet"); + resolvedText = CCmManagerTextResolver::ResolveTextL( KDestinationTextId ); + isLocalised = ETrue; + } + break; + default: + break; + } + + // Not Internet, operator or intranet...or something went wrong + if ( !isLocalised || ( isLocalised && !resolvedText ) ) + { + resolvedText = ( iNetworkRecord->iRecordName.GetL() ).AllocL(); + } + + return resolvedText; + } + +// --------------------------------------------------------------------------- +// Set the destination name. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::SetDestinationNameL( const TDesC& aDestinationName ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_SETDESTINATIONNAMEL_ENTRY ); + + //TODO, capability check depending on destination protection level, or if it is internet destination. Internet destination should be protected always? + + // Write action, load all records. + LoadAllRecordsL(); + + iNetworkRecord->iRecordName.SetL( aDestinationName ); + iDestApRecord->iRecordName.SetL( aDestinationName ); + + iNetworkRecordStatus = ECmmRecordStatusModified; + iDestApRecordStatus = ECmmRecordStatusModified; + iStatus = ECmmDestinationStatusChanged; + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_SETDESTINATIONNAMEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Get metadata of specified type. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::GetMetadataL( + const CMManager::TSnapMetadataField& aMetadataField, + TUint32& aMetadata ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_GETMETADATAL_ENTRY ); + + RefreshRecordL( ECmmDestMetadataRecord ); + + if ( !iMetadataRecord ) + { + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_GETMETADATAL_EXIT ); + + User::Leave( KErrCorrupt ); + } + + switch ( aMetadataField ) + { + case CMManager::ESnapMetadataInternet: + aMetadata = ( TUint32 )( iMetadataRecord->iMetadata ) & CMManager::ESnapMetadataInternet; + break; + case CMManager::ESnapMetadataHighlight: + aMetadata = ( TUint32 )( iMetadataRecord->iMetadata ) & CMManager::ESnapMetadataHighlight; + break; + case CMManager::ESnapMetadataHiddenAgent: + aMetadata = ( TUint32 )( iMetadataRecord->iMetadata ) & CMManager::ESnapMetadataHiddenAgent; + break; + case CMManager::ESnapMetadataDestinationIsLocalised: + aMetadata = ( ( TUint32 )( iMetadataRecord->iMetadata ) & CMManager::ESnapMetadataDestinationIsLocalised ) >> 4; + break; + case CMManager::ESnapMetadataPurpose: + aMetadata = ( ( TUint32 )( iMetadataRecord->iMetadata ) & CMManager::ESnapMetadataPurpose ) >> 8; + break; + default: + User::Leave( KErrArgument ); + break; + } + + OstTraceFunctionExit0( DUP1_CCMMDESTINATIONINSTANCE_GETMETADATAL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Set metadata of specified type. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::SetMetadataL( + const CMManager::TSnapMetadataField& aMetadataField, + const TUint32& aMetadata ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_SETMETADATAL_ENTRY ); + + // Write action, load all records. + LoadAllRecordsL(); + + switch ( aMetadataField ) + { + case CMManager::ESnapMetadataInternet: + SetMetadataInternetL( aMetadata ); + break; + case CMManager::ESnapMetadataHighlight: + SetMetadataHighlight( aMetadata ); + break; + case CMManager::ESnapMetadataHiddenAgent: + SetMetadataHiddenAgentL( aMetadata ); + break; + case CMManager::ESnapMetadataDestinationIsLocalised: + SetMetadataLocalizationL( aMetadata ); + break; + case CMManager::ESnapMetadataPurpose: + SetMetadataPurposeL( aMetadata ); + break; + default: + User::Leave( KErrArgument ); + break; + } + + iMetadataRecordStatus = ECmmRecordStatusModified; + iStatus = ECmmDestinationStatusChanged; + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_SETMETADATAL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Get destination protection level. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::GetProtectionL( CMManager::TProtectionLevel& aProtectionLevel ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_GETPROTECTIONL_ENTRY ); + + RefreshRecordL( ECmmDestMetadataRecord ); + + if ( !iMetadataRecord ) + { + User::Leave( KErrCorrupt ); + } + + TUint32 value = ( ( TUint32 )( iMetadataRecord->iMetadata ) & KDestProtectionLevelMask ) >> KBitsToShiftDestProtectionLevel; + switch ( value ) + { + case CMManager::EProtLevel0: + aProtectionLevel = CMManager::EProtLevel0; + break; + case CMManager::EProtLevel1: + aProtectionLevel = CMManager::EProtLevel1; + break; + case CMManager::EProtLevel2: + aProtectionLevel = CMManager::EProtLevel2; + break; + case CMManager::EProtLevel3: + aProtectionLevel = CMManager::EProtLevel3; + break; + default: + User::Leave( KErrCorrupt ); + break; + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_GETPROTECTIONL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Set destination protection level. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::SetProtectionL( + CMManager::TProtectionLevel aProtectionLevel ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_SETPROTECTIONL_ENTRY ); + + // Write action, load all records. + LoadAllRecordsL(); + + //TODO, verify capability check is done (NetworkControl). + + iCurrentProtectionLevel = aProtectionLevel; + if ( !iProtectionChanged ) + { + GetProtectionL( iLastProtectionLevel ); + } + if ( aProtectionLevel == iLastProtectionLevel ) + { + iProtectionChanged = EFalse; + } + else + { + iProtectionChanged = ETrue; + } + + // Read current metadata without protection bits. + TUint32 currentMetadata = + ( ( TUint32 )( iMetadataRecord->iMetadata ) & ( ~KDestProtectionLevelMask ) ); + // Add new protection bits. + iMetadataRecord->iMetadata = + currentMetadata | ( aProtectionLevel << KBitsToShiftDestProtectionLevel ); + + iMetadataRecordStatus = ECmmRecordStatusModified; + iStatus = ECmmDestinationStatusChanged; + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_SETPROTECTIONL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Return true if protection level has been changed. +// --------------------------------------------------------------------------- +// +TBool CCmmDestinationInstance::ProtectionChanged() + { + return iProtectionChanged; + } + +// --------------------------------------------------------------------------- +// Return the previous valid protection level of this connection method +// instance. +// --------------------------------------------------------------------------- +// +CMManager::TProtectionLevel CCmmDestinationInstance::LastProtectionLevel() + { + return iLastProtectionLevel; + } + +// --------------------------------------------------------------------------- +// Return the protection level currently set into this destination instance. +// --------------------------------------------------------------------------- +// +CMManager::TProtectionLevel CCmmDestinationInstance::CurrentProtectionLevel() + { + return iCurrentProtectionLevel; + } + +// --------------------------------------------------------------------------- +// Adds a connection method into this destination. Returns the index (priority) +// in the connection method array where the connection method was added. +// Embedded destinations can not be added with this method, use +// AddEmbeddedDestinationL() instead. +// --------------------------------------------------------------------------- +// +TInt CCmmDestinationInstance::AddConnMethodL( + const CCmmConnMethodInstance& aConnMethodInstance ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_ADDCONNMETHODL_ENTRY ); + + TUint32 connMethodId( aConnMethodInstance.GetId() ); + TUint32 bearerType( aConnMethodInstance.GetBearerType() ); + + // Check that the connection method is not an embedded destination. + if ( bearerType == KUidEmbeddedDestination ) + { + User::Leave( KErrArgument ); + } + + // Check that the connection method is not already inside this destination. + for ( TInt i = 0; i < iConnMethodItemArray.Count(); i++ ) + { + if ( connMethodId == iConnMethodItemArray[i].iId ) + { + User::Leave( KErrAlreadyExists ); + } + } + + // Remove the connection method from delete list, if found there. + for ( TInt i = 0; i < iConnMethodsToBeDeleted.Count(); i++ ) + { + if ( connMethodId == iConnMethodsToBeDeleted[i] ) + { + iConnMethodsToBeDeleted.Remove( i ); + break; + } + } + + // Get the priority value of this connection method according to bearer. + TUint bearerPriority( 0 ); + iCache->BearerPriorityFromIapRecordL( + ( CommsDat::CCDIAPRecord* )aConnMethodInstance.GetPluginDataInstance()->iGenRecordArray[KIapRecordIndex], + bearerPriority ); + TCmmConnMethodItem item( connMethodId, bearerType, bearerPriority, 0 ); + + // Find out the correct position for the connection method inside this + // destination. + TInt index = iConnMethodItemArray.Count(); + for ( TInt i = index - 1; i >= 0; i-- ) + { + if ( iConnMethodItemArray[i].iBearerPriority == + CMManager::KDataMobilitySelectionPolicyPriorityWildCard ) + { + index = i; + continue; + } + if ( iConnMethodItemArray[i].iBearerPriority == bearerPriority ) + { + break; + } + if ( iConnMethodItemArray[i].iBearerPriority > bearerPriority ) + { + index = i; + } + } + // Add the connection method item into this destination at the correct + // position (priority). + iConnMethodItemArray.InsertL( item, index ); + + SetStatus( ECmmDestinationStatusChanged ); + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_ADDCONNMETHODL_EXIT ); + return index; + } + +// --------------------------------------------------------------------------- +// Adds an embedded destination into this destination. Returns the index in +// the connection method array where the connection method was added. +// --------------------------------------------------------------------------- +// +TInt CCmmDestinationInstance::AddEmbeddedDestinationL( + const CCmmDestinationInstance& aEmbeddedDestinationInstance ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_ADDEMBEDDEDDESTINATIONL_ENTRY ); + + TUint32 embeddedDestinationId( aEmbeddedDestinationInstance.GetId() ); + + // Check that not adding itself. + if ( embeddedDestinationId == iId ) + { + User::Leave( KErrArgument ); + } + + // Check that the embedded destination is not already an embedded + // destination in this destination. + if ( HasEmbeddedWithId( embeddedDestinationId ) ) + { + User::Leave( KErrAlreadyExists ); + } + + // A destination can not be added into a destination that is itself an + // embedded destination. + if ( iCache->DestinationIsEmbedded( iId ) ) + { + User::Leave( KErrNotSupported ); + } + + // A destination can not be added into a destination that already has an + // embedded destination. + if ( HasEmbedded() || iCache->DestinationHasEmbedded( iId ) ) + { + User::Leave( KErrNotSupported ); + } + + // A destination that already has an embedded destination can not be added + // into a destination. + if ( aEmbeddedDestinationInstance.HasEmbedded() || + iCache->DestinationHasEmbedded( embeddedDestinationId ) ) + { + User::Leave( KErrNotSupported ); + } + + // Check session side destination instances for all clients. + // - Check that any destination instance does not contain aDestinationId as + // embedded destination. + // - Check that any destination instance for aEmbeddedDestinationId does + // not contain an embedded destination. + if ( iCmmSession->EmbeddedDestinationConflictsFromAllSessions( iId, embeddedDestinationId ) ) + { + User::Leave( KErrAlreadyExists ); + } + + // Add the embedded destination at the end of the connection method item array. + TInt index = iConnMethodItemArray.Count(); + TCmmConnMethodItem item( + embeddedDestinationId, + KUidEmbeddedDestination, + CMManager::KDataMobilitySelectionPolicyPriorityWildCard, + 0 ); + iConnMethodItemArray.AppendL( item ); + + SetStatus( ECmmDestinationStatusChanged ); + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_ADDEMBEDDEDDESTINATIONL_EXIT ); + return index; + } + +// --------------------------------------------------------------------------- +// Delete a connection method that belongs to this destination. If the +// connection method belongs to any other destination, it is only removed from +// this destination and not deleted. Does not call update. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::DeleteConnMethodFromDestinationL( + const CCmmConnMethodInstance& aConnMethodInstance ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_DELETECONNMETHODFROMDESTINATIONL_ENTRY ); + + // Check that the connection method is inside this destination. + TUint32 connMethodId( aConnMethodInstance.GetId() ); + TInt index( KErrNotFound ); + for ( TInt i = 0; i < iConnMethodItemArray.Count(); i++ ) + { + if ( connMethodId == iConnMethodItemArray[i].iId ) + { + index = i; + break; + } + } + if ( index < 0 ) + { + User::Leave( KErrArgument ); + } + + // Check if the connection method removal is blocked by any virtual IAPs. + if ( ConnMethodInDestinationButLocked( connMethodId ) ) + { + User::Leave( KErrLocked ); + } + + // Check if any virtual IAP points to this connection method, thus blocking + // the delete. + if ( iCache->ConnMethodPointedToByVirtualIap( connMethodId ) ) + { + User::Leave( KErrLocked ); + } + + // Check that the connection method is not in use by an active connection. + if ( iCache->CheckIfCmConnected( connMethodId ) ) + { + User::Leave( KErrInUse ); + } + + // This will also remove an embedded destination. + iConnMethodItemArray.Remove( index ); + SetStatus( ECmmDestinationStatusChanged ); + + // If this connection method is an embedded destination, then removing it + // from this destination is enough. The destination is not deleted. + if ( aConnMethodInstance.GetBearerType() != KUidEmbeddedDestination ) + { + // Add connection method to delete list only if not referenced from any + // other destination (in database or in any destination handles for the + // client currently beeing served). + if ( !iCache->ConnMethodInOtherDestination( connMethodId, iId ) && + !iCmmSession->ConnMethodInOtherDestination( connMethodId, iId ) ) + { + if ( iConnMethodsToBeDeleted.Find( connMethodId ) == KErrNotFound ) + { + iConnMethodsToBeDeleted.AppendL( connMethodId ); + } + } + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_DELETECONNMETHODFROMDESTINATIONL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Remove a connection method from this destination. If the second attribute +// aTestIfConnected is false, the test to check if connection method is in use +// is skipped. In this case this should have been already tested by the caller. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::RemoveConnMethodFromDestinationL( + const CCmmConnMethodInstance& aConnMethodInstance, + const TBool& aTestIfConnected ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_REMOVECONNMETHODFROMDESTINATIONL_ENTRY ); + + // Check that the connection method is inside this destination. + TUint32 connMethodId( aConnMethodInstance.GetId() ); + TInt index( KErrNotFound ); + for ( TInt i = 0; i < iConnMethodItemArray.Count(); i++ ) + { + if ( connMethodId == iConnMethodItemArray[i].iId ) + { + index = i; + break; + } + } + if ( index < 0 ) + { + User::Leave( KErrArgument ); + } + + // Check if the connection method removal is blocked by any virtual IAPs. + if ( ConnMethodInDestinationButLocked( connMethodId ) ) + { + User::Leave( KErrLocked ); + } + + if ( aTestIfConnected ) + { + // Check that the connection method is not in use by an active connection. + if ( iCache->CheckIfCmConnected( connMethodId ) ) + { + User::Leave( KErrInUse ); + } + } + + // This will also remove an embedded destination. + iConnMethodItemArray.Remove( index ); + SetStatus( ECmmDestinationStatusChanged ); + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_REMOVECONNMETHODFROMDESTINATIONL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Modifies the priority of a connection method inside this destination. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::ModifyConnMethodPriorityL( + const CCmmConnMethodInstance& aConnMethodInstance, + TUint aIndex ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_MODIFYCONNMETHODPRIORITYL_ENTRY ); + + // Check if the connection method is in this destination. Also store the + // current index of the connection method. + TInt oldIndex( KErrNotFound ); + for ( TInt i = 0; i < iConnMethodItemArray.Count(); i++ ) + { + if ( iConnMethodItemArray[i].iId == aConnMethodInstance.GetId() ) + { + oldIndex = i; + break; + } + } + if ( oldIndex < 0 ) + { + User::Leave( KErrArgument ); + } + + // If connection method is an embedded destination, just return silently. + if ( aConnMethodInstance.GetBearerType() == KUidEmbeddedDestination ) + { + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_MODIFYCONNMETHODPRIORITYL_EXIT ); + return; + } + + //TODO, if CM is virtual IAP that points into DESTINATION, just return silently. + // + // + + // Check index range. + if ( aIndex >= iConnMethodItemArray.Count() ) + { + User::Leave( KErrArgument ); + } + + // If the given index points to any wildcard priority connection method, + // adjust it so it points to the last priority position. + TUint numberOfConnMethodsWithPriority( NumberOfConnMethodsWithPriority() ); + if ( aIndex >= numberOfConnMethodsWithPriority ) + { + if ( numberOfConnMethodsWithPriority == 0 ) + { + // Can't be 0, since aConnMethodInstance is not a wildcard IAP and + // is in the array. + ASSERT( 0 ); + User::Leave( KErrCorrupt ); + } + aIndex = numberOfConnMethodsWithPriority--; + } + + // Check if the priority is changing from current. + if ( oldIndex == aIndex ) + { + OstTraceFunctionExit0( DUP1_CCMMDESTINATIONINSTANCE_MODIFYCONNMETHODPRIORITYL_EXIT ); + return; + } + + // Change the location of the connection method to reflect the new priority. + TCmmConnMethodItem item = iConnMethodItemArray[oldIndex]; + iConnMethodItemArray.Remove( oldIndex ); + iConnMethodItemArray.InsertL( item, ( TInt )aIndex ); + + SetStatus( ECmmDestinationStatusChanged ); + + OstTraceFunctionExit0( DUP2_CCMMDESTINATIONINSTANCE_MODIFYCONNMETHODPRIORITYL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Finds a connection method instance that belongs to the same session and +// matches the provided ID. Return NULL if no match is found. +// --------------------------------------------------------------------------- +// +CCmmConnMethodInstance* CCmmDestinationInstance::FindConnMethodInstanceFromSessionById( + const TUint32& aConnMethodId ) const + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_FINDCONNMETHODINSTANCEFROMSESSIONBYID_ENTRY ); + + CCmmConnMethodInstance* connMethodInstance = iCmmSession-> + FindConnMethodInstanceById( aConnMethodId ); + + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_FINDCONNMETHODINSTANCEFROMSESSIONBYID_EXIT ); + return connMethodInstance; + } + +// --------------------------------------------------------------------------- +// Finds a destination instance that belongs to the same session and matches +// the provided ID. Return NULL if no match is found. +// --------------------------------------------------------------------------- +// +CCmmDestinationInstance* CCmmDestinationInstance::FindDestinationInstanceFromSessionById( + const TUint32& aDestinationId ) const + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_FINDDESTINATIONINSTANCEFROMSESSIONBYID_ENTRY ); + + CCmmDestinationInstance* destInstance = + iCmmSession->FindDestinationInstanceById( aDestinationId ); + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_FINDDESTINATIONINSTANCEFROMSESSIONBYID_EXIT ); + return destInstance; + } + +// --------------------------------------------------------------------------- +// Check from all open destination handles in the same session if the given +// connection method is inside any of them. The given destination is skipped. +// --------------------------------------------------------------------------- +// +TBool CCmmDestinationInstance::ConnMethodInOtherDestinationInSession( + const TUint32& aConnMethodId, + const TUint32& aDestinationId ) const + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_CONNMETHODINOTHERDESTINATIONINSESSION_ENTRY ); + + TBool inOtherSession = iCmmSession-> + ConnMethodInOtherDestination( aConnMethodId, aDestinationId ); + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_CONNMETHODINOTHERDESTINATIONINSESSION_EXIT ); + return inOtherSession; + } + +// --------------------------------------------------------------------------- +// Check if the given connection method is in this destination. Include +// embedded destinations. +// --------------------------------------------------------------------------- +// +TBool CCmmDestinationInstance::ValidConnMethodIdInDestinationIncludeEmbedded( const TUint32& aConnMethodId ) const + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_VALIDCONNMETHODIDINDESTINATIONINCLUDEEMBEDDED_ENTRY ); + + TBool validity( EFalse ); + if ( aConnMethodId > 0 ) + { + for ( TInt i = 0; i < iConnMethodItemArray.Count(); i++ ) + { + if ( iConnMethodItemArray[i].iId == aConnMethodId ) + { + validity = ETrue; + break; + } + } + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_VALIDCONNMETHODIDINDESTINATIONINCLUDEEMBEDDED_EXIT ); + return validity; + } + +// --------------------------------------------------------------------------- +// Check if the given connection method is inside this destination and if it +// is in a 'locked' status. A locked connection method can't be deleted nor +// removed from the destination. A connection method becomes locked if it is +// the only remaining connection method in a destination and a virtual IAP +// points into that destination. +// --------------------------------------------------------------------------- +// +TBool CCmmDestinationInstance::ConnMethodInDestinationButLocked( + const TUint32& aConnMethodId ) const + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_CONNMETHODINDESTINATIONBUTLOCKED_ENTRY ); + + TBool result( EFalse ); + if ( iConnMethodItemArray.Count() == 1 ) + { + if ( iConnMethodItemArray[0].iId == aConnMethodId ) + { + if ( iCache->DestinationPointedToByVirtualIap( iId ) ) + { + result = ETrue; + } + } + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_CONNMETHODINDESTINATIONBUTLOCKED_EXIT ); + return result; + } + +// --------------------------------------------------------------------------- +// Counts how many connection methods that require priority information are +// currently in this destination. This excludes any virtual IAPs that point to +// a destination or any embedded destinations from the count. Assumes the +// connection method array is in order so all wildcard priority IAPs are at the +// end of the list. +// --------------------------------------------------------------------------- +// +TUint CCmmDestinationInstance::NumberOfConnMethodsWithPriority() const + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_NUMBEROFCONNMETHODSWITHPRIORITY_ENTRY ); + + TUint count( iConnMethodItemArray.Count() ); + + for ( TUint i = 0; i < iConnMethodItemArray.Count(); i++ ) + { + //TODO, add virtual IAP pointing to SNAP check. + if ( iConnMethodItemArray[i].iBearerType == KUidEmbeddedDestination ) + { + count = i; + break; + } + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_NUMBEROFCONNMETHODSWITHPRIORITY_EXIT ); + return count; + } + +// --------------------------------------------------------------------------- +// Check if this destination has an embedded destination. Checks the current +// (possibly unsaved) status of this destination handle, not the current status +// in database. +// --------------------------------------------------------------------------- +// +TBool CCmmDestinationInstance::HasEmbedded() const + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_HASEMBEDDED_ENTRY ); + + TBool result( EFalse ); + + // If there is an embedded destination, it will be at the very last + // position in the connection method item array. + TInt index = iConnMethodItemArray.Count() - 1; + if ( index >= 0 ) + { + if ( iConnMethodItemArray[index].iBearerType == KUidEmbeddedDestination ) + { + result = ETrue; + } + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_HASEMBEDDED_EXIT ); + return result; + } + +// --------------------------------------------------------------------------- +// Check if this destination has an embedded destination with the specified ID. +// Checks the current (possibly unsaved) status of this destination handle, not +// the current status in database. +// --------------------------------------------------------------------------- +// +TBool CCmmDestinationInstance::HasEmbeddedWithId( const TUint32& aDestinationId ) const + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_HASEMBEDDEDWITHID_ENTRY ); + + TBool result( EFalse ); + + // If there is an embedded destination, it will be at the very last + // position in the connection method item array. + TInt index = iConnMethodItemArray.Count() - 1; + if ( index >= 0 ) + { + // No need to check bearer, since ID will not match anyway if the last + // item is not an embedded destination. + if ( iConnMethodItemArray[index].iId == aDestinationId ) + { + result = ETrue; + } + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_HASEMBEDDEDWITHID_EXIT ); + return result; + } + +// --------------------------------------------------------------------------- +// After update/delete to database, refresh temporary ID to real ID if +// necessary and refresh status information for any related handles for +// all client sessions. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::RefreshHandlesForAllSessions( const TCmmIdStruct& aIdStruct ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_REFRESHHANDLESFORALLSESSIONS_ENTRY ); + + iCmmSession->RefreshHandlesForAllSessions( aIdStruct ); + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_REFRESHHANDLESFORALLSESSIONS_EXIT ); + } + +// --------------------------------------------------------------------------- +// If the destination contains a connection method with matching temporary ID, +// updates the ID to real ID. This is done after the connection method has been +// successfully saved into the database. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::RefreshConnMethodId( const TCmmIdStruct& aIdStruct ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_REFRESHCONNMETHODID_ENTRY ); + + for ( TInt i = 0; i < iConnMethodItemArray.Count(); i++ ) + { + if ( iConnMethodItemArray[i].iId == aIdStruct.iTemporaryId ) + { + iConnMethodItemArray[i].iId = aIdStruct.iRealId; + break; + } + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_REFRESHCONNMETHODID_EXIT ); + } + +// --------------------------------------------------------------------------- +// Called after this destination has been updated and database transaction has +// completed successfully. Sets the internal state of this destination instance +// to reflect the new valid state. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::UpdateSuccessful() + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_UPDATESUCCESSFUL_ENTRY ); + + SetStatus( ECmmDestinationStatusValid ); + SetStatusForAllRecords( ECmmRecordStatusLoaded ); + iConnMethodsToBeDeleted.Reset(); + iProtectionChanged = EFalse; + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_UPDATESUCCESSFUL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Checks if all mandatory records contain data and are ready to be saved into +// database. +// --------------------------------------------------------------------------- +// +TBool CCmmDestinationInstance::AllMandatoryRecordsContainData() const + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_ALLMANDATORYRECORDSCONTAINDATA_ENTRY ); + + TBool result( ETrue ); + + if ( iNetworkRecordStatus != ECmmRecordStatusLoaded && + iNetworkRecordStatus != ECmmRecordStatusExpired && + iNetworkRecordStatus != ECmmRecordStatusModified ) + { + result = EFalse; + } + if ( iDestApRecordStatus != ECmmRecordStatusLoaded && + iDestApRecordStatus != ECmmRecordStatusExpired && + iDestApRecordStatus != ECmmRecordStatusModified ) + { + result = EFalse; + } + if ( iMetadataRecordStatus != ECmmRecordStatusLoaded && + iMetadataRecordStatus != ECmmRecordStatusExpired && + iMetadataRecordStatus != ECmmRecordStatusModified ) + { + result = EFalse; + } + if ( !iNetworkRecord || !iDestApRecord || !iMetadataRecord ) + { + result = EFalse; + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_ALLMANDATORYRECORDSCONTAINDATA_EXIT ); + return result; + } + +// --------------------------------------------------------------------------- +// Loads a certain type of record from database if it is not up-to-date. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::RefreshRecordL( TCmmDbRecords aRecordType ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_REFRESHRECORDL_ENTRY ); + + TCmmRecordStatus status( ECmmRecordStatusBlank ); + switch ( aRecordType ) + { + case ECmmDestNetworkRecord: + status = iNetworkRecordStatus; + break; + case ECmmDestApRecord: + status = iDestApRecordStatus; + break; + case ECmmDestMetadataRecord: + status = iMetadataRecordStatus; + break; + default: + User::Leave( KErrCorrupt ); // Error, unknown type. + break; + } + + switch ( status ) + { + // Fallthrough intended + case ECmmRecordStatusBlank: + case ECmmRecordStatusExpired: + iCache->LoadDestinationRecordL( *this, aRecordType ); + break; + case ECmmRecordStatusLoaded: + case ECmmRecordStatusModified: + // Record is up-to-date. + break; + case ECmmRecordStatusUnsaved: + default: + User::Leave( KErrCorrupt ); // Error, unknown status. + break; + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_REFRESHRECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Loads all records from database that are not up-to-date. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::LoadAllRecordsL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_LOADALLRECORDSL_ENTRY ); + + RefreshRecordL( ECmmDestNetworkRecord ); + RefreshRecordL( ECmmDestApRecord ); + RefreshRecordL( ECmmDestMetadataRecord ); + + if ( !iNetworkRecord || !iDestApRecord || !iMetadataRecord ) + { + User::Leave( KErrCorrupt ); + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_LOADALLRECORDSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Set metadata of type ESnapMetadataInternet. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::SetMetadataInternetL( const TUint32& aMetadata ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_SETMETADATAINTERNETL_ENTRY ); + + if ( aMetadata ) + { + if ( iCache->DestinationExistsWithMetadataLocalizedL( *this, CMManager::ELocalisedDestInternet ) ) + { + User::Leave( KErrAlreadyExists ); + } + // Clear ESnapMetadataHiddenAgent-bit. + TUint32 value = iMetadataRecord->iMetadata & ( ~CMManager::ESnapMetadataHiddenAgent ); + + // Set old ESnapMetadataInternet-bit. + value = value | CMManager::ESnapMetadataInternet; + + // Clear ESnapMetadataDestinationIsLocalised-bits. + value = value & ( ~CMManager::ESnapMetadataDestinationIsLocalised ); + // Set ELocalisedDestInternet-value. + iMetadataRecord->iMetadata = value | ( CMManager::ELocalisedDestInternet << 4 ); + value = value | ( CMManager::ELocalisedDestInternet << 4 ); + + // Clear ESnapMetadataPurpose-bits. + value = value & ( ~CMManager::ESnapMetadataPurpose ); + // Set ESnapPurposeInternet-value. + iMetadataRecord->iMetadata = value | ( CMManager::ESnapPurposeInternet << 8 ); + } + else + { + // Clear old ESnapMetadataInternet-bit, ESnapMetadataDestinationIsLocalised-bits and CMManager::ESnapMetadataPurpose-bits. + TUint32 temp = ~( CMManager::ESnapMetadataInternet | CMManager::ESnapMetadataDestinationIsLocalised | CMManager::ESnapMetadataPurpose ); + iMetadataRecord->iMetadata = iMetadataRecord->iMetadata & temp; + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_SETMETADATAINTERNETL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Set metadata of type ESnapMetadataHighlight. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::SetMetadataHighlight( const TUint32& aMetadata ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_SETMETADATAHIGHLIGHTL_ENTRY ); + + // TODO: Old CmManager does not perform any duplicate checks when setting highlight. + // Now with single click this is not used anymore anyway. So I suggest we don't add any checks here. + if ( aMetadata ) + { + // Set ESnapMetadataHighlight-bit. + iMetadataRecord->iMetadata = iMetadataRecord->iMetadata | CMManager::ESnapMetadataHighlight; + } + else + { + // Clear ESnapMetadataHighlight-bit. + iMetadataRecord->iMetadata = iMetadataRecord->iMetadata & ( ~CMManager::ESnapMetadataHighlight ); + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_SETMETADATAHIGHLIGHTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Set metadata of type ESnapMetadataHiddenAgent. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::SetMetadataHiddenAgentL( const TUint32& aMetadata ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_SETMETADATAHIDDENAGENTL_ENTRY ); + + if ( aMetadata ) + { + TUint32 metadataInternet( iMetadataRecord->iMetadata & CMManager::ESnapMetadataInternet ); + TUint32 metadataLocalized( ( iMetadataRecord->iMetadata & CMManager::ESnapMetadataDestinationIsLocalised ) >> 4 ); + TUint32 metadataPurpose( ( iMetadataRecord->iMetadata & CMManager::ESnapMetadataPurpose ) >> 8 ); + if ( metadataInternet || + ( metadataLocalized == CMManager::ELocalisedDestInternet ) || + ( metadataPurpose == CMManager::ESnapPurposeInternet ) ) + { + // Not allowed to set ESnapMetadataHiddenAgent if destination is localized or has purpose set. + User::Leave( KErrArgument ); + } + // Set ESnapMetadataHiddenAgent-bit. + iMetadataRecord->iMetadata = iMetadataRecord->iMetadata | CMManager::ESnapMetadataHiddenAgent; + } + else + { + // Clear ESnapMetadataHiddenAgent-bit. + iMetadataRecord->iMetadata = iMetadataRecord->iMetadata & ( ~CMManager::ESnapMetadataHiddenAgent ); + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_SETMETADATAHIDDENAGENTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Set metadata of type ESnapMetadataDestinationIsLocalised. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::SetMetadataLocalizationL( const TUint32& aMetadata ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_SETMETADATALOCALIZATIONL_ENTRY ); + + // Check that aMetadata is within valid range. + if ( aMetadata > CMManager::ELocalisedDestIntranet ) + { + User::Leave( KErrArgument ); + } + + TUint32 temp = ~( CMManager::ESnapMetadataInternet | CMManager::ESnapMetadataDestinationIsLocalised | CMManager::ESnapMetadataPurpose ); + if ( aMetadata == CMManager::ENotLocalisedDest ) + { + // Clear old ESnapMetadataInternet-bit, ESnapMetadataDestinationIsLocalised-bits and ESnapMetadataPurpose-bits. + iMetadataRecord->iMetadata = iMetadataRecord->iMetadata & temp; + } + else + { + if ( iCache->DestinationExistsWithMetadataLocalizedL( *this, aMetadata ) ) + { + User::Leave( KErrAlreadyExists ); + } + + // Clear old ESnapMetadataInternet-bit, ESnapMetadataDestinationIsLocalised-bits and ESnapMetadataPurpose-bits. + TUint32 value = iMetadataRecord->iMetadata & temp; + switch ( aMetadata ) + { + case CMManager::ELocalisedDestInternet: + { + // Clear ESnapMetadataHiddenAgent-bit. + value = value & ( ~CMManager::ESnapMetadataHiddenAgent ); + // Set old ESnapMetadataInternet-bit. + value = value | CMManager::ESnapMetadataInternet; + // Set ESnapPurposeInternet-value. + value = value | ( CMManager::ESnapPurposeInternet << 8 ); + } + break; + case CMManager::ELocalisedDestWap: + { + // Set ESnapPurposeOperator-value. + value = value | ( CMManager::ESnapPurposeOperator << 8 ); + } + break; + case CMManager::ELocalisedDestMMS: + { + // Set ESnapMetadataHiddenAgent-bit. + value = value | CMManager::ESnapMetadataHiddenAgent; + // Set ESnapPurposeMMS-value. + value = value | ( CMManager::ESnapPurposeMMS << 8 ); + } + break; + case CMManager::ELocalisedDestIntranet: + { + // Set ESnapPurposeIntranet-value. + value = value | ( CMManager::ESnapPurposeIntranet << 8 ); + } + break; + default: + User::Leave( KErrArgument ); + break; + } + // Set ESnapMetadataDestinationIsLocalised-value. + iMetadataRecord->iMetadata = value | ( aMetadata << 4 ); + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_SETMETADATALOCALIZATIONL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Set metadata of type ESnapMetadataPurpose. +// --------------------------------------------------------------------------- +// +void CCmmDestinationInstance::SetMetadataPurposeL( const TUint32& aMetadata ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_SETMETADATAPURPOSEL_ENTRY ); + + // Check that aMetadata is within valid range. + if ( aMetadata > CMManager::ESnapPurposeIntranet ) + { + User::Leave( KErrArgument ); + } + + TUint32 temp = ~( CMManager::ESnapMetadataInternet | CMManager::ESnapMetadataDestinationIsLocalised | CMManager::ESnapMetadataPurpose ); + if ( aMetadata == CMManager::ESnapPurposeUnknown ) + { + // Clear old ESnapMetadataInternet-bit, ESnapMetadataDestinationIsLocalised-bits and ESnapMetadataPurpose-bits. + iMetadataRecord->iMetadata = iMetadataRecord->iMetadata & temp; + } + else + { + if ( iCache->DestinationExistsWithMetadataPurposeL( *this, aMetadata ) ) + { + User::Leave( KErrAlreadyExists ); + } + + // Clear old ESnapMetadataInternet-bit, ESnapMetadataDestinationIsLocalised-bits and ESnapMetadataPurpose-bits. + TUint32 value = iMetadataRecord->iMetadata & temp; + + switch ( aMetadata ) + { + case CMManager::ESnapPurposeInternet: + { + // Clear ESnapMetadataHiddenAgent-bit. + value = value & ( ~CMManager::ESnapMetadataHiddenAgent ); + // Set old ESnapMetadataInternet-bit. + value = value | CMManager::ESnapMetadataInternet; + // Set ELocalisedDestInternet-value. + value = value | ( CMManager::ELocalisedDestInternet << 4 ); + } + break; + case CMManager::ESnapPurposeOperator: + { + // Set ELocalisedDestWap-value. + value = value | ( CMManager::ELocalisedDestWap << 4 ); + } + break; + case CMManager::ESnapPurposeMMS: + { + // Set ESnapMetadataHiddenAgent-bit. + value = value | CMManager::ESnapMetadataHiddenAgent; + // Set ELocalisedDestMMS-value. + value = value | ( CMManager::ELocalisedDestMMS << 4 ); + } + break; + case CMManager::ESnapPurposeIntranet: + { + // Set ELocalisedDestIntranet-value. + value = value | ( CMManager::ELocalisedDestIntranet << 4 ); + } + break; + default: + User::Leave( KErrArgument ); + break; + } + // Set ESnapMetadataPurpose-value. + iMetadataRecord->iMetadata = value | ( aMetadata << 8 ); + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_SETMETADATAPURPOSEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Checks the current metadata for this destination, and verifies there is no +// other conflicting destinations in the database. +// --------------------------------------------------------------------------- +// +TBool CCmmDestinationInstance::ConflictingMetadataFoundL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONINSTANCE_CONFLICTINGMETADATAFOUNDL_ENTRY ); + + TBool result( EFalse ); + TUint32 metadataInternet( iMetadataRecord->iMetadata & CMManager::ESnapMetadataInternet ); + TUint32 metadataLocalized( ( iMetadataRecord->iMetadata & CMManager::ESnapMetadataDestinationIsLocalised ) >> 4 ); + TUint32 metadataPurpose( ( iMetadataRecord->iMetadata & CMManager::ESnapMetadataPurpose ) >> 8 ); + + if ( metadataPurpose ) + { + // Some metadata is set, need to check conflicts in database. + switch ( metadataPurpose ) + { + // Fallthrough intended. + case CMManager::ESnapPurposeInternet: + case CMManager::ESnapPurposeOperator: + case CMManager::ESnapPurposeMMS: + case CMManager::ESnapPurposeIntranet: + result = iCache->DestinationExistsWithMetadataPurposeL( *this, metadataPurpose ); + break; + default: + User::Leave( KErrCorrupt ); // Invalid metadata. + break; + } + } + else if ( metadataLocalized ) + { + // Error, metadataPurpose was not set. Continue anyway. + switch ( metadataLocalized ) + { + // Fallthrough intended. + case CMManager::ELocalisedDestInternet: + case CMManager::ELocalisedDestWap: + case CMManager::ELocalisedDestMMS: + case CMManager::ELocalisedDestIntranet: + result = iCache->DestinationExistsWithMetadataLocalizedL( *this, metadataLocalized ); + break; + default: + User::Leave( KErrCorrupt ); // Invalid metadata. + break; + } + } + else if ( metadataInternet ) + { + // Error, metadataPurpose and metadataLocalized was not set. Continue anyway. + result = iCache->DestinationExistsWithMetadataLocalizedL( *this, CMManager::ELocalisedDestInternet ); + } + + OstTraceFunctionExit0( CCMMDESTINATIONINSTANCE_CONFLICTINGMETADATAFOUNDL_EXIT ); + return result; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmdestinationstruct.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmdestinationstruct.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,1336 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Cache side object representing a destination. +* +*/ + + +#include +#include +#include // KAfInet + +#include "cmmdestinationstruct.h" +#include "cmmtransactionhandler.h" +#include "cmmdestinationinstance.h" +#include "cmmcache.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmdestinationstructTraces.h" +#endif + +const TUint KDefaultTierManagerTagId = KAfInet; + + +// --------------------------------------------------------------------------- +// Two phased construction. +// Opens a destination from database based on ID. +// --------------------------------------------------------------------------- +// +CCmmDestinationStruct* CCmmDestinationStruct::NewL( + CCmmCache* aCache, + CCmmTransactionHandler* aTransactionHandler, + const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_NEWL_ENTRY ); + + CCmmDestinationStruct* self = CCmmDestinationStruct::NewLC( aCache, aTransactionHandler, aDestinationId ); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_NEWL_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// Creates a new destination with name and ID (optional). +// If ID is 0, a free ID will be used when destination is saved to database. +// --------------------------------------------------------------------------- +// +CCmmDestinationStruct* CCmmDestinationStruct::NewL( + CCmmCache* aCache, + CCmmTransactionHandler* aTransactionHandler, + const TDesC& aName, + const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( DUP1_CCMMDESTINATIONSTRUCT_NEWL_ENTRY ); + + CCmmDestinationStruct* self = CCmmDestinationStruct::NewLC( aCache, aTransactionHandler, aName, aDestinationId ); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( DUP1_CCMMDESTINATIONSTRUCT_NEWL_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// Opens a destination from database based on ID. +// --------------------------------------------------------------------------- +// +CCmmDestinationStruct* CCmmDestinationStruct::NewLC( + CCmmCache* aCache, + CCmmTransactionHandler* aTransactionHandler, + const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_NEWLC_ENTRY ); + + CCmmDestinationStruct* self = new( ELeave ) CCmmDestinationStruct( aCache, aTransactionHandler ); + CleanupStack::PushL( self ); + self->ConstructL( aDestinationId ); + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_NEWLC_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// Creates a new destination with name and ID (optional). +// If ID is 0, a free ID will be used when destination is saved to database. +// --------------------------------------------------------------------------- +// +CCmmDestinationStruct* CCmmDestinationStruct::NewLC( + CCmmCache* aCache, + CCmmTransactionHandler* aTransactionHandler, + const TDesC& aName, + const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( DUP1_CCMMDESTINATIONSTRUCT_NEWLC_ENTRY ); + + CCmmDestinationStruct* self = new( ELeave ) CCmmDestinationStruct( aCache, aTransactionHandler ); + CleanupStack::PushL( self ); + self->ConstructL( aName, aDestinationId ); + + OstTraceFunctionExit0( DUP1_CCMMDESTINATIONSTRUCT_NEWLC_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// Cancels any active requests. +// --------------------------------------------------------------------------- +// +CCmmDestinationStruct::~CCmmDestinationStruct() + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_CCMMDESTINATIONSTRUCT_ENTRY ); + + if ( iReferenceCounter != 0 ) + { + ASSERT(0); // Error. + } + delete iNetworkRecord; + delete iDestApRecord; + delete iMetadataRecord; + delete iName; + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_CCMMDESTINATIONSTRUCT_EXIT ); + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CCmmDestinationStruct::CCmmDestinationStruct( + CCmmCache* aCache, + CCmmTransactionHandler* aTransactionHandler ) + : + iCache( aCache ), + iTransactionHandler( aTransactionHandler ) + { + OstTraceFunctionEntry0( DUP1_CCMMDESTINATIONSTRUCT_CCMMDESTINATIONSTRUCT_ENTRY ); + + iDestApRecord = NULL; + iNetworkRecord = NULL; + iMetadataRecord = NULL; + iDestApRecordStatus = ECmmRecordStatusBlank; + iNetworkRecordStatus = ECmmRecordStatusBlank; + iMetadataRecordStatus = ECmmRecordStatusBlank; + iReferenceCounter = 0; + iStatus = ECmmDestinationStatusNotSaved; + iId = 0; + iName = NULL; + + OstTraceFunctionExit0( DUP1_CCMMDESTINATIONSTRUCT_CCMMDESTINATIONSTRUCT_EXIT ); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// Opens an existing destination based on ID. +// --------------------------------------------------------------------------- +// +void CCmmDestinationStruct::ConstructL( const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_CONSTRUCTL_ENTRY ); + + // Check ID is in valid range. + if ( aDestinationId <= KCmDefaultDestinationAPTagId || aDestinationId >= KCmMaxDestinationAPTagId ) + { + User::Leave( KErrArgument ); + } + iId = aDestinationId; + + iDestApRecord = static_cast( + CommsDat::CCDRecordBase::RecordFactoryL( CommsDat::KCDTIdAccessPointRecord ) ); + iNetworkRecord = static_cast( + CommsDat::CCDRecordBase::RecordFactoryL( CommsDat::KCDTIdNetworkRecord ) ); + iMetadataRecord = new( ELeave ) CCDSNAPMetadataRecord( + iCache->TableId( ECmmDestMetadataRecord ) ); + + // Load access point record. + iDestApRecord->iRecordTag = iId; + if ( iDestApRecord->FindL( iTransactionHandler->Session() ) ) + { + iDestApRecord->LoadL( iTransactionHandler->Session() ); + } + else + { + User::Leave( KErrNotFound ); + } + iDestApRecordStatus = ECmmRecordStatusLoaded; + + // Load network record. + iNetworkRecord->SetRecordId( iDestApRecord->iCustomSelectionPolicy ); + iNetworkRecord->LoadL( iTransactionHandler->Session() ); + iNetworkRecordStatus = ECmmRecordStatusLoaded; + + // Load metadata record. + iMetadataRecord->iSNAP = iId; + if ( !iMetadataRecord->FindL( iTransactionHandler->Session() ) ) + { + // Not found -> fill in with default values. + iMetadataRecord->iSNAP = iId; + iMetadataRecord->iMetadata = 0; + iMetadataRecord->iIcon = 0; + iMetadataRecord->SetRecordId( KCDNewRecordRequest ); + iMetadataRecordStatus = ECmmRecordStatusUnsaved; + } + else + { + iMetadataRecord->LoadL( iTransactionHandler->Session() ); + iMetadataRecordStatus = ECmmRecordStatusLoaded; + } + + SetStatus( ECmmDestinationStatusValid ); + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// Creates a new destination. With name and optionally also with ID. +// --------------------------------------------------------------------------- +// +void CCmmDestinationStruct::ConstructL( const TDesC& aName, const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( DUP1_CCMMDESTINATIONSTRUCT_CONSTRUCTL_ENTRY ); + + SetStatus( ECmmDestinationStatusNotSaved ); + iId = aDestinationId; + iName = aName.AllocL(); + + iDestApRecord = static_cast( + CommsDat::CCDRecordBase::RecordFactoryL( CommsDat::KCDTIdAccessPointRecord ) ); + iNetworkRecord = static_cast( + CommsDat::CCDRecordBase::RecordFactoryL( CommsDat::KCDTIdNetworkRecord ) ); + iMetadataRecord = new( ELeave ) CCDSNAPMetadataRecord( + iCache->TableId( ECmmDestMetadataRecord ) ); + + if ( aDestinationId >= KTemporaryIdCounterStart ) + { + // Get a real ID from database during UpdateL(). + iNetworkRecord->SetRecordId( KCDNewRecordRequest ); + iDestApRecord->iRecordTag = 0; + iDestApRecord->iCustomSelectionPolicy = 0; + // Access Point record tag ID and custom selection policy value need to + // be set during UpdateL(), when network record's record ID is known. + // Also metadata record SNAP ID needs to be set. + iMetadataRecord->iSNAP = 0; + } + else + { + // Client provided an actual ID. + iNetworkRecord->SetRecordId( aDestinationId - KCmDefaultDestinationAPTagId ); + iDestApRecord->iRecordTag = aDestinationId; + iDestApRecord->iCustomSelectionPolicy = ( aDestinationId - KCmDefaultDestinationAPTagId ); + iMetadataRecord->iSNAP = aDestinationId; + } + iDestApRecord->SetRecordId( KCDNewRecordRequest ); + + iMetadataRecord->iMetadata = 0; + iMetadataRecord->SetRecordId( KCDNewRecordRequest ); + + iNetworkRecord->iRecordName.SetL( aName ); + iDestApRecord->iRecordName.SetL( aName ); + + InitializeDestApRecordL(); + + iDestApRecordStatus = ECmmRecordStatusUnsaved; + iNetworkRecordStatus = ECmmRecordStatusUnsaved; + iMetadataRecordStatus = ECmmRecordStatusUnsaved; + + OstTraceFunctionExit0( DUP1_CCMMDESTINATIONSTRUCT_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Set the destination ID. +// --------------------------------------------------------------------------- +// +void CCmmDestinationStruct::SetId( const TUint32& aId ) + { + iId = aId; + } + +// --------------------------------------------------------------------------- +// Get the destination ID. +// --------------------------------------------------------------------------- +// +TUint32 CCmmDestinationStruct::GetId() const + { + return iId; + } + +// --------------------------------------------------------------------------- +// Get the destination ID from network record. To get a valid ID, this must be +// called only during or after a call to UpdateL(). +// --------------------------------------------------------------------------- +// +TUint32 CCmmDestinationStruct::GetRealId() const + { + TUint32 id( iId ); + if ( iNetworkRecord ) + { + id = ( TUint32 )iNetworkRecord->RecordId() + KCmDefaultDestinationAPTagId; + } + return id; + } + +// --------------------------------------------------------------------------- +// Get the destination name. +// --------------------------------------------------------------------------- +// +TDesC& CCmmDestinationStruct::GetDestinationNameL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_GETDESTINATIONNAMEL_ENTRY ); + + // No network record exists if destination has not been saved yet. + if ( iStatus == ECmmDestinationStatusNotSaved && iName ) + { + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_GETDESTINATIONNAMEL_EXIT ); + return *iName; + } + + if ( iNetworkRecord ) + { + return iNetworkRecord->iRecordName.GetL(); + } + + User::Leave( KErrCorrupt ); + + OstTraceFunctionExit0( DUP1_CCMMDESTINATIONSTRUCT_GETDESTINATIONNAMEL_EXIT ); + return *iName; + } + +// --------------------------------------------------------------------------- +// Gets the current status of this destination struct. +// --------------------------------------------------------------------------- +// +TCmmDestinationStatus CCmmDestinationStruct::GetStatus() const + { + return iStatus; + } + +// --------------------------------------------------------------------------- +// Get the current reference count. +// --------------------------------------------------------------------------- +// +TInt CCmmDestinationStruct::GetReferenceCount() const + { + return iReferenceCounter; + } + +// --------------------------------------------------------------------------- +// Set the current status of this destination. +// ECmmDestinationStatusValid: Destination exists in database. +// ECmmDestinationStatusNotSaved: Destination does NOT exist in database yet. +// --------------------------------------------------------------------------- +// +void CCmmDestinationStruct::SetStatus( const TCmmDestinationStatus& aStatus ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_SETSTATUS_ENTRY ); + + switch ( aStatus ) + { + case ECmmDestinationStatusValid: + { + if ( iStatus == ECmmDestinationStatusNotSaved ) + { + delete iName; + iName = NULL; + } + } + // Fallthrough intended. + case ECmmDestinationStatusNotSaved: + case ECmmDestinationStatusToBeDeleted: + { + // Set the status. + iStatus = aStatus; + } + break; + default: + ASSERT( 0 ); // Error, invalid status. + break; + } + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_SETSTATUS_EXIT ); + } + +// --------------------------------------------------------------------------- +// Set the record status for all records. +// --------------------------------------------------------------------------- +// +void CCmmDestinationStruct::SetStatusForAllRecords( const TCmmRecordStatus& aStatus ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_SETSTATUSFORALLRECORDS_ENTRY ); + + iDestApRecordStatus = aStatus; + iNetworkRecordStatus = aStatus; + iMetadataRecordStatus = aStatus; + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_SETSTATUSFORALLRECORDS_EXIT ); + } + +// --------------------------------------------------------------------------- +// Copies the data for this destination to a session instance and increments +// the reference counter by one. +// --------------------------------------------------------------------------- +// +void CCmmDestinationStruct::CreateSessionInstanceL( + CCmmDestinationInstance& aDestinationInstance ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_CREATESESSIONINSTANCEL_ENTRY ); + + // This should work according to status. If status is valid, this + // destination exists in commsdat, and other sessions can also open a handle + // to it. Make copies of the records to give to session instance. + // + // If the status is unsaved, then this is a new destination that hasn't + // been saved to commsdat yet. Thus no other session can open a handle to it + // until it is saved with a call to UpdateL(). + // For a non-valid destination, to save memory, transfer the ownership of + // record pointers straight to the session and mark the cache pointers as + // NULL. When update is called, copy the records into the cache also. + // + + switch ( iStatus ) //TODO, add missing status values + { + case ECmmDestinationStatusNotSaved: + { + // Transfer ownership of table records to session. Mark local pointers to NULL. + + aDestinationInstance.SetRecordPointer( ECmmDestApRecord, iDestApRecord ); // iDestApRecord ownership is transfered. + aDestinationInstance.SetRecordPointer( ECmmDestNetworkRecord, iNetworkRecord ); // iNetworkRecord ownership is transfered. + aDestinationInstance.SetRecordPointer( ECmmDestMetadataRecord, iMetadataRecord ); // iMetadataRecord ownership is transfered. + iDestApRecord = NULL; + iNetworkRecord = NULL; + iMetadataRecord = NULL; + iDestApRecordStatus = ECmmRecordStatusBlank; + iNetworkRecordStatus = ECmmRecordStatusBlank; + iMetadataRecordStatus = ECmmRecordStatusBlank; + + aDestinationInstance.SetId( iId ); + aDestinationInstance.SetStatus( ECmmDestinationStatusChanged ); + } + break; + case ECmmDestinationStatusValid: + { + // Reload table records if needed, make copies and transfer those to session. + LoadRecordL( aDestinationInstance, ECmmDestApRecord ); + LoadRecordL( aDestinationInstance, ECmmDestNetworkRecord ); + LoadRecordL( aDestinationInstance, ECmmDestMetadataRecord ); + + aDestinationInstance.SetId( iId ); + aDestinationInstance.SetStatus( ECmmDestinationStatusValid ); + } + break; + default: + User::Leave( KErrCorrupt ); // Invalid status. + break; + } + + // A session handle has been made, increment reference counter. + iReferenceCounter++; + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_CREATESESSIONINSTANCEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// TODO +// --------------------------------------------------------------------------- +// +void CCmmDestinationStruct::RefreshDestinationInstanceL( + CCmmDestinationInstance& aDestinationInstance ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_REFRESHSESSIONINSTANCEL_ENTRY ); + + switch ( iStatus ) + { + case ECmmDestinationStatusValid: + case ECmmDestinationStatusToBeDeleted: + { + // Reload table records if needed, make copies and transfer those to session. + LoadRecordL( aDestinationInstance, ECmmDestApRecord ); + LoadRecordL( aDestinationInstance, ECmmDestNetworkRecord ); + LoadRecordL( aDestinationInstance, ECmmDestMetadataRecord ); + } + break; + case ECmmDestinationStatusNotSaved: // This was checked before. + case ECmmDestinationStatusChanged: + default: + User::Leave( KErrCorrupt ); // Invalid status. + break; + } + + // Add list of currently contained connection methods. + iCache->GetConnMethodsFromDestinationL( + aDestinationInstance.GetId(), + aDestinationInstance.iConnMethodItemArray ); + + // Internal state need to be set to the same state as after a successfull update. + aDestinationInstance.UpdateSuccessful(); + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_REFRESHSESSIONINSTANCEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Re-loads a destination record if needed and copies the latest version to +// the session instance given as parameter. +// --------------------------------------------------------------------------- +// +void CCmmDestinationStruct::LoadRecordL( + CCmmDestinationInstance& aDestinationInstance, + TCmmDbRecords aRecordType ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_LOADRECORDL_ENTRY ); + + if ( iStatus != ECmmDestinationStatusValid && iStatus != ECmmDestinationStatusToBeDeleted ) + { + // Destination must exist in database to be able to load any records. + User::Leave( KErrCorrupt ); + } + + // Record status: Action: + // + // ECmmRecordStatusBlank Error + // ECmmRecordStatusLoaded Skip load, already loaded + // ECmmRecordStatusExpired Load record from database + // ECmmRecordStatusModified Error, session side only status + // ECmmRecordStatusUnsaved Skip load, not in database + + CommsDat::CCDRecordBase* aRecordPointer; + + switch ( aRecordType ) + { + case ECmmDestNetworkRecord: + { + if ( iNetworkRecordStatus == ECmmRecordStatusExpired ) + { + iNetworkRecord->LoadL( iTransactionHandler->Session() ); + iNetworkRecordStatus = ECmmRecordStatusLoaded; + } + else if ( iNetworkRecordStatus == ECmmRecordStatusBlank || + iNetworkRecordStatus == ECmmRecordStatusModified ) + { + User::Leave( KErrCorrupt ); + } + aRecordPointer = CopyRecordL( + ECmmDestNetworkRecord, + static_cast( iNetworkRecord ) ); + aDestinationInstance.SetRecordPointer( + ECmmDestNetworkRecord, + aRecordPointer ); // Ownership is transfered. + } + break; + case ECmmDestApRecord: + { + if ( iDestApRecordStatus == ECmmRecordStatusExpired ) + { + iDestApRecord->LoadL( iTransactionHandler->Session() ); + iDestApRecordStatus = ECmmRecordStatusLoaded; + } + aRecordPointer = CopyRecordL( + ECmmDestApRecord, + static_cast( iDestApRecord ) ); + aDestinationInstance.SetRecordPointer( + ECmmDestApRecord, + aRecordPointer ); // Ownership is transfered. + } + break; + case ECmmDestMetadataRecord: + { + if ( iMetadataRecordStatus == ECmmRecordStatusExpired ) + { + iMetadataRecord->LoadL( iTransactionHandler->Session() ); + iMetadataRecordStatus = ECmmRecordStatusLoaded; + } + aRecordPointer = CopyRecordL( + ECmmDestMetadataRecord, + static_cast( iMetadataRecord ) ); + aDestinationInstance.SetRecordPointer( + ECmmDestMetadataRecord, + aRecordPointer ); // Ownership is transfered. + } + break; + default: + { + User::Leave( KErrArgument ); + } + break; + } + aRecordPointer = NULL; + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_LOADRECORDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Save the contents of a session side destination handle into database. +// --------------------------------------------------------------------------- +// +void CCmmDestinationStruct::UpdateL( + CCmmDestinationInstance& aDestinationInstance, + CCmmCache* aCache ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_UPDATEL_ENTRY ); + + // Structure: + // - Use ModifyL() or StoreL() according to own status (new destination or + // changes to existing one). + // + // - Update (store/modify) records to database using client copies. + // - Free local record tables. + // - Copy record tables from client instance into cache. + // - Update DataMobilitySelectionPolicy-records. + // + + TInt id( iId ); + switch ( aDestinationInstance.GetStatus() ) + { + case ECmmDestinationStatusValid: + { + if ( iStatus != ECmmDestinationStatusValid ) //TODO, how will external db changes affect this? + { + // Error, a 'valid'-status on session side implies a 'valid'-status on cache side. + User::Leave( KErrCorrupt ); + } + } + // Fallthrough intended. + case ECmmDestinationStatusChanged: + { + CommsDat::CCDRecordBase* recordPointer; + + // Get pointers to destination records in client instance. + aDestinationInstance.GetRecordPointer( ECmmDestApRecord, recordPointer ); + CommsDat::CCDAccessPointRecord* instanceDestApRecord = + static_cast( recordPointer ); + aDestinationInstance.GetRecordPointer( ECmmDestNetworkRecord, recordPointer ); + CommsDat::CCDNetworkRecord* instanceNetworkRecord = + static_cast( recordPointer ); + aDestinationInstance.GetRecordPointer( ECmmDestMetadataRecord, recordPointer ); + CCDSNAPMetadataRecord* instanceMetadataRecord = + static_cast( recordPointer ); + + recordPointer = NULL; + + switch ( iStatus ) + { + case ECmmDestinationStatusNotSaved: + { + // This is a new destination that doesn't exist in database yet. + + // Store network record first, the record ID is needed for + // destination access point record. + // Record ID for network record is set during construction. + + //TODO, Check method call from old CmManager: + //TODO, SetAttribute( iData->iNetworkRecord, ECDProtectedWrite, ProtectionLevel() == EProtLevel1 ); + instanceNetworkRecord->StoreL( iTransactionHandler->Session() ); + + // If ID is out of valid range, it means this destination was created + // without a specific ID. It is a temporary ID and can now be replaced + // with the real database ID. This also enables this destination to be + // opened by other clients. + // Record ID from network record must be used as real ID. + if ( iId >= KTemporaryIdCounterStart ) + { + id = instanceNetworkRecord->RecordId() + KCmDefaultDestinationAPTagId; + instanceDestApRecord->iRecordTag = id; + instanceDestApRecord->iCustomSelectionPolicy = ( id - KCmDefaultDestinationAPTagId ); + instanceMetadataRecord->iSNAP = id; + } + instanceDestApRecord->StoreL( iTransactionHandler->Session() ); + instanceMetadataRecord->StoreL( iTransactionHandler->Session() ); + } + break; + + case ECmmDestinationStatusValid: + case ECmmDestinationStatusToBeDeleted: + { + // This destination already exists in database and is beeing modified. + + //TODO, Check method call from old CmManager: + //TODO, SetAttribute( iData->iNetworkRecord, ECDProtectedWrite, ProtectionLevel() == EProtLevel1 ); + instanceNetworkRecord->ModifyL( iTransactionHandler->Session() ); + instanceDestApRecord->ModifyL( iTransactionHandler->Session() ); + if ( iMetadataRecordStatus == ECmmRecordStatusUnsaved ) + { + instanceMetadataRecord->StoreL( iTransactionHandler->Session() ); + } + else + { + instanceMetadataRecord->ModifyL( iTransactionHandler->Session() ); + } + } + break; + case ECmmDestinationStatusChanged: + default: + User::Leave( KErrCorrupt ); // Error, invalid status. + break; + } + + // Copy destination records from client instance into cache. + delete iDestApRecord; + delete iNetworkRecord; + delete iMetadataRecord; + iDestApRecord = NULL; + iNetworkRecord = NULL; + iMetadataRecord = NULL; + iDestApRecordStatus = ECmmRecordStatusBlank; + iNetworkRecordStatus = ECmmRecordStatusBlank; + iMetadataRecordStatus = ECmmRecordStatusBlank; + iDestApRecord = static_cast( CopyRecordL( ECmmDestApRecord, instanceDestApRecord ) ); + iNetworkRecord = static_cast( CopyRecordL( ECmmDestNetworkRecord, instanceNetworkRecord ) ); + iMetadataRecord = static_cast( CopyRecordL( ECmmDestMetadataRecord, instanceMetadataRecord ) ); + + instanceDestApRecord = NULL; + instanceNetworkRecord = NULL; + instanceMetadataRecord = NULL; + + + + // Write DataMobilitySelectionPolicy-records into database. + TInt neededRecordCount( aDestinationInstance.iConnMethodItemArray.Count() ); // +1 for destination itself. + TInt existingRecordCount( 0 ); + + // Create DataMobilitySelectionPolicy-record set. + CommsDat::CMDBRecordSet* snapRecordSet = + new( ELeave ) CommsDat::CMDBRecordSet( + iCache->TableId( ECmmDbSnapRecord ) ); + CleanupStack::PushL( snapRecordSet ); + + // Create a DataMobilitySelectionPolicy-record to prime the set. + CCDDataMobilitySelectionPolicyRecord* snapRecordPrime = + new( ELeave ) CCDDataMobilitySelectionPolicyRecord( + iCache->TableId( ECmmDbSnapRecord ) ); + CleanupStack::PushL( snapRecordPrime ); + + snapRecordPrime->iSNAP = id; + snapRecordSet->iRecords.AppendL( snapRecordPrime ); + CleanupStack::Pop( snapRecordPrime ); // Ownership moved. + + // Find matching DataMobilitySelectionPolicy-records. + if ( snapRecordSet->FindL( iTransactionHandler->Session() ) ) + { + existingRecordCount = snapRecordSet->iRecords.Count(); + } + + CCDDataMobilitySelectionPolicyRecord* snapRecord1 = + new( ELeave ) CCDDataMobilitySelectionPolicyRecord( + iCache->TableId( ECmmDbSnapRecord ) ); + CleanupStack::PushL( snapRecord1 ); + + // Current index in snapRecordSet. + TInt index( 0 ); + + // Initial record for destination itself. + snapRecord1->iSNAP = id; + snapRecord1->iRecordName.SetL( iNetworkRecord->iRecordName.GetL() ); + if ( existingRecordCount > index ) + { + snapRecord1->SetElementId( snapRecordSet->iRecords[index]->ElementId() ); + snapRecord1->iEmbeddedSNAP = 0; + snapRecord1->iIAP = 0; + snapRecord1->iPriority = 0; + snapRecord1->ModifyL( iTransactionHandler->Session() ); + index++; + } + else + { + snapRecord1->SetRecordId( KCDNewRecordRequest ); + snapRecord1->StoreL( iTransactionHandler->Session() ); + } + CleanupStack::PopAndDestroy( snapRecord1 ); + + // Records for destination contents. + for ( TInt i = 0; i < neededRecordCount; i++ ) + { + // Weird stuff starts to happen in commsdat side if we try to + // reuse a snap-record, so create new record for each entry. + CCDDataMobilitySelectionPolicyRecord* snapRecord2 = + new( ELeave ) CCDDataMobilitySelectionPolicyRecord( + iCache->TableId( ECmmDbSnapRecord ) ); + CleanupStack::PushL( snapRecord2 ); + + snapRecord2->iSNAP = id; + snapRecord2->iRecordName.SetL( iNetworkRecord->iRecordName.GetL() ); + + // If the connection method was added to destination while + // still having a temporary ID, update the ID to real ID. + TUint32 connMethodRealId( aDestinationInstance.iConnMethodItemArray[i].iId ); + if ( connMethodRealId >= KTemporaryIdCounterStart ) + { + aCache->TranslateTemporaryId( + aDestinationInstance.iConnMethodItemArray[i].iId, + connMethodRealId ); + } + + //TODO, if protection level is 1 (dest AND CMs), set ECDProtectedWrite. See oldimplementation. + + if ( aDestinationInstance.iConnMethodItemArray[i].iBearerType == KUidEmbeddedDestination ) + { + // Embedded destination. + snapRecord2->iEmbeddedSNAP = ( TInt )connMethodRealId; + snapRecord2->iIAP = 0; + snapRecord2->iPriority = + CMManager::KDataMobilitySelectionPolicyPriorityWildCard; + aDestinationInstance.iConnMethodItemArray[i].iPriority = + CMManager::KDataMobilitySelectionPolicyPriorityWildCard; // Update this just in case. + } + else + { + // Normal connection method. + snapRecord2->iEmbeddedSNAP = 0; + snapRecord2->iIAP = ( KCDMaskShowField & CommsDat::KCDTIdIAPRecord ) | ( connMethodRealId << 8 ); + snapRecord2->iPriority = i + 1; // Priority values start from 1. + aDestinationInstance.iConnMethodItemArray[i].iPriority = i + 1; // Update this just in case. + } + + if ( existingRecordCount > index ) + { + // An old record can be reused. + snapRecord2->SetElementId( snapRecordSet->iRecords[index]->ElementId() ); + snapRecord2->ModifyL( iTransactionHandler->Session() ); + index++; + } + else + { + // A new record must be created. + snapRecord2->SetRecordId( KCDNewRecordRequest ); + snapRecord2->StoreL( iTransactionHandler->Session() ); + } + CleanupStack::PopAndDestroy( snapRecord2 ); + } + + // Delete any extra records. + while ( existingRecordCount > index ) + { + CCDDataMobilitySelectionPolicyRecord* snapRecord3 = + new( ELeave ) CCDDataMobilitySelectionPolicyRecord( + iCache->TableId( ECmmDbSnapRecord ) ); + CleanupStack::PushL( snapRecord3 ); + snapRecord3->SetElementId( snapRecordSet->iRecords[index]->ElementId() ); + snapRecord3->DeleteL( iTransactionHandler->Session() ); + CleanupStack::PopAndDestroy( snapRecord3 ); + index++; + } + + + CleanupStack::PopAndDestroy( snapRecordSet ); + } + break; + case ECmmDestinationStatusNotSaved: + case ECmmDestinationStatusToBeDeleted: + default: + User::Leave( KErrCorrupt ); // Error, invalid status. + break; + } + + // Do not update destination status or record status values yet. Cache + // will set them after successfully commiting transaction to database. + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_UPDATEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Delete all database records of this destination. Also removes any records +// making this destination an embedded destination in another destination. +// --------------------------------------------------------------------------- +// +void CCmmDestinationStruct::DeleteL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_DELETEL_ENTRY ); + + // Check general status. + /*switch ( iStatus ) //TODO, already done? yes, cleanup + { + case ECmmDestinationStatusNotSaved: + { + // Doesn'texist in database. + User::Leave( KErrNotFound ); + } + break; + case ECmmDestinationStatusValid: + // Proceed. + break; + case ECmmDestinationStatusToBeDeleted: + { + // Already deleted, nothing to do. + return; + } + case ECmmDestinationStatusChanged: + default: + ASSERT( 0 ); // Error, invalid argument. + User::Leave( KErrCorrupt ); + break; + }*/ + + // Check status for records. + switch ( iNetworkRecordStatus ) + { + case ECmmRecordStatusLoaded: + case ECmmRecordStatusExpired: + { + iNetworkRecord->DeleteL( iTransactionHandler->Session() ); + } + break; + case ECmmRecordStatusUnsaved: + // Skip. + break; + case ECmmRecordStatusBlank: + case ECmmRecordStatusModified: + default: + ASSERT( 0 ); // Error, invalid status. + User::Leave( KErrCorrupt ); + break; + } + switch ( iDestApRecordStatus ) + { + case ECmmRecordStatusLoaded: + case ECmmRecordStatusExpired: + { + iDestApRecord->DeleteL( iTransactionHandler->Session() ); + } + break; + case ECmmRecordStatusUnsaved: + // Skip. + break; + case ECmmRecordStatusBlank: + case ECmmRecordStatusModified: + default: + ASSERT( 0 ); // Error, invalid status. + User::Leave( KErrCorrupt ); + break; + } + switch ( iMetadataRecordStatus ) + { + case ECmmRecordStatusLoaded: + case ECmmRecordStatusExpired: + { + iMetadataRecord->DeleteL( iTransactionHandler->Session() ); + } + break; + case ECmmRecordStatusUnsaved: + // Skip. + break; + case ECmmRecordStatusBlank: + case ECmmRecordStatusModified: + default: + ASSERT( 0 ); // Error, invalid status. + User::Leave( KErrCorrupt ); + break; + } + + // Delete all datamobility selection policy records related to this destination. + + // Create DataMobilitySelectionPolicy-record set. + CommsDat::CMDBRecordSet* snapRecordSet = + new( ELeave ) CommsDat::CMDBRecordSet( + iCache->TableId( ECmmDbSnapRecord ) ); + CleanupStack::PushL( snapRecordSet ); + + // Create a DataMobilitySelectionPolicy-record. + CCDDataMobilitySelectionPolicyRecord* snapRecord = + new( ELeave ) CCDDataMobilitySelectionPolicyRecord( + iCache->TableId( ECmmDbSnapRecord ) ); + CleanupStack::PushL( snapRecord ); + + TRAP_IGNORE( snapRecordSet->LoadL( iTransactionHandler->Session() ) ); + + // Loop through all datamobility selection policy records. + TInt snapRecordCount( snapRecordSet->iRecords.Count() ); + for ( TInt i = 0; i < snapRecordCount; i++ ) + { + snapRecord->SetElementId( snapRecordSet->iRecords[i]->ElementId() ); + snapRecord->LoadL( iTransactionHandler->Session() ); + + TInt snap = snapRecord->iSNAP; + TInt embeddedSnap = snapRecord->iEmbeddedSNAP; + if ( snap == iId || embeddedSnap == iId ) + { + snapRecord->DeleteL( iTransactionHandler->Session() ); + } + } + CleanupStack::PopAndDestroy( snapRecord ); + CleanupStack::PopAndDestroy( snapRecordSet ); + + OstTraceFunctionExit0( DUP1_CCMMDESTINATIONSTRUCT_DELETEL_EXIT ); + } + +// --------------------------------------------------------------------------- +// This should be called when a client session closes a destination handle. +// Reference counter is decremented by one and the remaining number of +// references is returned. +// --------------------------------------------------------------------------- +// +TInt CCmmDestinationStruct::SessionInstanceClosed() + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_SESSIONINSTANCECLOSED_ENTRY ); + + iReferenceCounter--; + if ( iReferenceCounter < 0 ) + { + // Error, reference counter shouldn't be able to go negative. + ASSERT( 0 ); + iReferenceCounter = 0; + } + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_SESSIONINSTANCECLOSED_EXIT ); + return iReferenceCounter; + } + +// ----------------------------------------------------------------------------- +// Called after this destination has been updated and database transaction has +// completed successfully. Sets the internal state of this destination +// structure to reflect the new valid state. +// ----------------------------------------------------------------------------- +// +void CCmmDestinationStruct::UpdateSuccessful() + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_UPDATESUCCESSFUL_ENTRY ); + + SetStatus( ECmmDestinationStatusValid ); + SetStatusForAllRecords( ECmmRecordStatusLoaded ); + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_UPDATESUCCESSFUL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmDestinationStruct::InitializeDestApRecordL +// Set default values to a new destination access point record. +// ----------------------------------------------------------------------------- +// +void CCmmDestinationStruct::InitializeDestApRecordL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_INITIALIZEDESTAPRECORDL_ENTRY ); + + SetDefaultTierManagerL(); + SetDefaultMCprL(); + SetDefaultCprL(); + SetDefaultSCprL(); + SetDefaultProtocolL(); + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_INITIALIZEDESTAPRECORDL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmDestinationStruct::SetDefaultTierManagerL +// Sets the default tier manager to destination access point record. +// ----------------------------------------------------------------------------- +void CCmmDestinationStruct::SetDefaultTierManagerL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_SETDEFAULTTIERMANAGERL_ENTRY ); + + CommsDat::CCDTierRecord* tierRecord = + static_cast( + CommsDat::CCDRecordBase::RecordFactoryL( CommsDat::KCDTIdTierRecord ) ); + CleanupStack::PushL( tierRecord ); + + tierRecord->iRecordTag = KDefaultTierManagerTagId; + + if ( tierRecord->FindL( iTransactionHandler->Session() ) ) + { + iDestApRecord->iTier = tierRecord->ElementId(); + } + else + { + User::Leave( KErrNotFound ); + } + CleanupStack::PopAndDestroy( tierRecord ); + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_SETDEFAULTTIERMANAGERL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmDestinationStruct::SetDefaultMCprL +// Sets the default MCpr to destination access point record. +// ----------------------------------------------------------------------------- +void CCmmDestinationStruct::SetDefaultMCprL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_SETDEFAULTMCPRL_ENTRY ); + + CommsDat::CCDMCprRecord* mcprRecord = + static_cast( + CommsDat::CCDRecordBase::RecordFactoryL( CommsDat::KCDTIdMCprRecord ) ); + CleanupStack::PushL( mcprRecord ); + + mcprRecord->SetRecordId( 1 ); + + mcprRecord->LoadL( iTransactionHandler->Session() ); + iDestApRecord->iMCpr = mcprRecord->ElementId(); + CleanupStack::PopAndDestroy( mcprRecord ); + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_SETDEFAULTMCPRL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmDestinationStruct::SetDefaultCprL +// Sets the default Cpr to destination access point record. +// ----------------------------------------------------------------------------- +void CCmmDestinationStruct::SetDefaultCprL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_SETDEFAULTCPRL_ENTRY ); + + CommsDat::CCDCprRecord* cprRecord = + static_cast( + CommsDat::CCDRecordBase::RecordFactoryL( CommsDat::KCDTIdCprRecord ) ); + CleanupStack::PushL( cprRecord ); + + cprRecord->SetRecordId( 1 ); + + cprRecord->LoadL( iTransactionHandler->Session() ); + iDestApRecord->iCpr = cprRecord->ElementId(); + CleanupStack::PopAndDestroy( cprRecord ); + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_SETDEFAULTCPRL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmDestinationStruct::SetDefaultSCprL +// Sets the default SCpr to destination access point record. +// ----------------------------------------------------------------------------- +void CCmmDestinationStruct::SetDefaultSCprL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_SETDEFAULTSCPRL_ENTRY ); + + CommsDat::CCDSCprRecord* scprRecord = + static_cast( + CommsDat::CCDRecordBase::RecordFactoryL( CommsDat::KCDTIdSCprRecord ) ); + CleanupStack::PushL( scprRecord ); + + scprRecord->SetRecordId( 1 ); + + scprRecord->LoadL( iTransactionHandler->Session() ); + iDestApRecord->iSCpr = scprRecord->ElementId(); + CleanupStack::PopAndDestroy( scprRecord ); + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_SETDEFAULTSCPRL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmDestinationStruct::SetDefaultProtocolL +// Sets the default protocol to destination access point record. +// ----------------------------------------------------------------------------- +void CCmmDestinationStruct::SetDefaultProtocolL() + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_SETDEFAULTPROTOCOLL_ENTRY ); + + CommsDat::CCDProtocolRecord* protocolRecord = + static_cast( + CommsDat::CCDRecordBase::RecordFactoryL( CommsDat::KCDTIdProtocolRecord ) ); + CleanupStack::PushL( protocolRecord ); + + protocolRecord->SetRecordId( 1 ); + + protocolRecord->LoadL( iTransactionHandler->Session() ); + iDestApRecord->iProtocol = protocolRecord->ElementId(); + CleanupStack::PopAndDestroy( protocolRecord ); + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_SETDEFAULTPROTOCOLL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Creates a copy of a record of the given type. +// ----------------------------------------------------------------------------- +CommsDat::CCDRecordBase* CCmmDestinationStruct::CopyRecordL( + TCmmDbRecords aRecordType, + CommsDat::CCDRecordBase* aSource ) + { + OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_COPYRECORDL_ENTRY ); + + CommsDat::CCDRecordBase* target = NULL; + + switch ( aRecordType ) + { + case ECmmDestNetworkRecord: + { + // Network record. + + CommsDat::CCDNetworkRecord* source = + static_cast( aSource ); + CommsDat::CCDNetworkRecord* networkRecord = + static_cast( + CommsDat::CCDRecordBase::RecordFactoryL( + CommsDat::KCDTIdNetworkRecord ) ); + CleanupStack::PushL( networkRecord ); + + if ( !source->iRecordTag.IsNull() ) + { + networkRecord->iRecordTag.SetL( source->iRecordTag ); + } + if ( !source->iRecordName.IsNull() ) + { + networkRecord->iRecordName.SetL( source->iRecordName ); + } + if ( !source->iHostName.IsNull() ) + { + networkRecord->iHostName.SetL( source->iHostName ); + } + networkRecord->SetElementId( source->ElementId() ); + + CleanupStack::Pop( networkRecord ); + target = static_cast( networkRecord ); + } + break; + case ECmmDestApRecord: + { + // Access point record. + + CommsDat::CCDAccessPointRecord* source = + static_cast( aSource ); + CommsDat::CCDAccessPointRecord* destApRecord = + static_cast( + CommsDat::CCDRecordBase::RecordFactoryL( + CommsDat::KCDTIdAccessPointRecord ) ); + CleanupStack::PushL( destApRecord ); + + if ( !source->iRecordTag.IsNull() ) + { + destApRecord->iRecordTag.SetL( source->iRecordTag ); + } + if ( !source->iRecordName.IsNull() ) + { + destApRecord->iRecordName.SetL( source->iRecordName ); + } + if ( !source->iAccessPointGID.IsNull() ) + { + destApRecord->iAccessPointGID.SetL( source->iAccessPointGID ); + } + if ( !source->iSelectionPolicy.IsNull() ) + { + destApRecord->iSelectionPolicy.SetL( source->iSelectionPolicy ); + } + + if ( !source->iTier.IsNull() ) + { + destApRecord->iTier.SetL( source->iTier ); + } + if ( !source->iMCpr.IsNull() ) + { + destApRecord->iMCpr.SetL( source->iMCpr ); + } + if ( !source->iCpr.IsNull() ) + { + destApRecord->iCpr.SetL( source->iCpr ); + } + if ( !source->iSCpr.IsNull() ) + { + destApRecord->iSCpr.SetL( source->iSCpr ); + } + if ( !source->iProtocol.IsNull() ) + { + destApRecord->iProtocol.SetL( source->iProtocol ); + } + if ( !source->iCprConfig.IsNull() ) + { + destApRecord->iCprConfig.SetL( source->iCprConfig ); + } + if ( !source->iAppSID.IsNull() ) + { + destApRecord->iAppSID.SetL( source->iAppSID ); + } + if ( !source->iConfigAPIdList.IsNull() ) + { + destApRecord->iConfigAPIdList.SetL( source->iConfigAPIdList ); + } + if ( !source->iCustomSelectionPolicy.IsNull() ) + { + destApRecord->iCustomSelectionPolicy.SetL( source->iCustomSelectionPolicy ); + } + if ( !source->iPriority.IsNull() ) + { + destApRecord->iPriority.SetL( source->iPriority ); + } + + destApRecord->SetElementId( aSource->ElementId() ); + + CleanupStack::Pop( destApRecord ); + target = static_cast( destApRecord ); + } + break; + case ECmmDestMetadataRecord: + { + // Metadata record. + CCDSNAPMetadataRecord* source = + static_cast( aSource ); + CCDSNAPMetadataRecord* metadataRecord = + new( ELeave ) CCDSNAPMetadataRecord( + iCache->TableId( ECmmDestMetadataRecord ) ); + CleanupStack::PushL( metadataRecord ); + + if ( !source->iRecordTag.IsNull() ) + { + metadataRecord->iRecordTag.SetL( source->iRecordTag ); + } + if ( !source->iRecordName.IsNull() ) + { + metadataRecord->iRecordName.SetL( source->iRecordName ); + } + if ( !source->iSNAP.IsNull() ) + { + metadataRecord->iSNAP.SetL( source->iSNAP ); + } + if ( !source->iMetadata.IsNull() ) + { + metadataRecord->iMetadata.SetL( source->iMetadata ); + } + if ( !source->iIcon.IsNull() ) + { + metadataRecord->iIcon.SetL( source->iIcon ); + } + metadataRecord->SetElementId( source->ElementId() ); + + CleanupStack::Pop( metadataRecord ); + target = static_cast( metadataRecord ); + } + break; + default: + { + User::Leave( KErrArgument ); + } + break; + } + + OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_COPYRECORDL_EXIT ); + return target; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmminstancemapping.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmminstancemapping.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,1162 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Keeps track of the general destination/connection method structure in +* database. +* +*/ + + +#include +#include +#include +#include +#include + +#include "cmminstancemapping.h" +#include "cmpluginbaseeng.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmminstancemappingTraces.h" +#endif + + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CDestination* CDestination::NewL() + { + OstTraceFunctionEntry0( CDESTINATION_NEWL_ENTRY ); + + CDestination* self = CDestination::NewLC(); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CDESTINATION_NEWL_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CDestination* CDestination::NewLC() + { + OstTraceFunctionEntry0( CDESTINATION_NEWLC_ENTRY ); + + CDestination* self = new( ELeave ) CDestination(); + CleanupStack::PushL( self ); + self->ConstructL(); + + OstTraceFunctionExit0( CDESTINATION_NEWLC_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CDestination::~CDestination() + { + OstTraceFunctionEntry0( CDESTINATION_CDESTINATION_ENTRY ); + + iConnMethodItemArray.Close(); + iUnsupportedConnMethods.Close(); + + OstTraceFunctionExit0( CDESTINATION_CDESTINATION_EXIT ); + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CDestination::CDestination() + { + OstTraceFunctionEntry0( DUP1_CDESTINATION_CDESTINATION_ENTRY ); + + iId = 0; + + OstTraceFunctionExit0( DUP1_CDESTINATION_CDESTINATION_EXIT ); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// +void CDestination::ConstructL() + { + OstTraceFunctionEntry0( CDESTINATION_CONSTRUCTL_ENTRY ); + OstTraceFunctionExit0( CDESTINATION_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmInstanceMapping* CCmmInstanceMapping::NewL( CCmmCache& aCache ) + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_NEWL_ENTRY ); + + CCmmInstanceMapping* self = CCmmInstanceMapping::NewLC( aCache ); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_NEWL_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmInstanceMapping* CCmmInstanceMapping::NewLC( CCmmCache& aCache ) + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_NEWLC_ENTRY ); + + CCmmInstanceMapping* self = new( ELeave ) CCmmInstanceMapping( aCache ); + CleanupStack::PushL( self ); + self->ConstructL(); + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_NEWLC_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CCmmInstanceMapping::~CCmmInstanceMapping() + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_CCMMINSTANCEMAPPING_ENTRY ); + + iConnMethodItemArray.Close(); + iUnsupportedConnMethods.Close(); + iDestinations.ResetAndDestroy(); + iDeletedConnMethods.Close(); + iDeletedDestinations.Close(); + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_CCMMINSTANCEMAPPING_EXIT ); + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CCmmInstanceMapping::CCmmInstanceMapping( CCmmCache& aCache ) : iCache( aCache ) + { + OstTraceFunctionEntry0( DUP1_CCMMINSTANCEMAPPING_CCMMINSTANCEMAPPING_ENTRY ); + iEasyWlanId = 0; + OstTraceFunctionExit0( DUP1_CCMMINSTANCEMAPPING_CCMMINSTANCEMAPPING_EXIT ); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::ConstructL() + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_CONSTRUCTL_ENTRY ); + + // Read connection methods from database and find the supported ones. + ReadAndValidateConnMethodsL(); + // Read destinations from database. + ReadAndValidateDestinationsL(); + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Resets arrays and reads CMs and Connection Methods +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::RefreshL() + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_REFRESHL_ENTRY ); + + ReadAndValidateConnMethodsL(); + ReadAndValidateDestinationsL(); + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_REFRESHL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Check if the given ID is a valid existing destination ID. +// --------------------------------------------------------------------------- +// +TBool CCmmInstanceMapping::ValidDestinationId( const TUint32& aId ) const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_VALIDDESTINATIONID_ENTRY ); + + TBool validity( EFalse ); + + if ( aId > 0 ) + { + for ( TInt i = 0; i < iDestinations.Count(); i++ ) + { + if ( iDestinations[i]->iId == aId ) + { + validity = ETrue; + break; + } + } + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_VALIDDESTINATIONID_EXIT ); + return validity; + } + +// --------------------------------------------------------------------------- +// Check if the given ID is a valid existing connection method ID. +// --------------------------------------------------------------------------- +// +TBool CCmmInstanceMapping::ValidConnMethodId( const TUint32& aId ) const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_VALIDCONNMETHODID_ENTRY ); + + TBool validity( EFalse ); + + if ( aId > 0 ) + { + for ( TInt i = 0; i < iConnMethodItemArray.Count(); i++ ) + { + if ( iConnMethodItemArray[i].iId == aId ) + { + validity = ETrue; + break; + } + } + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_VALIDCONNMETHODID_EXIT ); + return validity; + } + +// --------------------------------------------------------------------------- +// Check from database if the given destination is an embedded destination in +// any other destination. +// --------------------------------------------------------------------------- +// +TBool CCmmInstanceMapping::DestinationIsEmbedded( const TUint32& aDestinationId ) const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_DESTINATIONISEMBEDDED_ENTRY ); + + TBool result( EFalse ); + TInt index( 0 ); + + // Iterate through all destinations. + for ( TInt i = 0; i < iDestinations.Count(); i++ ) + { + // An embedded destination is always at the very last position in + // the connection method item array. + index = iDestinations[i]->iConnMethodItemArray.Count() - 1; + if ( index >= 0 ) + { + // We can skip bearer type check. If the last item isn't an + // embedded destination, the ID will not match anyway. + if ( iDestinations[i]->iConnMethodItemArray[index].iId == aDestinationId ) + { + result = ETrue; + break; + } + } + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_DESTINATIONISEMBEDDED_EXIT ); + return result; + } + +// --------------------------------------------------------------------------- +// Check from database if the given destination has an embedded destination. +// --------------------------------------------------------------------------- +// +TBool CCmmInstanceMapping::DestinationHasEmbedded( const TUint32& aDestinationId ) const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_DESTINATIONHASEMBEDDED_ENTRY ); + + TBool result( EFalse ); + + for ( TInt i = 0; i < iDestinations.Count(); i++ ) + { + // Find the correct destination. + if ( iDestinations[i]->iId == aDestinationId ) + { + // An embedded destination is always at the very last position in + // the connection method item array. + TInt index = iDestinations[i]->iConnMethodItemArray.Count() - 1; + if ( index >= 0 ) + { + if ( iDestinations[i]->iConnMethodItemArray[index].iBearerType == KUidEmbeddedDestination ) + { + result = ETrue; + } + } + break; + } + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_DESTINATIONHASEMBEDDED_EXIT ); + return result; + } + +// --------------------------------------------------------------------------- +// Check from database if the given destination is pointed to by any virtual +// IAP. +// --------------------------------------------------------------------------- +// +TBool CCmmInstanceMapping::DestinationPointedToByVirtualIap( + const TUint32& /*aDestinationId*/ ) const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_DESTINATIONPOINTEDTOBYVIRTUALIAP_ENTRY ); + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_DESTINATIONPOINTEDTOBYVIRTUALIAP_EXIT ); + + return EFalse; //TODO, virtual IAPs are not yet supported. + } + +// --------------------------------------------------------------------------- +// Check from database if the given connection method is pointed to by any +// virtual IAP. +// --------------------------------------------------------------------------- +// +TBool CCmmInstanceMapping::ConnMethodPointedToByVirtualIap( + const TUint32& /*aConnMethodId*/ ) const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_CONNMETHODPOINTEDTOBYVIRTUALIAP_ENTRY ); + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_CONNMETHODPOINTEDTOBYVIRTUALIAP_EXIT ); + + return EFalse; //TODO, virtual IAPs are not yet supported. + } + +// --------------------------------------------------------------------------- +// Check if the given connection method is the only connection method in the +// given destination and if a virtual IAP points to that destination. +// --------------------------------------------------------------------------- +// +TBool CCmmInstanceMapping::ConnMethodInDestinationButLocked( + const TUint32& /*aConnMethodId*/, + const TUint32& /*aDestinationId*/ ) const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_CONNMETHODINDESTINATIONBUTLOCKED_ENTRY ); + + // - Find correct destination. + // - Check if it only has 1 CM. + // - Check if the CM is the one given. + // - Call DestinationPointedToByVirtualIap( aDestinationId ). + // + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_CONNMETHODINDESTINATIONBUTLOCKED_EXIT ); + + return EFalse; //TODO, virtual IAPs are not yet supported. + } + +// --------------------------------------------------------------------------- +// Get bearer type of connection method matching given ID. +// Return KErrNone if ID is found, KErrNotFound if not. +// --------------------------------------------------------------------------- +// +TInt CCmmInstanceMapping::GetConnMethodBearerType( + const TUint32& aConnMethodId, + TUint32& bearerType ) const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_GETCONNMETHODBEARERTYPE_ENTRY ); + + TInt result( KErrNotFound ); + + for ( TInt i = 0; i < iConnMethodItemArray.Count(); i++ ) + { + if ( iConnMethodItemArray[i].iId == aConnMethodId ) + { + bearerType = iConnMethodItemArray[i].iBearerType; + result = KErrNone; + break; + } + } + if ( result == KErrNotFound ) + { + // Embedded destinations are not in connection method array, need check from ID range. + if ( aConnMethodId > KCmmDestIdIntervalMin && aConnMethodId < KCmmDestIdIntervalMax ) + { + bearerType = KUidEmbeddedDestination; + result = KErrNone; + } + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_GETCONNMETHODBEARERTYPE_EXIT ); + return result; + } + +// --------------------------------------------------------------------------- +// Returns the number of destinations the provided connection method belongs +// to. Zero is returned if the connection method belongs to no destination +// (legacy IAP) or does not exist. +// --------------------------------------------------------------------------- +// +TInt CCmmInstanceMapping::DestinationsContainingConnMethod( + const TUint32& aConnMethodId ) const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_CONNMETHODREFERENCECOUNT_ENTRY ); + + TInt referenceCount( 0 ); + TInt count( 0 ); + + // Go through each destination. + for ( TInt i = 0; i < iDestinations.Count(); i++ ) + { + TBool foundInThisDestination( EFalse ); + + // Loop through all connection methods in this destination. + count = iDestinations[i]->iConnMethodItemArray.Count(); + for ( TInt j = 0; j < count; j++ ) + { + if ( iDestinations[i]->iConnMethodItemArray[j].iId == aConnMethodId ) + { + foundInThisDestination = ETrue; + referenceCount++; + break; + } + } + + // Check unsupported connection methods also. + if ( !foundInThisDestination ) + { + count = iDestinations[i]->iUnsupportedConnMethods.Count(); + for ( TInt j = 0; j < count; j++ ) + { + if ( iDestinations[i]->iUnsupportedConnMethods[j] == aConnMethodId ) + { + referenceCount++; + break; + } + } + } + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_CONNMETHODREFERENCECOUNT_EXIT ); + return referenceCount; + } + +// --------------------------------------------------------------------------- +// Get database session. +// --------------------------------------------------------------------------- +// +CommsDat::CMDBSession& CCmmInstanceMapping::Session() const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_SESSION_ENTRY ); + + return iCache.Session(); + } + +// --------------------------------------------------------------------------- +// Discovers all connection methods from database. Unsupported connection +// methods are kept separately. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::ReadAndValidateConnMethodsL() + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_READANDVALIDATECONNMETHODSL_ENTRY ); + + CMDBRecordSet* iapRecordSet = + new( ELeave ) CMDBRecordSet( KCDTIdIAPRecord ); + CleanupStack::PushL( iapRecordSet ); + + CCDIAPRecord* iapRecord = static_cast( CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); + CleanupStack::PushL( iapRecord ); + + TRAP_IGNORE( iapRecordSet->LoadL( Session() ) ); + + //TODO, check from commsdat dump if all high-range IDs are available, or was some records + //TODO used up by something. will this possibly affect cm/destination creation with predef ID? (Keijo) + + iConnMethodItemArray.Reset(); + iUnsupportedConnMethods.Reset(); + + TInt iapRecordCount( iapRecordSet->iRecords.Count() ); + TInt err( KErrNone ); + TUint32 bearerType( 0 ); + TUint bearerPriority( CMManager::KDataMobilitySelectionPolicyPriorityWildCard ); + + for ( TInt i = 0; i < iapRecordCount; i++ ) + { + TUint32 connMethodId( iapRecordSet->iRecords[i]->RecordId() ); + + // Check the connection method is not on the deleted list waiting to be deleted from database. + TInt indexInDeletedList = iDeletedConnMethods.FindInOrder( ( TUint )connMethodId ); + if ( indexInDeletedList == KErrNotFound ) + { + // Check the bearer type of the iap. Leaves if iap is unsupported. + iapRecord->SetRecordId( connMethodId ); + TRAP( err, iCache.BearerInfoFromIapRecordL( iapRecord, bearerType, bearerPriority ) ); //TODO + if ( !err ) + { + TCmmConnMethodItem item( connMethodId, bearerType, bearerPriority, 0 ); + iConnMethodItemArray.Append( item ); // Ignore errors. + } + else if ( err == KErrNotSupported ) + { + iUnsupportedConnMethods.Append( connMethodId ); // Ignore errors. + } + else if ( err == KErrNoMemory ) + { + User::Leave( err ); //TODO, check what this will cause. + } + } + } + + CleanupStack::PopAndDestroy( iapRecord ); + CleanupStack::PopAndDestroy( iapRecordSet ); + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_READANDVALIDATECONNMETHODSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Discovers all destinations and the connection methods inside them. +// Unsupported connection methods are kept separately. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::ReadAndValidateDestinationsL() + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_READANDVALIDATEDESTINATIONSL_ENTRY ); + + // Make 2 loops, first add destinations and then connection methods / embedded destinations. + iDestinations.ResetAndDestroy(); + + // Explicitly build a TLinearOrder. Used as parameter to RArray::InsertInOrder(). + TLinearOrder connMethodItemOrderingLogic( TCmmConnMethodItem::Compare ); + + CMDBRecordSet* snapRecordSet = + new( ELeave ) CMDBRecordSet( + iCache.TableId( ECmmDbSnapRecord ) ); + CleanupStack::PushL( snapRecordSet ); + + CCDDataMobilitySelectionPolicyRecord* snapRecord = + new( ELeave ) CCDDataMobilitySelectionPolicyRecord( + iCache.TableId( ECmmDbSnapRecord ) ); + CleanupStack::PushL( snapRecord ); + + TRAP_IGNORE( snapRecordSet->LoadL( Session() ) ); + + // Read snap ID, connection method ID and embedded destination ID. + const TInt snapRecordCount( snapRecordSet->iRecords.Count() ); + for ( TInt i = 0; i < snapRecordCount; i++ ) + { + snapRecord->SetElementId( snapRecordSet->iRecords[i]->ElementId() ); + snapRecord->LoadL( Session() ); + + TUint32 destinationId = (TUint32)( snapRecord->iSNAP ); + TInt indexInDeletedList = iDeletedDestinations.FindInOrder( ( TUint )destinationId ); + if ( indexInDeletedList == KErrNotFound ) + { + TUint32 connMethodId = ( snapRecord->iIAP & KCDMaskShowRecordId ) >> 8; + TUint32 embeddedDestinationId = (TUint32)( snapRecord->iEmbeddedSNAP ); + + // If connMethodId and embeddedDestinationId are 0 this is a destination. + if ( connMethodId == 0 && embeddedDestinationId == 0 ) + { + TBool destAlreadyExists( EFalse ); + for ( TInt j = 0; j < iDestinations.Count(); j++ ) + { + if ( destinationId == iDestinations[j]->iId ) + { + destAlreadyExists = ETrue; + break; + } + } + + if ( !destAlreadyExists ) + { + CDestination* dest = CDestination::NewL(); + dest->iId = destinationId; + iDestinations.Append( dest ); + } + } + } + } + + // Read snap ID, connection method ID and embedded destination ID. + for ( TInt i = 0; i < snapRecordCount; i++ ) + { + snapRecord->SetElementId( snapRecordSet->iRecords[i]->ElementId() ); + snapRecord->LoadL( Session() ); + + TUint32 destinationId = (TUint32)( snapRecord->iSNAP ); + TUint32 connMethodId = ( snapRecord->iIAP & KCDMaskShowRecordId ) >> 8; + TUint32 embeddedDestinationId = (TUint32)( snapRecord->iEmbeddedSNAP ); + + // If connMethodId or embeddedDestinationId differs from 0 this is a connection method object. + if ( connMethodId > 0 || embeddedDestinationId > 0 ) + { + // Find destination. + CDestination* destination( NULL ); + for ( TInt j = 0; j < iDestinations.Count(); j++ ) + { + if ( destinationId == iDestinations[j]->iId ) + { + destination = iDestinations[j]; + break; + } + } + + if ( destination ) + { + if ( connMethodId ) + { + // Connection method, not embedded destination. + TBool found( EFalse ); + TCmmConnMethodItem item; + + // Find connection method. + for ( TInt j = 0; j < iConnMethodItemArray.Count(); j++ ) + { + if ( iConnMethodItemArray[j].iId == connMethodId ) + { + item = iConnMethodItemArray[j]; + found = ETrue; + break; + } + } + if ( found ) + { + // Make sure no duplicate entries are allowed. Any + // duplicate would imply a corrupted CommsDat. + TInt index = destination->iConnMethodItemArray.Find( + connMethodId, + TCmmConnMethodItem::FindCompare ); + if ( index == KErrNotFound ) + { + item.iPriority = snapRecord->iPriority; + destination->iConnMethodItemArray.InsertInOrderAllowRepeats( //TODO, if prio is 256, bearer type used? embeded should always be last. + item, + connMethodItemOrderingLogic ); // Ignore errors. + } + } + else + { + // Check if the connection method is unsupported instead. + for ( TInt j = 0; j < iUnsupportedConnMethods.Count(); j++ ) + { + if ( iUnsupportedConnMethods[j] == connMethodId ) + { + found = ETrue; + break; + } + } + if ( found ) + { + destination->iUnsupportedConnMethods.Append( connMethodId ); // Ignore errors. //TODO, allow repeats? + } + } + } + + else + { + // Embedded destination, not IAP. + // Prevent destinations from embedding themselves. + if ( embeddedDestinationId != destinationId ) + { + // Check embedded destination ID is valid. + TBool found( EFalse ); + for ( TInt j = 0; j < iDestinations.Count(); j++ ) + { + if ( embeddedDestinationId == iDestinations[j]->iId ) + { + found = ETrue; + break; + } + } + if ( found ) + { + TCmmConnMethodItem item( + embeddedDestinationId, + KUidEmbeddedDestination, + CMManager::KDataMobilitySelectionPolicyPriorityWildCard, + CMManager::KDataMobilitySelectionPolicyPriorityWildCard ); + destination->iConnMethodItemArray.InsertInOrderAllowRepeats( + item, + connMethodItemOrderingLogic ); + } + } + } + } + } + } + CleanupStack::PopAndDestroy( snapRecord ); + CleanupStack::PopAndDestroy( snapRecordSet ); + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_READANDVALIDATEDESTINATIONSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Returns all conenction method IDs. Unsupported connection methods are +// included if aCheckBearerType is set to EFalse. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::GetAllConnMethodsL( + RArray& aConnMethodArray, + TBool aCheckBearerType ) const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_GETCONNMETHODSL_ENTRY ); + + TInt connMethodCount = iConnMethodItemArray.Count(); + aConnMethodArray.Reset(); + + if ( aCheckBearerType ) + { + aConnMethodArray.ReserveL( connMethodCount ); + } + else + { + aConnMethodArray.ReserveL( connMethodCount + iUnsupportedConnMethods.Count() ); + } + + for ( TInt i = 0; i < connMethodCount; i++ ) + { + aConnMethodArray.AppendL( iConnMethodItemArray[i].iId ); + } + if ( !aCheckBearerType ) + { + // Include unsupported connection methods also. + for ( TInt i = 0; i < iUnsupportedConnMethods.Count(); i++ ) + { + aConnMethodArray.AppendL( iUnsupportedConnMethods[i] ); + } + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_GETCONNMETHODSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Return the number of destinations in database. +// --------------------------------------------------------------------------- +// +TInt CCmmInstanceMapping::GetDestinationCount() const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_GETDESTINATIONCOUNT_ENTRY ); + + return iDestinations.Count(); + } + +// --------------------------------------------------------------------------- +// Return an array containing all destination IDs. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::GetDestinationsL( RArray& aDestinationArray ) const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_GETDESTINATIONSL_ENTRY ); + + aDestinationArray.Reset(); + aDestinationArray.ReserveL( iDestinations.Count() ); // Re-allocates only if more is needed. + + for ( TInt i = 0; i < iDestinations.Count(); i++ ) + { + aDestinationArray.AppendL( iDestinations[i]->iId ); + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_GETDESTINATIONSL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Inserts all the valid connection methods inside the given destination into +// the provided connection method item array. The array is reset first. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::GetConnMethodsFromDestinationL( + const TUint32& aDestinationId, + RArray& aConnMethodArray ) const + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_GETCONNMETHODSFROMDESTINATIONL_ENTRY ); + + TBool destinationFound( EFalse ); + + for ( TInt i = 0; i < iDestinations.Count(); i++ ) + { + if ( iDestinations[i]->iId == aDestinationId ) + { + destinationFound = ETrue; + aConnMethodArray.Reset(); + aConnMethodArray.ReserveL( iDestinations[i]->iConnMethodItemArray.Count() ); + + for ( TInt j = 0; j < iDestinations[i]->iConnMethodItemArray.Count(); j++ ) + { + aConnMethodArray.AppendL( iDestinations[i]->iConnMethodItemArray[j] ); + } + break; + } + } + if ( !destinationFound ) + { + User::Leave( KErrNotFound ); + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_GETCONNMETHODSFROMDESTINATIONL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Check if the given connection method belongs to any other destination than +// the one provided. +// --------------------------------------------------------------------------- +// +TBool CCmmInstanceMapping::ConnMethodInOtherDestination( + const TUint32& aConnMethodId, + const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_CONNMETHODINOTHERDESTINATION_ENTRY ); + + // Loop through all destinations. + for ( TInt i = 0; i < iDestinations.Count(); i++ ) + { + // Skip the specified destination. + if ( iDestinations[i]->iId != aDestinationId ) + { + // Loop through all connection methods in the current destination. + for ( TInt j = 0; j < iDestinations[i]->iConnMethodItemArray.Count(); j++ ) + { + if ( iDestinations[i]->iConnMethodItemArray[j].iId == aConnMethodId ) + { + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_CONNMETHODINOTHERDESTINATION_EXIT ); + return ETrue; + } + } + } + } + + OstTraceFunctionExit0( DUP1_CCMMINSTANCEMAPPING_CONNMETHODINOTHERDESTINATION_EXIT ); + return EFalse; + } + +// --------------------------------------------------------------------------- +// Return the EasyWLAN IAP ID, zero if not found or WLAN not supported. +// --------------------------------------------------------------------------- +// +TUint32 CCmmInstanceMapping::EasyWlanIdL() + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_EASYWLANIDL_ENTRY ); + + iEasyWlanId = 0; + + // Check WLAN support. + if ( iCache.WlanSupported() ) + { + CMDBRecordSet* iapRecordSet = + new( ELeave ) CMDBRecordSet( KCDTIdIAPRecord ); + CleanupStack::PushL( iapRecordSet ); + TRAP_IGNORE( iapRecordSet->LoadL( Session() ) ); + + TInt iapRecordCount( iapRecordSet->iRecords.Count() ); + for ( TInt i = 0; i < iapRecordCount; i++ ) + { + CCDIAPRecord* iapRecord = ( CCDIAPRecord* )iapRecordSet->iRecords[i]; + + if ( TPtrC( iapRecord->iServiceType ) == TPtrC( KCDTypeNameLANService ) && + TPtrC( iapRecord->iBearerType ) == TPtrC( KCDTypeNameLANBearer ) ) + { + TUint32 serviceId = iapRecord->iService; + + CCDWlanServiceRecord* wlanServ = + new( ELeave ) CCDWlanServiceRecord( + CCDWlanServiceRecord::TableIdL( Session() ) ); + CleanupStack::PushL( wlanServ ); + + wlanServ->iWlanServiceId.SetL( serviceId ); + if ( wlanServ->FindL( Session() ) ) + { + wlanServ->LoadL( Session() ); + // Only EasyWLAN IAP has NULL in SSID field. + if ( wlanServ->iWLanSSID.IsNull() || + !( TPtrC( wlanServ->iWLanSSID ).Compare( KNullDesC ) ) ) + { + iEasyWlanId = iapRecord->RecordId(); + } + } + CleanupStack::PopAndDestroy( wlanServ ); + } + if ( iEasyWlanId != 0 ) + { + break; + } + } + CleanupStack::PopAndDestroy( iapRecordSet ); + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_EASYWLANIDL_EXIT ); + return iEasyWlanId; + } + +// --------------------------------------------------------------------------- +// Find out the internet destination ID. ID is set to 0 if not found. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::InternetDestinationIdL( TUint& aInternetDestinationId ) + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_INTERNETDESTINATIONIDL_ENTRY ); + + // Set to zero in case the destination is not found. + aInternetDestinationId = 0; + + CommsDat::CMDBRecordSet* metaSet = + new( ELeave )CommsDat::CMDBRecordSet( + iCache.TableId( ECmmDestMetadataRecord ) ); + CleanupStack::PushL( metaSet ); + + TRAP_IGNORE( metaSet->LoadL( Session() ) ); + + CCDSNAPMetadataRecord* metadataRecord = + new( ELeave ) CCDSNAPMetadataRecord( + iCache.TableId( ECmmDestMetadataRecord ) ); + CleanupStack::PushL( metadataRecord ); + + for ( TInt i = 0; i < metaSet->iRecords.Count(); i++ ) + { + metadataRecord->SetRecordId( metaSet->iRecords[i]->RecordId() ); + metadataRecord->LoadL( Session() ); + + TUint32 metadata = metadataRecord->iMetadata; + + TUint32 internet = metadata & CMManager::ESnapMetadataInternet; + TUint32 localizationValue = ( metadata & CMManager::ESnapMetadataDestinationIsLocalised ) >> 4; + TUint32 purposeValue = ( metadata & CMManager::ESnapMetadataPurpose ) >> 8; + + // The first record that has a matching value in any of the 3 metadata + // fields will be taken as the internet snap. + if ( internet || + ( localizationValue == CMManager::ELocalisedDestInternet ) || + ( purposeValue == CMManager::ESnapPurposeInternet ) ) + { + TInt id = metadataRecord->iSNAP; + if ( ValidDestinationId( ( TUint32 )id ) ) + { + aInternetDestinationId = ( TUint )id; + break; + } + } + } + CleanupStack::PopAndDestroy( metadataRecord ); + CleanupStack::PopAndDestroy( metaSet ); + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_INTERNETDESTINATIONIDL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Add a connection method ID to deleted list. Ignores any duplicates. Also +// removes the connection method from destination/connection method structures +// so Refresh()-call is not needed. Use this method if the connection method +// has not been removed from database yet. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::AddConnMethodToDeletedListL( const TUint& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_ADDCONNMETHODTODELETEDLISTL_ENTRY ); + + iDeletedConnMethods.InsertInOrderL( aConnMethodId ); + + // Remove the connection method from current destination/connection method structures. + RemoveConnMethod( aConnMethodId ); + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_ADDCONNMETHODTODELETEDLISTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Remove a connection method ID from deleted list. Nothing happens if ID is +// not found from the list. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::RemoveConnMethodFromDeletedList( const TUint& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_REMOVECONNMETHODFROMDELETEDLIST_ENTRY ); + + TInt index = iDeletedConnMethods.FindInOrder( aConnMethodId ); + if ( index != KErrNotFound ) + { + iDeletedConnMethods.Remove( index ); + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_REMOVECONNMETHODFROMDELETEDLIST_EXIT ); + } + +// --------------------------------------------------------------------------- +// Add a destination ID to deleted list. Ignores any duplicates. Also removes +// the destination from destination/connection method structures so +// Refresh()-call is not needed. Use this method if the connection method has +// not been removed from database yet. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::AddDestinationToDeletedListL( const TUint& aDestinationId ) + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_ADDDESTINATIONTODELETEDLISTL_ENTRY ); + + iDeletedDestinations.InsertInOrderL( aDestinationId ); + + // Remove the destination from current destination/connection method structures. + RemoveDestination( aDestinationId ); + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_ADDDESTINATIONTODELETEDLISTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Remove a destination ID from deleted list. Nothing happens if ID is not +// found from the list. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::RemoveDestinationFromDeletedList( const TUint& aDestinationId ) //TODO, check removal is called in all necessary places. + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_REMOVEDESTINATIONFROMDELETEDLIST_ENTRY ); + + TInt index = iDeletedDestinations.FindInOrder( aDestinationId ); + if ( index != KErrNotFound ) + { + iDeletedDestinations.Remove( index ); + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_REMOVEDESTINATIONFROMDELETEDLIST_EXIT ); + } + +// --------------------------------------------------------------------------- +// Remove the connection method from current destination/connection method +// structures. This is a lot faster than calling Refresh(). Use this method if +// the connection method has been removed from database. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::RemoveConnMethod( const TUint32& aConnMethodId ) //TODO, check where this is used and if it would be better to use version with array instead? + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_REMOVECONNMETHOD_ENTRY ); + + // Remove from list of connection methods. + for ( TInt i = 0; i < iConnMethodItemArray.Count(); i++ ) + { + if ( iConnMethodItemArray[i].iId == aConnMethodId ) + { + iConnMethodItemArray.Remove( i ); + break; + } + } + + // Remove connection method from all destinations. + for ( TInt i = 0; i < iDestinations.Count(); i++ ) + { + for ( TInt j = 0; j < iDestinations[i]->iConnMethodItemArray.Count(); j++ ) + { + if ( iDestinations[i]->iConnMethodItemArray[j].iId == aConnMethodId ) + { + iDestinations[i]->iConnMethodItemArray.Remove( j ); + break; + } + } + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_REMOVECONNMETHOD_EXIT ); + } + +// --------------------------------------------------------------------------- +// Remove the connection method from current destination/connection method +// structures. This is a lot faster than calling Refresh(). Use this method if +// the connection method has been removed from database. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::RemoveConnMethod( + const TUint32& aConnMethodId, + RArray& aChangedDestinations ) + { + + // Remove from list of connection methods. + for ( TInt i = 0; i < iConnMethodItemArray.Count(); i++ ) + { + if ( iConnMethodItemArray[i].iId == aConnMethodId ) + { + iConnMethodItemArray.Remove( i ); + break; + } + } + + // Remove connection method from all destinations. + for ( TInt i = 0; i < iDestinations.Count(); i++ ) + { + for ( TInt j = 0; j < iDestinations[i]->iConnMethodItemArray.Count(); j++ ) + { + if ( iDestinations[i]->iConnMethodItemArray[j].iId == aConnMethodId ) + { + iDestinations[i]->iConnMethodItemArray.Remove( j ); + // Add ID of changed destination into array. Ignore any error. + aChangedDestinations.Append( iDestinations[i]->iId ); + break; + } + } + } + + } + +// --------------------------------------------------------------------------- +// Remove the destination from current destination/connection method +// structures. This is a lot faster than calling Refresh(). Use this method if +// the connection method has been removed from database. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::RemoveDestination( const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_REMOVEDESTINATION_ENTRY ); + + for ( TInt i = 0; i < iDestinations.Count(); i++ ) + { + if ( iDestinations[i]->iId == aDestinationId ) + { + delete iDestinations[i]; + iDestinations.Remove( i ); + i--; + } + else + { + // Check also if the destination is an embedded destination + // anywhere, and remove that reference too. + TInt cmCount( iDestinations[i]->iConnMethodItemArray.Count() ); + if ( cmCount ) + { + if ( iDestinations[i]->iConnMethodItemArray[cmCount - 1].iId == aDestinationId ) + { + iDestinations[i]->iConnMethodItemArray.Remove( cmCount - 1 ); + } + } + } + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_REMOVEDESTINATION_EXIT ); + } + +// --------------------------------------------------------------------------- +// Remove the connection method from all destinations in the current +// destination/connection method structures. This is a lot faster than calling +// Refresh(). The ID of any changed destination is added to the +// aChangedDestinations-array. +// --------------------------------------------------------------------------- +// +void CCmmInstanceMapping::RemoveConnMethodFromDestinations( + const TUint32& aConnMethodId, + RArray& aChangedDestinations ) + { + OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_REMOVECONNMETHODFROMDESTINATIONS_ENTRY ); + + // Remove given connection method from all destinations. + for ( TInt i = 0; i < iDestinations.Count(); i++ ) + { + for ( TInt j = 0; j < iDestinations[i]->iConnMethodItemArray.Count(); j++ ) + { + if ( iDestinations[i]->iConnMethodItemArray[j].iId == aConnMethodId ) + { + iDestinations[i]->iConnMethodItemArray.Remove( j ); + // Add ID of changed destination into array. Ignore any error. + aChangedDestinations.Append( iDestinations[i]->iId ); + break; + } + } + } + + OstTraceFunctionExit0( CCMMINSTANCEMAPPING_REMOVECONNMETHODFROMDESTINATIONS_EXIT ); + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmlistenermanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmlistenermanager.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,183 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Manages all CommsDat table specific CenRep listeners. +* +*/ + + +#include "cmmcache.h" +#include "cmmlistenermanager.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmlistenermanagerTraces.h" +#endif + + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmListenerManager* CCmmListenerManager::NewL( CCmmCache* aCache ) + { + OstTraceFunctionEntry0( CCMMLISTENERMANAGER_NEWL_ENTRY ); + + CCmmListenerManager* self = CCmmListenerManager::NewLC( aCache ); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMMLISTENERMANAGER_NEWL_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Two phased construction. +// --------------------------------------------------------------------------- +// +CCmmListenerManager* CCmmListenerManager::NewLC( CCmmCache* aCache ) + { + OstTraceFunctionEntry0( CCMMLISTENERMANAGER_NEWLC_ENTRY ); + + CCmmListenerManager* self = new( ELeave ) CCmmListenerManager( aCache ); + CleanupStack::PushL( self ); + self->ConstructL(); + + OstTraceFunctionExit0( CCMMLISTENERMANAGER_NEWLC_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CCmmListenerManager::~CCmmListenerManager() + { + OstTraceFunctionEntry0( CCMMLISTENERMANAGER_CCMMLISTENERMANAGER_ENTRY ); + + // The destructor of each listener will cancel their own active request. + iListeners.ResetAndDestroy(); + + OstTraceFunctionExit0( CCMMLISTENERMANAGER_CCMMLISTENERMANAGER_EXIT ); + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CCmmListenerManager::CCmmListenerManager( CCmmCache* aCache ) : iCache( aCache ) + { + OstTraceFunctionEntry0( DUP1_CCMMLISTENERMANAGER_CCMMLISTENERMANAGER_ENTRY ); + OstTraceFunctionExit0( DUP1_CCMMLISTENERMANAGER_CCMMLISTENERMANAGER_EXIT ); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// +void CCmmListenerManager::ConstructL() + { + OstTraceFunctionEntry0( CCMMLISTENERMANAGER_CONSTRUCTL_ENTRY ); + + // Create the basic set of listeners, start them if necessary and store them in iListeners-array. + + OstTraceFunctionExit0( CCMMLISTENERMANAGER_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Adds a new listener to monitor for changes in the given database table. +// --------------------------------------------------------------------------- +// +void CCmmListenerManager::AddListenerL( TUint32 aIdentifier ) + { + OstTraceFunctionEntry0( CCMMLISTENERMANAGER_ADDLISTENERL_ENTRY ); + + TBool duplicateFound( EFalse ); + for ( TInt i = 0; i < iListeners.Count(); i++ ) + { + if ( iListeners[i]->GetTableId() == aIdentifier ) + { + duplicateFound = ETrue; + break; + } + } + + if ( !duplicateFound ) + { + CCmmDbChangeListener* dbChangeListener = CCmmDbChangeListener::NewLC( this, aIdentifier ); + iListeners.AppendL( dbChangeListener ); + CleanupStack::Pop( dbChangeListener ); + TInt err = dbChangeListener->Start(); + if ( err ) + { + iCache->DbChangeError( aIdentifier ); + } + } + + OstTraceFunctionExit0( CCMMLISTENERMANAGER_ADDLISTENERL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Stops and deletes the listener monitoring the given database table. +// --------------------------------------------------------------------------- +// +TInt CCmmListenerManager::RemoveListener( TUint32 aIdentifier ) + { + OstTraceFunctionEntry0( CCMMLISTENERMANAGER_REMOVELISTENER_ENTRY ); + + TInt res( KErrNotFound ); + for ( TInt i = 0; i < iListeners.Count(); i++ ) + { + if ( iListeners[i]->GetTableId() == aIdentifier ) + { + delete iListeners[i]; + iListeners.Remove( i ); + res = KErrNone; + break; + } + } + + OstTraceFunctionExit0( CCMMLISTENERMANAGER_REMOVELISTENER_EXIT ); + return res; + } + +// --------------------------------------------------------------------------- +// Tells the listener manager that a change has been detected in the given +// database table. +// --------------------------------------------------------------------------- +// +void CCmmListenerManager::DbChangeDetected( TUint32 aIdentifier ) + { + OstTraceFunctionEntry0( CCMMLISTENERMANAGER_DBCHANGEDETECTED_ENTRY ); + + iCache->DbChangeDetected( aIdentifier ); + + OstTraceFunctionExit0( CCMMLISTENERMANAGER_DBCHANGEDETECTED_EXIT ); + } + +// --------------------------------------------------------------------------- +// Tells the listener manager that an error has been encountered while +// listening the given database table. Change notifications will not be working +// for this database table. +// --------------------------------------------------------------------------- +// +void CCmmListenerManager::DbChangeError( TUint32 aIdentifier ) + { + OstTraceFunctionEntry0( CCMMLISTENERMANAGER_DBCHANGEERROR_ENTRY ); + + iCache->DbChangeError( aIdentifier ); + + OstTraceFunctionExit0( CCMMLISTENERMANAGER_DBCHANGEERROR_EXIT ); + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmserver.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,580 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Connection method manager server. +* +*/ + + +#include +#include +#include + +#include "cmmserver.h" +#include "cmmsession.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmserverTraces.h" +#endif + + +const TUint CCmmServer::iCmmRangeCount = 12; + +const TInt CCmmServer::iCmmRanges[iCmmRangeCount] = + { + 0, // 0-10 + 11, // 11-14 + 15, // 15-21 + 22, // 22-99 + 100, // 100-112 + 113, // 113-126 + 127, // 127-199 + 200, // 200-205 + 206, // 206-210 + 211, // 211-214 + 215, // 215-220 + 221 // 221-KMaxInt + }; + +const TUint8 CCmmServer::iCmmElementIndex[iCmmRangeCount] = + { + CPolicyServer::EAlwaysPass, // 0-10 + CPolicyServer::ECustomCheck, // 11-14 + CPolicyServer::ECustomCheck, // 15-21 + CPolicyServer::ENotSupported, // 22-99 + CPolicyServer::EAlwaysPass, // 100-112 + CPolicyServer::ECustomCheck, // 113-126 + CPolicyServer::ENotSupported, // 127-199 + CPolicyServer::EAlwaysPass, // 200-205 + CPolicyServer::ECustomCheck, // 206-210 + CPolicyServer::ECustomCheck, // 211-214 + CPolicyServer::ECustomCheck, // 215-220 + CPolicyServer::ENotSupported // 221-> + }; + +const CPolicyServer::TPolicyElement CCmmServer::iCmmElements[] = + { + {_INIT_SECURITY_POLICY_C1(ECapabilityReadDeviceData), CPolicyServer::EFailClient}, + {_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData), CPolicyServer::EFailClient}, + {_INIT_SECURITY_POLICY_C2(ECapabilityReadDeviceData, ECapabilityWriteDeviceData), + CPolicyServer::EFailClient}, + {_INIT_SECURITY_POLICY_C1(ECapabilityNetworkControl), CPolicyServer::EFailClient}, + }; + +const CPolicyServer::TPolicy CCmmServer::iCmmPolicy = //TODO, check comments + { + CPolicyServer::EAlwaysPass, // Specifies all connect attempts should pass + iCmmRangeCount, // Count of ranges + iCmmRanges, // 0-999, 1000-1008, 1009... + iCmmElementIndex, // Only range 1000-1008 are checked + iCmmElements // The list of policy elements + }; + + +// ----------------------------------------------------------------------------- +// CCmmServer::CustomSecurityCheckL +// Implements custom security checking for IPCs marked with +// TSpecialCase::ECustomCheck. +// ----------------------------------------------------------------------------- +// +CPolicyServer::TCustomResult CCmmServer::CustomSecurityCheckL( + const RMessage2& aMessage, + TInt& /*aAction*/, + TSecurityInfo& /*aMissing*/ ) + { + switch ( aMessage.Function() ) + { + // *********** 2nd range: 11-14 ************* + case ECmmGetConnMethodInfoInt: + case ECmmGetConnMethodInfoBool: + case ECmmGetConnMethodInfoString: + case ECmmGetConnMethodInfoString8: + // *********** 10th range: 211-214 ************* + case ECMGetIntAttribute: + case ECMGetBoolAttribute: + case ECMGetStringAttribute: + case ECMGetString8Attribute: + { + switch ( aMessage.Int0() ) + { + // Private userdata has to be checked. + // WPA: + case CMManager::EWlanEnableWpaPsk: + case CMManager::EWlanWpaPreSharedKey: + // WEP: + case CMManager::EWlanWepKey1InHex: + case CMManager::EWlanWepKey2InHex: + case CMManager::EWlanWepKey3InHex: + case CMManager::EWlanWepKey4InHex: + case CMManager::EWlanWepKey1InAscii: + case CMManager::EWlanWepKey2InAscii: + case CMManager::EWlanWepKey3InAscii: + case CMManager::EWlanWepKey4InAscii: + case CMManager::EWlanWepKeyIndex: + // WAPI: + case CMManager::EWlanWapiPsk: + case CMManager::EWlanWapiPskFormat: + // 802.1x: + case CMManager::EWlan802_1xAllowUnencrypted: //TODO, should this be here? + // Authentication: + case CMManager::ECmIFAuthName: + case CMManager::EPacketDataIFAuthName: + case CMManager::ECmIFAuthPass: + case CMManager::EPacketDataIFAuthPass: + { + // ECapabilityReadDeviceData + return ( iCmmElements[0].iPolicy.CheckPolicy( aMessage ) ) ? + EPass : EFail; + } + default: + // By default reading does not need any capabilities + return EPass; + } + } + // *********** 3rd range: 15-21 ************* + case ECmmUpdateBearerPriorityArray: + case ECmmWriteDefaultConnection: + case ECmmWriteGeneralConnectionSettings: + { + // ECapabilityWriteDeviceData is needed for writing + return ( iCmmElements[1].iPolicy.CheckPolicy( aMessage ) ) ? + EPass : EFail; + } + case ECmmCopyConnMethod: + case ECmmMoveConnMethod: + case ECmmRemoveConnMethod: + case ECmmRemoveAllReferences: + { + // At this phase capability is not checked because of + // it's too heavy operation... + // At later phase the protection of the target destination + // and/or connection method is checked. + return EPass; + } + // *********** 6th range: 113-126 ************* + case EDestCreateDestinationWithName: + case EDestCreateDestinationWithNameAndId: + { + // ECapabilityWriteDeviceData is needed for writing + return ( iCmmElements[1].iPolicy.CheckPolicy( aMessage ) ) ? + EPass : EFail; + } + case EDestIsConnected: + case EDestAddConnMethod: + case EDestAddEmbeddedDestination: + case EDestDeleteConnMethod: + case EDestRemoveConnMethod: + case EDestModifyPriority: + case EDestSetName: + case EDestSetMetadata: + case EDestSetProtection: + case EDestSetHidden: + case EDestUpdate: + case EDestDelete: + { + // At this phase capability is not checked because of + // it's too heavy operation... + // At Session phase the protection of the destination and/or + // connection method is checked. If destination/connection method + // is protected ECapabilityNetworkControl is required from a + // client. + return EPass; + } + // *********** 9th range: 206-210 ************* + case ECMCreateConnMethod: + case ECMCreateConnMethodWithId: + { + // ECapabilityWriteDeviceData is needed for writing + return ( iCmmElements[1].iPolicy.CheckPolicy( aMessage ) ) ? + EPass : EFail; + } + case ECMCreateConnMethodToDest: + case ECMCreateConnMethodToDestWithId: + case ECMCreateCopyOfExisting: + { + // At this phase capability is not checked because of + // it's too heavy operation... + // At Session phase the protection of the destination and/or + // connection method is checked. + return EPass; + } + // *********** 11th range: 215-220 ************* + case ECMSetIntAttribute: + case ECMSetBoolAttribute: + case ECMSetStringAttribute: + case ECMSetString8Attribute: + { + switch ( aMessage.Int0() ) + { + // WPA: + case CMManager::EWlanEnableWpaPsk: + case CMManager::EWlanWpaPreSharedKey: + // WEP: + case CMManager::EWlanWepKey1InHex: + case CMManager::EWlanWepKey2InHex: + case CMManager::EWlanWepKey3InHex: + case CMManager::EWlanWepKey4InHex: + case CMManager::EWlanWepKey1InAscii: + case CMManager::EWlanWepKey2InAscii: + case CMManager::EWlanWepKey3InAscii: + case CMManager::EWlanWepKey4InAscii: + case CMManager::EWlanWepKeyIndex: + // WAPI: + case CMManager::EWlanWapiPsk: + case CMManager::EWlanWapiPskFormat: + // 802.1x: + case CMManager::EWlan802_1xAllowUnencrypted: //TODO, should this be here? + // Authentication: + case CMManager::ECmIFAuthName: + case CMManager::EPacketDataIFAuthName: + case CMManager::ECmIFAuthPass: + case CMManager::EPacketDataIFAuthPass: + { + // ECapabilityReadDeviceData + return ( iCmmElements[2].iPolicy.CheckPolicy( aMessage ) ) ? + EPass : EFail; + } + default: + { + // ECapabilityWriteDeviceData + return ( iCmmElements[1].iPolicy.CheckPolicy( aMessage ) ) ? + EPass : EFail; + } + } + } + case ECMDelete: + case ECMUpdate: + { + // ECapabilityWriteDeviceData + return ( iCmmElements[1].iPolicy.CheckPolicy( aMessage ) ) ? + EPass : EFail; + } + default: + return EPass; + } + } + +CCmmServer::CCmmServer( TInt aPriority ) : CPolicyServer( aPriority, iCmmPolicy ) + { + OstTraceFunctionEntry0( CCMMSERVER_CCMMSERVER_ENTRY ); + + iSessionCount = 0; + iCmManager = NULL; + iContainerIndex = NULL; + iShutdown = NULL; + + OstTraceFunctionExit0( CCMMSERVER_CCMMSERVER_EXIT ); + } + +CCmmServer::~CCmmServer() + { + OstTraceFunctionEntry0( DUP1_CCMMSERVER_CCMMSERVER_ENTRY ); + + delete iCmManager; + delete iContainerIndex; + delete iShutdown; + + OstTraceFunctionExit0( DUP1_CCMMSERVER_CCMMSERVER_EXIT ); + } + +CCmmServer* CCmmServer::NewL() + { + OstTraceFunctionEntry0( CCMMSERVER_NEWL_ENTRY ); + + CCmmServer* server = CCmmServer::NewLC(); + CleanupStack::Pop( server ); + + OstTraceFunctionExit0( CCMMSERVER_NEWL_EXIT ); + return server; + } + +CCmmServer* CCmmServer::NewLC() + { + OstTraceFunctionEntry0( CCMMSERVER_NEWLC_ENTRY ); + + CCmmServer* server = new( ELeave ) CCmmServer( EPriorityNormal ); + CleanupStack::PushL( server ); + server->ConstructL(); + + OstTraceFunctionExit0( CCMMSERVER_NEWLC_EXIT ); + return server; + } + +void CCmmServer::ConstructL() + { + OstTraceFunctionEntry0( CCMMSERVER_CONSTRUCTL_ENTRY ); + + StartL( KCmmServer ); + + iCmManager = CCmManagerImpl::NewL(); + + // Create the object container index. + iContainerIndex = CObjectConIx::NewL(); + + // Construct shutdown timer. + iShutdown = new( ELeave ) CCmmDelayedShutdown( this ); + iShutdown->ConstructL(); + + OstTraceFunctionExit0( CCMMSERVER_CONSTRUCTL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Create a new session. +// ----------------------------------------------------------------------------- +// +CSession2* CCmmServer::NewSessionL( + const TVersion& /*aVersion*/, + const RMessage2& /*aMessage*/ ) const + { + OstTraceFunctionEntry0( CCMMSERVER_NEWSESSIONL_ENTRY ); + + return CCmmSession::NewL( *const_cast( this ), iCmManager->Cache() ); + } + +// ----------------------------------------------------------------------------- +// Increments the session counter. Cancels the shutdown timer if active. +// ----------------------------------------------------------------------------- +// +void CCmmServer::IncrementSessions() + { + OstTraceFunctionEntry0( CCMMSERVER_INCREMENTSESSIONS_ENTRY ); + + iSessionCount++; + iShutdown->Cancel(); + + OstTraceFunctionExit0( CCMMSERVER_INCREMENTSESSIONS_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Decrements the session counter. Starts the shutdown counter when last +// session closes. +// ----------------------------------------------------------------------------- +// +void CCmmServer::DecrementSessions() + { + OstTraceFunctionEntry0( CCMMSERVER_DECREMENTSESSIONS_ENTRY ); + + iSessionCount--; + + // Terminate the server when there are no clients left. + if ( iSessionCount <= 0 ) + { + if ( !iShutdown->IsActive() ) + { + iShutdown->Start(); + } + } + OstTraceFunctionExit0( CCMMSERVER_DECREMENTSESSIONS_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmServer::NewContainerL +// ----------------------------------------------------------------------------- +// +CObjectCon* CCmmServer::NewContainerL() + { + OstTraceFunctionEntry0( CCMMSERVER_NEWCONTAINERL_ENTRY ); + + return iContainerIndex->CreateL(); + } + +// ----------------------------------------------------------------------------- +// CCmmServer::RemoveContainer +// ----------------------------------------------------------------------------- +// +void CCmmServer::RemoveContainer( CObjectCon* aContainer ) + { + OstTraceFunctionEntry0( CCMMSERVER_REMOVECONTAINER_ENTRY ); + + iContainerIndex->Remove( aContainer ); + + OstTraceFunctionExit0( CCMMSERVER_REMOVECONTAINER_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmServer::RunError +// ----------------------------------------------------------------------------- +// +TInt CCmmServer::RunError( TInt aError ) + { + OstTraceFunctionEntry0( CCMMSERVER_RUNERROR_ENTRY ); + + Message().Complete( aError ); + + // The leave will result in an early return from CServer::RunL(), + // skipping the call to request another message. So we issue the + // request here in order to keep the server running. + ReStart(); + + OstTraceFunctionExit0( CCMMSERVER_RUNERROR_EXIT ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCmmServer::CmManager +// ----------------------------------------------------------------------------- +// +CCmManagerImpl* CCmmServer::CmManager() + { + OstTraceFunctionEntry0( CCMMSERVER_CMMANAGER_ENTRY ); + + OstTraceFunctionExit0( CCMMSERVER_CMMANAGER_EXIT ); + + return iCmManager; + } + +// ----------------------------------------------------------------------------- +// Check for restrictions for adding an embedded destination from destination +// instances of all clients. +// - aDestinationId is the ID of the destination where a destination is beeing +// embedded. +// - aEmbeddedDestinationId is the ID of the destination that is beeing +// embedded. +// ----------------------------------------------------------------------------- +// +TBool CCmmServer::EmbeddedDestinationConflictsFromAllSessions( + const TUint32& aDestinationId, + const TUint32& aEmbeddedDestinationId ) + { + OstTraceFunctionEntry0( CCMMSERVER_EMBEDDEDDESTINATIONCONFLICTSFROMALLSESSIONS_ENTRY ); + + TBool result( EFalse ); + CSession2* session( NULL ); + + // Iterate through all sessions. + iSessionIter.SetToFirst(); + for ( session = iSessionIter++; session; session = iSessionIter++ ) + { + CCmmSession* cmmSession = static_cast( session ); + if ( cmmSession->EmbeddedDestinationConflicts( aDestinationId, aEmbeddedDestinationId ) ) + { + result = ETrue; + break; + } + } + OstTraceFunctionExit0( CCMMSERVER_EMBEDDEDDESTINATIONCONFLICTSFROMALLSESSIONS_EXIT ); + + return result; + } + +// --------------------------------------------------------------------------- +// Notify each session about a destination/connection method that has been +// updated to, or deleted from, database. +// --------------------------------------------------------------------------- +// +void CCmmServer::RefreshHandlesForAllSessions( const TUint32& aId ) + { + OstTraceFunctionEntry0( CCMMSERVER_REFRESHHANDLESFORALLSESSIONS_ENTRY ); + + CSession2* session( NULL ); + + // Iterate through all sessions. + iSessionIter.SetToFirst(); + for ( session = iSessionIter++; session; session = iSessionIter++ ) + { + CCmmSession* cmmSession = static_cast( session ); + cmmSession->RefreshHandles( aId ); + } + OstTraceFunctionExit0( CCMMSERVER_REFRESHHANDLESFORALLSESSIONS_EXIT ); + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCmmDelayedShutdown::CCmmDelayedShutdown +// ----------------------------------------------------------------------------- +// +CCmmDelayedShutdown::CCmmDelayedShutdown( CCmmServer* aServer ) + : + CActive( 0 ), + iServer( aServer ) + { + } + +// ----------------------------------------------------------------------------- +// CCmmDelayedShutdown::ConstructL +// ----------------------------------------------------------------------------- +// +void CCmmDelayedShutdown::ConstructL() + { + OstTraceFunctionEntry0( CCMMDELAYEDSHUTDOWN_CONSTRUCTL_ENTRY ); + + CActiveScheduler::Add( this ); + User::LeaveIfError( iTimer.CreateLocal() ); + + OstTraceFunctionExit0( CCMMDELAYEDSHUTDOWN_CONSTRUCTL_EXIT ); + } + +// Destructor +CCmmDelayedShutdown::~CCmmDelayedShutdown() + { + OstTraceFunctionEntry0( CCMMDELAYEDSHUTDOWN_CCMMDELAYEDSHUTDOWN_ENTRY ); + + Cancel(); + iTimer.Close(); + iServer = NULL; + + OstTraceFunctionExit0( CCMMDELAYEDSHUTDOWN_CCMMDELAYEDSHUTDOWN_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmMonDelayedShutdown::Start +// ----------------------------------------------------------------------------- +// +void CCmmDelayedShutdown::Start() + { + OstTraceFunctionEntry0( CCMMDELAYEDSHUTDOWN_START_ENTRY ); + + if ( IsActive() ) + { + OstTraceFunctionExit0( CCMMDELAYEDSHUTDOWN_START_EXIT ); + + return; + } + + iTimer.After( iStatus, KCmmShutdownDelay ); + SetActive(); + + OstTraceFunctionExit0( DUP1_CCMMDELAYEDSHUTDOWN_START_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmMonDelayedShutdown::DoCancel +// ----------------------------------------------------------------------------- +// +void CCmmDelayedShutdown::DoCancel() + { + OstTraceFunctionEntry0( CCMMDELAYEDSHUTDOWN_DOCANCEL_ENTRY ); + + iTimer.Cancel(); + + OstTraceFunctionExit0( CCMMDELAYEDSHUTDOWN_DOCANCEL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmMonDelayedShutdown::RunL +// ----------------------------------------------------------------------------- +// +void CCmmDelayedShutdown::RunL() + { + OstTraceFunctionEntry0( CCMMDELAYEDSHUTDOWN_RUNL_ENTRY ); + + CActiveScheduler::Stop(); + + OstTraceFunctionExit0( CCMMDELAYEDSHUTDOWN_RUNL_EXIT ); + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmsession.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,3064 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Handles client requests. +* +*/ + + +#include +#include +#include + +#include "cmmserver.h" +#include "cmmserverdefs.h" +#include "cmmsession.h" +#include "cmmdestinationinstance.h" +#include "cmmconnmethodinstance.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmsessionTraces.h" +#endif + + +CCmmSession* CCmmSession::NewL( CCmmServer& aServer, CCmmCache& aCache ) + { + OstTraceFunctionEntry0( CCMMSESSION_NEWL_ENTRY ); + + CCmmSession* self = CCmmSession::NewLC( aServer, aCache ); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMMSESSION_NEWL_EXIT ); + return self; + } + +CCmmSession* CCmmSession::NewLC( CCmmServer& aServer, CCmmCache& aCache ) + { + OstTraceFunctionEntry0( CCMMSESSION_NEWLC_ENTRY ); + + CCmmSession* self = new( ELeave ) CCmmSession( aServer, aCache ); + CleanupStack::PushL( self ) ; + self->ConstructL() ; + + OstTraceFunctionExit0( CCMMSESSION_NEWLC_EXIT ); + return self ; + } + +// ----------------------------------------------------------------------------- +// Constructor. +// ----------------------------------------------------------------------------- +// +CCmmSession::CCmmSession( CCmmServer& aServer, CCmmCache& aCache ) + : + iServer( aServer ), + iCache( aCache ) + { + OstTraceFunctionEntry0( CCMMSESSION_CCMMSESSION_ENTRY ); + + iDestinationContainer = NULL; + iDestinationObjects = NULL; + iConnMethodContainer = NULL; + iConnMethodObjects = NULL; + + OstTraceFunctionExit0( CCMMSESSION_CCMMSESSION_EXIT ); + } + +// ----------------------------------------------------------------------------- +// The second phase of two phase construction. +// ----------------------------------------------------------------------------- +// +void CCmmSession::ConstructL() + { + OstTraceFunctionEntry0( CCMMSESSION_CONSTRUCTL_ENTRY ); + + iServer.IncrementSessions(); + + // Create a new object index (it stores the destination objects owned by + // this session). + iDestinationObjects = CObjectIx::NewL(); + + // Initialize the object container using the object container index in the + // server (Object container provides unique ids for the objects owned by + // this session). + iDestinationContainer = iServer.NewContainerL(); + + // The same for connection method subsessions. + iConnMethodObjects = CObjectIx::NewL(); + iConnMethodContainer = iServer.NewContainerL(); + + OstTraceFunctionExit0( CCMMSESSION_CONSTRUCTL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CCmmSession::~CCmmSession() + { + OstTraceFunctionEntry0( DUP1_CCMMSESSION_CCMMSESSION_ENTRY ); + + iServer.DecrementSessions(); + + delete iDestinationObjects; + iDestinationObjects = NULL; + + if ( iDestinationContainer != 0 ) + { + iServer.RemoveContainer( iDestinationContainer ); + iDestinationContainer = NULL; + } + + delete iConnMethodObjects; + iConnMethodObjects = NULL; + + if ( iConnMethodContainer != 0 ) + { + iServer.RemoveContainer( iConnMethodContainer ); + iConnMethodContainer = NULL; + } + OstTraceFunctionExit0( DUP1_CCMMSESSION_CCMMSESSION_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::ServiceL +// ----------------------------------------------------------------------------- +// +void CCmmSession::ServiceL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_SERVICEL_ENTRY ); + + TInt result( KErrNone ); + switch ( aMessage.Function() ) + { + case ECmmGetBearerInfoInt: + { + GetBearerInfoIntL( aMessage ); + } + break; + case ECmmGetBearerInfoBool: + { + GetBearerInfoBoolL( aMessage ); + } + break; + case ECmmGetBearerInfoString: + { + GetBearerInfoStringL( aMessage ); + } + break; + case ECmmGetBearerInfoString8: + { + GetBearerInfoString8L( aMessage ); + } + break; + case ECmmGetConnMethodInfoInt: + { + GetConnMethodInfoIntL( aMessage ); + } + break; + case ECmmGetConnMethodInfoBool: + { + GetConnMethodInfoBoolL( aMessage ); + } + break; + case ECmmGetConnMethodInfoString: + { + GetConnMethodInfoStringL( aMessage ); + } + break; + case ECmmGetConnMethodInfoString8: + { + GetConnMethodInfoString8L( aMessage ); + } + break; + case ECmmGetConnMethodArray: + { + GetConnMethodArrayL( aMessage ); + } + break; + case ECmmGetAllDestinations: + { + GetAllDestinationsL( aMessage ); + } + break; + case ECmmGetEasyWlanId: + { + GetEasyWLANIdL( aMessage ); + } + break; + case ECmmRemoveAllReferences: // CM becomes uncategorized. + { + RemoveAllReferencesL( aMessage ); + } + break; + case ECmmGetSupportedBearers: + { + GetSupportedBearersL( aMessage ); + } + break; + case ECmmReadDefaultConnection: + { + ReadDefaultConnectionL( aMessage ); + } + break; + case ECmmWriteDefaultConnection: + { + // Default connection is now just internet snap. + result = KErrNotSupported; + } + break; + case ECmmReadGeneralConnectionSettings: + { + ReadGenConnSettingsL( aMessage ); + } + break; + case ECmmWriteGeneralConnectionSettings: + { + WriteGenConnSettingsL( aMessage ); + } + break; + case ECmmGetBearerPriorityArray: + { + GetBearerPriorityArrayL( aMessage ); + } + break; + case ECmmUpdateBearerPriorityArray: + { + UpdateBearerPriorityArrayL( aMessage ); + } + break; + case ECmmCopyConnMethod: + { + CopyConnMethodL( aMessage ); + } + break; + case ECmmMoveConnMethod: + { + MoveConnMethodL( aMessage ); + } + break; + case ECmmRemoveConnMethod: + { + RemoveConnMethodL( aMessage ); + } + break; + + case EDestGetDestination: + case EDestRefresh: + case EDestCreateDestinationWithName: + case EDestCreateDestinationWithNameAndId: + case EDestCloseDestination: + case EDestGetConnMethodCount: + case EDestGetConnMethodPriority: + case EDestGetName: + case EDestGetId: + case EDestGetElementId: + case EDestMetadata: + case EDestGetProtectionLevel: + case EDestIsConnected: + case EDestIsHidden: + case EDestIsEqual: + case EDestAddConnMethod: + case EDestAddEmbeddedDestination: + case EDestDeleteConnMethod: + case EDestRemoveConnMethod: + case EDestModifyPriority: + case EDestSetName: + case EDestSetMetadata: + case EDestSetProtection: + case EDestSetHidden: + case EDestUpdate: + case EDestDelete: + { + ServiceDestinationL( aMessage ); + } + break; + + case ECMGetConnMethodWithId: + case ECMRefresh: + case ECMCreateConnMethod: + case ECMCreateConnMethodWithId: + case ECMGetConnMethodFromDestWithIndex: + case ECMGetConnMethodFromDestWithId: + case ECMCreateConnMethodToDest: + case ECMCreateConnMethodToDestWithId: + case ECMCreateCopyOfExisting: + case ECMCloseConnMethod: + case ECMGetIntAttribute: + case ECMGetBoolAttribute: + case ECMGetStringAttribute: + case ECMGetString8Attribute: + case ECMIsEqual: + case ECMSetIntAttribute: + case ECMSetBoolAttribute: + case ECMSetStringAttribute: + case ECMSetString8Attribute: + case ECMDelete: + case ECMUpdate: + case EDestGetEmbeddedDestination: + { + ServiceConnMethodL( aMessage ); + } + break; + default: + { + result = KErrNotSupported; + } + break; + } + + aMessage.Complete( result ); + + OstTraceFunctionExit0( CCMMSESSION_SERVICEL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Finds a connection method instance that belongs to this session and matches +// the provided ID. Return NULL if no match is found. +// ----------------------------------------------------------------------------- +// +CCmmConnMethodInstance* CCmmSession::FindConnMethodInstanceById( + const TUint32& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMSESSION_FINDCONNMETHODINSTANCEBYID_ENTRY ); + + CCmmConnMethodInstance* wantedConnMethodInstance( NULL ); + + for ( TInt i = 0; i < iConnMethodObjects->Count(); i++ ) + { + CCmmConnMethodInstance* connMethodInstance = + ( CCmmConnMethodInstance* )( ( *iConnMethodObjects )[i] ); + if ( connMethodInstance && connMethodInstance->GetId() == aConnMethodId ) + { + wantedConnMethodInstance = connMethodInstance; + break; + } + } + + OstTraceFunctionExit0( CCMMSESSION_FINDCONNMETHODINSTANCEBYID_EXIT ); + return wantedConnMethodInstance; + } + +// ----------------------------------------------------------------------------- +// Finds a destination instance that belongs to this session and matches +// the provided handle. +// ----------------------------------------------------------------------------- +// +CCmmDestinationInstance* CCmmSession::FindDestinationInstanceByHandleL( + const TInt& aDestinationHandle ) + { + OstTraceFunctionEntry0( CCMMSESSION_FINDDESTINATIONINSTANCEBYHANDLEL_ENTRY ); + + return (CCmmDestinationInstance*)iDestinationObjects->AtL( aDestinationHandle ); + } + +// ----------------------------------------------------------------------------- +// Finds a destination instance that belongs to this session and matches +// the provided ID. Return NULL if no match is found. +// ----------------------------------------------------------------------------- +// +CCmmDestinationInstance* CCmmSession::FindDestinationInstanceById( + const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( CCMMSESSION_FINDDESTINATIONINSTANCEBYID_ENTRY ); + + CCmmDestinationInstance* wantedDestinationInstance( NULL ); + + for ( TInt i = 0; i < iDestinationObjects->Count(); i++ ) + { + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )( ( *iDestinationObjects )[i] ); + if ( destinationInstance && destinationInstance->GetId() == aDestinationId ) + { + wantedDestinationInstance = destinationInstance; + break; + } + } + + OstTraceFunctionExit0( CCMMSESSION_FINDDESTINATIONINSTANCEBYID_EXIT ); + return wantedDestinationInstance; + } + +// ----------------------------------------------------------------------------- +// Check from all open destination handles in this session if the given +// connection method is inside any of them. The given destination is skipped. +// ----------------------------------------------------------------------------- +// +TBool CCmmSession::ConnMethodInOtherDestination( + const TUint32& aConnMethodId, + const TUint32& aDestinationId ) + { + OstTraceFunctionEntry0( CCMMSESSION_CONNMETHODINOTHERDESTINATION_ENTRY ); + + for ( TInt i = 0; i < iDestinationObjects->Count(); i++ ) + { + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )( ( *iDestinationObjects )[i] ); + if ( destinationInstance && destinationInstance->GetId() != aDestinationId ) + { + for ( TInt j = 0; j < destinationInstance->iConnMethodItemArray.Count(); j++ ) + { + if ( destinationInstance->iConnMethodItemArray[i].iId == aConnMethodId ) + { + OstTraceFunctionExit0( CCMMSESSION_CONNMETHODINOTHERDESTINATION_EXIT ); + return ETrue; + } + } + } + } + + OstTraceFunctionExit0( DUP1_CCMMSESSION_CONNMETHODINOTHERDESTINATION_EXIT ); + return EFalse; + } + +// ----------------------------------------------------------------------------- +// Check for restrictions for adding an embedded destination from destination +// instances of all clients. +// - aDestinationId is the ID of the destination where a destination is beeing +// embedded. +// - aEmbeddedDestinationId is the ID of the destination that is beeing +// embedded. +// ----------------------------------------------------------------------------- +// +TBool CCmmSession::EmbeddedDestinationConflictsFromAllSessions( + const TUint32& aDestinationId, + const TUint32& aEmbeddedDestinationId ) + { + OstTraceFunctionEntry0( CCMMSESSION_EMBEDDEDDESTINATIONCONFLICTSFROMALLSESSIONS_ENTRY ); + + return iServer.EmbeddedDestinationConflictsFromAllSessions( aDestinationId, aEmbeddedDestinationId ); + } + +// ----------------------------------------------------------------------------- +// Check for restrictions for adding an embedded destination from destination +// instances of this session. +// - aDestinationId is the ID of the destination where a destination is beeing +// embedded. +// - aEmbeddedDestinationId is the ID of the destination that is beeing +// embedded. +// +// - Check that any destination instance does not contain aDestinationId as +// embedded destination. +// - Check that any destination instance for aEmbeddedDestinationId does not +// contain an embedded destination. +// ----------------------------------------------------------------------------- +// +TBool CCmmSession::EmbeddedDestinationConflicts( + const TUint32& aDestinationId, + const TUint32& aEmbeddedDestinationId ) + { + OstTraceFunctionEntry0( CCMMSESSION_EMBEDDEDDESTINATIONCONFLICTS_ENTRY ); + + TBool result( EFalse ); + + for ( TInt i = 0; i < iDestinationObjects->Count(); i++ ) + { + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )( ( *iDestinationObjects )[i] ); + if ( destinationInstance ) + { + if ( destinationInstance->HasEmbeddedWithId( aDestinationId ) || + ( destinationInstance->GetId() == aEmbeddedDestinationId && + destinationInstance->HasEmbedded() ) ) + { + result = ETrue; + break; + } + } + } + + OstTraceFunctionExit0( CCMMSESSION_EMBEDDEDDESTINATIONCONFLICTS_EXIT ); + return result; + } + +// --------------------------------------------------------------------------- +// After update to database, refresh temporary ID to real ID if necessary and +// refresh status information for any related handles for all client sessions. +// --------------------------------------------------------------------------- +// +void CCmmSession::RefreshHandlesForAllSessions( const TCmmIdStruct& aIdStruct ) + { + OstTraceFunctionEntry0( CCMMSESSION_REFRESHHANDLESFORALLSESSIONS_ENTRY ); + + // If the ID structure contains a temporary ID, we need to update the + // temporary ID to the real ID for all relevant handles in this session and + // cache. + if ( aIdStruct.iTemporaryId ) + { + // Real ID tells if this is a destination or connection method. + + if ( aIdStruct.iRealId < KCmmConnMethodIdIntervalMax ) + { + // Connection method. Need to iterate through all destination and + // connection method handles. + + // Update the ID of the connection method on session side. + for ( TInt i = 0; i < iConnMethodObjects->Count(); i++ ) + { + CCmmConnMethodInstance* connMethodInstance = + ( CCmmConnMethodInstance* )( ( *iConnMethodObjects )[i] ); + if ( connMethodInstance && + connMethodInstance->GetId() == aIdStruct.iTemporaryId ) + { + connMethodInstance->SetId( aIdStruct.iRealId ); //TODO, need to set ID inside records? + break; // Can only be 1 match. + } + } + // Update the ID of the connection method in cache side also. + iCache.RefreshConnMethodId( aIdStruct ); + + // Iterate all destinations. If the connection method is in them, + // update the ID to real ID. + for ( TInt i = 0; i < iDestinationObjects->Count(); i++ ) + { + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )( ( *iDestinationObjects )[i] ); + if ( destinationInstance ) + { + destinationInstance->RefreshConnMethodId( aIdStruct ); + } + } + } + else + { + // Destination. Need to iterate through all destination handles. + for ( TInt i = 0; i < iDestinationObjects->Count(); i++ ) + { + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )( ( *iDestinationObjects )[i] ); + if ( destinationInstance && + destinationInstance->GetId() == aIdStruct.iTemporaryId ) + { + destinationInstance->SetId( aIdStruct.iRealId ); + break; // Can only be 1 match. + } + } + // Update the ID of the destination in cache side also. + iCache.RefreshDestinationId( aIdStruct ); + } + } + + // Update status information for all related destination/connection method + // handles in all client sessions. + iServer.RefreshHandlesForAllSessions( aIdStruct.iRealId ); + + OstTraceFunctionExit0( CCMMSESSION_REFRESHHANDLESFORALLSESSIONS_EXIT ); + } + +// --------------------------------------------------------------------------- +// Removes a connection method from any open destination handle in this +// session. +// --------------------------------------------------------------------------- +// +void CCmmSession::RemoveConnMethodFromDestinationHandles( + const TUint32& aConnMethodId ) + { + OstTraceFunctionEntry0( CCMMSESSION_REMOVECONNMETHODFROMDESTINATIONHANDLES_ENTRY ); + + for ( TInt i = 0; i < iDestinationObjects->Count(); i++ ) + { + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )( ( *iDestinationObjects )[i] ); + if ( destinationInstance ) + { + for ( TInt j = 0; j < destinationInstance->iConnMethodItemArray.Count(); j++ ) + { + if ( destinationInstance->iConnMethodItemArray[j].iId == aConnMethodId ) + { + destinationInstance->iConnMethodItemArray.Remove( j ); + break; + } + } + } + } + + OstTraceFunctionExit0( CCMMSESSION_REMOVECONNMETHODFROMDESTINATIONHANDLES_EXIT ); + } + +// --------------------------------------------------------------------------- +// Notify this session destination/connection method handles about an +// updated/deleted destination/connection method. +// --------------------------------------------------------------------------- +// +void CCmmSession::RefreshHandles( const TUint32& aId ) const + { + OstTraceFunctionEntry0( CCMMSESSION_REFRESHHANDLES_ENTRY ); + + // Destination or connection method. + if ( aId < KCmmConnMethodIdIntervalMax ) + { + // Connection method. + for ( TInt i = 0; i < iConnMethodObjects->Count(); i++ ) + { + CCmmConnMethodInstance* connMethodInstance = + ( CCmmConnMethodInstance* )( ( *iConnMethodObjects )[i] ); + if ( connMethodInstance && connMethodInstance->GetId() == aId ) + { + connMethodInstance->SetStatus( ECmmConnMethodStatusChanged ); + } + } + } + else + { + // Destination. + for ( TInt i = 0; i < iDestinationObjects->Count(); i++ ) + { + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )( ( *iDestinationObjects )[i] ); + if ( destinationInstance && destinationInstance->GetId() == aId ) + { + destinationInstance->SetStatus( ECmmDestinationStatusChanged ); //TODO, any record status need be set? + } + } + } + + OstTraceFunctionExit0( CCMMSESSION_REFRESHHANDLES_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetBearerInfoIntL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetBearerInfoIntL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETBEARERINFOINTL_ENTRY ); + + TUint32 bearerType( aMessage.Int0() ); + TUint32 attribute( aMessage.Int1() ); + + TUint32 result = iCache.GetBearerInfoIntL( bearerType, attribute ); + TPckg resultPckg( result ); + aMessage.WriteL( 2, resultPckg ); + + OstTraceFunctionExit0( CCMMSESSION_GETBEARERINFOINTL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetBearerInfoBoolL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetBearerInfoBoolL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETBEARERINFOBOOLL_ENTRY ); + + TUint32 bearerType( aMessage.Int0() ); + TUint32 attribute( aMessage.Int1() ); + + TBool result = iCache.GetBearerInfoBoolL( bearerType, attribute ); + TPckg resultPckg( result ); + aMessage.WriteL( 2, resultPckg ); + + OstTraceFunctionExit0( CCMMSESSION_GETBEARERINFOBOOLL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetBearerInfoStringL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetBearerInfoStringL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETBEARERINFOSTRINGL_ENTRY ); + + TUint32 bearerType( aMessage.Int0() ); + TUint32 attribute( aMessage.Int1() ); + + HBufC* result = iCache.GetBearerInfoStringL( bearerType, attribute ); + if ( !result ) + { + OstTraceFunctionExit0( CCMMSESSION_GETBEARERINFOSTRINGL_EXIT ); + return; + } + CleanupStack::PushL( result ); + + TInt bufferLen = aMessage.GetDesMaxLength( 2 ); + if ( result && result->Length() > bufferLen ) + { + User::Leave( KErrArgument ); + } + + TPtrC resultPtr = result->Des(); + aMessage.WriteL( 2, resultPtr ); + CleanupStack::PopAndDestroy( result ); + + OstTraceFunctionExit0( DUP1_CCMMSESSION_GETBEARERINFOSTRINGL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetBearerInfoString8L +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetBearerInfoString8L( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETBEARERINFOSTRING8L_ENTRY ); + + TUint32 bearerType( aMessage.Int0() ); + TUint32 attribute( aMessage.Int1() ); + + HBufC8* result = iCache.GetBearerInfoString8L( bearerType, attribute ); + if ( !result ) + { + OstTraceFunctionExit0( CCMMSESSION_GETBEARERINFOSTRING8L_EXIT ); + return; + } + CleanupStack::PushL( result ); + + TInt bufferLen = aMessage.GetDesMaxLength( 2 ); + if ( result && result->Length() > bufferLen ) + { + User::Leave( KErrArgument ); + } + + TPtrC8 resultPtr = result->Des(); + aMessage.WriteL( 2, resultPtr ); + CleanupStack::PopAndDestroy( result ); + + OstTraceFunctionExit0( DUP1_CCMMSESSION_GETBEARERINFOSTRING8L_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetConnMethodInfoIntL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetConnMethodInfoIntL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETCONNMETHODINFOINTL_ENTRY ); + + TUint32 cmId( aMessage.Int0() ); + TUint32 attribute( aMessage.Int1() ); + + TUint32 result = iCache.GetConnectionMethodInfoIntL( cmId, attribute ); + TPckg resultPckg( result ); + aMessage.WriteL( 2, resultPckg ); + + OstTraceFunctionExit0( CCMMSESSION_GETCONNMETHODINFOINTL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetConnMethodInfoBoolL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetConnMethodInfoBoolL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETCONNMETHODINFOBOOLL_ENTRY ); + + TUint32 cmId( aMessage.Int0() ); + TUint32 attribute( aMessage.Int1() ); + + TBool result = iCache.GetConnectionMethodInfoBoolL( cmId, attribute ); + TPckg resultPckg( result ); + aMessage.WriteL( 2, resultPckg ); + + OstTraceFunctionExit0( CCMMSESSION_GETCONNMETHODINFOBOOLL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetConnMethodInfoStringL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetConnMethodInfoStringL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETCONNMETHODINFOSTRINGL_ENTRY ); + + TUint32 cmId( aMessage.Int0() ); + TUint32 attribute( aMessage.Int1() ); + + HBufC* result = iCache.GetConnectionMethodInfoStringL( cmId, attribute ); + if ( !result ) + { + OstTraceFunctionExit0( CCMMSESSION_GETCONNMETHODINFOSTRINGL_EXIT ); + return; + } + CleanupStack::PushL( result ); + + TInt bufferLen = aMessage.GetDesMaxLength( 2 ); + if ( result && result->Length() > bufferLen ) + { + User::Leave( KErrArgument ); + } + + TPtrC resultPtr = result->Des(); + aMessage.WriteL( 2, resultPtr ); + CleanupStack::PopAndDestroy( result ); + + OstTraceFunctionExit0( DUP1_CCMMSESSION_GETCONNMETHODINFOSTRINGL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetConnMethodInfoString8L +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetConnMethodInfoString8L( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETCONNMETHODINFOSTRING8L_ENTRY ); + + TUint32 cmId( aMessage.Int0() ); + TUint32 attribute( aMessage.Int1() ); + + HBufC8* result = iCache.GetConnectionMethodInfoString8L( cmId, attribute ); + if ( !result ) + { + OstTraceFunctionExit0( CCMMSESSION_GETCONNMETHODINFOSTRING8L_EXIT ); + return; + } + CleanupStack::PushL( result ); + + TInt bufferLen = aMessage.GetDesMaxLength( 2 ); + if ( result && result->Length() > bufferLen ) + { + User::Leave( KErrArgument ); + } + + TPtrC8 resultPtr = result->Des(); + aMessage.WriteL( 2, resultPtr ); + CleanupStack::PopAndDestroy( result ); + + OstTraceFunctionExit0( DUP1_CCMMSESSION_GETCONNMETHODINFOSTRING8L_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetConnMethodArrayL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetConnMethodArrayL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETCONNMETHODARRAYL_ENTRY ); + + // Read attribute flags from client request. + TPckgBuf parametersPckg; + aMessage.ReadL( 0, parametersPckg ); + TCmmIpcStructGetConnMethods attributes = parametersPckg(); + + // Create connection method ID array. + RArray cmArray; + CleanupClosePushL( cmArray ); + iCache.GetAllConnMethodsL( cmArray, attributes.iCheckBearerType ); + + // Check if only legacy connection methods are needed. + if ( attributes.iLegacyOnly ) + { + // Remove all referenced connection methods. + for ( TInt i = cmArray.Count() - 1; i >= 0; i-- ) + { + if ( iCache.DestinationsContainingConnMethod( cmArray[i] ) ) + { + cmArray.Remove( i ); + } + } + } + + // EasyWLAN handling. + if ( !attributes.iEasyWlan ) + { + // If there is an EasyWLAN IAP, the ID needs to be removed from the array. + TUint32 easyWlanId = iCache.EasyWlanIdL(); + if ( easyWlanId != 0 ) + { + TInt index = cmArray.Find( easyWlanId ); + if ( index != KErrNotFound ) + { + cmArray.Remove( index ); + } + } + } + + // Check connection method ID count. + TInt connMethodCount = cmArray.Count(); + if ( connMethodCount > aMessage.GetDesMaxLengthL( 2 ) ) + { + // Client buffer is too small to contain all the informarmation. Return + // without any answer and the client side will ask again using a bigger + // buffer. + CleanupStack::PopAndDestroy( &cmArray ); + return; + } + + TPckg countPckg( connMethodCount ); + aMessage.WriteL( 1, countPckg ); + + if ( connMethodCount == 0 ) + { + CleanupStack::PopAndDestroy( &cmArray ); + return; + } + + // Write connection method IDs to client. + HBufC8* idBuf = HBufC8::NewLC( connMethodCount ); + TPtr8 bufPtr( idBuf->Des() ); + for ( TInt i = 0; i < connMethodCount; i++ ) + { + bufPtr.Append( (TUint8)( cmArray[i] & 0x000000FF ) ); + } + aMessage.WriteL( 2, bufPtr ); + + CleanupStack::PopAndDestroy( idBuf ); + CleanupStack::PopAndDestroy( &cmArray ); + + OstTraceFunctionExit0( DUP1_CCMMSESSION_GETCONNMETHODARRAYL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetAllDestinationsL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetAllDestinationsL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETALLDESTINATIONSL_ENTRY ); + + TInt destCount = iCache.GetDestinationCount(); + if ( destCount > aMessage.GetDesMaxLengthL( 1 ) ) + { + // Client buffer is too small to contain all the informarmation. Return + // without any answer and the client side will ask again using a bigger + // buffer. + return; + } + + // Write the destination count to client. + TPckg countPckg( destCount ); + aMessage.WriteL( 0, countPckg ); + + if ( destCount == 0 ) + { + return; + } + + // Get the destination IDs from database cache. + RArray destArray; + CleanupClosePushL( destArray ); + iCache.GetDestinationsL( destArray ); + + HBufC16* idBuf = HBufC16::NewLC( destCount ); + TPtr16 bufPtr( idBuf->Des() ); + for ( TInt i = 0; i < destCount; i++ ) + { + bufPtr.Append( destArray[i] ); + } + + // Write the destination IDs to client. + aMessage.WriteL( 1, bufPtr ); + + CleanupStack::PopAndDestroy( idBuf ); + CleanupStack::PopAndDestroy( &destArray ); + + OstTraceFunctionExit0( DUP1_CCMMSESSION_GETALLDESTINATIONSL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetEasyWLANIdL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetEasyWLANIdL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETEASYWLANIDL_ENTRY ); + + TUint32 id = iCache.EasyWlanIdL(); + TPckg idPckg( id ); + aMessage.WriteL( 0, idPckg ); + + OstTraceFunctionExit0( CCMMSESSION_GETEASYWLANIDL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetSupportedBearersL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetSupportedBearersL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETSUPPORTEDBEARERSL_ENTRY ); + + // Get the supported bearer types. + RArray bearerArray; + CleanupClosePushL( bearerArray ); + iServer.CmManager()->SupportedBearersL( bearerArray ); + + // Write bearer count to client. + TInt bearerCount( bearerArray.Count() ); + TInt neededBufferSize( bearerCount * sizeof( TUint32 ) ); + TPckg countPckg( bearerCount ); + aMessage.WriteL( 0, countPckg ); + + // Check the client buffer size. + if ( neededBufferSize > aMessage.GetDesMaxLengthL( 1 ) || bearerCount == 0 ) + { + // Client buffer is too small to contain all the information. Return + // with only the bearer count information and the client side will ask + // again using a big enough buffer. + CleanupStack::PopAndDestroy( &bearerArray ); + return; + } + + // Add the bearer types into a buffer. + HBufC8* bearerBuf = HBufC8::NewLC( neededBufferSize ); + TPtr8 ptr( bearerBuf->Des() ); + for ( TInt i = 0; i < bearerCount; i++ ) + { + TUint32 a( bearerArray[i] ); + ptr.Append( (TUint8*)&a, 4 ); + } + + // Write the bearer types to client. + aMessage.WriteL( 1, ptr ); + + CleanupStack::PopAndDestroy( bearerBuf ); + CleanupStack::PopAndDestroy( &bearerArray ); + + OstTraceFunctionExit0( DUP1_CCMMSESSION_GETSUPPORTEDBEARERSL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::ReadDefaultConnectionL +// ----------------------------------------------------------------------------- +// +void CCmmSession::ReadDefaultConnectionL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_READDEFAULTCONNECTIONL_ENTRY ); + + // Default connection is now simply the internet destination. + TCmDefConnValue defaultConnection; + defaultConnection.iType = ECmDefConnDestination; + defaultConnection.iId = 0; + + iCache.InternetDestinationIdL( defaultConnection.iId ); + if ( defaultConnection.iId == 0 ) + { + User::Leave( KErrNotFound ); + } + + TPckgBuf dcPckgBuf( defaultConnection ); + aMessage.WriteL( 0, dcPckgBuf ); + + OstTraceFunctionExit0( CCMMSESSION_READDEFAULTCONNECTIONL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::ReadGenConnSettingsL +// ----------------------------------------------------------------------------- +// +void CCmmSession::ReadGenConnSettingsL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_READGENCONNSETTINGSL_ENTRY ); + + TCmGenConnSettings genConnSettings; + iCache.ReadGenConnSettingsL( genConnSettings ); + + TPckgBuf genConnSettingsPckgBuf( genConnSettings ); + aMessage.WriteL( 0, genConnSettingsPckgBuf ); + + OstTraceFunctionExit0( CCMMSESSION_READGENCONNSETTINGSL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::WriteGenConnSettingsL +// ----------------------------------------------------------------------------- +// +void CCmmSession::WriteGenConnSettingsL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_WRITEGENCONNSETTINGSL_ENTRY ); + + // Read data from client request. + TPckgBuf genConnSettingsPckgBuf; + aMessage.ReadL( 0, genConnSettingsPckgBuf ); + TCmGenConnSettings genConnSettings = genConnSettingsPckgBuf(); + + iCache.WriteGenConnSettingsL( genConnSettings ); + + OstTraceFunctionExit0( CCMMSESSION_WRITEGENCONNSETTINGSL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetBearerPriorityArrayL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetBearerPriorityArrayL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETBEARERPRIORITYARRAYL_ENTRY ); + + const TInt maxLength( aMessage.GetDesMaxLengthL( 0 ) ); + if ( maxLength < 2 ) + { + // Minimum length of 2 is needed to store count and needed length. + User::Leave( KErrArgument ); + } + + RPointerArray bearerPriorityArray; + CmmCleanupResetAndDestroyPushL( bearerPriorityArray ); + + iCache.CopyBearerPriorityArrayL( bearerPriorityArray ); + const TInt bearerCountInArray( bearerPriorityArray.Count() ); + TInt bearerCount( bearerCountInArray ); + + TInt maxBufLen( 2 ); + // Check the length needed for serializing. + for ( TInt i = 0; i < bearerCountInArray; i++ ) + { + // Skip if service type is not valid. + if ( bearerPriorityArray[i]->ServiceType() && bearerPriorityArray[i]->ServiceType()->Length() > 0 ) + { + maxBufLen += KCmmBearerPriorityHeaderLength; // Priorities and servicetype length. + maxBufLen += bearerPriorityArray[i]->ServiceType()->Length(); + } + else + { + bearerCount--; + } + } + + // If given buffer is shorter than needed, just write count and needed length. + if ( maxBufLen > maxLength ) + { + HBufC* buffer = HBufC::NewLC( KCmmDefaultBearerPriorityArraySize ); + TPtr bufferPtr( buffer->Des() ); + + bufferPtr.Append( bearerCount ); + bufferPtr.Append( maxBufLen ); + aMessage.WriteL( 0, bufferPtr ); + + CleanupStack::PopAndDestroy( buffer ); + CleanupStack::PopAndDestroy( &bearerPriorityArray ); + OstTraceFunctionExit0( CCMMSESSION_GETBEARERPRIORITYARRAYL_EXIT ); + return; + } + + // Add needed buffer + space for bearerCount and maxlength. + HBufC* buffer = HBufC::NewLC( maxBufLen ); + TPtr bufferPtr( buffer->Des() ); + + // Write count and bufmaxLen. + bufferPtr.Append( bearerCount ); + bufferPtr.Append( maxBufLen ); + + for ( TInt i = 0; i < bearerCountInArray; i++ ) + { + // Skip if service type is not valid. + if ( bearerPriorityArray[i]->ServiceType() && bearerPriorityArray[i]->ServiceType()->Length() > 0 ) + { + TUint32 priority = bearerPriorityArray[i]->Priority(); + TUint32 uiPriority = bearerPriorityArray[i]->UiPriority(); + const HBufC* serviceType = bearerPriorityArray[i]->ServiceType(); + + bufferPtr.Append( priority >> KBitsInTwoBytes ); + bufferPtr.Append( priority & 0x0000FFFF ); + bufferPtr.Append( uiPriority >> KBitsInTwoBytes ); + bufferPtr.Append( uiPriority & 0x0000FFFF ); + + const TInt stringLength = serviceType->Length(); + bufferPtr.Append( stringLength ); + bufferPtr.Append( *serviceType ); + } + } + aMessage.WriteL( 0, bufferPtr ); + + CleanupStack::PopAndDestroy( buffer ); + CleanupStack::PopAndDestroy( &bearerPriorityArray ); + + OstTraceFunctionExit0( DUP1_CCMMSESSION_GETBEARERPRIORITYARRAYL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::UpdateBearerPriorityArrayL +// ----------------------------------------------------------------------------- +// +void CCmmSession::UpdateBearerPriorityArrayL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_UPDATEBEARERPRIORITYARRAYL_ENTRY ); + + HBufC* bearerPriorityBuf = HBufC::NewLC( aMessage.GetDesMaxLengthL( 0 ) ); + TPtr bearerPriorityBufPtr( bearerPriorityBuf->Des() ); + + aMessage.ReadL( 0, bearerPriorityBufPtr ); + + const TInt bearerCount = bearerPriorityBufPtr[0]; + if ( ( bearerCount < 1 ) || ( aMessage.GetDesMaxLengthL( 0 ) < 2 ) ) + { + User::Leave( KErrArgument ); + } + + RPointerArray bearerPriorityArray; + CmmCleanupResetAndDestroyPushL( bearerPriorityArray ); + + TInt position( 2 ); // Start of first priority item. + for ( TInt i = 0; i < bearerCount; i++ ) + { + TUint32 priority; + TUint32 uiPriority; + priority = bearerPriorityBufPtr[position] << KBitsInTwoBytes; + position++; + priority += bearerPriorityBufPtr[position]; + position++; + uiPriority = bearerPriorityBufPtr[position] << KBitsInTwoBytes; + position++; + uiPriority += bearerPriorityBufPtr[position]; + position++; + const TInt stringLength = bearerPriorityBufPtr[position]; + position++; + if ( stringLength <= 0 ) + { + User::Leave( KErrArgument ); + } + else + { + HBufC* serviceName = HBufC::NewLC( stringLength ); + serviceName->Des().Append( &( bearerPriorityBufPtr[position] ), stringLength ); + position += stringLength; + + TPtrC tempServiceType( serviceName->Des() ); + CCmmBearerPriority* item = CCmmBearerPriority::NewLC( tempServiceType, priority, uiPriority ); + bearerPriorityArray.AppendL( item ); + CleanupStack::Pop( item ); + + CleanupStack::PopAndDestroy( serviceName ); + } + } + + // Update bearer priority array + iCache.UpdateBearerPriorityArrayL( bearerPriorityArray ); + + CleanupStack::PopAndDestroy( &bearerPriorityArray ); + CleanupStack::PopAndDestroy( bearerPriorityBuf ); + + OstTraceFunctionExit0( CCMMSESSION_UPDATEBEARERPRIORITYARRAYL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Copies a connection method into a destination. If the connection method is +// in any other destination, it becomes shared. Calls update on the target +// destination. +// ----------------------------------------------------------------------------- +// +void CCmmSession::CopyConnMethodL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_COPYCONNMETHODL_ENTRY ); + + CCmmDestinationInstance* destination = ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int0() ); + CCmmConnMethodInstance* connMethod = ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int1() ); + + // Can't add an embedded destination this way. + if ( connMethod->IsEmbeddedDestination() ) + { + User::Leave( KErrArgument ); + } + + //TODO, capability check, what to do if anything is protected. + + // Add connection method into destination. + TInt index = destination->AddConnMethodL( *connMethod ); + + // Update destination into database. + destination->UpdateL(); + + // Write the connection method index (priority) inside the destination to client. + TPckg indexPckg( index ); + aMessage.WriteL( 2, indexPckg ); + + OstTraceFunctionExit0( CCMMSESSION_COPYCONNMETHODL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Moves a connection method from one destination to another. Calls update on +// both the source and target destinations (which also updates the connection +// method). +// ----------------------------------------------------------------------------- +// +void CCmmSession::MoveConnMethodL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_MOVECONNMETHODL_ENTRY ); + + // Read data from client request. + TPckgBuf attributesPckg; + aMessage.ReadL( 0, attributesPckg ); + TCmmIpcStructMoveConnMethod attributes = attributesPckg(); + + CCmmDestinationInstance* sourceDestination = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( attributes.iSourceDestHandle ); + CCmmDestinationInstance* targetDestination = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( attributes.iTargetDestHandle ); + CCmmConnMethodInstance* connMethod = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( attributes.iConnMethodHandle ); + TUint32 connMethodId( connMethod->GetId() ); + + // Can't add an embedded destination this way. + if ( connMethod->IsEmbeddedDestination() ) + { + User::Leave( KErrArgument ); + } + // Check if the connection method is in the source destination. + if ( !sourceDestination->ValidConnMethodIdInDestinationIncludeEmbedded( connMethodId ) ) + { + User::Leave( KErrNotFound ); + } + // Check if the connection method is already in the target destination. + if ( targetDestination->ValidConnMethodIdInDestinationIncludeEmbedded( connMethodId ) ) + { + User::Leave( KErrAlreadyExists ); + } + // Check if the connection method can be removed from the source destination. + if ( sourceDestination->ConnMethodInDestinationButLocked( connMethodId ) ) + { + User::Leave( KErrLocked ); + } + // Check that the connection method is not in use by an active connection. + if ( iCache.CheckIfCmConnected( connMethodId ) ) + { + User::Leave( KErrInUse ); + } + + //TODO, capability checks, what to do if anything is protected. + + // Add connection method into target destination and update it. + attributesPckg().iIndex = targetDestination->AddConnMethodL( *connMethod ); + targetDestination->UpdateL(); + + // Remove connection method from source destination and update it. + sourceDestination->RemoveConnMethodFromDestinationL( *connMethod, EFalse ); // EFalse to not check connected state again. + sourceDestination->UpdateL(); + + // Write the index (priority) back to client. + aMessage.WriteL( 0, attributesPckg ); + + OstTraceFunctionExit0( CCMMSESSION_MOVECONNMETHODL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Remove a connection method froma destination. Does not call update on the +// affected destination. +// ----------------------------------------------------------------------------- +// +void CCmmSession::RemoveConnMethodL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_REMOVECONNMETHODL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int0() ); + CCmmConnMethodInstance* connMethodInstance = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int1() ); + + //TODO, capability checks + + destinationInstance->RemoveConnMethodFromDestinationL( *connMethodInstance ); + destinationInstance->UpdateL(); + + OstTraceFunctionExit0( CCMMSESSION_REMOVECONNMETHODL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Removes a connection method from every destination and make it uncategorized. +// Updates any destination that contains the connection method. +// ----------------------------------------------------------------------------- +// +void CCmmSession::RemoveAllReferencesL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_REMOVEALLREFERENCESL_ENTRY ); + + CCmmConnMethodInstance* connMethodInstance = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int0() ); + + iCache.CheckIfConnMethodReferencesCanBeRemovedL( *connMethodInstance ); + iCache.RemoveAllReferencesToConnMethodL( *connMethodInstance ); + + OstTraceFunctionExit0( CCMMSESSION_REMOVEALLREFERENCESL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::ServiceDestinationL +// ----------------------------------------------------------------------------- +// +void CCmmSession::ServiceDestinationL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_SERVICEDESTINATIONL_ENTRY ); + + switch ( aMessage.Function() ) + { + case EDestGetDestination: + { + GetDestinationL( aMessage ); + } + break; + case EDestRefresh: + { + RefreshDestinationL( aMessage ); + } + break; + case EDestCreateDestinationWithName: + { + CreateDestinationWithNameL( aMessage ); + } + break; + case EDestCreateDestinationWithNameAndId: + { + CreateDestinationWithNameAndIdL( aMessage ); + } + break; + case EDestCloseDestination: + { + CloseDestination( aMessage ); + } + break; + case EDestGetConnMethodCount: + { + GetConnectionMehodCountL( aMessage ); + } + break; + case EDestGetConnMethodPriority: + { + GetConnMethodPriorityL( aMessage ); + } + break; + case EDestGetName: + { + GetDestinationNameL( aMessage ); + } + break; + case EDestGetId: + { + GetDestinationIdL( aMessage ); + } + break; + case EDestGetElementId: + { + GetDestinationElementIdL( aMessage ); + } + break; + case EDestMetadata: + { + GetDestinationMetadataL( aMessage ); + } + break; + case EDestGetProtectionLevel: + { + GetDestinationProtectionLevelL( aMessage ); + } + break; + case EDestIsConnected: + { + IsDestinationConnectedL( aMessage ); + } + break; + case EDestIsHidden: + { + IsDestinationHiddenL( aMessage ); + } + break; + case EDestIsEqual: + { + DestinationIsEqualL( aMessage ); + } + break; + case EDestAddConnMethod: + { + DestAddConnMethodL( aMessage ); + } + break; + case EDestAddEmbeddedDestination: + { + DestAddEmbeddedDestinationL( aMessage ); + } + break; + case EDestDeleteConnMethod: + { + DestDeleteConnMethodL( aMessage ); + } + break; + case EDestRemoveConnMethod: + { + DestRemoveConnMethodL( aMessage ); + } + break; + case EDestModifyPriority: + { + ModifyConnMethodPriorityL( aMessage ); + } + break; + case EDestSetName: + { + SetDestinationNameL( aMessage ); + } + break; + case EDestSetMetadata: + { + SetDestinationMetadataL( aMessage ); + } + break; + case EDestSetProtection: + { + SetDestinationProtectionL( aMessage ); + } + break; + case EDestSetHidden: + { + SetDestinationHiddenL( aMessage ); + } + break; + case EDestUpdate: + { + UpdateDestinationL( aMessage ); + } + break; + case EDestDelete: + { + DeleteDestinationL( aMessage ); + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + OstTraceFunctionExit0( CCMMSESSION_SERVICEDESTINATIONL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetDestinationL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetDestinationL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETDESTINATIONL_ENTRY ); + + // Structure: + // - Check arguments. + // - Create session instance. + // - Ask cache to open/create target and put data to session instance. + // - Create subsession and complete message. + + // API side checks that ID is between 0x1000 - 0x1100, and converts if necessary. + TUint32 destinationId( aMessage.Int0() ); + + // Check that the ID is in valid range. + if ( destinationId <= KCmDefaultDestinationAPTagId || + destinationId >= KCmMaxDestinationAPTagId ) + { + User::Leave( KErrArgument ); + } + + // Check if a destination with given ID exists. + if ( !iCache.DestinationExistsWithId( destinationId ) ) + { + User::Leave( KErrNotFound ); + } + + // If this session already has a destination with matching ID open, provide + // the client with a reference to the already opened handle. + CCmmDestinationInstance* destinationInstance = FindDestinationInstanceById( destinationId ); + if ( destinationInstance ) + { + TPckg existingHandlePckg( destinationInstance->GetHandle() ); + aMessage.WriteL( 1, existingHandlePckg ); + User::Leave( KErrAlreadyExists ); + } + destinationInstance = NULL; + TPckg existingHandlePckg( 0 ); + aMessage.WriteL( 1, existingHandlePckg ); + + destinationInstance = CCmmDestinationInstance::NewLC( this, &iCache ); + + // Cache will open a handle to the destination if not already open, and + // copy relevant data into this destination instance. + iCache.OpenDestinationL( *destinationInstance, destinationId ); + + iDestinationContainer->AddL( ( CObject* ) destinationInstance ); + TInt handle = iDestinationObjects->AddL( ( CObject* ) destinationInstance ); + destinationInstance->SetHandle( handle ); + CleanupStack::Pop( destinationInstance ); + + TPckg handlePckg( handle ); + TInt err = aMessage.Write( 3, handlePckg ); + if ( err ) + { + // Removes from object index and destroys the object. + iDestinationObjects->Remove( handle ); + User::Leave( err ); + } + + OstTraceFunctionExit0( CCMMSESSION_GETDESTINATIONL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::RefreshDestinationL +// ----------------------------------------------------------------------------- +// +void CCmmSession::RefreshDestinationL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_REFRESHDESTINATIONL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + iCache.RefreshDestinationL( *destinationInstance ); + + OstTraceFunctionExit0( CCMMSESSION_REFRESHDESTINATIONL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::CreateDestinationWithNameL +// ----------------------------------------------------------------------------- +// +void CCmmSession::CreateDestinationWithNameL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_CREATEDESTINATIONWITHNAMEL_ENTRY ); + + // Structure: + // - Check arguments. + // - Create session instance. + // - Ask cache to open/create target and put data to session instance. + // - Create subsession and complete message. + + // Load and check name. + TInt destNameLength = aMessage.GetDesLength( 0 ); + if ( destNameLength <= 0 ) + { + User::Leave( KErrArgument ); + } + + HBufC* destinationName = HBufC::NewLC( destNameLength ); + TPtr ptrDestinationName = destinationName->Des(); + aMessage.ReadL( 0, ptrDestinationName ); + + // Check if a destination with given name exists (or is already created but not yet saved). + if ( iCache.DestinationExistsWithNameL( *destinationName, 0 ) || + iCache.NotSavedDestinationOpenWithNameL( *destinationName, 0 ) ) + { + User::Leave( KErrAlreadyExists ); + } + + CCmmDestinationInstance* destinationInstance = CCmmDestinationInstance::NewLC( this, &iCache ); + + // Create a temporary ID to be used until a real one is obtained from the database. + TUint32 temporaryId = iCache.NextFreeTemporaryId(); + + // Cache will create the destination data structure and copy the relevant + // data to the session instance. + iCache.CreateDestinationL( *destinationInstance, *destinationName, temporaryId ); + + iDestinationContainer->AddL( ( CObject* ) destinationInstance ); + TInt handle = iDestinationObjects->AddL( ( CObject* ) destinationInstance ); + destinationInstance->SetHandle( handle ); + CleanupStack::Pop( destinationInstance ); + CleanupStack::PopAndDestroy( destinationName ); + + TPckg handlePckg( handle ); + TInt err = aMessage.Write( 3, handlePckg ); + if ( err ) + { + // Removes from object index and destroys the object. + iDestinationObjects->Remove( handle ); + User::Leave( err ); + } + + OstTraceFunctionExit0( CCMMSESSION_CREATEDESTINATIONWITHNAMEL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::CreateDestinationWithNameAndIdL +// ----------------------------------------------------------------------------- +// +void CCmmSession::CreateDestinationWithNameAndIdL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_CREATEDESTINATIONWITHNAMEANDIDL_ENTRY ); + + // Structure: + // - Check arguments. + // - Create session instance. + // - Ask cache to open/create target and put data to session instance. + // - Create subsession and complete message. + + // API side checks that ID is between 0x1000 - 0x1100, and converts if necessary. + TUint32 destinationId( (TUint32)aMessage.Int1() ); + + // Check that the ID is in valid range. + if ( destinationId <= KCmDefaultDestinationAPTagId || + destinationId >= KCmMaxDestinationAPTagId ) + { + User::Leave( KErrArgument ); + } + + // Check if a destination with given ID exists (or is already created but not saved). + if ( iCache.DestinationExistsWithId( destinationId ) || + iCache.DestinationOpenWithId( destinationId ) ) + { + User::Leave( KErrAlreadyExists ); + } + + // Load and check name. + TInt destNameLength = aMessage.GetDesLength( 0 ); + if ( destNameLength <= 0 ) + { + User::Leave( KErrArgument ); + } + + HBufC* destinationName = HBufC::NewLC( destNameLength ); + + TPtr ptrDestinationName = destinationName->Des(); + aMessage.ReadL( 0, ptrDestinationName ); + + // Check if a destination with given name exists (or is already created but not yet saved). + if ( iCache.DestinationExistsWithNameL( *destinationName, 0 ) || + iCache.NotSavedDestinationOpenWithNameL( *destinationName, 0 ) ) + { + User::Leave( KErrAlreadyExists ); + } + + CCmmDestinationInstance* destinationInstance = CCmmDestinationInstance::NewLC( this, &iCache ); + + // Cache will create the destination data structure and copy the relevant + // data to the session instance. + iCache.CreateDestinationL( *destinationInstance, *destinationName, destinationId ); + + iDestinationContainer->AddL( ( CObject* ) destinationInstance ); + TInt handle = iDestinationObjects->AddL( ( CObject* ) destinationInstance ); + destinationInstance->SetHandle( handle ); + CleanupStack::Pop( destinationInstance ); + CleanupStack::PopAndDestroy( destinationName ); + + TPckg handlePckg( handle ); + TInt err = aMessage.Write( 3, handlePckg ); + if ( err ) + { + // Removes from object index and destroys the object. + iDestinationObjects->Remove( handle ); + User::Leave( err ); + } + + OstTraceFunctionExit0( CCMMSESSION_CREATEDESTINATIONWITHNAMEANDIDL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::CloseDestinationL +// ----------------------------------------------------------------------------- +// +void CCmmSession::CloseDestination( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_CLOSEDESTINATION_ENTRY ); + + // Check first that the destination instance exists. + CObject* destinationObject = iDestinationObjects->At( aMessage.Int3() ); + if ( destinationObject ) + { + // Destination instance destructor will notify cache. + iDestinationObjects->Remove( aMessage.Int3() ); + } + + OstTraceFunctionExit0( CCMMSESSION_CLOSEDESTINATION_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Return the connection method count from the provided destination. +// Embedded destinations are included. +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetConnectionMehodCountL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETCONNECTIONMEHODCOUNTL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + TInt connMethodCount( destinationInstance->iConnMethodItemArray.Count() ); // Includes embedded destinations. + + TPckg countPckg( connMethodCount ); + aMessage.WriteL( 0, countPckg ); + + OstTraceFunctionExit0( CCMMSESSION_GETCONNECTIONMEHODCOUNTL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetConnMethodPriorityL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetConnMethodPriorityL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETCONNMETHODPRIORITYL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + CCmmConnMethodInstance* connMethodInstance = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int0() ); + TUint32 connMethodId = connMethodInstance->GetId(); + + TInt index( KErrNotFound ); + for ( TInt i = 0; i < destinationInstance->iConnMethodItemArray.Count(); i++ ) + { + if ( destinationInstance->iConnMethodItemArray[i].iId == connMethodId ) + { + // Index in the connection method array is the connection method + // priority. But priority starts from 1, so adjust by +1. + index = i + 1; + break; + } + } + + // Leave if given connection method is not inside this destination. + User::LeaveIfError( index ); + + // Check if the connection method is an embedded destination. + if ( connMethodInstance->GetBearerType() == KUidEmbeddedDestination ) + { + index = CMManager::KDataMobilitySelectionPolicyPriorityWildCard; + } + + //TODO, what if CM is virtual? + + TUint priority = ( TUint )index; + TPckg priorityPckg( priority ); + aMessage.WriteL( 1, priorityPckg ); + + OstTraceFunctionExit0( CCMMSESSION_GETCONNMETHODPRIORITYL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetDestinationNameL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetDestinationNameL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETDESTINATIONNAMEL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + HBufC* name = destinationInstance->GetLocalisedDestinationNameL(); + CleanupStack::PushL( name ); + TPtrC namePtr( name->Des() ); + + TInt bufferLen = aMessage.GetDesMaxLength( 0 ); + if ( namePtr.Length() > bufferLen ) + { + User::Leave( KErrArgument ); + } + + aMessage.WriteL( 0, namePtr ); + + CleanupStack::PopAndDestroy( name ); + + OstTraceFunctionExit0( CCMMSESSION_GETDESTINATIONNAMEL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetDestinationIdL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetDestinationIdL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETDESTINATIONIDL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + TUint32 id = destinationInstance->GetRecordTagFromApRecordL(); + TPckg idPckg( id ); + aMessage.WriteL( 0, idPckg ); + + OstTraceFunctionExit0( CCMMSESSION_GETDESTINATIONIDL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetDestinationElementIdL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetDestinationElementIdL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETDESTINATIONELEMENTIDL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + TUint32 elementId = destinationInstance->GetElementIdL(); + TPckg elementIdPckg( elementId ); + aMessage.WriteL( 0, elementIdPckg ); + + OstTraceFunctionExit0( CCMMSESSION_GETDESTINATIONELEMENTIDL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetDestinationMetadataL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetDestinationMetadataL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETDESTINATIONMETADATAL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + CMManager::TSnapMetadataField metadataField = + ( CMManager::TSnapMetadataField )aMessage.Int0(); + + TUint32 metadata( 0 ); + destinationInstance->GetMetadataL( metadataField, metadata ); + + TPckg metadataPckg( metadata ); + aMessage.WriteL( 1, metadataPckg ); + + OstTraceFunctionExit0( CCMMSESSION_GETDESTINATIONMETADATAL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetDestinationProtectionLevelL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetDestinationProtectionLevelL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETDESTINATIONPROTECTIONLEVELL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + CMManager::TProtectionLevel protLevel( CMManager::EProtLevel0 ); + destinationInstance->GetProtectionL( protLevel ); + + TPckg protLevelPckg( protLevel ); + aMessage.WriteL( 0, protLevelPckg ); + + OstTraceFunctionExit0( CCMMSESSION_GETDESTINATIONPROTECTIONLEVELL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::IsDestinationConnectedL +// ----------------------------------------------------------------------------- +// +void CCmmSession::IsDestinationConnectedL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_ISDESTINATIONCONNECTEDL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + if ( !iCache.DestinationExistsWithId( destinationInstance->GetId() ) ) + { + User::Leave( KErrNotFound ); + } + + TBool isConnected = iCache.DestinationConnectedL( destinationInstance->GetId() ); + TPckg isConnectedPckg( isConnected ); + aMessage.WriteL( 0, isConnectedPckg ); + + OstTraceFunctionExit0( CCMMSESSION_ISDESTINATIONCONNECTEDL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::IsDestinationHiddenL +// ----------------------------------------------------------------------------- +// +void CCmmSession::IsDestinationHiddenL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_ISDESTINATIONHIDDENL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + TUint32 isHiddenMetadata( 0 ); + destinationInstance->GetMetadataL( CMManager::ESnapMetadataHiddenAgent, isHiddenMetadata ); + + TBool isHidden( EFalse ); + if ( isHiddenMetadata ) + { + isHidden = ETrue; + } + + TPckg isHiddenPckg( isHidden ); + aMessage.WriteL( 0, isHiddenPckg ); + + OstTraceFunctionExit0( CCMMSESSION_ISDESTINATIONHIDDENL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Checks if the destination given as parameter is equal to this destination +// ----------------------------------------------------------------------------- +// +void CCmmSession::DestinationIsEqualL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_DESTINATIONISEQUALL_ENTRY ); + + CCmmDestinationInstance* dest = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + CCmmDestinationInstance* destToBeCompared = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int0() ); + + TBool equal( EFalse ); + if ( dest->GetId() == destToBeCompared->GetId() ) + { + equal = ETrue; + } + + TPckg equalPckg( equal ); + + aMessage.WriteL( 1, equalPckg ); + + OstTraceFunctionExit0( CCMMSESSION_DESTINATIONISEQUALL_EXIT ); + } + + +// ----------------------------------------------------------------------------- +// Adds a connection method into a destination. Does not add embedded +// destinations. +// ----------------------------------------------------------------------------- +// +void CCmmSession::DestAddConnMethodL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_DESTADDCONNMETHODL_ENTRY ); + + CCmmDestinationInstance* destination = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + CCmmConnMethodInstance* connMethod = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int0() ); + + if ( connMethod->IsEmbeddedDestination() ) + { + User::Leave( KErrArgument ); + } + + TInt index = destination->AddConnMethodL( *connMethod ); + TPckg indexPckg( index ); + aMessage.WriteL( 1, indexPckg ); + + OstTraceFunctionExit0( CCMMSESSION_DESTADDCONNMETHODL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Adds a destination into a destination as an embedded destination. +// ----------------------------------------------------------------------------- +// +void CCmmSession::DestAddEmbeddedDestinationL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_DESTADDEMBEDDEDDESTINATIONL_ENTRY ); + + CCmmDestinationInstance* destination = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + CCmmDestinationInstance* embeddedDestination = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int0() ); + + TInt index = destination->AddEmbeddedDestinationL( *embeddedDestination ); + TPckg indexPckg( index ); + aMessage.WriteL( 1, indexPckg ); + + OstTraceFunctionExit0( CCMMSESSION_DESTADDEMBEDDEDDESTINATIONL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::DestDeleteConnMethodL +// ----------------------------------------------------------------------------- +// +void CCmmSession::DestDeleteConnMethodL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_DESTDELETECONNMETHODL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + CCmmConnMethodInstance* connMethodInstance = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int0() ); + + //TODO, capability checks + + destinationInstance->DeleteConnMethodFromDestinationL( *connMethodInstance ); + + OstTraceFunctionExit0( CCMMSESSION_DESTDELETECONNMETHODL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::DestRemoveConnMethodL +// ----------------------------------------------------------------------------- +// +void CCmmSession::DestRemoveConnMethodL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_DESTREMOVECONNMETHODL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + CCmmConnMethodInstance* connMethodInstance = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int0() ); + + //TODO, capability checks + + destinationInstance->RemoveConnMethodFromDestinationL( *connMethodInstance ); + + OstTraceFunctionExit0( CCMMSESSION_DESTREMOVECONNMETHODL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::ModifyConnMethodPriorityL +// ----------------------------------------------------------------------------- +// +void CCmmSession::ModifyConnMethodPriorityL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_MODIFYCONNMETHODPRIORITYL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + CCmmConnMethodInstance* connMethodInstance = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int0() ); + + //TODO, capability checks + + // Index values start from 0 (0 meaning highest priority). + TUint index( ( TUint )aMessage.Int1() ); + + destinationInstance->ModifyConnMethodPriorityL( *connMethodInstance, index ); + + OstTraceFunctionExit0( CCMMSESSION_MODIFYCONNMETHODPRIORITYL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::SetDestinationNameL +// ----------------------------------------------------------------------------- +// +void CCmmSession::SetDestinationNameL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_SETDESTINATIONNAMEL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + // Load and check name. + TInt destNameLength = aMessage.GetDesLength( 0 ); + if ( destNameLength <= 0 ) + { + User::Leave( KErrArgument ); //TODO, check also max length? + } + + HBufC* newName = HBufC::NewLC( destNameLength ); + TPtr ptrNewName = newName->Des(); + aMessage.ReadL( 0, ptrNewName ); + + // Check if a destination with given name exists (or is already created but not yet saved). + if ( iCache.DestinationExistsWithNameL( *newName, destinationInstance->GetId() ) || + iCache.NotSavedDestinationOpenWithNameL( *newName, destinationInstance->GetId() ) ) + { + User::Leave( KErrAlreadyExists ); + } + + destinationInstance->SetDestinationNameL( *newName ); + + CleanupStack::PopAndDestroy( newName ); + + OstTraceFunctionExit0( CCMMSESSION_SETDESTINATIONNAMEL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::SetDestinationMetadataL +// ----------------------------------------------------------------------------- +// +void CCmmSession::SetDestinationMetadataL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_SETDESTINATIONMETADATAL_ENTRY ); + + //TODO, Capability check. Protection level or Internet destination. + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + CMManager::TSnapMetadataField metadataField = + ( CMManager::TSnapMetadataField )aMessage.Int0(); + TUint32 metadata = aMessage.Int1(); + + destinationInstance->SetMetadataL( metadataField, metadata ); + + OstTraceFunctionExit0( CCMMSESSION_SETDESTINATIONMETADATAL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::SetDestinationProtectionL +// ----------------------------------------------------------------------------- +// +void CCmmSession::SetDestinationProtectionL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_SETDESTINATIONPROTECTIONL_ENTRY ); + + //TODO, Capability check: ECapabilityNetworkControl + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + CMManager::TProtectionLevel protLevel = + ( CMManager::TProtectionLevel )aMessage.Int0(); + destinationInstance->SetProtectionL( protLevel ); + + OstTraceFunctionExit0( CCMMSESSION_SETDESTINATIONPROTECTIONL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::SetDestinationHiddenL +// ----------------------------------------------------------------------------- +// +void CCmmSession::SetDestinationHiddenL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_SETDESTINATIONHIDDENL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + TBool hidden = aMessage.Int0(); + destinationInstance->SetMetadataL( CMManager::ESnapMetadataHiddenAgent, hidden ); + + OstTraceFunctionExit0( CCMMSESSION_SETDESTINATIONHIDDENL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::UpdateDestinationL +// ----------------------------------------------------------------------------- +// +void CCmmSession::UpdateDestinationL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_UPDATEDESTINATIONL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + destinationInstance->UpdateL(); + + OstTraceFunctionExit0( CCMMSESSION_UPDATEDESTINATIONL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::DeleteDestinationL +// ----------------------------------------------------------------------------- +// +void CCmmSession::DeleteDestinationL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_DELETEDESTINATIONL_ENTRY ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( aMessage.Int3() ); + + iCache.CheckIfDestinationCanBeDeletedL( *destinationInstance ); + iCache.DeleteDestinationL( *destinationInstance ); + + // Close the destination handle. Destination instance destructor will + // notify cache. If the reference count for the cache side handle goes to + // zero, it will be deleted. + iDestinationObjects->Remove( aMessage.Int3() ); + + OstTraceFunctionExit0( CCMMSESSION_DELETEDESTINATIONL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::ServiceConnMethodL +// ----------------------------------------------------------------------------- +// +void CCmmSession::ServiceConnMethodL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_SERVICECONNMETHODL_ENTRY ); + + switch ( aMessage.Function() ) + { + case ECMCreateConnMethod: + { + CreateConnMethodL( aMessage ); + } + break; + case ECMUpdate: + { + UpdateConnMethodL( aMessage ); + } + break; + case ECMCloseConnMethod: + { + CloseConnMethod( aMessage ); // Can't leave. + } + break; + case ECMDelete: + { + DeleteConnMethodL( aMessage ); + } + break; + case ECMGetConnMethodWithId: + { + GetConnMethodWithIdL( aMessage ); + } + break; + case ECMRefresh: + { + RefreshConnMethodL( aMessage ); + } + break; + case ECMGetIntAttribute: + { + GetIntAttributeL( aMessage ); + } + break; + case ECMGetBoolAttribute: + { + GetBoolAttributeL( aMessage ); + } + break; + case ECMGetStringAttribute: + { + GetStringAttributeL( aMessage ); + } + break; + case ECMGetString8Attribute: + { + GetString8AttributeL( aMessage ); + } + break; + case ECMSetIntAttribute: + { + SetIntAttributeL( aMessage ); + } + break; + case ECMSetBoolAttribute: + { + SetBoolAttributeL( aMessage ); + } + break; + case ECMSetStringAttribute: + { + SetStringAttributeL( aMessage ); + } + break; + case ECMSetString8Attribute: + { + SetString8AttributeL( aMessage ); + } + break; + case ECMCreateConnMethodWithId: + { + CreateConnMethodWithIdL( aMessage ); + } + break; + case ECMGetConnMethodFromDestWithIndex: + { + GetConnMethodFromDestWithIndexL( aMessage ); + } + break; + case ECMGetConnMethodFromDestWithId: + { + GetConnMethodFromDestWithIdL( aMessage ); + } + break; + case ECMCreateConnMethodToDest: + { + CreateConnMethodToDestL( aMessage ); + } + break; + case ECMCreateConnMethodToDestWithId: + { + CreateConnMethodToDestWithIdL( aMessage ); + } + break; + case ECMIsEqual: + { + CmIsEqualL( aMessage ); + } + break; + case ECMCreateCopyOfExisting: + { + CreateCopyOfExistingL( aMessage ); + } + break; + case EDestGetEmbeddedDestination: + { + GetEmbeddedDestinationL( aMessage ); + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + } + + OstTraceFunctionExit0( CCMMSESSION_SERVICECONNMETHODL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Create a new connection method (not embedded destination). +// ----------------------------------------------------------------------------- +// +void CCmmSession::CreateConnMethodL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_CREATECONNMETHODL_ENTRY ); + + TUint32 bearerType( aMessage.Int0() ); + + CCmmConnMethodInstance* connMethod = CCmmConnMethodInstance::NewLC( this, &iCache ); + iCache.CreateConnMethodL( *connMethod, NULL, bearerType, 0 ); + + iConnMethodContainer->AddL( ( CObject* ) connMethod ); + TInt handle = iConnMethodObjects->AddL( ( CObject* ) connMethod ); + connMethod->SetHandle( handle ); + CleanupStack::Pop( connMethod ); + + TPckg handlePckg( handle ); + TInt error = aMessage.Write( 3, handlePckg ); + if ( error ) + { + // Remove from object index and destroy the object. + iConnMethodObjects->Remove( handle ); + User::Leave( error ); + } + + OstTraceFunctionExit0( CCMMSESSION_CREATECONNMETHODL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::ConnMethodUpdateL +// ----------------------------------------------------------------------------- +// +void CCmmSession::UpdateConnMethodL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_UPDATECONNMETHODL_ENTRY ); + + CCmmConnMethodInstance* connMethod = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int3() ); + connMethod->UpdateL(); + + OstTraceFunctionExit0( CCMMSESSION_UPDATECONNMETHODL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::CloseConnMethod +// ----------------------------------------------------------------------------- +// +void CCmmSession::CloseConnMethod( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_CLOSECONNMETHOD_ENTRY ); + + // Check first that the connection method instance exists. + CObject* connMethodObject = iConnMethodObjects->At( aMessage.Int3() ); + if ( connMethodObject ) + { + // Connection method instance destructor will notify cache. + iConnMethodObjects->Remove( aMessage.Int3() ); + } + + OstTraceFunctionExit0( CCMMSESSION_CLOSECONNMETHOD_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::ConnMethodUpdateL +// ----------------------------------------------------------------------------- +// +void CCmmSession::DeleteConnMethodL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_DELETECONNMETHODL_ENTRY ); + + CCmmConnMethodInstance* connMethodInstance = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int3() ); + + iCache.CheckIfConnMethodCanBeDeletedL( *connMethodInstance ); + iCache.DeleteConnMethodL( *connMethodInstance ); + // Ignore the boolean return value. It is always true, or the + // DeleteL()-call leaves. + + // Close the connection method handle. Connection method instance + // destructor will notify cache. If the reference count for the cache side + // handle goes to zero, it will be deleted. + iConnMethodObjects->Remove( aMessage.Int3() ); + + OstTraceFunctionExit0( CCMMSESSION_DELETECONNMETHODL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetConnMethodWithIdL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetConnMethodWithIdL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETCONNMETHODWITHIDL_ENTRY ); + + TUint32 connMethodId = aMessage.Int0(); + + // If this session already has a connection method with matching id open, + // provide the client with a reference to the already opened handle. + CCmmConnMethodInstance* cmInstance = FindConnMethodInstanceById( connMethodId ); + if ( cmInstance ) + { + // Also check that the connection method exists in database. + if ( iCache.ConnMethodExistsWithId( connMethodId ) ) + { + TPckg existingHandlePckg( cmInstance->GetHandle() ); + aMessage.WriteL( 1, existingHandlePckg ); + User::Leave( KErrAlreadyExists ); + } + } + cmInstance = NULL; + TPckg existingHandlePckg( 0 ); + aMessage.WriteL( 1, existingHandlePckg ); + + cmInstance = CCmmConnMethodInstance::NewLC( this, &iCache ); + // Will check if connection method ID is valid. + iCache.OpenConnMethodL( *cmInstance, NULL, connMethodId ); + + iConnMethodContainer->AddL( ( CObject* ) cmInstance ); + TInt handle = iConnMethodObjects->AddL( ( CObject* ) cmInstance ); + cmInstance->SetHandle( handle ); + CleanupStack::Pop( cmInstance ); + + TPckg handlePckg( handle ); + TInt error = aMessage.Write( 3, handlePckg ); + if ( error ) + { + // Remove from object index and destroy the object. + iConnMethodObjects->Remove( handle ); + User::Leave( error ); + } + + OstTraceFunctionExit0( CCMMSESSION_GETCONNMETHODWITHIDL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::RefreshConnMethodL +// ----------------------------------------------------------------------------- +// +void CCmmSession::RefreshConnMethodL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_REFRESHCONNMETHODL_ENTRY ); + + CCmmConnMethodInstance* connMethodInstance = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int3() ); + + iCache.RefreshConnMethodL( *connMethodInstance ); + + OstTraceFunctionExit0( CCMMSESSION_REFRESHCONNMETHODL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetIntAttributeL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetIntAttributeL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETINTATTRIBUTEL_ENTRY ); + + CCmmConnMethodInstance* cm = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int3() ); + + TUint32 attribute( aMessage.Int0() ); + TUint32 value = cm->GetIntAttributeL( attribute ); + + TPckg valuePckg( value ); + aMessage.WriteL( 1, valuePckg ); + + OstTraceFunctionExit0( CCMMSESSION_GETINTATTRIBUTEL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetBoolAttributeL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetBoolAttributeL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETBOOLATTRIBUTEL_ENTRY ); + + CCmmConnMethodInstance* cm = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int3() ); + + TUint32 attribute( aMessage.Int0() ); + TBool value = cm->GetBoolAttributeL( attribute ); + + TPckg valuePckg( value ); + aMessage.WriteL( 1, valuePckg ); + + OstTraceFunctionExit0( CCMMSESSION_GETBOOLATTRIBUTEL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetStringAttributeL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetStringAttributeL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETSTRINGATTRIBUTEL_ENTRY ); + + CCmmConnMethodInstance* cm = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int3() ); + + TUint32 attribute( aMessage.Int0() ); + HBufC* value = cm->GetStringAttributeL( attribute ); + if ( !value ) + { + OstTraceFunctionExit0( CCMMSESSION_GETSTRINGATTRIBUTEL_EXIT ); + return; + } + CleanupStack::PushL( value ); + TPtrC valuePtr = value->Des(); + + // check the buffer length of the given buffer + TInt bufferLen = aMessage.GetDesMaxLength( 1 ); + if ( valuePtr.Length() > bufferLen ) + { + User::Leave( KErrArgument ); + } + + aMessage.WriteL( 1, valuePtr ); + CleanupStack::PopAndDestroy( value ); + + OstTraceFunctionExit0( DUP1_CCMMSESSION_GETSTRINGATTRIBUTEL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::GetString8AttributeL +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetString8AttributeL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETSTRING8ATTRIBUTEL_ENTRY ); + + CCmmConnMethodInstance* cm = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int3() ); + + TUint32 attribute( aMessage.Int0() ); + HBufC8* value = cm->GetString8AttributeL( attribute ); + if ( !value ) + { + OstTraceFunctionExit0( CCMMSESSION_GETSTRING8ATTRIBUTEL_EXIT ); + return; + } + CleanupStack::PushL( value ); + TPtrC8 valuePtr = value->Des(); + + // check the buffer length of the given buffer + TInt bufferLen = aMessage.GetDesMaxLength( 1 ); + if ( valuePtr.Length() > bufferLen ) + { + User::Leave( KErrArgument ); + } + + aMessage.WriteL( 1, valuePtr ); + CleanupStack::PopAndDestroy( value ); + + OstTraceFunctionExit0( DUP1_CCMMSESSION_GETSTRING8ATTRIBUTEL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::SetIntAttributeL +// ----------------------------------------------------------------------------- +// +void CCmmSession::SetIntAttributeL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_SETINTATTRIBUTEL_ENTRY ); + + CCmmConnMethodInstance* cm = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int3() ); + + TUint32 attribute( aMessage.Int0() ); + TUint32 value( aMessage.Int1() ); + + cm->SetIntAttributeL( attribute, value ); + + OstTraceFunctionExit0( CCMMSESSION_SETINTATTRIBUTEL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::SetBoolAttributeL +// ----------------------------------------------------------------------------- +// +void CCmmSession::SetBoolAttributeL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_SETBOOLATTRIBUTEL_ENTRY ); + + CCmmConnMethodInstance* cm = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int3() ); + + TUint32 attribute( aMessage.Int0() ); + TBool value( aMessage.Int1() ); + + cm->SetBoolAttributeL( attribute, value ); + + OstTraceFunctionExit0( CCMMSESSION_SETBOOLATTRIBUTEL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::SetStringAttributeL +// ----------------------------------------------------------------------------- +// +void CCmmSession::SetStringAttributeL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_SETSTRINGATTRIBUTEL_ENTRY ); + + CCmmConnMethodInstance* cm = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int3() ); + + TUint32 attribute( aMessage.Int0() ); + + HBufC* value = HBufC::NewLC( aMessage.GetDesLengthL( 1 ) ); + TPtr valuePtr( value->Des() ); + aMessage.ReadL( 1, valuePtr ); + + cm->SetStringAttributeL( attribute, valuePtr ); + + CleanupStack::PopAndDestroy( value ); + + OstTraceFunctionExit0( CCMMSESSION_SETSTRINGATTRIBUTEL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// CCmmSession::SetString8AttributeL +// ----------------------------------------------------------------------------- +// +void CCmmSession::SetString8AttributeL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_SETSTRING8ATTRIBUTEL_ENTRY ); + + CCmmConnMethodInstance* cm = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int3() ); + + TUint32 attribute( aMessage.Int0() ); + + HBufC8* value = HBufC8::NewLC( aMessage.GetDesLengthL( 1 ) ); + TPtr8 valuePtr( value->Des() ); + aMessage.ReadL( 1, valuePtr ); + + cm->SetString8AttributeL( attribute, valuePtr ); + + CleanupStack::PopAndDestroy( value ); + + OstTraceFunctionExit0( CCMMSESSION_SETSTRING8ATTRIBUTEL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Create a new connection method (not embedded destination) with specific ID. +// ----------------------------------------------------------------------------- +// +void CCmmSession::CreateConnMethodWithIdL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_CREATECONNMETHODWITHIDL_ENTRY ); + + TUint32 bearerType( aMessage.Int0() ); + TUint32 connMethodId = ( aMessage.Int1() ); + + CCmmConnMethodInstance* connMethod = + CCmmConnMethodInstance::NewLC( this, &iCache ); + // Will check if ID is available. + iCache.CreateConnMethodL( *connMethod, NULL, bearerType, connMethodId ); + + iConnMethodContainer->AddL( ( CObject* ) connMethod ); + TInt handle = iConnMethodObjects->AddL( ( CObject* ) connMethod ); + connMethod->SetHandle( handle ); + CleanupStack::Pop( connMethod ); + + TPckg handlePckg( handle ); + TInt error = aMessage.Write( 3, handlePckg ); + if ( error ) + { + // Remove from object index and destroy the object. + iConnMethodObjects->Remove( handle ); + User::Leave( error ); + } + + OstTraceFunctionExit0( CCMMSESSION_CREATECONNMETHODWITHIDL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Gets a Connection Method from a Destination with index number. +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetConnMethodFromDestWithIndexL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETCONNMETHODFROMDESTWITHINDEXL_ENTRY ); + + TInt destinationHandle( aMessage.Int0() ); + TInt connMethodIndex( aMessage.Int1() ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( destinationHandle ); + + // Check index is in range. + if ( connMethodIndex < 0 || + connMethodIndex >= destinationInstance->iConnMethodItemArray.Count() ) + { + User::Leave( KErrArgument ); + } + TInt connMethodId( destinationInstance->iConnMethodItemArray[connMethodIndex].iId ); + + // If this session already has a connection method with matching id open + // and that connection method correctly belongs to the provided destination, + // provide the client with a reference to the already opened handle. + CCmmConnMethodInstance* cmInstance = FindConnMethodInstanceById( connMethodId ); + if ( cmInstance && + destinationInstance->ValidConnMethodIdInDestinationIncludeEmbedded( connMethodId ) ) + { + // Also check that the connection method exists in database. + if ( iCache.ConnMethodExistsWithId( connMethodId ) || + iCache.DestinationExistsWithId( connMethodId ) ) + { + TPckg existingHandlePckg( cmInstance->GetHandle() ); + aMessage.WriteL( 2, existingHandlePckg ); + User::Leave( KErrAlreadyExists ); + } + } + cmInstance = NULL; + TPckg existingHandlePckg( 0 ); + aMessage.WriteL( 2, existingHandlePckg ); + + cmInstance = CCmmConnMethodInstance::NewLC( this, &iCache ); + // Will check if connection method ID is valid. + iCache.OpenConnMethodL( *cmInstance, destinationInstance, connMethodId ); + + iConnMethodContainer->AddL( ( CObject* ) cmInstance ); + TInt handle = iConnMethodObjects->AddL( ( CObject* ) cmInstance ); + cmInstance->SetHandle( handle ); + CleanupStack::Pop( cmInstance ); + + TPckg handlePckg( handle ); + TInt error = aMessage.Write( 3, handlePckg ); + if ( error ) + { + // Remove from object index and destroy the object. + iConnMethodObjects->Remove( handle ); + User::Leave( error ); + } + + OstTraceFunctionExit0( CCMMSESSION_GETCONNMETHODFROMDESTWITHINDEXL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Gets a Connection Method from a Destination with Id. +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetConnMethodFromDestWithIdL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETCONNMETHODFROMDESTWITHIDL_ENTRY ); + + TInt destinationHandle( aMessage.Int0() ); + TUint32 connMethodId( aMessage.Int1() ); + + CCmmDestinationInstance* destinationInstance = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( destinationHandle ); + + // If this session already has a connection method with matching id open + // and that connection method correctly belongs to the provided destination, + // provide the client with a reference to the already opened handle. + CCmmConnMethodInstance* cmInstance = FindConnMethodInstanceById( connMethodId ); + if ( cmInstance && + destinationInstance->ValidConnMethodIdInDestinationIncludeEmbedded( connMethodId ) ) + { + // Also check that the connection method exists in database. + if ( iCache.ConnMethodExistsWithId( connMethodId ) || + iCache.DestinationExistsWithId( connMethodId ) ) + { + TPckg existingHandlePckg( cmInstance->GetHandle() ); + aMessage.WriteL( 2, existingHandlePckg ); + User::Leave( KErrAlreadyExists ); + } + } + cmInstance = NULL; + TPckg existingHandlePckg( 0 ); + aMessage.WriteL( 2, existingHandlePckg ); + + cmInstance = CCmmConnMethodInstance::NewLC( this, &iCache ); + // Will check if connection method ID is valid. + iCache.OpenConnMethodL( *cmInstance, destinationInstance, connMethodId ); + + iConnMethodContainer->AddL( ( CObject* ) cmInstance ); + TInt handle = iConnMethodObjects->AddL( ( CObject* ) cmInstance ); + cmInstance->SetHandle( handle ); + CleanupStack::Pop( cmInstance ); + + TPckg handlePckg( handle ); + TInt error = aMessage.Write( 3, handlePckg ); + if ( error ) + { + // Remove from object index and destroy the object. + iConnMethodObjects->Remove( handle ); + User::Leave( error ); + } + + OstTraceFunctionExit0( CCMMSESSION_GETCONNMETHODFROMDESTWITHIDL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Create a new connection method (not embedded destination) into a destination. +// ----------------------------------------------------------------------------- +// +void CCmmSession::CreateConnMethodToDestL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_CREATECONNMETHODTODESTL_ENTRY ); + + TInt destinationHandle( aMessage.Int0() ); + TUint32 bearerType( aMessage.Int1() ); + + CCmmDestinationInstance* destination = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( destinationHandle ); + + CCmmConnMethodInstance* connMethod = CCmmConnMethodInstance::NewLC( this, &iCache ); + iCache.CreateConnMethodL( *connMethod, destination, bearerType, 0 ); + + iConnMethodContainer->AddL( ( CObject* ) connMethod ); + TInt handle = iConnMethodObjects->AddL( ( CObject* ) connMethod ); + connMethod->SetHandle( handle ); + CleanupStack::Pop( connMethod ); + + TPckg handlePckg( handle ); + TInt error = aMessage.Write( 3, handlePckg ); + if ( error ) + { + // Remove from object index and destroy the object. + iConnMethodObjects->Remove( handle ); + User::Leave( error ); + } + + OstTraceFunctionExit0( CCMMSESSION_CREATECONNMETHODTODESTL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Create a new connection method (not embedded destination) with specific ID +// into a destination. +// ----------------------------------------------------------------------------- +// +void CCmmSession::CreateConnMethodToDestWithIdL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_CREATECONNMETHODTODESTWITHIDL_ENTRY ); + + TInt destinationHandle( aMessage.Int0() ); + TUint32 bearerType( aMessage.Int1() ); + TUint32 connMethodId( aMessage.Int2() ); + + CCmmDestinationInstance* destination = + ( CCmmDestinationInstance* )iDestinationObjects->AtL( destinationHandle ); + + CCmmConnMethodInstance* connMethod = + CCmmConnMethodInstance::NewLC( this, &iCache ); + // Will check if ID is available. + iCache.CreateConnMethodL( *connMethod, destination, bearerType, connMethodId ); + + iConnMethodContainer->AddL( ( CObject* ) connMethod ); + TInt handle = iConnMethodObjects->AddL( ( CObject* ) connMethod ); + connMethod->SetHandle( handle ); + CleanupStack::Pop( connMethod ); + + TPckg handlePckg( handle ); + TInt error = aMessage.Write( 3, handlePckg ); + if ( error ) + { + // Remove from object index and destroy the object. + iConnMethodObjects->Remove( handle ); + User::Leave( error ); + } + + OstTraceFunctionExit0( CCMMSESSION_CREATECONNMETHODTODESTWITHIDL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Checks if the CM given as parameter is equal to this CM +// ----------------------------------------------------------------------------- +// +void CCmmSession::CmIsEqualL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_CMISEQUALL_ENTRY ); + + CCmmConnMethodInstance* cm = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int3() ); + + CCmmConnMethodInstance* cmToBeCompared = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int0() ); + + TBool equal( EFalse ); + if ( cm->GetId() == cmToBeCompared->GetId() ) + { + equal = ETrue; + } + + TPckg equalPckg( equal ); + aMessage.WriteL( 1, equalPckg ); + + OstTraceFunctionExit0( CCMMSESSION_CMISEQUALL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Creates a copy of an existing connection method and opens a handle to it. +// ----------------------------------------------------------------------------- +// +void CCmmSession::CreateCopyOfExistingL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_CREATECOPYOFEXISTINGL_ENTRY ); + + CCmmConnMethodInstance* sourceCm = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int0() ); + TUint32 cmId = sourceCm->GetId(); + + CCmmConnMethodInstance* targetCm = + CCmmConnMethodInstance::NewLC( this, &iCache ); + iCache.CreateCopyOfConnMethodL( *targetCm, *sourceCm ); + + iConnMethodContainer->AddL( ( CObject* ) targetCm ); + TInt handle = iConnMethodObjects->AddL( ( CObject* ) targetCm ); + targetCm->SetHandle( handle ); + CleanupStack::Pop( targetCm ); + + TPckg handlePckg( handle ); + TInt error = aMessage.Write( 3, handlePckg ); + if ( error ) + { + // Remove from object index and destroy the object. + iConnMethodObjects->Remove( handle ); + User::Leave( error ); + } + + OstTraceFunctionExit0( CCMMSESSION_CREATECOPYOFEXISTINGL_EXIT ); + } + +// ----------------------------------------------------------------------------- +// Creates a copy of an existing connection method and opens a handle to it. +// ----------------------------------------------------------------------------- +// +void CCmmSession::GetEmbeddedDestinationL( const RMessage2& aMessage ) + { + OstTraceFunctionEntry0( CCMMSESSION_GETEMBEDDEDDESTINATIONL_ENTRY ); + + CCmmConnMethodInstance* connMethodInstance = + ( CCmmConnMethodInstance* )iConnMethodObjects->AtL( aMessage.Int3() ); + + if ( connMethodInstance->GetBearerType() != KUidEmbeddedDestination ) + { + User::Leave( KErrNotSupported ); + } + + TUint32 destinationId = connMethodInstance->GetId(); + + // Check that the ID is in valid range. + if ( destinationId <= KCmDefaultDestinationAPTagId || + destinationId >= KCmMaxDestinationAPTagId ) + { + User::Leave( KErrCorrupt ); + } + + // If this session already has a destination with matching ID open, provide + // the client with a reference to the already opened handle. + CCmmDestinationInstance* destinationInstance = FindDestinationInstanceById( destinationId ); + if ( destinationInstance ) + { + if ( iCache.DestinationExistsWithId( destinationId ) ) + { + TPckg existingHandlePckg( destinationInstance->GetHandle() ); + aMessage.WriteL( 1, existingHandlePckg ); + User::Leave( KErrAlreadyExists ); + } + } + destinationInstance = NULL; + TPckg existingHandlePckg( 0 ); + aMessage.WriteL( 1, existingHandlePckg ); + + destinationInstance = CCmmDestinationInstance::NewLC( this, &iCache ); + + // Cache will open a handle to the destination if not already open, and + // copy relevant data into this destination instance. + iCache.OpenDestinationL( *destinationInstance, destinationId ); // Checks ID is valid. + + iDestinationContainer->AddL( ( CObject* ) destinationInstance ); + TInt handle = iDestinationObjects->AddL( ( CObject* ) destinationInstance ); + destinationInstance->SetHandle( handle ); + CleanupStack::Pop( destinationInstance ); + + TPckg handlePckg( handle ); + TInt error = aMessage.Write( 3, handlePckg ); + if ( error ) + { + // Removes from object index and destroys the object. + iDestinationObjects->Remove( handle ); + User::Leave( error ); + } + OstTraceFunctionExit0( CCMMSESSION_GETEMBEDDEDDESTINATIONL_EXIT ); + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmsrvstatic.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmsrvstatic.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Creates and starts the server. +* +*/ + + +#include "cmmstarter.h" + + +// +// Perform all server initialisation, in particular creation of the scheduler +// and server and then run the scheduler. +// +static void RunServerL() + { + // Create and install the active scheduler we need. + CActiveScheduler* s = new( ELeave ) CActiveScheduler; + CleanupStack::PushL( s ); + CActiveScheduler::Install( s ); + + // Create the server. + CServer2* server = CCmmStarter::CreateAndStartServerL(); + CleanupStack::PushL( server ); + + // Naming the server thread after server startup helps to debug panics. + User::LeaveIfError( RThread::RenameMe( CCmmStarter::ServerName() ) ); + + // Initialisation complete, now signal the client. + RProcess::Rendezvous( KErrNone ); + + // Ready to run. + CActiveScheduler::Start(); + + // Cleanup the server and scheduler. + CleanupStack::PopAndDestroy( server ); + CleanupStack::PopAndDestroy( s ); + } + +// +// Server process entry-point. +// +TInt E32Main() + { +// __UHEAP_MARK; + + CTrapCleanup* cleanup = CTrapCleanup::New(); + TInt r = KErrNoMemory; + if ( cleanup ) + { + TRAP( r, RunServerL() ); + delete cleanup; + } + +// __UHEAP_MARKEND; + return r; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmstarter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmstarter.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Creates and starts Connection Method Manager server. +* +*/ + + +#include "cmmstarter.h" +#include "cmmserverdefs.h" +#include "cmmserver.h" + + +CServer2* CCmmStarter::CreateAndStartServerL() + { + return CCmmServer::NewL(); + } + +TPtrC CCmmStarter::ServerName() + { + return KCmmServer().Mid( 0 ); + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/src/cmmtransactionhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/src/cmmtransactionhandler.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,201 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Common transaction handler of framework and plugins. +* +*/ + + +#include "cmmtransactionhandler.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmtransactionhandlerTraces.h" +#endif + +const TUint32 KMaxOpenTransAttempts = 10; +const TUint32 KRetryAfter = 100000; + + +// --------------------------------------------------------------------------- +// NewL. +// --------------------------------------------------------------------------- +// +CCmmTransactionHandler* CCmmTransactionHandler::NewL( CommsDat::CMDBSession& aDb ) + { + OstTraceFunctionEntry0( CCMTRANSACTIONHANDLER_NEWL_ENTRY ); + + CCmmTransactionHandler* self = new( ELeave ) CCmmTransactionHandler( aDb ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + OstTraceFunctionExit0( CCMTRANSACTIONHANDLER_NEWL_EXIT ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CCmmTransactionHandler::~CCmmTransactionHandler() + { + OstTraceFunctionEntry0( CCMTRANSACTIONHANDLER_CCMTRANSACTIONHANDLER_ENTRY ); + delete &iDb; + OstTraceFunctionExit0( CCMTRANSACTIONHANDLER_CCMTRANSACTIONHANDLER_EXIT ); + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CCmmTransactionHandler::CCmmTransactionHandler( CommsDat::CMDBSession& aDb ) : iDb( aDb ) + { + OstTraceFunctionEntry0( DUP1_CCMTRANSACTIONHANDLER_CCMTRANSACTIONHANDLER_ENTRY ); + iRefCount = 0; + OstTraceFunctionExit0( DUP1_CCMTRANSACTIONHANDLER_CCMTRANSACTIONHANDLER_EXIT ); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// +void CCmmTransactionHandler::ConstructL() + { + OstTraceFunctionEntry0( CCMTRANSACTIONHANDLER_CONSTRUCTL_ENTRY ); + iDb.SetAttributeMask( CommsDat::ECDHidden | CommsDat::ECDProtectedWrite ); + OstTraceFunctionExit0( CCMTRANSACTIONHANDLER_CONSTRUCTL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Return the CommsDat session. +// --------------------------------------------------------------------------- +// +CommsDat::CMDBSession& CCmmTransactionHandler::Session() const + { + return iDb; + } + +// --------------------------------------------------------------------------- +// Opens a CommsDat transaction if it is not already open. Reference counter +// is inreased by one. +// --------------------------------------------------------------------------- +// +void CCmmTransactionHandler::OpenTransactionLC() + { + OstTraceFunctionEntry0( CCMTRANSACTIONHANDLER_OPENTRANSACTIONLC_ENTRY ); + + iRefCount++; + CleanupClosePushL( *this ); + + if ( !iDb.IsInTransaction() ) + { + TInt err( KErrNone ); + TUint32 attempts( KMaxOpenTransAttempts ); + + do + { + TRAP( err, iDb.OpenTransactionL() ); + if ( err ) + { + User::After( KRetryAfter ); + } + } while ( err && attempts-- ); + User::LeaveIfError( err ); + } + + OstTraceFunctionExit0( CCMTRANSACTIONHANDLER_OPENTRANSACTIONLC_EXIT ); + } + +// --------------------------------------------------------------------------- +// Decreases the reference counter by one. If it reaches zero, commits the open +// CommsDat transaction. If an error code is given as argument, the CommsDat +// transaction is rolled back instead. +// --------------------------------------------------------------------------- +// +void CCmmTransactionHandler::CommitTransactionL( TInt aError ) + { + OstTraceFunctionEntry0( CCMTRANSACTIONHANDLER_COMMITTRANSACTIONL_ENTRY ); + + iRefCount--; + CleanupStack::Pop( this ); + + if ( !iRefCount ) + { + if ( aError ) + { + iDb.RollbackTransactionL(); + } + else + { + iDb.CommitTransactionL(); + } + } + + OstTraceFunctionExit0( CCMTRANSACTIONHANDLER_COMMITTRANSACTIONL_EXIT ); + } + +// --------------------------------------------------------------------------- +// Performs RollbackTransactionL(). +// Pay attention to CleanupStack if calling this. The transaction handler +// needs to be popped from CleanupStack manually. +// --------------------------------------------------------------------------- +// +void CCmmTransactionHandler::Close() + { + OstTraceFunctionEntry0( CCMTRANSACTIONHANDLER_CLOSE_ENTRY ); + + if ( iRefCount == 0 ) + { + // No active transaction, do nothing. + OstTraceFunctionExit0( DUP1_CCMTRANSACTIONHANDLER_CLOSE_EXIT ); + return; + } + + if ( !iDb.IsInTransaction() ) + { + // Sometimes CommsDat closes the transaction on its own decision w/o any + // notification or reason. E.g. when you try to delete a non-existing + // record, it leaves with KErrNotFound, but rolls back the transaction. + iRefCount = 0; + } + else + { + iRefCount--; + + if ( !iRefCount ) + { + if ( iDb.IsInTransaction() ) + { + TRAP_IGNORE( iDb.RollbackTransactionL() ); + } + } + } + + OstTraceFunctionExit0( DUP2_CCMTRANSACTIONHANDLER_CLOSE_EXIT ); + } + +// --------------------------------------------------------------------------- +// Return the current reference count. Transaction is currently open if the +// count above 0. +// --------------------------------------------------------------------------- +// +TUint32 CCmmTransactionHandler::GetReferenceCount() + { + OstTraceFunctionEntry0( CCMTRANSACTIONHANDLER_GETREFERENCECOUNT_ENTRY ); + OstTraceFunctionExit0( CCMTRANSACTIONHANDLER_GETREFERENCECOUNT_EXIT ); + return iRefCount; + } + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/traces/OstTraceDefinitions.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler +// REMOVE BEFORE CHECK-IN TO VERSION CONTROL +// #define OST_TRACE_COMPILER_IN_USE +#include +#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/cmmserver/traces/fixed_id.definitions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cmmgr/cmmserver/traces/fixed_id.definitions Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,501 @@ +#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt. +[GROUP]TRACE_FLOW=0x7 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ADDRESOURCEFILEL_ENTRY=0x99 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ADDRESOURCEFILEL_EXIT=0x9a +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ALLIAPSL_ENTRY=0xe2 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ALLIAPSL_EXIT=0xe3 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ALLOCREADL_ENTRY=0xa2 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ALLOCREADL_EXIT=0xa3 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_BEARERPRIORITYARRAYL_ENTRY=0x8f +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_BEARERPRIORITYARRAYL_EXIT=0x90 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_BUILDPLUGINARRAYL_ENTRY=0xcb +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_BUILDPLUGINARRAYL_EXIT=0xcc +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CCMMANAGERIMPL_ENTRY=0x87 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CCMMANAGERIMPL_EXIT=0x88 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CHECKTABLESL_ENTRY=0x8b +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CHECKTABLESL_EXIT=0x8c +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CLEANUPGLOBALPRIORITYARRAY_ENTRY=0x97 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CLEANUPGLOBALPRIORITYARRAY_EXIT=0x98 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_COMMITTRANSACTIONL_ENTRY=0xa8 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_COMMITTRANSACTIONL_EXIT=0xa9 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CONSTRUCTL_ENTRY=0xa4 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CONSTRUCTL_EXIT=0xa5 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_COPYBEARERPRIORITYARRAYL_ENTRY=0x91 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_COPYBEARERPRIORITYARRAYL_EXIT=0x92 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CREATEBEARERPRIORITYARRAYL_ENTRY=0x8d +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CREATEBEARERPRIORITYARRAYL_EXIT=0x8e +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_EASYWLANIDL_ENTRY=0xe0 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_EASYWLANIDL_EXIT=0xe1 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_FEATURESUPPORTED_ENTRY=0xdb +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_FINDRESOURCEFILE_ENTRY=0x9f +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_FINDRESOURCEFILE_EXIT=0xa0 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETBEARERINFOBOOLL_ENTRY=0xcf +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETBEARERINFOBOOLL_EXIT=0xd0 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETBEARERINFOINTL_ENTRY=0xcd +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETBEARERINFOINTL_EXIT=0xce +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETBEARERINFOSTRING8L_ENTRY=0xd3 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETBEARERINFOSTRING8L_EXIT=0xd4 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETBEARERINFOSTRINGL_ENTRY=0xd1 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETBEARERINFOSTRINGL_EXIT=0xd2 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETCONNECTIONMETHODINFOBOOLL_ENTRY=0xd6 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETCONNECTIONMETHODINFOBOOLL_EXIT=0xd7 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETCONNECTIONMETHODINFOINTL_ENTRY=0xd5 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETCONNECTIONMETHODINFOSTRING8L_ENTRY=0xd9 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETCONNECTIONMETHODINFOSTRINGL_ENTRY=0xd8 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETINTERNETDESTINATIONIDL_EXIT=0xfd +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GLOBALBEARERPRIORITY_ENTRY=0x95 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GLOBALBEARERPRIORITY_EXIT=0x96 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_HANDLEDEFCONNDELETEDL_ENTRY=0xe8 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_HANDLEDEFCONNDELETEDL_EXIT=0xe9 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ISEASYWLANL_ENTRY=0xdc +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ISEASYWLANL_EXIT=0xdd +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ISMEMORYLOW_ENTRY=0xf4 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ISMEMORYLOW_EXIT=0xf5 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_NEWL_ENTRY=0x85 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_NEWL_EXIT=0x86 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_OPENTRANSACTIONLC_ENTRY=0xa6 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_OPENTRANSACTIONLC_EXIT=0xa7 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_READDEFCONNL_ENTRY=0xee +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_READDEFCONNL_EXIT=0xef +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_READDEFCONNWOTRANSL_ENTRY=0xea +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_READDEFCONNWOTRANSL_EXIT=0xeb +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_REMOVERESOURCEFILE_ENTRY=0x9c +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_REMOVERESOURCEFILE_EXIT=0x9d +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_REPLACEDEFCONNRECORDL_ENTRY=0xf0 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_REPLACEDEFCONNRECORDL_EXIT=0xf1 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ROLLBACKTRANSACTION_ENTRY=0xaa +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ROLLBACKTRANSACTION_EXIT=0xab +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_SESSION_ENTRY=0xda +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_UPDATEBEARERPRIORITYARRAYL_ENTRY=0x93 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_UPDATEBEARERPRIORITYARRAYL_EXIT=0x94 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_WRITEDEFCONNL_ENTRY=0xf2 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_WRITEDEFCONNL_EXIT=0xf3 +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_WRITEDEFCONNWOTRANSL_ENTRY=0xec +[TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_WRITEDEFCONNWOTRANSL_EXIT=0xed +[TRACE]TRACE_FLOW[0x7]_CCMMDELAYEDSHUTDOWN_CCMMDELAYEDSHUTDOWN_ENTRY=0x78 +[TRACE]TRACE_FLOW[0x7]_CCMMDELAYEDSHUTDOWN_CCMMDELAYEDSHUTDOWN_EXIT=0x79 +[TRACE]TRACE_FLOW[0x7]_CCMMDELAYEDSHUTDOWN_CONSTRUCTL_ENTRY=0x7a +[TRACE]TRACE_FLOW[0x7]_CCMMDELAYEDSHUTDOWN_CONSTRUCTL_EXIT=0x7b +[TRACE]TRACE_FLOW[0x7]_CCMMDELAYEDSHUTDOWN_DOCANCEL_ENTRY=0x81 +[TRACE]TRACE_FLOW[0x7]_CCMMDELAYEDSHUTDOWN_DOCANCEL_EXIT=0x82 +[TRACE]TRACE_FLOW[0x7]_CCMMDELAYEDSHUTDOWN_RUNL_ENTRY=0x83 +[TRACE]TRACE_FLOW[0x7]_CCMMDELAYEDSHUTDOWN_RUNL_EXIT=0x84 +[TRACE]TRACE_FLOW[0x7]_CCMMDELAYEDSHUTDOWN_START_ENTRY=0x7e +[TRACE]TRACE_FLOW[0x7]_CCMMDELAYEDSHUTDOWN_START_EXIT=0x7f +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_CCMMINSTANCEMAPPING_ENTRY=0x1da +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_CCMMINSTANCEMAPPING_EXIT=0x1db +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_CONSTRUCTL_ENTRY=0x1dc +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_CONSTRUCTL_EXIT=0x1dd +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_GETCONNMETHODSL_ENTRY=0x1ed +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_GETCONNMETHODSL_EXIT=0x1ee +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_GETDESTINATIONSL_ENTRY=0x1ef +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_GETDESTINATIONSL_EXIT=0x1f0 +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_NEWLC_ENTRY=0x1d8 +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_NEWLC_EXIT=0x1d9 +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_NEWL_ENTRY=0x1d6 +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_NEWL_EXIT=0x1d7 +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_READANDVALIDATECONNMETHODSL_ENTRY=0x1e5 +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_READANDVALIDATECONNMETHODSL_EXIT=0x1e6 +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_READANDVALIDATEDESTINATIONSL_ENTRY=0x1e7 +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_READANDVALIDATEDESTINATIONSL_EXIT=0x1e8 +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_REFRESHL_ENTRY=0x1de +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_REFRESHL_EXIT=0x1df +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_SESSION_ENTRY=0x1e4 +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_VALIDCONNMETHODID_ENTRY=0x1e2 +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_VALIDCONNMETHODID_EXIT=0x1e3 +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_VALIDDESTINATIONID_ENTRY=0x1e0 +[TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_VALIDDESTINATIONID_EXIT=0x1e1 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_CCMMSERVER_ENTRY=0x61 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_CCMMSERVER_EXIT=0x62 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_CMMANAGER_ENTRY=0x76 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_CMMANAGER_EXIT=0x77 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_CONSTRUCTL_ENTRY=0x69 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_CONSTRUCTL_EXIT=0x6a +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_INCREMENTSESSIONS_ENTRY=0x6c +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_INCREMENTSESSIONS_EXIT=0x6d +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_NEWCONTAINERL_ENTRY=0x71 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_NEWLC_ENTRY=0x67 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_NEWLC_EXIT=0x68 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_NEWL_ENTRY=0x65 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_NEWL_EXIT=0x66 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_NEWSESSIONL_ENTRY=0x6b +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_REMOVECONTAINER_ENTRY=0x72 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_REMOVECONTAINER_EXIT=0x73 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_RUNERROR_ENTRY=0x74 +[TRACE]TRACE_FLOW[0x7]_CCMMSERVER_RUNERROR_EXIT=0x75 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CCMMSESSION_ENTRY=0x5 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CCMMSESSION_EXIT=0x6 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CLOSECONNMETHOD_ENTRY=0x5d +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CLOSECONNMETHOD_EXIT=0x5e +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CLOSEDESTINATION_ENTRY=0x35 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CLOSEDESTINATION_EXIT=0x36 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CONSTRUCTL_ENTRY=0x7 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CONSTRUCTL_EXIT=0x8 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CREATECONNMETHODL_ENTRY=0x59 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CREATECONNMETHODL_EXIT=0x5a +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CREATEDESTINATIONWITHNAMEANDIDL_ENTRY=0x2e +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CREATEDESTINATIONWITHNAMEANDIDL_EXIT=0x2f +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CREATEDESTINATIONWITHNAMEL_ENTRY=0x2c +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CREATEDESTINATIONWITHNAMEL_EXIT=0x2d +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_DELETECONNMETHODL_ENTRY=0x5f +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_DELETECONNMETHODL_EXIT=0x60 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_DESTINATIONDELETEL_ENTRY=0x55 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_DESTINATIONDELETEL_EXIT=0x56 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_DESTINATIONUPDATEL_ENTRY=0x53 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_DESTINATIONUPDATEL_EXIT=0x54 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETALLDESTINATIONSL_ENTRY=0x20 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETBEARERINFOBOOLL_ENTRY=0xf +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETBEARERINFOBOOLL_EXIT=0x10 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETBEARERINFOINTL_ENTRY=0xd +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETBEARERINFOINTL_EXIT=0xe +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETBEARERINFOSTRING8L_ENTRY=0x13 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETBEARERINFOSTRING8L_EXIT=0x14 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETBEARERINFOSTRINGL_ENTRY=0x11 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETBEARERINFOSTRINGL_EXIT=0x12 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNECTIONMEHODCOUNTL_ENTRY=0x37 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNECTIONMEHODCOUNTL_EXIT=0x38 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNMETHODARRAYL_ENTRY=0x1d +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNMETHODINFOBOOLL_ENTRY=0x17 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNMETHODINFOBOOLL_EXIT=0x18 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNMETHODINFOINTL_ENTRY=0x15 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNMETHODINFOINTL_EXIT=0x16 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNMETHODINFOSTRING8L_ENTRY=0x1b +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNMETHODINFOSTRING8L_EXIT=0x1c +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNMETHODINFOSTRINGL_ENTRY=0x19 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNMETHODINFOSTRINGL_EXIT=0x1a +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNMETHODPRIORITYL_ENTRY=0x39 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNMETHODPRIORITYL_EXIT=0x3a +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETDESTINATIONELEMENTIDL_ENTRY=0x3f +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETDESTINATIONELEMENTIDL_EXIT=0x40 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETDESTINATIONIDL_ENTRY=0x3d +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETDESTINATIONIDL_EXIT=0x3e +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETDESTINATIONL_ENTRY=0x2a +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETDESTINATIONL_EXIT=0x2b +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETDESTINATIONMETADATAL_ENTRY=0x41 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETDESTINATIONMETADATAL_EXIT=0x42 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETDESTINATIONNAMEL_ENTRY=0x3b +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETDESTINATIONNAMEL_EXIT=0x3c +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETDESTINATIONPROTECTIONLEVELL_ENTRY=0x43 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETDESTINATIONPROTECTIONLEVELL_EXIT=0x44 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETEASYWLANIDL_ENTRY=0x23 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETEASYWLANIDL_EXIT=0x24 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETSUPPORTEDBEARERSL_ENTRY=0x25 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_ISDESTINATIONCONNECTEDL_ENTRY=0x45 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_ISDESTINATIONCONNECTEDL_EXIT=0x46 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_ISDESTINATIONHIDDENL_ENTRY=0x47 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_ISDESTINATIONHIDDENL_EXIT=0x48 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_MODIFYCMPRIORITYL_ENTRY=0x49 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_MODIFYCMPRIORITYL_EXIT=0x4a +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_NEWLC_ENTRY=0x3 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_NEWLC_EXIT=0x4 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_NEWL_ENTRY=0x1 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_NEWL_EXIT=0x2 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SERVICECONNMETHODL_ENTRY=0x57 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SERVICECONNMETHODL_EXIT=0x58 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SERVICEDESTINATIONL_ENTRY=0x28 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SERVICEDESTINATIONL_EXIT=0x29 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SERVICEL_ENTRY=0xb +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SERVICEL_EXIT=0xc +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SETDESTINATIONHIDDENL_ENTRY=0x51 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SETDESTINATIONHIDDENL_EXIT=0x52 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SETDESTINATIONMETADATAL_ENTRY=0x4d +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SETDESTINATIONMETADATAL_EXIT=0x4e +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SETDESTINATIONNAMEL_ENTRY=0x4b +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SETDESTINATIONNAMEL_EXIT=0x4c +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SETDESTINATIONPROTECTIONL_ENTRY=0x4f +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_SETDESTINATIONPROTECTIONL_EXIT=0x50 +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_UPDATECONNMETHODL_ENTRY=0x5b +[TRACE]TRACE_FLOW[0x7]_CCMMSESSION_UPDATECONNMETHODL_EXIT=0x5c +[TRACE]TRACE_FLOW[0x7]_CCMTRANSACTIONHANDLER_CLOSE_ENTRY=0x117 +[TRACE]TRACE_FLOW[0x7]_CCMTRANSACTIONHANDLER_CLOSE_EXIT=0x118 +[TRACE]TRACE_FLOW[0x7]_CCMTRANSACTIONHANDLER_COMMITTRANSACTIONL_ENTRY=0x115 +[TRACE]TRACE_FLOW[0x7]_CCMTRANSACTIONHANDLER_COMMITTRANSACTIONL_EXIT=0x116 +[TRACE]TRACE_FLOW[0x7]_CCMTRANSACTIONHANDLER_CONSTRUCTL_ENTRY=0x10f +[TRACE]TRACE_FLOW[0x7]_CCMTRANSACTIONHANDLER_CONSTRUCTL_EXIT=0x110 +[TRACE]TRACE_FLOW[0x7]_CCMTRANSACTIONHANDLER_NEWL_ENTRY=0x10c +[TRACE]TRACE_FLOW[0x7]_CCMTRANSACTIONHANDLER_NEWL_EXIT=0x10d +[TRACE]TRACE_FLOW[0x7]_CCMTRANSACTIONHANDLER_OPENTRANSACTIONLC_ENTRY=0x113 +[TRACE]TRACE_FLOW[0x7]_CCMTRANSACTIONHANDLER_OPENTRANSACTIONLC_EXIT=0x114 +[TRACE]TRACE_FLOW[0x7]_CDESTINATION_CDESTINATION_ENTRY=0x1d2 +[TRACE]TRACE_FLOW[0x7]_CDESTINATION_CDESTINATION_EXIT=0x1d3 +[TRACE]TRACE_FLOW[0x7]_CDESTINATION_CONSTRUCTL_ENTRY=0x1d4 +[TRACE]TRACE_FLOW[0x7]_CDESTINATION_CONSTRUCTL_EXIT=0x1d5 +[TRACE]TRACE_FLOW[0x7]_CDESTINATION_NEWLC_ENTRY=0x1d0 +[TRACE]TRACE_FLOW[0x7]_CDESTINATION_NEWLC_EXIT=0x1d1 +[TRACE]TRACE_FLOW[0x7]_CDESTINATION_NEWL_ENTRY=0x1ce +[TRACE]TRACE_FLOW[0x7]_CDESTINATION_NEWL_EXIT=0x1cf +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMANAGERIMPL_ADDRESOURCEFILEL_EXIT=0x9b +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMANAGERIMPL_CCMMANAGERIMPL_ENTRY=0x89 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMANAGERIMPL_CCMMANAGERIMPL_EXIT=0x8a +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMANAGERIMPL_FINDRESOURCEFILE_EXIT=0xa1 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMANAGERIMPL_ISEASYWLANL_EXIT=0xde +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMANAGERIMPL_REMOVERESOURCEFILE_EXIT=0x9e +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMDELAYEDSHUTDOWN_CCMMDELAYEDSHUTDOWN_ENTRY=0x7c +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMDELAYEDSHUTDOWN_CCMMDELAYEDSHUTDOWN_EXIT=0x7d +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMDELAYEDSHUTDOWN_START_EXIT=0x80 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMSERVER_CCMMSERVER_ENTRY=0x63 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMSERVER_CCMMSERVER_EXIT=0x64 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMSESSION_CCMMSESSION_ENTRY=0x9 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMSESSION_CCMMSESSION_EXIT=0xa +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMSESSION_GETALLDESTINATIONSL_EXIT=0x22 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMSESSION_GETCONNMETHODARRAYL_EXIT=0x1f +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMMSESSION_GETSUPPORTEDBEARERSL_EXIT=0x27 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMTRANSACTIONHANDLER_CCMTRANSACTIONHANDLER_ENTRY=0x111 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMTRANSACTIONHANDLER_CCMTRANSACTIONHANDLER_EXIT=0x112 +[TRACE]TRACE_FLOW[0x7]_DUP1_CCMTRANSACTIONHANDLER_CLOSE_EXIT=0x119 +[TRACE]TRACE_FLOW[0x7]_DUP2_CCMMANAGERIMPL_ISEASYWLANL_EXIT=0xdf +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_BEARERRECORDIDLC_ENTRY=0x1bc +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_BEARERRECORDIDLC_EXIT=0x1bd +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_CANHANDLEIAPIDL_ENTRY=0x1b6 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_CANHANDLEIAPIDL_EXIT=0x1b7 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_CCMCONNECTIONMETHODINFO_ENTRY=0x1a0 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_CCMCONNECTIONMETHODINFO_EXIT=0x1a1 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_CONSTRUCTL_ENTRY=0x1a2 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_CONSTRUCTL_EXIT=0x1a3 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_COPYADDITIONALDATAL_ENTRY=0x1c2 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_COPYADDITIONALDATAL_EXIT=0x1c3 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_CREATECOPYL_ENTRY=0x1c6 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_CREATECOPYL_EXIT=0x1c7 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_CREATEINSTANCEL_ENTRY=0x1c4 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_CREATEINSTANCEL_EXIT=0x1c5 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_CREATENEWSERVICERECORDL_ENTRY=0x1be +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_CREATENEWSERVICERECORDL_EXIT=0x1bf +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_GETCONNECTIONINFOBOOLL_ENTRY=0x1ac +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_GETCONNECTIONINFOBOOLL_EXIT=0x1ad +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_GETCONNECTIONINFOINTL_ENTRY=0x1aa +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_GETCONNECTIONINFOINTL_EXIT=0x1ab +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_GETCONNECTIONINFOSTRING8L_ENTRY=0x1b0 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_GETCONNECTIONINFOSTRING8L_EXIT=0x1b1 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_GETCONNECTIONINFOSTRINGL_ENTRY=0x1ae +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_GETCONNECTIONINFOSTRINGL_EXIT=0x1af +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_INITIALIZEWITHUIL_ENTRY=0x1b4 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_INITIALIZEWITHUIL_EXIT=0x1b5 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_NEWLC_ENTRY=0x1a6 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_NEWLC_EXIT=0x1a7 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_NEWL_ENTRY=0x1a4 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_NEWL_EXIT=0x1a5 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_RESETANDLOADL_ENTRY=0x1c0 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_RESETANDLOADL_EXIT=0x1c1 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_RESETIFINMEMORY_ENTRY=0x1c8 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_RESETIFINMEMORY_EXIT=0x1c9 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_RUNSETTINGSL_ENTRY=0x1b2 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_RUNSETTINGSL_EXIT=0x1b3 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_SERVICERECORDIDLC_ENTRY=0x1ba +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMCONNECTIONMETHODINFO_SERVICERECORDIDLC_EXIT=0x1bb +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_CCMDESTINATIONDATA=0x125 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_CMMGR_ENTRY=0x18c +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_CMMGR_EXIT=0x18d +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_CONNECTIONMETHODCOUNT_ENTRY=0x141 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_CONNECTIONMETHODCOUNT_EXIT=0x142 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_IDISVALID_ENTRY=0x188 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_IDISVALID_EXIT=0x189 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_ISHIDDEN_ENTRY=0x170 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_ISHIDDEN_EXIT=0x171 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_METADATAL_ENTRY=0x16b +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_METADATAL_EXIT=0x16c +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_PROTECTIONLEVEL_ENTRY=0x147 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_RESETANDDESTROYARRAY_ENTRY=0x176 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONDATA_RESETANDDESTROYARRAY_EXIT=0x177 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_ADDTOARRAYL_ENTRY=0x144 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_ADDTOARRAYL_EXIT=0x145 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CCMDESTINATIONIMPL=0x124 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFDESTINATIONIDEXISTSL_ENTRY=0x130 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFDESTINATIONIDEXISTSL_EXIT=0x131 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFDESTINATIONNAMEEXISTL_ENTRY=0x132 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFDESTINATIONNAMEEXISTL_EXIT=0x133 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFEMBEDDEDL_ENTRY=0x151 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFEMBEDDEDL_EXIT=0x152 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFINTERNETEXISTSL_ENTRY=0x17f +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFINTERNETEXISTSL_EXIT=0x180 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFLOCALISEDDESTEXISTL_ENTRY=0x190 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFLOCALISEDDESTEXISTL_EXIT=0x191 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFNAMEMODIFIEDL_ENTRY=0x17a +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFNAMEMODIFIEDL_EXIT=0x17b +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFPURPOSEEXISTL_ENTRY=0x192 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CHECKIFPURPOSEEXISTL_EXIT=0x193 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CLEANUPEMBEDDEDL_ENTRY=0x165 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CLEANUPEMBEDDEDL_EXIT=0x166 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CLEANUPSNAPMETADATATABLEL_ENTRY=0x167 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CLEANUPSNAPMETADATATABLEL_EXIT=0x168 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CMMGR_ENTRY=0x18e +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CMMGR_EXIT=0x18f +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_COMMITTRANSACTIONL_ENTRY=0x139 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_COMMITTRANSACTIONL_EXIT=0x13a +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CONNECTIONMETHODCOUNT_ENTRY=0x143 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CONSTRUCTL_ENTRY=0x12a +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CONSTRUCTL_EXIT=0x12b +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_CREATEDESTINATIONAPTAGIDL_ENTRY=0x157 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_DELETEIAPRECORDSL_ENTRY=0x178 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_DELETEIAPRECORDSL_EXIT=0x179 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_DELETELD_ENTRY=0x14d +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_DELETELD_EXIT=0x14e +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_DELETERELATEDRECORDSL_ENTRY=0x14f +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_DELETERELATEDRECORDSL_EXIT=0x150 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_GETDATA_ENTRY=0x184 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_GETDATA_EXIT=0x185 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_GETDESTINATIONAPTAGID_ENTRY=0x158 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_IDISVALID_ENTRY=0x18a +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_IDISVALID_EXIT=0x18b +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_INITIALIZEDESTAPRECORDL_ENTRY=0x194 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_INITIALIZEDESTAPRECORDL_EXIT=0x195 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_ISCONNECTEDL_ENTRY=0x17d +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_ISCONNECTEDL_EXIT=0x17e +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_ISHIDDEN_ENTRY=0x173 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_LOADDESTAPRECORDL_ENTRY=0x163 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_LOADDESTAPRECORDL_EXIT=0x164 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_LOADNETWORKRECORDL_ENTRY=0x161 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_LOADNETWORKRECORDL_EXIT=0x162 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_LOADSNAPMETADATATABLEL_ENTRY=0x15f +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_LOADSNAPMETADATATABLEL_EXIT=0x160 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_METADATAL=0x16d +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_NAMELC_ENTRY=0x13d +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_NAMELC_EXIT=0x13e +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_NEWLC_ENTRY=0x122 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_NEWLC_EXIT=0x123 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_NEWL_ENTRY=0x11a +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_NEWL_EXIT=0x11b +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_OPENTRANSACTIONLC_ENTRY=0x137 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_OPENTRANSACTIONLC_EXIT=0x138 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_PROTECTIONLEVELL_ENTRY=0x181 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_PROTECTIONLEVELL_EXIT=0x182 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_PROTECTIONLEVEL_ENTRY=0x148 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_ROLLBACKTRANSACTION_ENTRY=0x13b +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_ROLLBACKTRANSACTION_EXIT=0x13c +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SESSION_ENTRY=0x136 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETATTRIBUTE_ENTRY=0x159 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETATTRIBUTE_EXIT=0x15a +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETDATA_ENTRY=0x186 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETDATA_EXIT=0x187 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETDEFAULTCPRL_ENTRY=0x19a +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETDEFAULTCPRL_EXIT=0x19b +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETDEFAULTMCPRL_ENTRY=0x198 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETDEFAULTMCPRL_EXIT=0x199 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETDEFAULTPROTOCOLL_ENTRY=0x19e +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETDEFAULTPROTOCOLL_EXIT=0x19f +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETDEFAULTSCPRL_ENTRY=0x19c +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETDEFAULTSCPRL_EXIT=0x19d +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETDEFAULTTIERMANAGERL_ENTRY=0x196 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETDEFAULTTIERMANAGERL_EXIT=0x197 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETHIDDENL_ENTRY=0x174 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETHIDDENL_EXIT=0x175 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETIDL_ENTRY=0x12e +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETIDL_EXIT=0x12f +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETMETADATAL=0x16e +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETMETADATAL_EXIT=0x16f +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETNAMEL_ENTRY=0x13f +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETNAMEL_EXIT=0x140 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETPROTECTIONL_ENTRY=0x149 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SETPROTECTIONL_EXIT=0x14a +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SORTRECORDSBYPRIORITY_ENTRY=0x169 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_SORTRECORDSBYPRIORITY_EXIT=0x16a +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_UPDATEDESTAPRECORDL_ENTRY=0x155 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_UPDATEDESTAPRECORDL_EXIT=0x156 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_UPDATEL_ENTRY=0x14b +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_UPDATEL_EXIT=0x14c +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_UPDATENETWORKRECORDL_ENTRY=0x153 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_UPDATENETWORKRECORDL_EXIT=0x154 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_UPDATESNAPMETADATATABLEL_ENTRY=0x15d +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_UPDATESNAPMETADATATABLEL_EXIT=0x15e +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_UPDATESNAPTABLEL_ENTRY=0x15b +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMDESTINATIONIMPL_UPDATESNAPTABLEL_EXIT=0x15c +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ALLDESTINATIONSL_ENTRY=0xc2 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ALLDESTINATIONSL_EXIT=0xc3 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ALLSNAPRECORDSL_ENTRY=0xe4 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ALLSNAPRECORDSL_EXIT=0xe5 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_BEARERTYPEFROMCMIDL_ENTRY=0xbe +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_BEARERTYPEFROMCMIDL_EXIT=0xbf +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_BEARERTYPEFROMIAPRECORDL_ENTRY=0xc0 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_BEARERTYPEFROMIAPRECORDL_EXIT=0xc1 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CONNECTIONMETHODL_ENTRY=0xb7 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CONNECTIONMETHODL_EXIT=0xb8 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CONNMETHODUPDATED_ENTRY=0x105 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CONNMETHODUPDATED_EXIT=0x106 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CREATECONNECTIONMETHODL_ENTRY=0xae +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CREATECONNECTIONMETHODL_EXIT=0xb0 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CREATECONNMETHODL_ENTRY=0xff +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CREATEDESTINATIONL_ENTRY=0xac +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CREATESNAPRECORDL_ENTRY=0xf8 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_CREATESNAPRECORDL_EXIT=0xf9 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_DESTINATIONL_ENTRY=0xc4 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_DESTINATIONPROTECTIONLEVELL_ENTRY=0x107 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_DOCREATECONNECTIONMETHODL_ENTRY=0xb1 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_DOCREATECONNECTIONMETHODL_EXIT=0xb2 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_DOFINDCONNMETHL_ENTRY=0xbb +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_DOFINDCONNMETHL_EXIT=0xbc +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_DOFINDCONNMETHODL_ENTRY=0xb9 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_DOFINDCONNMETHODL_EXIT=0xba +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETALLDESTINATIONSL_ENTRY=0x10a +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETALLDESTINATIONSL_EXIT=0x10b +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETCONNECTIONMETHODL_ENTRY=0xb5 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETCONNECTIONMETHODL_EXIT=0xb6 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETCONNECTIONMETHODOBJECTL_ENTRY=0xb3 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETCONNECTIONMETHODOBJECTL_EXIT=0xb4 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETCONNMETHODL_ENTRY=0xfe +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETDEFCONNL_ENTRY=0x101 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETDEFCONNL_EXIT=0x102 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_GETINTERNETDESTINATIONIDL_ENTRY=0xfc +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_HASUNPROTECTEDDESTINATIONSL_ENTRY=0xc9 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_HASUNPROTECTEDDESTINATIONSL_EXIT=0xca +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_IAPLINKEDL_ENTRY=0x100 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ISDESTINATIONCONNECTEDL_ENTRY=0x109 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ISDESTINATIONHIDDENL_ENTRY=0x108 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ISIAPLINKEDL_ENTRY=0xe6 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_ISIAPLINKEDL_EXIT=0xe7 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_NUMOFCONNMETHODREFERENCESL_ENTRY=0xc7 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_NUMOFCONNMETHODREFERENCESL_EXIT=0xc8 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_NUMOFCONNMETHODREFSL_ENTRY=0x103 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_NUMOFCONNMETHODREFSL_EXIT=0x104 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_PARENTDESTINATIONL_ENTRY=0xfa +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_PARENTDESTINATIONL_EXIT=0xfb +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_SNAPRECORDL_ENTRY=0xf6 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_SNAPRECORDL_EXIT=0xf7 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_SUPPORTEDBEARERSL_ENTRY=0xc5 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMANAGERIMPL_SUPPORTEDBEARERSL_EXIT=0xc6 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_ADDTODESTINATIONSCONNMETHODARRAYL_ENTRY=0x1e9 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMINSTANCEMAPPING_ADDTODESTINATIONSCONNMETHODARRAYL_EXIT=0x1ea +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMSERVER_DECREMENTSESSIONS_ENTRY=0x6e +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMSERVER_DECREMENTSESSIONS_EXIT=0x6f +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CHECKIFDESTINATIONEXISTSL_ENTRY=0x32 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CHECKIFDESTINATIONEXISTSL_EXIT=0x33 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CONVERTDESTIDIFNEEDED_ENTRY=0x30 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMSESSION_CONVERTDESTIDIFNEEDED_EXIT=0x31 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETALLDESTINATIONSL_EXIT=0x21 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETCONNMETHODARRAYL_EXIT=0x1e +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMMSESSION_GETSUPPORTEDBEARERSL_EXIT=0x26 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCMTRANSACTIONHANDLER_CCMTRANSACTIONHANDLER=0x10e +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCONNMETHOD_CCONNMETHOD_ENTRY=0x1ca +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_CCONNMETHOD_CCONNMETHOD_EXIT=0x1cb +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCCMDESTINATIONIMPL_NEWL_ENTRY=0x11c +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMCONNECTIONMETHODINFO_CANHANDLEIAPIDL_ENTRY=0x1b8 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMCONNECTIONMETHODINFO_CANHANDLEIAPIDL_EXIT=0x1b9 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMCONNECTIONMETHODINFO_CCMCONNECTIONMETHODINFO_ENTRY=0x1a8 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMCONNECTIONMETHODINFO_CCMCONNECTIONMETHODINFO_EXIT=0x1a9 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMDESTINATIONDATA_CCMDESTINATIONDATA_ENTRY=0x126 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMDESTINATIONDATA_CCMDESTINATIONDATA_EXIT=0x127 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMDESTINATIONDATA_ISHIDDEN_EXIT=0x172 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMDESTINATIONIMPL_ADDTOARRAYL_EXIT=0x146 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMDESTINATIONIMPL_CCMDESTINATIONIMPL_ENTRY=0x128 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMDESTINATIONIMPL_CCMDESTINATIONIMPL_EXIT=0x129 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMDESTINATIONIMPL_CHECKIFNAMEMODIFIEDL_EXIT=0x17c +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMDESTINATIONIMPL_CONSTRUCTL_ENTRY=0x12c +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMDESTINATIONIMPL_CONSTRUCTL_EXIT=0x12d +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMDESTINATIONIMPL_NEWL_EXIT=0x11d +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMMANAGERIMPL_CREATECONNECTIONMETHODL_ENTRY=0xaf +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMMANAGERIMPL_CREATEDESTINATIONL_ENTRY=0xad +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMMANAGERIMPL_DOFINDCONNMETHL_EXIT=0xbd +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMMINSTANCEMAPPING_ADDTODESTINATIONSCONNMETHODARRAYL_EXIT=0x1eb +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMMINSTANCEMAPPING_GETCONNMETHODSL_ENTRY=0x1f1 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMMINSTANCEMAPPING_GETCONNMETHODSL_EXIT=0x1f2 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMMSERVER_DECREMENTSESSIONS_EXIT=0x70 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCMMSESSION_CHECKIFDESTINATIONEXISTSL_EXIT=0x34 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCONNMETHOD_CCONNMETHOD_ENTRY=0x1cc +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP1_CCONNMETHOD_CCONNMETHOD_EXIT=0x1cd +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP2_CCMDESTINATIONIMPL_CONSTRUCTL_ENTRY=0x134 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP2_CCMDESTINATIONIMPL_CONSTRUCTL_EXIT=0x135 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP2_CCMDESTINATIONIMPL_NEWL_ENTRY=0x11e +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP2_CCMDESTINATIONIMPL_NEWL_EXIT=0x11f +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP2_CCMDESTINATIONIMPL_PROTECTIONLEVEL_ENTRY=0x183 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP2_CCMMINSTANCEMAPPING_ADDTODESTINATIONSCONNMETHODARRAYL_EXIT=0x1ec +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP3_CCMDESTINATIONIMPL_NEWL_ENTRY=0x120 +[[OBSOLETE]][TRACE]TRACE_FLOW[0x7]_DUP3_CCMDESTINATIONIMPL_NEWL_EXIT=0x121 +[[OBSOLETE]][TRACE]TRACE_NORMAL[0x3]_CCMMINSTANCEMAPPING_READANDVALIDATEDESTINATIONSL=0x1 diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/database/rom/cmmanagerdatabase.iby --- a/cmmanager/cmmgr/database/rom/cmmanagerdatabase.iby Fri Apr 16 15:21:37 2010 +0300 +++ b/cmmanager/cmmgr/database/rom/cmmanagerdatabase.iby Mon May 03 12:53:07 2010 +0300 @@ -14,13 +14,12 @@ * Description: * */ -#ifndef __CMMANAGERDATABASE_IBY__ -#define __CMMANAGERDATABASE_IBY__ +#ifndef CMMANAGERDATABASE_IBY__ +#define CMMANAGERDATABASE_IBY__ file=ABI_DIR\BUILD_DIR\cmmanagerdatabase.dll SHARED_LIB_DIR\cmmanagerdatabase.dll +#endif // CMMANAGERDATABASE_IBY__ -#endif // __CMMANAGERDATABASE_IBY__ - diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/database/src/cmmanagertableformats.cpp --- a/cmmanager/cmmgr/database/src/cmmanagertableformats.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/cmmanager/cmmgr/database/src/cmmanagertableformats.cpp Mon May 03 12:53:07 2010 +0300 @@ -97,8 +97,8 @@ X_REGISTER_ATTRIBUTE( CCDDefConnRecord, iDefConnType, TMDBNum ) X_REGISTER_ATTRIBUTE( CCDDefConnRecord, iDefConnUid, TMDBNum ) X_REGISTER_ATTRIBUTE( CCDDefConnRecord, iUsageOfWlan, TMDBNum ) - X_REGISTER_ATTRIBUTE( CCDDefConnRecord, iCellularDataUsageHome, TMDBNum ) - X_REGISTER_ATTRIBUTE( CCDDefConnRecord, iCellularDataUsageVisitor, TMDBNum ) + X_REGISTER_ATTRIBUTE( CCDDefConnRecord, iCellularDataUsageHome, TMDBNum ) + X_REGISTER_ATTRIBUTE( CCDDefConnRecord, iCellularDataUsageVisitor, TMDBNum ) X_REGISTER_ATTRIBUTE( CCDRecordBase, iRecordTag, TMDBNum ) X_REGISTER_ATTRIBUTE( CCDRecordBase, iRecordName, TMDBText ) END_ATTRIBUTE_TABLE() diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cmmgr/group/bld.inf --- a/cmmanager/cmmgr/group/bld.inf Fri Apr 16 15:21:37 2010 +0300 +++ b/cmmanager/cmmgr/group/bld.inf Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -11,7 +11,8 @@ * * Contributors: * -* Description: Build information for the Connection Method Manager +* Description: +* Build information for the Connection Method Manager. * */ @@ -22,26 +23,13 @@ DEFAULT PRJ_EXPORTS -// export iby files -../Rom/CmManager.iby CORE_MW_LAYER_IBY_EXPORT_PATH(CmManager.iby) -../Rom/CmManagerResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(CmManagerResources.iby) - -../Rom/cmpluginembdestination.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cmpluginembdestination.iby) -../Rom/cmpluginembdestinationresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(cmpluginembdestinationresources.iby) - -../Rom/cmpluginpacketdata.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cmpluginpacketdata.iby) -../Rom/cmpluginpacketdataresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(cmpluginpacketdataresources.iby) - -../Rom/cmpluginvpn.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cmpluginvpn.iby) -../Rom/cmpluginvpnresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(cmpluginvpnresources.iby) - -../Rom/cmpluginwlan.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cmpluginwlan.iby) -../Rom/cmpluginwlanresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(cmpluginwlanresources.iby) - PRJ_MMPFILES -// None +#include "../database/group/bld.inf" +#include "../cmmapi/group/bld.inf" +#include "../cmmpluginbase/group/bld.inf" +#include "../cmmserver/group/bld.inf" +#include "../cmmplugins/group/bld.inf" -#include "../database/group/bld.inf" -#include "../Framework/Group/bld.inf" -#include "../Plugins/Group/bld.inf" +PRJ_TESTMMPFILES + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/bwins/connection_settings_shimu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/bwins/connection_settings_shimu.def Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,42 @@ +EXPORTS + ?setString8Attribute@CmConnectionMethodShim@@QAEXW4ConnectionMethodAttribute@CMManagerShim@@VQString@@@Z @ 1 NONAME ; void CmConnectionMethodShim::setString8Attribute(enum CMManagerShim::ConnectionMethodAttribute, class QString) + ?getString8Attribute@CmConnectionMethodShim@@QBE?AVQString@@W4ConnectionMethodAttribute@CMManagerShim@@@Z @ 2 NONAME ; class QString CmConnectionMethodShim::getString8Attribute(enum CMManagerShim::ConnectionMethodAttribute) const + ?connectionMethodCount@CmDestinationShim@@QBEHXZ @ 3 NONAME ; int CmDestinationShim::connectionMethodCount(void) const + ?modifyPriority@CmDestinationShim@@QAEXPAVCmConnectionMethodShim@@H@Z @ 4 NONAME ; void CmDestinationShim::modifyPriority(class CmConnectionMethodShim *, int) + ?setBoolAttribute@CmConnectionMethodShim@@QAEXW4ConnectionMethodAttribute@CMManagerShim@@_N@Z @ 5 NONAME ; void CmConnectionMethodShim::setBoolAttribute(enum CMManagerShim::ConnectionMethodAttribute, bool) + ?createConnectionMethod@CmManagerShim@@QAEPAVCmConnectionMethodShim@@I@Z @ 6 NONAME ; class CmConnectionMethodShim * CmManagerShim::createConnectionMethod(unsigned int) + ?getIntAttribute@CmConnectionMethodShim@@QBEIW4ConnectionMethodAttribute@CMManagerShim@@@Z @ 7 NONAME ; unsigned int CmConnectionMethodShim::getIntAttribute(enum CMManagerShim::ConnectionMethodAttribute) const + ?isHidden@CmDestinationShim@@QBE_NXZ @ 8 NONAME ; bool CmDestinationShim::isHidden(void) const + ?setIntAttribute@CmConnectionMethodShim@@QAEXW4ConnectionMethodAttribute@CMManagerShim@@I@Z @ 9 NONAME ; void CmConnectionMethodShim::setIntAttribute(enum CMManagerShim::ConnectionMethodAttribute, unsigned int) + ?update@CmDestinationShim@@QAEXXZ @ 10 NONAME ; void CmDestinationShim::update(void) + ?setStringAttribute@CmConnectionMethodShim@@QAEXW4ConnectionMethodAttribute@CMManagerShim@@VQString@@@Z @ 11 NONAME ; void CmConnectionMethodShim::setStringAttribute(enum CMManagerShim::ConnectionMethodAttribute, class QString) + ??0CmConnectionMethodShim@@QAE@AAVRCmConnectionMethod@@@Z @ 12 NONAME ; CmConnectionMethodShim::CmConnectionMethodShim(class RCmConnectionMethod &) + ?deleteDestination@CmDestinationShim@@QAEXXZ @ 13 NONAME ; void CmDestinationShim::deleteDestination(void) + ?metadata@CmDestinationShim@@QBEIW4SnapMetadataField@CMManagerShim@@@Z @ 14 NONAME ; unsigned int CmDestinationShim::metadata(enum CMManagerShim::SnapMetadataField) const + ?destination@CmManagerShim@@QBEPAVCmDestinationShim@@I@Z @ 15 NONAME ; class CmDestinationShim * CmManagerShim::destination(unsigned int) const + ?getBoolAttribute@CmConnectionMethodShim@@QBE_NW4ConnectionMethodAttribute@CMManagerShim@@@Z @ 16 NONAME ; bool CmConnectionMethodShim::getBoolAttribute(enum CMManagerShim::ConnectionMethodAttribute) const + ?connectionMethod@CmManagerShim@@QBEPAVCmConnectionMethodShim@@I@Z @ 17 NONAME ; class CmConnectionMethodShim * CmManagerShim::connectionMethod(unsigned int) const + ?connectionMethod@CmManagerShim@@QBEXAAV?$QList@I@@_N@Z @ 18 NONAME ; void CmManagerShim::connectionMethod(class QList &, bool) const + ?update@CmConnectionMethodShim@@QAEXXZ @ 19 NONAME ; void CmConnectionMethodShim::update(void) + ?name@CmDestinationShim@@QBE?AVQString@@XZ @ 20 NONAME ; class QString CmDestinationShim::name(void) const + ?allDestinations@CmManagerShim@@QBEXAAV?$QList@I@@@Z @ 21 NONAME ; void CmManagerShim::allDestinations(class QList &) const + ??1CmManagerShim@@QAE@XZ @ 22 NONAME ; CmManagerShim::~CmManagerShim(void) + ?protectionLevel@CmDestinationShim@@QBE?AW4CmmProtectionLevel@CMManagerShim@@XZ @ 23 NONAME ; enum CMManagerShim::CmmProtectionLevel CmDestinationShim::protectionLevel(void) const + ?getStringAttribute@CmConnectionMethodShim@@QBE?AVQString@@W4ConnectionMethodAttribute@CMManagerShim@@@Z @ 24 NONAME ; class QString CmConnectionMethodShim::getStringAttribute(enum CMManagerShim::ConnectionMethodAttribute) const + ?id@CmDestinationShim@@QBEIXZ @ 25 NONAME ; unsigned int CmDestinationShim::id(void) const + ??0CmManagerShim@@QAE@XZ @ 26 NONAME ; CmManagerShim::CmManagerShim(void) + ??1CmConnectionMethodShim@@QAE@XZ @ 27 NONAME ; CmConnectionMethodShim::~CmConnectionMethodShim(void) + ?connectionMethodByID@CmDestinationShim@@QBEPAVCmConnectionMethodShim@@I@Z @ 28 NONAME ; class CmConnectionMethodShim * CmDestinationShim::connectionMethodByID(unsigned int) const + ??0CmDestinationShim@@QAE@AAVRCmDestination@@@Z @ 29 NONAME ; CmDestinationShim::CmDestinationShim(class RCmDestination &) + ?connectionMethod@CmDestinationShim@@QBEPAVCmConnectionMethodShim@@H@Z @ 30 NONAME ; class CmConnectionMethodShim * CmDestinationShim::connectionMethod(int) const + ?addConnectionMethod@CmDestinationShim@@QAEHPAVCmConnectionMethodShim@@@Z @ 31 NONAME ; int CmDestinationShim::addConnectionMethod(class CmConnectionMethodShim *) + ?deleteConnectionMethod@CmDestinationShim@@QAEXPAVCmConnectionMethodShim@@@Z @ 32 NONAME ; void CmDestinationShim::deleteConnectionMethod(class CmConnectionMethodShim *) + ?deleteConnectionMethod@CmConnectionMethodShim@@QAE_NXZ @ 33 NONAME ; bool CmConnectionMethodShim::deleteConnectionMethod(void) + ?priority@CmDestinationShim@@QBEIPAVCmConnectionMethodShim@@@Z @ 34 NONAME ; unsigned int CmDestinationShim::priority(class CmConnectionMethodShim *) const + ?setName@CmDestinationShim@@QAEXVQString@@@Z @ 35 NONAME ; void CmDestinationShim::setName(class QString) + ??1CmDestinationShim@@QAE@XZ @ 36 NONAME ; CmDestinationShim::~CmDestinationShim(void) + ?removeConnectionMethod@CmDestinationShim@@QAEXPAVCmConnectionMethodShim@@@Z @ 37 NONAME ; void CmDestinationShim::removeConnectionMethod(class CmConnectionMethodShim *) + ?createDestination@CmManagerShim@@QAEPAVCmDestinationShim@@VQString@@@Z @ 38 NONAME ; class CmDestinationShim * CmManagerShim::createDestination(class QString) + ?refresh@CmConnectionMethodShim@@QAEXXZ @ 39 NONAME ; void CmConnectionMethodShim::refresh(void) + ?refresh@CmDestinationShim@@QAEXXZ @ 40 NONAME ; void CmDestinationShim::refresh(void) + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/connection_settings_shim.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/connection_settings_shim.pro Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,72 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# Connection Settings Shim project file. +# + +TEMPLATE = lib +TARGET = connection_settings_shim +TARGET.CAPABILITY = ALL -TCB + +#BUILD_DLL macro is used to define export macro +DEFINES += BUILD_CONNECTIONSETTINGSSHIMDLL_DLL +DEPENDPATH += . + +# Temporary solution to fix tracecompiler +# When tracecompiler is fixed, this can be removed +symbian: { + MMP_RULES += "USERINCLUDE traces" +} + +#Store generated files to their own directory +MOC_DIR = build +RCC_DIR = build + +symbian*::LIBS += -lcmmanager + +# Sources +HEADERS += \ + ../../ipcm_plat/connection_settings_shim_api/inc/cmconnectionmethod_shim.h \ + inc/cmconnectionmethod_shim_s60_p.h \ + ../../ipcm_plat/connection_settings_shim_api/inc/cmdestination_shim.h \ + inc/cmdestination_shim_s60_p.h \ + ../../ipcm_plat/connection_settings_shim_api/inc/cmmanager_shim.h \ + inc/cmmanager_shim_s60_p.h \ + ../../ipcm_plat/connection_settings_shim_api/inc/cmmanagerdefines_shim.h \ + traces/OstTraceDefinitions.h + +SOURCES += \ + src/cmconnectionmethod_shim.cpp \ + src/cmconnectionmethod_shim_s60.cpp \ + src/cmdestination_shim.cpp \ + src/cmdestination_shim_s60.cpp \ + src/cmmanager_shim.cpp \ + src/cmmanager_shim_s60.cpp + +# Temporary export directory definition +# This can be removed when the default has changed to "." from ".." +mmpRuleDeffile = \ + "$${LITERAL_HASH}ifdef WINSCW" \ + "DEFFILE ./bwins/connection_settings_shim.def" \ + "$${LITERAL_HASH}else" \ + "DEFFILE ./eabi/connection_settings_shim.def" \ + "$${LITERAL_HASH}endif" + +symbian: +{ + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.UID3 = 0x2002E6D1 + MMP_RULES += mmpRuleDeffile + BLD_INF_RULES.prj_exports += "rom/connection_settings_shim.iby CORE_MW_LAYER_IBY_EXPORT_PATH(connection_settings_shim.iby)" +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/eabi/connection_settings_shimu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/eabi/connection_settings_shimu.def Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,48 @@ +EXPORTS + _ZN13CmManagerShim17createDestinationE7QString @ 1 NONAME + _ZN13CmManagerShim22createConnectionMethodEj @ 2 NONAME + _ZN13CmManagerShimC1Ev @ 3 NONAME + _ZN13CmManagerShimC2Ev @ 4 NONAME + _ZN13CmManagerShimD1Ev @ 5 NONAME + _ZN13CmManagerShimD2Ev @ 6 NONAME + _ZN17CmDestinationShim14modifyPriorityEP22CmConnectionMethodShimi @ 7 NONAME + _ZN17CmDestinationShim17deleteDestinationEv @ 8 NONAME + _ZN17CmDestinationShim19addConnectionMethodEP22CmConnectionMethodShim @ 9 NONAME + _ZN17CmDestinationShim22deleteConnectionMethodEP22CmConnectionMethodShim @ 10 NONAME + _ZN17CmDestinationShim22removeConnectionMethodEP22CmConnectionMethodShim @ 11 NONAME + _ZN17CmDestinationShim6updateEv @ 12 NONAME + _ZN17CmDestinationShim7setNameE7QString @ 13 NONAME + _ZN17CmDestinationShimC1ER14RCmDestination @ 14 NONAME + _ZN17CmDestinationShimC2ER14RCmDestination @ 15 NONAME + _ZN17CmDestinationShimD1Ev @ 16 NONAME + _ZN17CmDestinationShimD2Ev @ 17 NONAME + _ZN22CmConnectionMethodShim15setIntAttributeEN13CMManagerShim25ConnectionMethodAttributeEj @ 18 NONAME + _ZN22CmConnectionMethodShim16setBoolAttributeEN13CMManagerShim25ConnectionMethodAttributeEb @ 19 NONAME + _ZN22CmConnectionMethodShim18setStringAttributeEN13CMManagerShim25ConnectionMethodAttributeE7QString @ 20 NONAME + _ZN22CmConnectionMethodShim19setString8AttributeEN13CMManagerShim25ConnectionMethodAttributeE7QString @ 21 NONAME + _ZN22CmConnectionMethodShim22deleteConnectionMethodEv @ 22 NONAME + _ZN22CmConnectionMethodShim6updateEv @ 23 NONAME + _ZN22CmConnectionMethodShimC1ER19RCmConnectionMethod @ 24 NONAME + _ZN22CmConnectionMethodShimC2ER19RCmConnectionMethod @ 25 NONAME + _ZN22CmConnectionMethodShimD1Ev @ 26 NONAME + _ZN22CmConnectionMethodShimD2Ev @ 27 NONAME + _ZNK13CmManagerShim11destinationEj @ 28 NONAME + _ZNK13CmManagerShim15allDestinationsER5QListIjE @ 29 NONAME + _ZNK13CmManagerShim16connectionMethodER5QListIjEb @ 30 NONAME + _ZNK13CmManagerShim16connectionMethodEj @ 31 NONAME + _ZNK17CmDestinationShim15protectionLevelEv @ 32 NONAME + _ZNK17CmDestinationShim16connectionMethodEi @ 33 NONAME + _ZNK17CmDestinationShim20connectionMethodByIDEj @ 34 NONAME + _ZNK17CmDestinationShim21connectionMethodCountEv @ 35 NONAME + _ZNK17CmDestinationShim2idEv @ 36 NONAME + _ZNK17CmDestinationShim4nameEv @ 37 NONAME + _ZNK17CmDestinationShim8isHiddenEv @ 38 NONAME + _ZNK17CmDestinationShim8metadataEN13CMManagerShim17SnapMetadataFieldE @ 39 NONAME + _ZNK17CmDestinationShim8priorityEP22CmConnectionMethodShim @ 40 NONAME + _ZNK22CmConnectionMethodShim15getIntAttributeEN13CMManagerShim25ConnectionMethodAttributeE @ 41 NONAME + _ZNK22CmConnectionMethodShim16getBoolAttributeEN13CMManagerShim25ConnectionMethodAttributeE @ 42 NONAME + _ZNK22CmConnectionMethodShim18getStringAttributeEN13CMManagerShim25ConnectionMethodAttributeE @ 43 NONAME + _ZNK22CmConnectionMethodShim19getString8AttributeEN13CMManagerShim25ConnectionMethodAttributeE @ 44 NONAME + _ZN17CmDestinationShim7refreshEv @ 45 NONAME + _ZN22CmConnectionMethodShim7refreshEv @ 46 NONAME + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/inc/cmconnectionmethod_shim_s60_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/inc/cmconnectionmethod_shim_s60_p.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,126 @@ +/* + * 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: + * Private implementation of Wrapper for CM Manager Symbian interface. + */ + +#ifndef CMCONNECTIONMETHOD_SHIM_S60_P_H +#define CMCONNECTIONMETHOD_SHIM_S60_P_H + +// System includes + +#include +#include +#include + +// User includes + +// Forward declarations + +// External data types + +// Constants + +// Class declaration +class CmConnectionMethodShimPrivate +{ + +public: + + // Data types + + CmConnectionMethodShimPrivate(RCmConnectionMethod &cm); + + ~CmConnectionMethodShimPrivate(); + + uint GetIntAttribute( + CMManagerShim::ConnectionMethodAttribute attribute) const; + + bool GetBoolAttribute( + CMManagerShim::ConnectionMethodAttribute attribute) const; + + QString GetStringAttribute( + CMManagerShim::ConnectionMethodAttribute attribute) const; + + QString GetString8Attribute( + CMManagerShim::ConnectionMethodAttribute attribute) const; + + void SetIntAttribute( + CMManagerShim::ConnectionMethodAttribute attribute, + uint value); + + void SetBoolAttribute( + CMManagerShim::ConnectionMethodAttribute attribute, + bool value); + + void SetStringAttribute( + CMManagerShim::ConnectionMethodAttribute attribute, + QString value); + + void SetString8Attribute( + CMManagerShim::ConnectionMethodAttribute attribute, + QString value); + + bool DeleteConnectionMethod(); + + void Update(); + + void Refresh(); + +protected: + +private: + + Q_DISABLE_COPY(CmConnectionMethodShimPrivate) + + void GetStringAttributeL( + CMManagerShim::ConnectionMethodAttribute attribute, + QString &value) const; + + void GetString8AttributeL( + CMManagerShim::ConnectionMethodAttribute attribute, + QString &value) const; + + void SetIntAttributeL( + CMManagerShim::ConnectionMethodAttribute attribute, + uint value); + + void SetBoolAttributeL( + CMManagerShim::ConnectionMethodAttribute attribute, + bool value); + + void SetStringAttributeL( + CMManagerShim::ConnectionMethodAttribute attribute, + QString value); + + void SetString8AttributeL( + CMManagerShim::ConnectionMethodAttribute attribute, + QString value); + + void TraceIfError(TInt error) const; + +private: // data + + RCmConnectionMethod iCm; //!< CmManager Connection Method instance + + // Friend classes + + /* + * CmDestinationShimPrivate::AddConnectionMethodL needs direct access + * to Connection Methods it is adding to the Destination. + */ + friend class CmDestinationShimPrivate; +}; + +#endif // CMCONNECTIONMETHOD_SHIM_S60_P_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/inc/cmdestination_shim_s60_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/inc/cmdestination_shim_s60_p.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,117 @@ +/* + * 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: + * Private implementation of Wrapper for CM Manager Symbian interface. + */ + +#ifndef CMDESTINATION_SHIM_P_H +#define CMDESTINATION_SHIM_P_H + +// System includes + +#include +#include + +// User includes + +// Forward declarations + +class RCmDestination; +class CmConnectionMethodShim; + +// External data types + +// Constants + +// Class declaration + +class CmDestinationShimPrivate +{ + +public: + + // Data types + + CmDestinationShimPrivate(RCmDestination &destination); + + ~CmDestinationShimPrivate(); + + int ConnectionMethodCount() const; + + CmConnectionMethodShim *ConnectionMethod(int index) const; + + CmConnectionMethodShim *ConnectionMethodByID(uint cmId) const; + + uint Priority(CmConnectionMethodShim *cmItem) const; + + QString Name() const; + + uint Id() const; + + uint Metadata(CMManagerShim::SnapMetadataField metadataField) const; + + CMManagerShim::CmmProtectionLevel ProtectionLevel() const; + + bool IsHidden() const; + + int AddConnectionMethod(CmConnectionMethodShim *cm); + + void DeleteConnectionMethod(CmConnectionMethodShim *cm); + + void RemoveConnectionMethod(CmConnectionMethodShim *cm); + + void ModifyPriority(CmConnectionMethodShim *cm, int index); + + void SetName(QString name); + + void Update(); + + void Refresh(); + + void DeleteDestination(); + +protected: + +private: + + Q_DISABLE_COPY(CmDestinationShimPrivate) + + void PriorityL(CmConnectionMethodShim *cmShim, uint &priority) const; + + void NameL(QString &name) const; + + void AddConnectionMethodL(CmConnectionMethodShim *cm, int &index); + + void DeleteConnectionMethodL(CmConnectionMethodShim *cm); + + void RemoveConnectionMethodL(CmConnectionMethodShim *cm); + + void ModifyPriorityL(CmConnectionMethodShim *cm, int index); + + void SetNameL(QString name); + + CMManagerShim::CmmProtectionLevel mapCmmProtectionLevel( + CMManager::TProtectionLevel protectionlvl) const; + + void TraceIfError(TInt error) const; + +private: // data + + RCmDestination iDestination; //!< CmManager Destination instance + + // Friend classes + +}; + +#endif // CMDESTINATION_SHIM_P_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/inc/cmmanager_shim_s60_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/inc/cmmanager_shim_s60_p.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,85 @@ +/* + * 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: + * Private implementation of Wrapper for CM Manager Symbian interface. + */ + +#ifndef CMMANAGER_SHIM_S60_P_H +#define CMMANAGER_SHIM_S60_P_H + +// System includes + +#include +#include + +// User includes + +// Forward declarations + +class CmConnectionMethodShim; +class CmDestinationShim; + +// External data types + +// Constants + +// Class declaration + +class CmManagerShimPrivate +{ + +public: + + // Data types + + CmManagerShimPrivate(); + + ~CmManagerShimPrivate(); + + CmDestinationShim *CreateDestination(QString name); + + CmConnectionMethodShim *CreateConnectionMethod(uint bearerType); + + CmConnectionMethodShim* ConnectionMethod(uint connectionMethodId) const; + + void ConnectionMethod( + QList &cmArray, + bool legacyOnly) const; + + CmDestinationShim *Destination(uint destinationId) const; + + void AllDestinations(QList &destArray) const; + +protected: + +private: + + Q_DISABLE_COPY(CmManagerShimPrivate) + + void ConnectionMethodL( + QList &cmArray, + bool legacyOnly) const; + + void AllDestinationsL(QList &destArray) const; + + void TraceIfError(TInt error) const; + +private: // data + + RCmManager iCmManager; //!< Cm Manager instance + + // Friend classes +}; + +#endif // CMMANAGER_SHIM_S60_P_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/rom/connection_settings_shim.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/rom/connection_settings_shim.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,23 @@ +/* + * 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 CONNECTION_SETTINGS_SHIM_IBY +#define CONNECTION_SETTINGS_SHIM_IBY + +file=ABI_DIR\BUILD_DIR\connection_settings_shim.dll SHARED_LIB_DIR\connection_settings_shim.dll + +#endif // CONNECTION_SETTINGS_SHIM_IBY diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/src/cmconnectionmethod_shim.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/src/cmconnectionmethod_shim.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * Wrapper for CM Manager Symbian interface. + */ + +// System includes + +#include +#include + +// User includes + +#include "cmconnectionmethod_shim_s60_p.h" + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +CmConnectionMethodShim::CmConnectionMethodShim( + RCmConnectionMethod &cm) +{ + d_ptr = new CmConnectionMethodShimPrivate(cm); +} + +CmConnectionMethodShim::~CmConnectionMethodShim() +{ + delete d_ptr; +} + +uint CmConnectionMethodShim::getIntAttribute( + CMManagerShim::ConnectionMethodAttribute attribute) const +{ + return d_ptr->GetIntAttribute(attribute); +} + +bool CmConnectionMethodShim::getBoolAttribute( + CMManagerShim::ConnectionMethodAttribute attribute) const +{ + return d_ptr->GetBoolAttribute(attribute); +} + +QString CmConnectionMethodShim::getStringAttribute( + CMManagerShim::ConnectionMethodAttribute attribute) const +{ + return d_ptr->GetStringAttribute(attribute); +} + +QString CmConnectionMethodShim::getString8Attribute( + CMManagerShim::ConnectionMethodAttribute attribute) const +{ + return d_ptr->GetString8Attribute(attribute); +} + +void CmConnectionMethodShim::setIntAttribute( + CMManagerShim::ConnectionMethodAttribute attribute, + uint value) +{ + d_ptr->SetIntAttribute(attribute, value); +} + +void CmConnectionMethodShim::setBoolAttribute( + CMManagerShim::ConnectionMethodAttribute attribute, + bool value) +{ + d_ptr->SetBoolAttribute(attribute, value); +} + +void CmConnectionMethodShim::setStringAttribute( + CMManagerShim::ConnectionMethodAttribute attribute, + QString value) +{ + d_ptr->SetStringAttribute(attribute, value); +} + +void CmConnectionMethodShim::setString8Attribute( + CMManagerShim::ConnectionMethodAttribute attribute, + QString value) +{ + d_ptr->SetString8Attribute(attribute, value); +} + +bool CmConnectionMethodShim::deleteConnectionMethod() +{ + return d_ptr->DeleteConnectionMethod(); +} + +void CmConnectionMethodShim::update() +{ + d_ptr->Update(); +} + +void CmConnectionMethodShim::refresh() +{ + d_ptr->Refresh(); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/src/cmconnectionmethod_shim_s60.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/src/cmconnectionmethod_shim_s60.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,285 @@ +/* + * 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: + * Private implementation of Wrapper for CM Manager Symbian interface. + */ + +// System includes + +#include + +// User includes + +#include "cmconnectionmethod_shim_s60_p.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmconnectionmethod_shim_s60Traces.h" +#endif + + +/*! + \class CmConnectionMethodShimPrivate + \brief Private implementation class for CM Manager Connection Method Shim. + + Wrapper for CM Manager Symbian interface. Symbian leaves are converted to + standard C++ exceptions. + + Wrapper functions are identical to those in CmConnectionMethodShim class, + so refer to cmconnectionmethod_shim.h for descriptions. Private functions + in this class are just leaving versions of the same wrapper functions. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + * Constructor. + * + * @param[in] cm CM Manager connection method object. + */ + +CmConnectionMethodShimPrivate::CmConnectionMethodShimPrivate( + RCmConnectionMethod &cm) : + iCm(cm) +{ + OstTraceFunctionEntry0(CMCONNECTIONMETHODSHIMPRIVATE_CMCONNECTIONMETHODSHIMPRIVATE_ENTRY); + OstTraceFunctionExit0(CMCONNECTIONMETHODSHIMPRIVATE_CMCONNECTIONMETHODSHIMPRIVATE_EXIT); +} + +/*! + * Destructor. + */ + +CmConnectionMethodShimPrivate::~CmConnectionMethodShimPrivate() +{ + OstTraceFunctionEntry0(DUP1_CMCONNECTIONMETHODSHIMPRIVATE_CMCONNECTIONMETHODSHIMPRIVATE_ENTRY); + + iCm.Close(); + + OstTraceFunctionExit0(DUP1_CMCONNECTIONMETHODSHIMPRIVATE_CMCONNECTIONMETHODSHIMPRIVATE_EXIT); +} + +uint CmConnectionMethodShimPrivate::GetIntAttribute( + CMManagerShim::ConnectionMethodAttribute attribute) const +{ + OstTraceFunctionEntry0(CMCONNECTIONMETHODSHIMPRIVATE_GETINTATTRIBUTE_ENTRY); + + uint value = 0; + TRAPD(error, value = iCm.GetIntAttributeL(attribute)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMCONNECTIONMETHODSHIMPRIVATE_GETINTATTRIBUTE_EXIT); + return value; +} + +bool CmConnectionMethodShimPrivate::GetBoolAttribute( + CMManagerShim::ConnectionMethodAttribute attribute) const +{ + OstTraceFunctionEntry0(CMCONNECTIONMETHODSHIMPRIVATE_GETBOOLATTRIBUTE_ENTRY); + + bool value = false; + TRAPD(error, value = iCm.GetBoolAttributeL(attribute)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMCONNECTIONMETHODSHIMPRIVATE_GETBOOLATTRIBUTE_EXIT); + return value; +} + +QString CmConnectionMethodShimPrivate::GetStringAttribute( + CMManagerShim::ConnectionMethodAttribute attribute) const +{ + OstTraceFunctionEntry0(CMCONNECTIONMETHODSHIMPRIVATE_GETSTRINGATTRIBUTE_ENTRY); + + QString value; + TRAPD(error, GetStringAttributeL(attribute, value)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMCONNECTIONMETHODSHIMPRIVATE_GETSTRINGATTRIBUTE_EXIT); + return value; +} + +QString CmConnectionMethodShimPrivate::GetString8Attribute( + CMManagerShim::ConnectionMethodAttribute attribute) const +{ + OstTraceFunctionEntry0(CMCONNECTIONMETHODSHIMPRIVATE_GETSTRING8ATTRIBUTE_ENTRY); + + QString value; + TRAPD(error, GetString8AttributeL(attribute, value)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMCONNECTIONMETHODSHIMPRIVATE_GETSTRING8ATTRIBUTE_EXIT); + return value; +} + +void CmConnectionMethodShimPrivate::SetIntAttribute( + CMManagerShim::ConnectionMethodAttribute attribute, + uint value) +{ + OstTraceFunctionEntry0(CMCONNECTIONMETHODSHIMPRIVATE_SETINTATTRIBUTE_ENTRY); + + TRAPD(error, SetIntAttributeL(attribute, value)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMCONNECTIONMETHODSHIMPRIVATE_SETINTATTRIBUTE_EXIT); +} + +void CmConnectionMethodShimPrivate::SetBoolAttribute( + CMManagerShim::ConnectionMethodAttribute attribute, + bool value) +{ + OstTraceFunctionEntry0(CMCONNECTIONMETHODSHIMPRIVATE_SETBOOLATTRIBUTE_ENTRY); + + TRAPD(error, SetBoolAttributeL(attribute, value)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMCONNECTIONMETHODSHIMPRIVATE_SETBOOLATTRIBUTE_EXIT); +} + +void CmConnectionMethodShimPrivate::SetStringAttribute( + CMManagerShim::ConnectionMethodAttribute attribute, + QString value) +{ + OstTraceFunctionEntry0(CMCONNECTIONMETHODSHIMPRIVATE_SETSTRINGATTRIBUTE_ENTRY); + + TRAPD(error, SetStringAttributeL(attribute, value)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMCONNECTIONMETHODSHIMPRIVATE_SETSTRINGATTRIBUTE_EXIT); +} + +void CmConnectionMethodShimPrivate::SetString8Attribute( + CMManagerShim::ConnectionMethodAttribute attribute, + QString value) +{ + OstTraceFunctionEntry0(CMCONNECTIONMETHODSHIMPRIVATE_SETSTRING8ATTRIBUTE_ENTRY); + + TRAPD(error, SetString8AttributeL(attribute, value)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMCONNECTIONMETHODSHIMPRIVATE_SETSTRING8ATTRIBUTE_EXIT); +} + +bool CmConnectionMethodShimPrivate::DeleteConnectionMethod() +{ + OstTraceFunctionEntry0(CMCONNECTIONMETHODSHIMPRIVATE_DELETECONNECTIONMETHOD_ENTRY); + + bool value = false; + TRAPD(error, value = iCm.DeleteL()); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMCONNECTIONMETHODSHIMPRIVATE_DELETECONNECTIONMETHOD_EXIT); + return value; +} + +void CmConnectionMethodShimPrivate::Update() +{ + OstTraceFunctionEntry0(CMCONNECTIONMETHODSHIMPRIVATE_UPDATE_ENTRY); + + TRAPD(error, iCm.UpdateL()); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMCONNECTIONMETHODSHIMPRIVATE_UPDATE_EXIT); +} + +void CmConnectionMethodShimPrivate::Refresh() +{ + OstTraceFunctionEntry0(CMCONNECTIONMETHODSHIMPRIVATE_REFRESH_ENTRY); + + TRAPD(error, iCm.RefreshL()); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMCONNECTIONMETHODSHIMPRIVATE_REFRESH_EXIT); +} + +void CmConnectionMethodShimPrivate::GetStringAttributeL( + CMManagerShim::ConnectionMethodAttribute attribute, + QString &value) const +{ + HBufC* buf = iCm.GetStringAttributeL(attribute); + value = QString::fromUtf16(buf->Ptr(), buf->Length()); + delete buf; +} + +void CmConnectionMethodShimPrivate::GetString8AttributeL( + CMManagerShim::ConnectionMethodAttribute attribute, + QString &value) const +{ + HBufC8* buf = iCm.GetString8AttributeL(attribute); + value = QString::fromLatin1((const char*)buf->Ptr(), buf->Length()); + delete buf; +} + +void CmConnectionMethodShimPrivate::SetIntAttributeL( + CMManagerShim::ConnectionMethodAttribute attribute, + uint value) +{ + iCm.SetIntAttributeL(attribute, value); +} + +void CmConnectionMethodShimPrivate::SetBoolAttributeL( + CMManagerShim::ConnectionMethodAttribute attribute, + bool value) +{ + iCm.SetBoolAttributeL(attribute, value); +} + +void CmConnectionMethodShimPrivate::SetStringAttributeL( + CMManagerShim::ConnectionMethodAttribute attribute, + QString value) +{ + TPtrC16 valuePtr(reinterpret_cast(value.utf16())); + iCm.SetStringAttributeL(attribute, valuePtr); +} + +void CmConnectionMethodShimPrivate::SetString8AttributeL( + CMManagerShim::ConnectionMethodAttribute attribute, + QString value) +{ + QByteArray tempValue = value.toLatin1(); + TPtrC8 valuePtr(reinterpret_cast(tempValue.data())); + iCm.SetString8AttributeL(attribute, valuePtr); +} + +/*! + * Traces given error code if it is not KErrNone. + * + * @param[in] error Symbian error code. + */ + +void CmConnectionMethodShimPrivate::TraceIfError(TInt error) const +{ + if (error != KErrNone) { + OstTrace1( + TRACE_WARNING, + CMCONNECTIONMETHODSHIMPRIVATE_TRACEIFERROR, + "CmConnectionMethodShimPrivate::TraceIfError;Error code=%d", + error); + } +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/src/cmdestination_shim.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/src/cmdestination_shim.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,132 @@ +/* + * 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: + * Wrapper for CM Manager Symbian interface. + */ + +// System includes + +#include +#include +#include + +// User includes + +#include "cmdestination_shim_s60_p.h" +#include "cmconnectionmethod_shim_s60_p.h" + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +CmDestinationShim::CmDestinationShim(RCmDestination &destination) +{ + d_ptr = new CmDestinationShimPrivate(destination); +} + +CmDestinationShim::~CmDestinationShim() +{ + delete d_ptr; +} + +int CmDestinationShim::connectionMethodCount() const +{ + return d_ptr->ConnectionMethodCount(); +} + +CmConnectionMethodShim *CmDestinationShim::connectionMethod(int index) const +{ + return d_ptr->ConnectionMethod(index); +} + +CmConnectionMethodShim *CmDestinationShim::connectionMethodByID( + uint cmId) const +{ + return d_ptr->ConnectionMethodByID(cmId); +} + +uint CmDestinationShim::priority(CmConnectionMethodShim *cmItem) const +{ + return d_ptr->Priority(cmItem); +} + +QString CmDestinationShim::name() const +{ + return d_ptr->Name(); +} + +uint CmDestinationShim::id() const +{ + return d_ptr->Id(); +} + +uint CmDestinationShim::metadata( + CMManagerShim::SnapMetadataField metadataField) const +{ + return d_ptr->Metadata(metadataField); +} + +CMManagerShim::CmmProtectionLevel CmDestinationShim::protectionLevel() const +{ + return d_ptr->ProtectionLevel(); +} + +bool CmDestinationShim::isHidden() const +{ + return d_ptr->IsHidden(); +} + +int CmDestinationShim::addConnectionMethod(CmConnectionMethodShim *cm) +{ + return d_ptr->AddConnectionMethod(cm); +} + +void CmDestinationShim::deleteConnectionMethod(CmConnectionMethodShim *cm) +{ + d_ptr->DeleteConnectionMethod(cm); +} + +void CmDestinationShim::removeConnectionMethod(CmConnectionMethodShim *cm) +{ + d_ptr->RemoveConnectionMethod(cm); +} + +void CmDestinationShim::modifyPriority(CmConnectionMethodShim *cm, int index) +{ + d_ptr->ModifyPriority(cm, index); +} + +void CmDestinationShim::setName(QString name) +{ + d_ptr->SetName(name); +} + +void CmDestinationShim::update() +{ + d_ptr->Update(); +} + +void CmDestinationShim::refresh() +{ + d_ptr->Refresh(); +} + +void CmDestinationShim::deleteDestination() +{ + d_ptr->DeleteDestination(); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/src/cmdestination_shim_s60.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/src/cmdestination_shim_s60.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,409 @@ +/* + * 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: + * Private implementation of Wrapper for CM Manager Symbian interface. + */ + +// System includes + +#include +#include +#include +#include +#include + +// User includes + +#include "cmdestination_shim_s60_p.h" +#include "cmconnectionmethod_shim_s60_p.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmdestination_shim_s60Traces.h" +#endif + + +/*! + \class CmDestinationShimPrivate + \brief Private implementation class for CM Manager Destination Shim. + + Wrapper for CM Manager Symbian interface. Symbian leaves are converted to + standard C++ exceptions. + + Wrapper functions are identical to those in CmDestinationShim class, so + refer to cmdestination_shim.h for descriptions. Private functions in this + class are just leaving versions of the same wrapper functions. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + * Constructor. + * + * @param[in] destination CM Manager destination object. + */ + +CmDestinationShimPrivate::CmDestinationShimPrivate( + RCmDestination &destination) : + iDestination(destination) +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_CMDESTINATIONSHIMPRIVATE_ENTRY); + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_CMDESTINATIONSHIMPRIVATE_EXIT); +} + +/*! + * Destructor. + */ + +CmDestinationShimPrivate::~CmDestinationShimPrivate() +{ + OstTraceFunctionEntry0(DUP1_CMDESTINATIONSHIMPRIVATE_CMDESTINATIONSHIMPRIVATE_ENTRY); + + iDestination.Close(); + + OstTraceFunctionExit0(DUP1_CMDESTINATIONSHIMPRIVATE_CMDESTINATIONSHIMPRIVATE_EXIT); +} + +int CmDestinationShimPrivate::ConnectionMethodCount() const +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_CONNECTIONMETHODCOUNT_ENTRY); + + int count = iDestination.ConnectionMethodCount(); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_CONNECTIONMETHODCOUNT_EXIT); + return count; +} + +CmConnectionMethodShim *CmDestinationShimPrivate::ConnectionMethod( + int index) const +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_CONNECTIONMETHOD_ENTRY); + + RCmConnectionMethod cm; + TRAPD(error, cm = iDestination.ConnectionMethodL(index)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_CONNECTIONMETHOD_EXIT); + return new CmConnectionMethodShim(cm); +} + +CmConnectionMethodShim *CmDestinationShimPrivate::ConnectionMethodByID( + uint cmId) const +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_CONNECTIONMETHODBYID_ENTRY); + + RCmConnectionMethod cm; + TRAPD(error, cm = iDestination.ConnectionMethodByIDL(cmId)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_CONNECTIONMETHODBYID_EXIT); + return new CmConnectionMethodShim(cm); +} + +uint CmDestinationShimPrivate::Priority(CmConnectionMethodShim *cmItem) const +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_PRIORITY_ENTRY); + + uint priority; + TRAPD(error, PriorityL(cmItem, priority)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_PRIORITY_EXIT); + return priority; +} + +QString CmDestinationShimPrivate::Name() const +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_NAME_ENTRY); + + QString name; + TRAPD(error, NameL(name)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_NAME_EXIT); + return name; +} + +uint CmDestinationShimPrivate::Id() const +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_ID_ENTRY); + + uint id = iDestination.Id(); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_ID_EXIT); + return id; +} + +uint CmDestinationShimPrivate::Metadata( + CMManagerShim::SnapMetadataField metadataField) const +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_METADATA_ENTRY); + + uint metadata = 0; + TRAPD( + error, + metadata = iDestination.MetadataL((CMManager::TSnapMetadataField)metadataField)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_METADATA_EXIT); + return metadata; +} + +CMManagerShim::CmmProtectionLevel CmDestinationShimPrivate::ProtectionLevel() const +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_PROTECTIONLEVEL_ENTRY); + + CMManager::TProtectionLevel protectionlvl = CMManager::EProtLevel3; + TRAPD(error, protectionlvl = iDestination.ProtectionLevel()); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_PROTECTIONLEVEL_EXIT); + return mapCmmProtectionLevel(protectionlvl); +} + +bool CmDestinationShimPrivate::IsHidden() const +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_ISHIDDEN_ENTRY); + + bool hidden = iDestination.IsHidden(); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_ISHIDDEN_EXIT); + return hidden; +} + +int CmDestinationShimPrivate::AddConnectionMethod( + CmConnectionMethodShim *cm) +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_ADDCONNECTIONMETHOD_ENTRY); + + int index; + TRAPD(error, AddConnectionMethodL(cm, index)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_ADDCONNECTIONMETHOD_EXIT); + return index; +} + +void CmDestinationShimPrivate::DeleteConnectionMethod( + CmConnectionMethodShim *cm) +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_DELETECONNECTIONMETHOD_ENTRY); + + TRAPD(error, DeleteConnectionMethodL(cm)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_DELETECONNECTIONMETHOD_EXIT); +} + +void CmDestinationShimPrivate::RemoveConnectionMethod( + CmConnectionMethodShim *cm) +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_REMOVECONNECTIONMETHOD_ENTRY); + + TRAPD(error, RemoveConnectionMethodL(cm)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_REMOVECONNECTIONMETHOD_EXIT); +} + +void CmDestinationShimPrivate::ModifyPriority( + CmConnectionMethodShim *cm, + int index) +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_MODIFYPRIORITY_ENTRY); + + TRAPD(error, ModifyPriorityL(cm, index)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_MODIFYPRIORITY_EXIT); +} + +void CmDestinationShimPrivate::SetName(QString name) +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_SETNAME_ENTRY); + + TRAPD(error, SetNameL(name)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_SETNAME_EXIT); +} + +void CmDestinationShimPrivate::Update() +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_UPDATE_ENTRY); + + TRAPD(error, iDestination.UpdateL()); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_UPDATE_EXIT); +} + +void CmDestinationShimPrivate::Refresh() +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_REFRESH_ENTRY); + + TRAPD(error, iDestination.RefreshL()); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_REFRESH_EXIT); +} + +void CmDestinationShimPrivate::DeleteDestination() +{ + OstTraceFunctionEntry0(CMDESTINATIONSHIMPRIVATE_DELETEDESTINATION_ENTRY); + + TRAPD(error, iDestination.DeleteLD()); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMDESTINATIONSHIMPRIVATE_DELETEDESTINATION_EXIT); +} + +void CmDestinationShimPrivate::PriorityL( + CmConnectionMethodShim *cmShim, + uint &priority) const +{ + RCmConnectionMethod cm; + cm = iDestination.ConnectionMethodByIDL( + cmShim->getIntAttribute(CMManagerShim::CmId)); + priority = iDestination.PriorityL(cm); +} + +void CmDestinationShimPrivate::NameL(QString &name) const +{ + HBufC* iapName; + iapName = iDestination.NameLC(); + name = QString::fromUtf16(iapName->Ptr(), iapName->Length()); + CleanupStack::PopAndDestroy(); // iapName +} + +void CmDestinationShimPrivate::AddConnectionMethodL( + CmConnectionMethodShim *cmShim, + int &index) +{ + index = iDestination.AddConnectionMethodL(cmShim->d_ptr->iCm); + iDestination.UpdateL(); +} + +void CmDestinationShimPrivate::DeleteConnectionMethodL( + CmConnectionMethodShim *cmShim) +{ + RCmConnectionMethod cm; + cm = iDestination.ConnectionMethodByIDL( + cmShim->getIntAttribute(CMManagerShim::CmId)); + iDestination.DeleteConnectionMethodL(cm); + iDestination.UpdateL(); +} + +void CmDestinationShimPrivate::RemoveConnectionMethodL( + CmConnectionMethodShim *cmShim) +{ + RCmConnectionMethod cm; + cm = iDestination.ConnectionMethodByIDL( + cmShim->getIntAttribute(CMManagerShim::CmId)); + iDestination.RemoveConnectionMethodL(cm); + iDestination.UpdateL(); +} + +void CmDestinationShimPrivate::ModifyPriorityL( + CmConnectionMethodShim *cmShim, + int index) +{ + RCmConnectionMethod cm; + cm = iDestination.ConnectionMethodByIDL( + cmShim->getIntAttribute(CMManagerShim::CmId)); + iDestination.ModifyPriorityL(cm, index); + iDestination.UpdateL(); +} + +void CmDestinationShimPrivate::SetNameL(QString name) +{ + TPtrC16 namePtr(reinterpret_cast(name.utf16())); + iDestination.SetNameL(namePtr); + iDestination.UpdateL(); +} + +/*! + * Maps CM Manager protection levels to those defined by the shim. + * + * @param[in] protectionlvl CM Manager protection level. + * @return CM Manager Shim protection level. + */ + +CMManagerShim::CmmProtectionLevel CmDestinationShimPrivate::mapCmmProtectionLevel( + CMManager::TProtectionLevel protectionlvl) const +{ + CMManagerShim::CmmProtectionLevel retval = CMManagerShim::ProtLevel3; + + switch (protectionlvl) { + case CMManager::EProtLevel0: + retval = CMManagerShim::ProtLevel0; + break; + + case CMManager::EProtLevel1: + retval = CMManagerShim::ProtLevel1; + break; + + case CMManager::EProtLevel2: + retval = CMManagerShim::ProtLevel2; + break; + + case CMManager::EProtLevel3: + retval = CMManagerShim::ProtLevel3; + break; + +#ifndef QT_NO_DEBUG + default: + Q_ASSERT( 0 ); + break; +#endif + } + + return retval; +} + +/*! + * Traces given error code if it is not KErrNone. + * + * @param[in] error Symbian error code. + */ + +void CmDestinationShimPrivate::TraceIfError(TInt error) const +{ + if (error != KErrNone) { + OstTrace1( + TRACE_WARNING, + CMDESTINATIONSHIMPRIVATE_TRACEIFERROR, + "CmDestinationShimPrivate::TraceIfError;Error code=%d", + error); + } +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/src/cmmanager_shim.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/src/cmmanager_shim.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * Wrapper for CM Manager Symbian interface. + */ + +// System includes + +#include +#include +#include +#include +#include + +// User includes + +#include "cmmanager_shim_s60_p.h" + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +CmManagerShim::CmManagerShim() +{ + d_ptr = new CmManagerShimPrivate(); +} + +CmManagerShim::~CmManagerShim() +{ + delete d_ptr; +} + +CmDestinationShim *CmManagerShim::createDestination(QString name) +{ + return d_ptr->CreateDestination(name); +} + +CmConnectionMethodShim *CmManagerShim::createConnectionMethod(uint bearerType) +{ + return d_ptr->CreateConnectionMethod(bearerType); +} + +CmConnectionMethodShim *CmManagerShim::connectionMethod( + uint connectionMethodId) const +{ + return d_ptr->ConnectionMethod(connectionMethodId); +} + +void CmManagerShim::connectionMethod( + QList &cmArray, + bool legacyOnly) const +{ + return d_ptr->ConnectionMethod( + cmArray, + legacyOnly); +} + +CmDestinationShim *CmManagerShim::destination(uint destinationId) const +{ + return d_ptr->Destination(destinationId); +} + +void CmManagerShim::allDestinations(QList &destArray) const +{ + return d_ptr->AllDestinations(destArray); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/src/cmmanager_shim_s60.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/src/cmmanager_shim_s60.cpp Mon May 03 12:53:07 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: + * Private implementation of Wrapper for CM Manager Symbian interface. + */ + +// System includes + +#include +#include +#include +#include +#include + +// User includes + +#include "cmmanager_shim_s60_p.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cmmanager_shim_s60Traces.h" +#endif + + +/*! + \class CmManagerShimPrivate + \brief Private implementation class for CM Manager Shim. + + Wrapper for CM Manager Symbian interface. Symbian leaves are converted to + standard C++ exceptions. + + Wrapper functions are identical to those in CmManagerShim class, so + refer to cmdestination_shim.h for descriptions. Private functions in this + class are just leaving versions of the same wrapper functions. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + * Constructor. + */ + +CmManagerShimPrivate::CmManagerShimPrivate() +{ + OstTraceFunctionEntry0(CMMANAGERSHIMPRIVATE_CMMANAGERSHIMPRIVATE_ENTRY); + + TRAPD(error, iCmManager.OpenL()); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMMANAGERSHIMPRIVATE_CMMANAGERSHIMPRIVATE_EXIT); +} + +/*! + * Destructor. + */ + +CmManagerShimPrivate::~CmManagerShimPrivate() +{ + OstTraceFunctionEntry0(DUP1_CMMANAGERSHIMPRIVATE_CMMANAGERSHIMPRIVATE_ENTRY); + + iCmManager.Close(); + + OstTraceFunctionExit0(DUP1_CMMANAGERSHIMPRIVATE_CMMANAGERSHIMPRIVATE_EXIT); +} + +CmDestinationShim *CmManagerShimPrivate::CreateDestination(QString name) +{ + OstTraceFunctionEntry0(CMMANAGERSHIMPRIVATE_CREATEDESTINATION_ENTRY); + + RCmDestination dest; + TRAPD( + error, + TPtrC16 namePtr(reinterpret_cast(name.utf16())); + dest = iCmManager.CreateDestinationL(namePtr); + dest.UpdateL()); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMMANAGERSHIMPRIVATE_CREATEDESTINATION_EXIT); + return new CmDestinationShim(dest); +} + +CmConnectionMethodShim *CmManagerShimPrivate::CreateConnectionMethod( + uint bearerType) +{ + OstTraceFunctionEntry0(CMMANAGERSHIMPRIVATE_CREATECONNECTIONMETHOD_ENTRY); + + RCmConnectionMethod connectionMethod; + TRAPD(error, connectionMethod = iCmManager.CreateConnectionMethodL(bearerType)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMMANAGERSHIMPRIVATE_CREATECONNECTIONMETHOD_EXIT); + return new CmConnectionMethodShim(connectionMethod); +} + +CmConnectionMethodShim *CmManagerShimPrivate::ConnectionMethod( + uint connectionMethodId) const +{ + OstTraceFunctionEntry0(CMMANAGERSHIMPRIVATE_CONNECTIONMETHOD_ENTRY); + + RCmConnectionMethod connectionMethod; + TRAPD(error, connectionMethod = iCmManager.ConnectionMethodL(connectionMethodId)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMMANAGERSHIMPRIVATE_CONNECTIONMETHOD_EXIT); + return new CmConnectionMethodShim(connectionMethod); +} + +void CmManagerShimPrivate::ConnectionMethod( + QList &cmArray, + bool legacyOnly) const +{ + OstTraceFunctionEntry0(DUP1_CMMANAGERSHIMPRIVATE_CONNECTIONMETHOD_ENTRY); + + TRAPD(error, ConnectionMethodL(cmArray, legacyOnly)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(DUP1_CMMANAGERSHIMPRIVATE_CONNECTIONMETHOD_EXIT); +} + +CmDestinationShim *CmManagerShimPrivate::Destination( + uint destinationId) const +{ + OstTraceFunctionEntry0(CMMANAGERSHIMPRIVATE_DESTINATION_ENTRY); + + RCmDestination dest; + TRAPD(error, dest = iCmManager.DestinationL(destinationId)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMMANAGERSHIMPRIVATE_DESTINATION_EXIT); + return new CmDestinationShim(dest); +} + +void CmManagerShimPrivate::AllDestinations(QList &destArray) const +{ + OstTraceFunctionEntry0(CMMANAGERSHIMPRIVATE_ALLDESTINATIONS_ENTRY); + + TRAPD(error, AllDestinationsL(destArray)); + TraceIfError(error); + qt_symbian_throwIfError(error); + + OstTraceFunctionExit0(CMMANAGERSHIMPRIVATE_ALLDESTINATIONS_EXIT); +} + +void CmManagerShimPrivate::ConnectionMethodL( + QList &cmArray, + bool legacyOnly) const +{ + RArray array; + iCmManager.ConnectionMethodL( + array, + true, // Check bearer type + legacyOnly, + false); // No Easy WLAN + for (TInt i = 0; i < array.Count(); i++) { + cmArray.append(array[i]); + } + // Free memory + array.Reset(); +} + +void CmManagerShimPrivate::AllDestinationsL(QList &destArray) const +{ + destArray.clear(); + RArray destinationIdArray; + + destinationIdArray.Reset(); + iCmManager.AllDestinationsL(destinationIdArray); + + for (TInt i = 0; i < destinationIdArray.Count(); i++) { + destArray.append(destinationIdArray[i]); + } + // Free memory + destinationIdArray.Reset(); +} + +/*! + * Traces given error code if it is not KErrNone. + * + * @param[in] error Symbian error code. + */ + +void CmManagerShimPrivate::TraceIfError(TInt error) const +{ + if (error != KErrNone) { + OstTrace1( + TRACE_WARNING, + CMMANAGERSHIMPRIVATE_TRACEIFERROR, + "CmManagerShimPrivate::TraceIfError;Error code=%d", + error); + } +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/traces/OstTraceDefinitions.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,21 @@ +/* + * 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: + * OST trace definition header. + */ + +#ifndef OSTTRACEDEFINITIONS_H +#define OSTTRACEDEFINITIONS_H +#include +#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/tsrc/ut/testcmmgrshim.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/tsrc/ut/testcmmgrshim.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,1104 @@ +/* +* 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: +* CM Application Settings UI unit testing. +*/ + +#include +#include + +#include +#include +#include +#include + +#include + +#include "cmdestination_shim.h" +#include "cmconnectionmethod_shim.h" + +#include "testcmmgrshim.h" + +// ----------------------------------------------------------------------------- +// STATIC TEST DATA +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +// TEST MACROES +// ----------------------------------------------------------------------------- + +// Test macro for verifying an exception throwing code block +#define TEST_CATCH_AND_VERIFY(code, error) \ + { \ + int error_code; \ + QT_TRYCATCH_ERROR(error_code, code); \ + QCOMPARE(error_code, error); \ + } + +// ----------------------------------------------------------------------------- +// FRAMEWORK FUNCTIONS +// ----------------------------------------------------------------------------- + +/** + * Test main function. Runs all test cases. + */ +int main(int argc, char *argv[]) +{ + Q_UNUSED(argc); + + char *pass[3]; + pass[0] = argv[0]; + pass[1] = "-o"; + pass[2] = "c:\\data\\TestCmMgrShim.txt"; + + TestCmMgrShim tc; + int res = QTest::qExec(&tc, 3, pass); + + return res; +} + +/** + * This function is be called before the first test case is executed. + */ +void TestCmMgrShim::initTestCase() +{ +} + +/** + * This function is be called after the last test case was executed. + */ +void TestCmMgrShim::cleanupTestCase() +{ +} + +/** + * This function is be called before each test case is executed. + */ +void TestCmMgrShim::init() +{ + // Initialize the CmManagerShim object + mCmManagerShim = new CmManagerShim; +} + +/** + * This function is be called after each test case is executed. + */ +void TestCmMgrShim::cleanup() +{ + // There should be no destinations + QList destinations; + mCmManagerShim->allDestinations(destinations); + int destinationCount = destinations.count(); + + // Delete the destinations if there were any + deleteDestinations(); + + // There should be no connection methods + QList connMethods; + mCmManagerShim->connectionMethod(connMethods, false); + int connMethodCount = connMethods.count(); + + // Delete the connection methods if there were any + deleteConnectionMethods(); + + // Validate after the deletions are done + QCOMPARE(destinationCount, 0); + QCOMPARE(connMethodCount, 0); + + delete mCmManagerShim; +} + +// ----------------------------------------------------------------------------- +// TEST CASES +// ----------------------------------------------------------------------------- + +/** + * Test case for testing initial state. + * -Reads AND DELETES all destinations and connection methods. + * -Verifies that there are no destinations and connection methods. + */ +void TestCmMgrShim::tcResetSettings() +{ + // Read all destinations + QList destinations; + mCmManagerShim->allDestinations(destinations); + + // Delete the destinations + for (int i=0; i < destinations.count(); i++) { + CmDestinationShim *dest = mCmManagerShim->destination(destinations[i]); + dest->deleteDestination(); + + // Update should leave + TEST_CATCH_AND_VERIFY( + dest->update(), + KErrBadHandle); + + delete dest; + } + + // Check that there no longer are any destinations + mCmManagerShim->allDestinations(destinations); + QCOMPARE(destinations.count(), 0); + + // Read all connection methods + QList connMethods; + mCmManagerShim->connectionMethod(connMethods, false); + + // Remove possible uncategorized connection methods + for (int i=0; i < connMethods.count(); i++){ + CmConnectionMethodShim *cm = + mCmManagerShim->connectionMethod(connMethods[i]); + QVERIFY(cm != NULL); + bool ok = cm->deleteConnectionMethod(); + QVERIFY(ok == true); + delete cm; + } + + // Check that tere is no longer any connection methods + mCmManagerShim->connectionMethod(connMethods, false); + QCOMPARE(connMethods.count(), 0); + + // Try reading a Connection Method with an erroneous ID + TEST_CATCH_AND_VERIFY( + mCmManagerShim->connectionMethod(0), + KErrArgument); + + // Try reading a non-existent Connection Method + TEST_CATCH_AND_VERIFY( + mCmManagerShim->connectionMethod(1), + KErrNotFound); +} + +/** + * Test case for testing basic legacy WLAN connection method handling. + * -Creates a legacy WLAN connection method (i.e. does not belong to + * any destination). + * -Deletes the connection method. + */ +void TestCmMgrShim::tcLegacyConnMethodWlan() +{ + // Create the connection method + CmConnectionMethodShim *cm = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypeWlan); + QVERIFY(cm != NULL); + + // Update to CommsDat + cm->update(); + + // Check bearer type + int bearer = cm->getIntAttribute(CMManagerShim::CmBearerType); + QCOMPARE(bearer, (int)CMManagerShim::BearerTypeWlan); + + // Check ID + int id = cm->getIntAttribute(CMManagerShim::CmId); + QCOMPARE(id, 1); + + // Delete the connection method reference + delete cm; + + // Refetch the connection method + cm = mCmManagerShim->connectionMethod(id); + QVERIFY(cm != NULL); + + // Delete the connection method + cm->deleteConnectionMethod(); + + // Check that double deletion throws an exception + TEST_CATCH_AND_VERIFY( + cm->deleteConnectionMethod(), + KErrBadHandle); + + delete cm; +} + +/** + * Test case for testing basic legacy GPRS connection method handling. + * -Creates a legacy GPRS connection method (i.e. does not belong to + * any destination). + * -Deletes the connection method. + */ +void TestCmMgrShim::tcLegacyConnMethodGprs() +{ + // Create the connection method + CmConnectionMethodShim *cm = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypePacketData); + QVERIFY(cm != NULL); + + // Update to CommsDat + cm->update(); + + // Check ID + int id = cm->getIntAttribute(CMManagerShim::CmId); + QCOMPARE(id, 1); + + // Check bearer type + int bearer = cm->getIntAttribute(CMManagerShim::CmBearerType); + QCOMPARE(bearer, (int)CMManagerShim::BearerTypePacketData); + + // Delete the connection method reference + delete cm; + + // Refetch the connection method + cm = mCmManagerShim->connectionMethod(id); + QVERIFY(cm != NULL); + + // Delete the connection method + cm->deleteConnectionMethod(); + delete cm; +} + +/** + * Basic error case testing for CmManagerShim. + * All test call should throw an exception since they are invalid. + */ +void TestCmMgrShim::tcCmManagerBasicFails() +{ + // Try creating a destination with an invalid name + CmDestinationShim *dest = 0; + TEST_CATCH_AND_VERIFY( + dest = mCmManagerShim->createDestination(QString("")), + KErrArgument); + QVERIFY(dest == NULL); + + // Try creating a connection method with an invalid bearer type + CmConnectionMethodShim *cm = 0; + TEST_CATCH_AND_VERIFY( + cm = mCmManagerShim->createConnectionMethod(0), + KErrArgument); + QVERIFY(cm == NULL); + + // Try fetching a connection method with an invalid ID + cm = 0; + TEST_CATCH_AND_VERIFY( + cm = mCmManagerShim->connectionMethod(42), + KErrNotFound); + QVERIFY(cm == NULL); + + // Try fetching a destination with an invalid ID + dest = 0; + TEST_CATCH_AND_VERIFY( + dest = mCmManagerShim->destination(42), + KErrArgument); + QVERIFY(dest == NULL); +} + +/** + * Test case for testing basic destination handling + * -Create a destination + * -Validate the default destination content + * -Delete the destination + */ +void TestCmMgrShim::tcBasicDestination() +{ + // Create a new destination + CmDestinationShim *dest; + dest = mCmManagerShim->createDestination("TestDestination"); + QVERIFY(dest != NULL); + + // Update to CommsDat + dest->update(); + + // Check the name + QString name(dest->name()); + QCOMPARE(name, QString("TestDestination")); + + // Check ID + uint destinationId = dest->id(); + QVERIFY(destinationId >= 4000); + + // Check protection level default value + CMManagerShim::CmmProtectionLevel prot = dest->protectionLevel(); + QCOMPARE(prot, CMManagerShim::ProtLevel0); + + // Check hidden flag default value + bool isHidden = dest->isHidden(); + QCOMPARE(isHidden, false); + + // Check destination content + int connMethodCount = dest->connectionMethodCount(); + QCOMPARE(connMethodCount, 0); + + // Delete the destination + dest->deleteDestination(); + + // Check that double deletion throws an exception + TEST_CATCH_AND_VERIFY( + dest->deleteDestination(), + KErrBadHandle); + + delete dest; +} + +/** + * Test case for testing basic modifications for a destination. + * -Create a destination + * -Add a GPRS connection method to it. + * -Add a WLAN connection method to it. + * -Delete the GPRS connection method. + * -Delete the Destination (and thus also the WLAN connection method). + */ +void TestCmMgrShim::tcDestinationModify() +{ + // Create a new destination + CmDestinationShim *dest; + dest = mCmManagerShim->createDestination("TestDestination"); + QVERIFY(dest != NULL); + uint destId = dest->id(); + QVERIFY(destId >= 4000); + + // Check destination initial content + int connMethodCount = dest->connectionMethodCount(); + QCOMPARE(connMethodCount, 0); + + // Create a GPRS connection method + CmConnectionMethodShim *cm = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypePacketData); + QVERIFY(cm != NULL); + + // Update to CommsDat + cm->update(); + + // Add the connection method to the destination + int index = dest->addConnectionMethod(cm); + QCOMPARE(index, 0); + + // Update to CommsDat + dest->update(); + + // Create a WLAN connection method + CmConnectionMethodShim *cmWlan = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypeWlan); + QVERIFY(cmWlan != NULL); + + // Update to CommsDat + cmWlan->update(); + + // Add the connection method to the destination + index = dest->addConnectionMethod(cmWlan); + QCOMPARE(index, 0); + + // Update to CommsDat + dest->update(); + + // Delete the WLAN connection method reference + delete cmWlan; + cmWlan = 0; + + // Delete the GPRS connection method + dest->deleteConnectionMethod(cm); + delete cm; + cm = 0; + + // Update to CommsDat + dest->update(); + + // Verify the delete + connMethodCount = dest->connectionMethodCount(); + QCOMPARE(connMethodCount, 1); + + // Delete the whole destination including the remaining WLAN conn method. + dest->deleteDestination(); + delete dest; + + // Check that the destination is gone + dest = NULL; + TEST_CATCH_AND_VERIFY( + dest = mCmManagerShim->destination(destId), + KErrNotFound); + QCOMPARE(dest, (CmDestinationShim *)0); +} + +/** + * Test case for adding and reading boolean attribute for a connection method. + * -Creates a legacy WLAN connection method (i.e. does not belong to + * any destination). + * -Sets a boolean attribute. + * -Gets the boolean attribute. + * -Deletes the connection method. + */ +void TestCmMgrShim::tcConnMethodSetBoolAttribute() +{ + // Create the connection method + CmConnectionMethodShim *cm = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypeWlan); + QVERIFY(cm != NULL); + + // Update to CommsDat + cm->update(); + + // Set bool attribute value + cm->setBoolAttribute(CMManagerShim::CmProxyUsageEnabled, true); + + // Update to CommsDat + cm->update(); + + // Get bool attribute value + bool testBool = false; + testBool = cm->getBoolAttribute(CMManagerShim::CmProxyUsageEnabled); + QCOMPARE(testBool, true); + + // Delete the connection method + cm->deleteConnectionMethod(); + delete cm; +} + +/** + * Test case for adding and reading integer attribute for a connection method. + * -Creates a legacy WLAN connection method (i.e. does not belong to + * any destination). + * -Sets an int attribute. + * -Gets the int attribute. + * -Deletes the connection method. + */ +void TestCmMgrShim::tcConnMethodSetIntAttribute() +{ + // Create the connection method + CmConnectionMethodShim *cm = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypeWlan); + QVERIFY(cm != NULL); + + // Update to CommsDat + cm->update(); + + // Set int attribute value + uint testInt = 99; + cm->setIntAttribute(CMManagerShim::CmProxyPortNumber, testInt); + + // Update to CommsDat + cm->update(); + + // Get int attribute value + uint resultInt = cm->getIntAttribute(CMManagerShim::CmProxyPortNumber); + QCOMPARE(resultInt, testInt); + + // Delete the connection method + cm->deleteConnectionMethod(); + delete cm; +} + +/** + * Test case for adding and reading string attributes for a connection method. + * -Creates a legacy WLAN connection method (i.e. does not belong to + * any destination). + * -Sets a string attribute. + * -Gets the string attribute. + * -Deletes the connection method. + */ +void TestCmMgrShim::tcConnMethodSetStringAttribute() +{ + // Create the connection method + CmConnectionMethodShim *cm = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypeWlan); + QVERIFY(cm != NULL); + + // Update to CommsDat + cm->update(); + + // Set string attribute value + QString testString("TestProxyServerName"); + cm->setStringAttribute(CMManagerShim::CmProxyServerName, testString); + + // Set string8 attribute value + QString testString2("key12"); + cm->setString8Attribute(CMManagerShim::WlanWepKey1InAscii, testString2); + + // Update to CommsDat + cm->update(); + + // Check string attribute value + QString resultString = cm->getStringAttribute(CMManagerShim::CmProxyServerName); + QCOMPARE(resultString, testString); + + // Check string8 attribute value + resultString = cm->getString8Attribute(CMManagerShim::WlanWepKey1InAscii); + QCOMPARE(resultString, testString2); + + // Delete the connection method + cm->deleteConnectionMethod(); + delete cm; +} + +/** + * Test case for testing attribute reads using a wrong attribute type. + * All test reads in this case should fail to an exception. + */ +void TestCmMgrShim::tcConnMethodWrongTypeAttributeRead() +{ + // Create the connection method + CmConnectionMethodShim *cm = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypeWlan); + QVERIFY(cm != NULL); + + // Update to CommsDat + cm->update(); + + // Try reading name erroneously as an int attribute + uint intResult = 0; + TEST_CATCH_AND_VERIFY( + intResult = cm->getIntAttribute(CMManagerShim::CmName), + KErrNotSupported); + QCOMPARE(intResult, (uint)0); + + // Try reading name erroneously as a bool attribute + bool boolResult = false; + TEST_CATCH_AND_VERIFY( + boolResult = cm->getBoolAttribute(CMManagerShim::CmName), + KErrNotSupported); + QCOMPARE(boolResult, false); + + // Try reading ID erroneously as a string attribute + QString stringResult; + TEST_CATCH_AND_VERIFY( + stringResult = cm->getStringAttribute(CMManagerShim::CmId), + KErrNotSupported); + QCOMPARE(stringResult, QString("")); + + // Try reading ID erroneously as a string 8 attribute + stringResult = ""; + TEST_CATCH_AND_VERIFY( + stringResult = cm->getString8Attribute(CMManagerShim::CmId), + KErrNotSupported); + QCOMPARE(stringResult, QString("")); + + // Delete the connection method + cm->deleteConnectionMethod(); + delete cm; +} + +/** + * Test case for testing attribute reads using a wrong attribute type. + * All test reads in this case should fail to an exception. + */ +void TestCmMgrShim::tcConnMethodWrongTypeAttributeWrite() +{ + // Create the connection method + CmConnectionMethodShim *cm = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypeWlan); + QVERIFY(cm != NULL); + + // Update to CommsDat + cm->update(); + + // Try writing name erroneously as an int attribute + TEST_CATCH_AND_VERIFY( + cm->setIntAttribute(CMManagerShim::CmName, 0), + KErrNotSupported); + + // Try writing name erroneously as a bool attribute + TEST_CATCH_AND_VERIFY( + cm->setBoolAttribute(CMManagerShim::CmName, false), + KErrNotSupported); + + // Try writing ID erroneously as a string attribute + TEST_CATCH_AND_VERIFY( + cm->setStringAttribute(CMManagerShim::CmId, QString("dada")), + KErrNotSupported); + + // Try reading ID erroneously as a string 8 attribute + TEST_CATCH_AND_VERIFY( + cm->setString8Attribute(CMManagerShim::CmId, QString("dada")), + KErrNotSupported); + + // Delete the connection method + cm->deleteConnectionMethod(); + delete cm; +} + +/** + * Test case for testing connection method refreshing. + * -Create a connection method + * -Read the name of the connection method + * -Change the name, but don't update CommsDat + * -Refsesh connection method + * -Check that the name is the original one + * -Delete the connection method + */ +void TestCmMgrShim::tcConnectionMethodRefresh() +{ + // Create the connection method + CmConnectionMethodShim *cm = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypeWlan); + QVERIFY(cm != NULL); + + // Update to CommsDat + cm->update(); + + // Check ID + int id = cm->getIntAttribute(CMManagerShim::CmId); + QCOMPARE(id, 1); + + // Check the default name + QString name = cm->getStringAttribute(CMManagerShim::CmName); + QCOMPARE(name, QString("Connection Method")); + + // Change name + cm->setStringAttribute(CMManagerShim::CmName, "WlanBlaaBlaa"); + // Do not update CommsDat + + // Check the changed name + QString newName = cm->getStringAttribute(CMManagerShim::CmName); + QCOMPARE(newName, QString("WlanBlaaBlaa")); + + // Refresh connection method + cm->refresh(); + + // Delete the connection method reference + delete cm; + + // Refetch the connection method + cm = mCmManagerShim->connectionMethod(id); + QVERIFY(cm != NULL); + + // Check that the bearer name in database is the original one + newName = cm->getStringAttribute(CMManagerShim::CmName); + QCOMPARE(newName, name); + + // Delete the connection method + cm->deleteConnectionMethod(); + delete cm; +} + +/** + * Test case for testing reading destination's connection methods. + * -Create a destination + * -Add a GPRS connection method to it. + * -Add a WLAN connection method to it. + * -Read number of connection methods. + * -Read connection method by index. + * -Read connection method by unknown index. + * -Read connection method by id. + * -Read connection method by unknown id. + * -Delete the Destination (and connection methods). + */ +void TestCmMgrShim::tcDestinationReadConnectionMethods() +{ + // Create a new destination + CmDestinationShim *dest; + dest = mCmManagerShim->createDestination("TestDestination"); + QVERIFY(dest != NULL); + uint destId = dest->id(); + QVERIFY(destId >= 4000); + + // Check destination initial content + int connMethodCount = dest->connectionMethodCount(); + QCOMPARE(connMethodCount, 0); + + // Create a GPRS connection method + CmConnectionMethodShim *cmGprs = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypePacketData); + QVERIFY(cmGprs != NULL); + // Update to CommsDat + cmGprs->update(); + + // Add the connection method to the destination + int index = dest->addConnectionMethod(cmGprs); + QCOMPARE(index, 0); + // Update to CommsDat + dest->update(); + + delete cmGprs; + cmGprs = 0; + + // Create a WLAN connection method + CmConnectionMethodShim *cmWlan = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypeWlan); + QVERIFY(cmWlan != NULL); + // Update to CommsDat + cmWlan->update(); + + // Add the connection method to the destination + index = dest->addConnectionMethod(cmWlan); + QCOMPARE(index, 0); + // Update to CommsDat + dest->update(); + + + // Check number of destination's connection methods + connMethodCount = dest->connectionMethodCount(); + QCOMPARE(connMethodCount, 2); + + // Read connection method by index. + CmConnectionMethodShim *cm = dest->connectionMethod(1); + QVERIFY(cm != NULL); + + // Try to read connection method by unknown index. + TEST_CATCH_AND_VERIFY( + dest->connectionMethod(2), + KErrArgument); + + // Read connection method by id. + uint id = cmWlan->getIntAttribute(CMManagerShim::CmId); + cm = dest->connectionMethodByID(id); + QVERIFY(cm != NULL); + + delete cmWlan; + cmWlan = 0; + + delete cm; + cm = 0; + + // Try to read connection method by unknown id. + TEST_CATCH_AND_VERIFY( + dest->connectionMethodByID(100), + KErrNotFound); + + // Delete the destination (and connection methods). + dest->deleteDestination(); + delete dest; +} + +/** + * Test case for testing removing connection method from single destination. + * -Create 2 destinations + * -Add a WLAN connection method to both. + * -Remove the WLAN connection method from the first destination. + * -Remove the WLAN connection method from the other destination. + * -Delete the Destinations. + * -Delete connection method. + */ +void TestCmMgrShim::tcDestinationRemoveConnectionMethod() +{ + // Create a new destination + CmDestinationShim *dest1; + dest1 = mCmManagerShim->createDestination("TestDestination1"); + QVERIFY(dest1 != NULL); + uint destId1 = dest1->id(); + QVERIFY(destId1 >= 4000); + + // Create another destination + CmDestinationShim *dest2; + dest2 = mCmManagerShim->createDestination("TestDestination2"); + QVERIFY(dest2 != NULL); + uint destId2 = dest2->id(); + QVERIFY(destId2 >= 4000); + + // Check destinations initial content + int connMethodCount = dest1->connectionMethodCount(); + QCOMPARE(connMethodCount, 0); + connMethodCount = dest2->connectionMethodCount(); + QCOMPARE(connMethodCount, 0); + + // Create a WLAN connection method + CmConnectionMethodShim *cmWlan = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypeWlan); + QVERIFY(cmWlan != NULL); + // Update to CommsDat + cmWlan->update(); + + uint cmWlanId = cmWlan->getIntAttribute(CMManagerShim::CmId); + QCOMPARE(cmWlanId, (uint)1); + + // Add the connection method to the destination 1 + int index = dest1->addConnectionMethod(cmWlan); + QCOMPARE(index, 0); + // Update to CommsDat + dest1->update(); + + // Add the connection method to the destination 2 + index = dest2->addConnectionMethod(cmWlan); + QCOMPARE(index, 0); + // Update to CommsDat + dest2->update(); + + // Remove the WLAN connection method from destination 1 + dest1->removeConnectionMethod(cmWlan); + // Update to CommsDat + dest1->update(); + + // Verify the delete + connMethodCount = dest1->connectionMethodCount(); + QCOMPARE(connMethodCount, 0); + + // Check that WLAN connection method still exists for destination 2 + connMethodCount = dest2->connectionMethodCount(); + QCOMPARE(connMethodCount, 1); + + // Remove the WLAN connection method from destination 2 + dest2->removeConnectionMethod(cmWlan); + // Update to CommsDat + dest2->update(); + + // Verify the delete + connMethodCount = dest2->connectionMethodCount(); + QCOMPARE(connMethodCount, 0); + + // Delete destinations + dest1->deleteDestination(); + delete dest1; + dest2->deleteDestination(); + delete dest2; + + // Check that WLAN connection method still exists + delete cmWlan; + cmWlan = mCmManagerShim->connectionMethod(cmWlanId); + QVERIFY(cmWlan != NULL); + + // Remove WLAN connection method. + cmWlan->deleteConnectionMethod(); + delete cmWlan; +} + +/** + * Test case for testing destination's cm priority reading and changing. + * -Create a destination + * -Add a GPRS connection method to it. + * -Add a WLAN connection method to it. + * -Read priority values of the connection methods + * -Change the priority values + * -Read the changed priority values + * -Try to change the priority value to unsupported value + * -Delete the destination (and connection methods) + */ +void TestCmMgrShim::tcDestinationPriority() +{ + // Create a new destination + CmDestinationShim *dest; + dest = mCmManagerShim->createDestination("TestDestination"); + QVERIFY(dest != NULL); + uint destId = dest->id(); + QVERIFY(destId >= 4000); + + // Create a GPRS connection method + CmConnectionMethodShim *cmGprs = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypePacketData); + QVERIFY(cmGprs != NULL); + // Update to CommsDat + cmGprs->update(); + + // Add the connection method to the destination + int index = dest->addConnectionMethod(cmGprs); + QCOMPARE(index, 0); + // Update to CommsDat + dest->update(); + + // Create a WLAN connection method + CmConnectionMethodShim *cmWlan = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypeWlan); + QVERIFY(cmWlan != NULL); + // Update to CommsDat + cmWlan->update(); + + // Add the connection method to the destination + index = dest->addConnectionMethod(cmWlan); + QCOMPARE(index, 0); + // Update to CommsDat + dest->update(); + + // Get the priority of connection methods + int priority = dest->priority(cmWlan); + QCOMPARE(priority, 1); + priority = dest->priority(cmGprs); + QCOMPARE(priority, 2); + + // Modify the priority of GPRS connection method + dest->modifyPriority(cmGprs, 0); + dest->modifyPriority(cmWlan, 1); + // Update to CommsDat + dest->update(); + + // Check the priorities + priority = dest->priority(cmGprs); + QCOMPARE(priority, 1); + priority = dest->priority(cmWlan); + QCOMPARE(priority, 2); + + // Try to modify the priority to forbidden value + TEST_CATCH_AND_VERIFY( + dest->modifyPriority(cmGprs, 2), + KErrArgument); + + // Delete the whole destination including the remaining WLAN conn method. + dest->deleteDestination(); + + delete dest; + delete cmGprs; + delete cmWlan; +} + +/** + * Test case for testing miscellaneous methods for destination. + * -Create a destination + * -Change the name of the destination + * -Check if the destination is hidden + * -Check if destination is "internet" with metadata. + * -Delete the destination + */ +void TestCmMgrShim::tcDestinationMisc() +{ + // Create a new destination + CmDestinationShim *dest; + dest = mCmManagerShim->createDestination("TestDestination"); + QVERIFY(dest != NULL); + uint destId = dest->id(); + QVERIFY(destId >= 4000); + + // Change the name of the destination + dest->setName("NewName"); + // Update to CommsDat + dest->update(); + + // Check the name + QString name(dest->name()); + QCOMPARE(name, QString("NewName")); + + // Check if destination is hidden + bool hidden = dest->isHidden(); + QCOMPARE(hidden, false); + + // Check "internet" metadata field + uint metadata = dest->metadata(CMManagerShim::SnapMetadataInternet); + QCOMPARE(metadata, (uint)false); + + // Delete the destination + dest->deleteDestination(); + delete dest; +} + +/** + * Test case for testing destination refreshing method. + * -Create a destination + * -Add a GPRS connection method, but don't update CommsDat + * -Change the name of the destination, but don't update CommsDat + * -Refresh destination + * -Check that the changes are not valid anymore + * -Delete the destination + * -Delete the connection method + */ +void TestCmMgrShim::tcDestinationRefresh() +{ + // Create a new destination + CmDestinationShim *dest; + dest = mCmManagerShim->createDestination("TestDestination"); + QVERIFY(dest != NULL); + uint destId = dest->id(); + QVERIFY(destId >= 4000); + dest->update(); + + // Create a GPRS connection method + CmConnectionMethodShim *cmGprs = mCmManagerShim->createConnectionMethod( + CMManagerShim::BearerTypePacketData); + QVERIFY(cmGprs != NULL); + // Update to CommsDat + cmGprs->update(); + + // Add the connection method to the destination + int index = dest->addConnectionMethod(cmGprs); + QCOMPARE(index, 0); + // Don't update CommsDat + + // Change the name of the destination + dest->setName("NewName"); + // Don't update to CommsDat + + // Refresh destination + dest->refresh(); + + // Delete the destination reference + delete dest; + + // Refetch the destination + dest = mCmManagerShim->destination(destId); + QVERIFY(dest != NULL); + + // Check the name that it is the original one + QString name(dest->name()); + QCOMPARE(name, QString("TestDestination")); + + // Check destination content + int connMethodCount = dest->connectionMethodCount(); + QCOMPARE(connMethodCount, 0); + + // Delete the destination + dest->deleteDestination(); + delete dest; + + // Delete connection method + bool ok = cmGprs->deleteConnectionMethod(); + delete cmGprs; + QCOMPARE(ok, true); +} + +/** + * Test case for testing data reads using a invalid input data. + * All test reads in this case should fail to an exception. + */ +void TestCmMgrShim::tcDestinationInvalidParams() +{ + // Create a new destination + CmDestinationShim *dest; + dest = mCmManagerShim->createDestination("TestDestination"); + QVERIFY(dest != NULL); + + // Update to CommsDat + dest->update(); + + // Try reading with an invalid connection method index + CmConnectionMethodShim *cm = 0; + TEST_CATCH_AND_VERIFY( + dest->connectionMethod(42), + KErrArgument); + QVERIFY(cm == 0); + + // Try reading with an invalid connection method ID + cm = 0; + TEST_CATCH_AND_VERIFY( + dest->connectionMethodByID(42), + KErrNotFound); + QVERIFY(cm == 0); + + // Delete the destination + dest->deleteDestination(); + delete dest; +} + +// ----------------------------------------------------------------------------- +// SUB TEST CASES +// ----------------------------------------------------------------------------- + +/** + * Case for deleting all destinations. + */ +void TestCmMgrShim::deleteDestinations() +{ + // Read all destinations + QList destinations; + mCmManagerShim->allDestinations(destinations); + + // Delete the destinations + for (int i=0; i < destinations.count(); i++) { + CmDestinationShim *dest = mCmManagerShim->destination(destinations[i]); + dest->deleteDestination(); + delete dest; + } +} + +/** + * Case for deleting all connection methods. + */ +void TestCmMgrShim::deleteConnectionMethods() +{ + // Read all connection methods + QList connMethods; + mCmManagerShim->connectionMethod(connMethods, false); + + // Remove all connection methods + for (int i=0; i < connMethods.count(); i++){ + CmConnectionMethodShim *cm = + mCmManagerShim->connectionMethod(connMethods[i]); + QVERIFY(cm != NULL); + bool ok = cm->deleteConnectionMethod(); + QVERIFY(ok == true); + delete cm; + } +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/tsrc/ut/testcmmgrshim.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/tsrc/ut/testcmmgrshim.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Header for Connection Settings Shim Unit Test program. +*/ + +#include + +#include + +class HbMainWindow; + +class TestCmMgrShim : public QObject +{ + Q_OBJECT + + public slots: + // Test framework functions + void initTestCase(); + void cleanupTestCase(); + void init(); + void cleanup(); + + private slots: + // Test cases + void tcResetSettings(); + void tcLegacyConnMethodWlan(); + void tcLegacyConnMethodGprs(); + void tcCmManagerBasicFails(); + void tcBasicDestination(); + void tcDestinationModify(); + void tcConnMethodSetBoolAttribute(); + void tcConnMethodSetIntAttribute(); + void tcConnMethodSetStringAttribute(); + void tcConnMethodWrongTypeAttributeRead(); + void tcConnMethodWrongTypeAttributeWrite(); + void tcConnectionMethodRefresh(); + void tcDestinationReadConnectionMethods(); + void tcDestinationRemoveConnectionMethod(); + void tcDestinationPriority(); + void tcDestinationMisc(); + void tcDestinationRefresh(); + void tcDestinationInvalidParams(); + + private: + // Sub test cases + void deleteDestinations(); + void deleteConnectionMethods(); + + private: + // Test data + CmManagerShim *mCmManagerShim; +}; diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/tsrc/ut/testcmmgrshim.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/tsrc/ut/testcmmgrshim.pro Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,36 @@ +# +# 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 Connection Settings Shim Unit Tests. + +TEMPLATE = app + +TARGET = testcmmgrshim + +CONFIG += hb qtestlib + +INCLUDEPATH += . +DEPENDPATH += . + +HEADERS += \ + testcmmgrshim.h +SOURCES += \ + testcmmgrshim.cpp + +LIBS += -lconnection_settings_shim + +symbian: { + SYMBIAN_PLATFORMS = WINSCW ARMV5 + TARGET.CAPABILITY = ALL -TCB +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/connection_settings_shim/tsrc/ut/tools/cmmgrshim_ctc.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/connection_settings_shim/tsrc/ut/tools/cmmgrshim_ctc.bat Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,79 @@ +:: +:: 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: +:: Script for running Connection Settings Shim test cases with CTC analysis. + +@echo off + +::----------------------------------------------------------------------------- +:: Set the local variables +::----------------------------------------------------------------------------- + +:: Connection Settings Shim base directory +set cmmgrshim_dir=..\..\.. +pushd %cmmgrshim_dir% + +:: CTC instrumentation excludes +set ctc_excludes=-C EXCLUDE=* -C NO_EXCLUDE=src\*.cpp + +::----------------------------------------------------------------------------- +:: Remove old coverage data +::----------------------------------------------------------------------------- + +echo Cleaning up... +del MON.* ctcerr.txt profile.txt +rd /s /q CTCHTML +echo ...done + +::----------------------------------------------------------------------------- +:: Build & instrument code +::----------------------------------------------------------------------------- + +echo Building code and instrumenting.. +call del MON.* ctcerr.txt profile.txt +call make distclean +call qmake +call ctcwrap -i d -2comp %ctc_excludes% sbs -c winscw_udeb +echo ...done + +::----------------------------------------------------------------------------- +:: Build test code +::----------------------------------------------------------------------------- + +echo Building test code... +call cd tsrc\ut +call make distclean +call qmake +call sbs -c winscw_udeb +echo ...done + +::----------------------------------------------------------------------------- +:: Execute the tests +::----------------------------------------------------------------------------- + +echo Running tests.. +cd ..\.. +call \epoc32\release\winscw\udeb\testcmmgrshim.exe +echo ...done + +::----------------------------------------------------------------------------- +:: Create coverage results +::----------------------------------------------------------------------------- + +echo Creating results... +call ctcpost -p profile.txt +call ctc2html -i profile.txt +echo ...done + +popd diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/cpdestinationplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/cpdestinationplugin.pro Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,61 @@ +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +TARGET = cpdestinationplugin +DEPENDPATH += . +INCLUDEPATH += . +CONFIG += hb plugin +CONFIG += debug +MOC_DIR = moc +OBJECTS_DIR = obj +RCC_DIR = rcc +LIBS += -lcpframework \ + -lconnection_settings_shim +symbian*::LIBS += -lcmmanager +RESOURCES = res/cpdestinationplugin.qrc + +# Sources +HEADERS += inc/cpiapitem.h \ + inc/cpdestinationplugin.h \ + inc/cpdestinationgroup.h \ + inc/cpadddestinationentryitemdata.h \ + inc/cpdestinationentryitem.h \ + traces/OstTraceDefinitions.h +SOURCES += src/cpiapitem.cpp \ + src/cpadddestinationentryitemdata.cpp \ + src/cpdestinationentryitem.cpp \ + src/cpdestinationplugin.cpp \ + src/cpdestinationgroup.cpp + +TRANSLATIONS = cpdestinationplugin.ts + +symbian: +{ + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.UID3 = 0x2002BC90 + TARGET.CAPABILITY = CAP_GENERAL_DLL + + deploy.path = C: + qtplugins.path = /resource/qt/plugins/controlpanel + qtplugins.sources += qmakepluginstubs/cpdestinationplugin.qtplugin + + for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" + BLD_INF_RULES.prj_exports += "rom/cpdestinationplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cpdestinationplugin.iby)" + BLD_INF_RULES.prj_exports += "rom/cpdestinationplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(cpdestinationplugin_resources.iby)" +} + +plugin.sources = cpdestinationplugin.dll +plugin.path = /resource/qt/plugins/controlpanel +DEPLOYMENT += plugin diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/inc/cpadddestinationentryitemdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/inc/cpadddestinationentryitemdata.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,79 @@ +/* + * 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: + * Data item for representing "Add Destination" button in UI. + */ + +#ifndef CPADDDESTINATIONENTRYITEMDATA_H +#define CPADDDESTINATIONENTRYITEMDATA_H + +// System includes +#include + +// User includes + +// Forward declarations +class CpDestinationGroup; +class CmManagerShim; +class HbInputDialog; +class HbAction; + +// External data types + +// Constants + +// Class declaration +class CpAddDestinationEntryItemData : public CpSettingFormEntryItemData +{ + Q_OBJECT +public: + explicit CpAddDestinationEntryItemData( + CpItemDataHelper &itemDataHelper, + CpDestinationGroup *parent = 0); + + virtual ~CpAddDestinationEntryItemData(); + +signals: + +public slots: + void setNewDestinationName(); + +protected: + +protected slots: + +private: + virtual CpBaseSettingView *createSettingView() const; + bool isDestinationNameValid(const QString dest, CmManagerShim *cmm) const; + void showErrorNote(); + +private slots: + + void onLaunchView(); + +private: // data + + //! Parent object + CpDestinationGroup *mParent; + //! New Destination name query dialog + HbInputDialog *mDialog; + //! New Destination name query's OK action + HbAction *mOkAction; + + //! Maximun length for destination name + static const int DestinationNameMaxLength = 30; + +}; + +#endif //CPADDDESTINATIONENTRYITEMDATA_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/inc/cpdestinationentryitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/inc/cpdestinationentryitem.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,120 @@ +/* +* 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 items represents one Destination in UI. +* +*/ + +#ifndef CPDESTINATIONENTRYITEM_H +#define CPDESTINATIONENTRYITEM_H + +// System includes +#include +#include +#include + +// User includes + +// Forward declarations +class QString; +class HbMenu; +class HbView; +class HbListWidget; +class HbListWidgetItem; +class HbMainWindow; +class HbAction; +class HbInputDialog; +class CpItemDataHelper; +class CpIapItem; +class CmConnectionMethodShim; +class CmManagerShim; + +// External data types + +// Constants + +// Class declaration +class CpDestinationEntryItemData : public CpSettingFormEntryItemData +{ + Q_OBJECT +public: + explicit CpDestinationEntryItemData(CpItemDataHelper &itemDataHelper); + virtual ~CpDestinationEntryItemData(); + + int destinationId(); + void setDestinationId( int destId ); + QString destinationName(); + void setDestinationName(const QString destinationName); + +signals: + void destChanged(); + +public slots: + void updateDestinationView(); + void showItemMenu(QPointF position); + void renameDestination(); + void confirmDestinationDelete(); + void deleteDestination(); + void activateArrangeMode(); + void viewDone(); + void viewCancel(); + void updateIndex(HbListWidgetItem *widgetItem); + void saveNewDestinationName(); + +protected: + +protected slots: + +private: + virtual CpBaseSettingView *createSettingView() const; + void fetchReferencedAps( + QList > &apList, const CmManagerShim *cmm) const; + bool isDestinationNameValid(QString &destination, const CmManagerShim *cmm); + void createArrangeModeView(HbView *view); + void constructSettingView(CpBaseSettingView *view) const; + HbMenu *createItemMenu( + CMManagerShim::CmmProtectionLevel protLvl, + const QPointF position); + void lauchNewDestinationNameQuery(); + void showRenameError(const QString &info); + void showErrorNote(const QString &info); + +private slots: + +private: // data + + //! Helper for connecting signals to underlying widgets + CpItemDataHelper *mItemDataHelper; + //! Unique Destination ID + int mDestinationId; + //! Destination Name + QString mDestinationName; + //! List of access points contained by this object + QList *mAps; + //! Pointer to CmManager for commsdat operations + CmManagerShim *mCmm; + //! Previous view when arrange mode view is shown + HbView *mPreView; + //! List of access points for arrange mode + HbListWidget *mList; + //! New Destination name query dialog + HbInputDialog *mDialog; + //! New Destination name query's OK action + HbAction *mOkAction; + + //! Maximun length for destination name + static const int DestinationNameMaxLength = 30; +}; + +#endif /* CPDESTINATIONENTRYITEM_H */ diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/inc/cpdestinationgroup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/inc/cpdestinationgroup.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,82 @@ +/* +* 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: +* CpDestinationGroup contains all destination UI items as well as +* items for uncategorized access points and adding new destinations. +*/ + +#ifndef CPDESTINATIONGROUP_H +#define CPDESTINATIONGROUP_H + +// System includes +#include +#include + +// User includes +#include "cpbearerapplugininterface.h" + +// Forward declarations +class CpDestinationEntryItemData; +class CmDestinationShim; +class CmManagerShim; + +// External data types + +// Constants + +// Class declaration +class CpDestinationGroup : public CpSettingFormItemData +{ + Q_OBJECT + +public: + CpDestinationGroup(CpItemDataHelper &itemDataHelper); + ~CpDestinationGroup(); + + void addDestination(const QString &dest, int destId); + void deleteDestination(int destId); + CpBearerApPluginInterface *findBearerPlugin(int apId); + +signals: + +public slots: + void updateDestinationInformation(); + +protected: + +protected slots: + +private: + void createUncategorisedDestination(); + void fetchDestinations(QList > &destinationList); + void loadBearerPlugins(); + QString getDestinationAdditionalText(int iapCount); + +private slots: + +private: // data + + //! Helper for connecting signals to underlying widgets + CpItemDataHelper *mItemDataHelper; + //! True is uncategorised "destination" is currently shown + bool mUncategorisedShown; + //! Pointer to CmManager for commsdat operations + CmManagerShim *mCmManager; + /*! List of plugins that implement views for access points + * according to bearer type + */ + QList *mBearerPlugins; +}; + +#endif // CPDESTINATIONGROUP_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/inc/cpdestinationplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/inc/cpdestinationplugin.h Mon May 03 12:53:07 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: +* Control Panel plugin for showing destinations and access points +* settings. +* +*/ + +#ifndef CPDESTINATIONPLUGIN_H +#define CPDESTINATIONPLUGIN_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class QTranslator; + +// External data types + +// Constants + +// Class declaration +class CpDestinationPlugin : public QObject, public CpPluginInterface +{ + Q_OBJECT + Q_INTERFACES(CpPluginInterface) + +public: + CpDestinationPlugin(); + ~CpDestinationPlugin(); + QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; + +signals: + +public slots: + +protected: + +protected slots: + +private: + +private slots: + +private: // data + //! Translator for localization + QTranslator *mTranslator; + +}; + +#endif // CPDESTINATIONPLUGIN_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/inc/cpiapitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/inc/cpiapitem.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,118 @@ +/* +* 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: +* Data item for representing access points in UI. +* +*/ + +#ifndef CPIAPITEM_H +#define CPIAPITEM_H + +// System includes +#include +#include +#include +#include +#include + +// User includes + +// Forward declarations +class HbDialog; +class HbRadioButtonList; +class HbAction; +class HbMenu; +class CmManagerShim; +class CpBearerApPluginInterface; + +// External data types + +// Constants + +// Class declaration +class CpIapItem : public CpSettingFormEntryItemData + { + Q_OBJECT + +public: + CpIapItem( + CpItemDataHelper &itemDataHelper, + int iapId, + const QString &iapName, + int destId, + bool apProtected, + CpBearerApPluginInterface *bearerPlugin); + + ~CpIapItem(); + + int getIapId() const; + +signals: + void iapChanged(); + +public slots: + void showItemMenu(QPointF position); + void moveIap(); + void showDeleteConfirmation(); + void shareIap(); + void queryDialogClosed(); + void deleteConfirmed(); + void updateIap(const QModelIndex index); + +protected: + +protected slots: + +private: + virtual CpBaseSettingView *createSettingView() const; + void queryDestination(); + void saveMove(int id); + void saveShare(int id); + bool isCmManagerAvailable(); + HbMenu *createItemMenu( + CMManagerShim::CmmProtectionLevel protLvl, + const QPointF &position); + void showErrorNote(const QString &info); + +private slots: + +private: // data + //! Unique ID for access point + int mIapId; + //! Access point name + QString mIapName; + //! ID of the destination referencing this access point + int mDestId; + //! Boolean showing if access point is protected. + bool mProtected; + //! Helper for connecting signals to underlying widgets + CpItemDataHelper *mItemDataHelper; + //! Pointer to CmManager for commsdat operations + CmManagerShim *mCmm; + //! Plugin that implements settings view for this access point + CpBearerApPluginInterface *mBearerPlugin; + + //! Variable showing if access point move transaction is ongoing + bool mMoveOngoing; + //! Target destination query dialog. Used for move and share + HbDialog *mDialog; + //! Dialog's OK action + HbAction *mOk; + //! List of available destinations' IDs + QList mDestinationList; + //! List of available destinations + HbRadioButtonList *mList; +}; + +#endif // CPIAPITEM_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/res/cpdestinationplugin.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/res/cpdestinationplugin.qrc Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,5 @@ + + + cpdestinationplugindialogs.docml + + diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/rom/cpdestinationplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/rom/cpdestinationplugin.iby Mon May 03 12:53:07 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: +* Destination Plugin IBY file for control panel +*/ + +#ifndef CPDESTINATIONPLUGIN_IBY +#define CPDESTINATIONPLUGIN_IBY + +#include + +file=ABI_DIR/BUILD_DIR/cpdestinationplugin.dll SHARED_LIB_DIR/cpdestinationplugin.dll + +data=/epoc32/data/c/resource/qt/plugins/controlpanel/cpdestinationplugin.qtplugin resource/qt/plugins/controlpanel/cpdestinationplugin.qtplugin + +#endif // CPDESTINATIONPLUGIN_IBY diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/rom/cpdestinationplugin_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/rom/cpdestinationplugin_resources.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,25 @@ +/* +* 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: +* Destination Plugin IBY file. +*/ + +#ifndef CPDESTINATIONPLUGIN_RESOURCES_IBY +#define CPDESTINATIONPLUGIN_RESOURCES_IBY + +#include + +data=DATAZ_/QT_TRANSLATIONS_DIR/cpdestinationplugin.qm QT_TRANSLATIONS_DIR/cpdestinationplugin.qm + +#endif // CPDESTINATIONPLUGIN_RESOURCES_IBY diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/src/cpadddestinationentryitemdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/src/cpadddestinationentryitemdata.cpp Mon May 03 12:53:07 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: + * Data item for representing "Add Destination" button in UI. + */ + +// System includes +#include +#include +#include +#include +#include +#include +#include + +// User includes +#include "cpadddestinationentryitemdata.h" +#include "cpdestinationgroup.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cpadddestinationentryitemdataTraces.h" +#endif +/*! + \class CpAddDestinationEntryItemData + \brief This class is a dummy destination. It does not contain + access points but clicking it starts new destination + creation process. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + + +/*! + + Constructor. + + @param[in] itemDataHelper Helper from Control Panel for making connections. + @param[in] parent Parent object. + */ +CpAddDestinationEntryItemData::CpAddDestinationEntryItemData(CpItemDataHelper &itemDataHelper, + CpDestinationGroup *parent) + : CpSettingFormEntryItemData(itemDataHelper), + mParent(parent), + mDialog(0) +{ + OstTraceFunctionEntry0(CPADDDESTINATIONENTRYITEMDATA_CPADDDESTINATIONENTRYITEMDATA_ENTRY); + // Fix connections + itemDataHelper.removeConnection(this,SIGNAL(pressed()),this,SLOT(onLaunchView())); + itemDataHelper.addConnection(this,SIGNAL(clicked()),this,SLOT(onLaunchView())); + OstTraceFunctionExit0(CPADDDESTINATIONENTRYITEMDATA_CPADDDESTINATIONENTRYITEMDATA_EXIT); +} + +/*! + Destructor. + */ +CpAddDestinationEntryItemData::~CpAddDestinationEntryItemData() +{ + OstTraceFunctionEntry0(DUP1_CPADDDESTINATIONENTRYITEMDATA_CPADDDESTINATIONENTRYITEMDATA_ENTRY); + OstTraceFunctionExit0(DUP1_CPADDDESTINATIONENTRYITEMDATA_CPADDDESTINATIONENTRYITEMDATA_EXIT); +} + +/*! + Inherited member from CpSettingFormEntryItemData. When this item is clicked + new dialog is started for creating new destination. + */ +void CpAddDestinationEntryItemData::onLaunchView() +{ + OstTraceFunctionEntry0(CPADDDESTINATIONENTRYITEMDATA_ONLAUNCHVIEW_ENTRY); + mDialog = new HbInputDialog(); + mDialog->setAttribute(Qt::WA_DeleteOnClose); + mDialog->lineEdit()->setMaxLength(DestinationNameMaxLength); + mDialog->clearActions(); + mDialog->setPromptText(hbTrId("txt_occ_dialog_destination_name")); + mDialog->setInputMode(HbInputDialog::TextInput); + mOkAction = new HbAction(hbTrId("txt_common_button_ok")); + bool connected = connect(mOkAction, + SIGNAL(triggered()), + this, + SLOT(setNewDestinationName())); + Q_ASSERT(connected); + HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel")); + mDialog->addAction(mOkAction); + mDialog->addAction(cancelAction); + mDialog->show(); + OstTraceFunctionExit0(CPADDDESTINATIONENTRYITEMDATA_ONLAUNCHVIEW_EXIT); +} + +/*! + This function is called when user selects OK from destination + name query popup. The given name is valited and if the name is + valid, new destination is created in commsdat with given name. + If validation fails user is promted again for destination name. + */ +void CpAddDestinationEntryItemData::setNewDestinationName() +{ + OstTraceFunctionEntry0(CPADDDESTINATIONENTRYITEMDATA_SETNEWDESTINATIONNAME_ENTRY); + QString destinationName = mDialog->value().toString(); + bool destinationNameInvalid = true; + CmManagerShim *cmm = NULL; + CmDestinationShim *destination = NULL; + + try { + cmm = new CmManagerShim(); + if (isDestinationNameValid(destinationName, cmm)) { + // Destination name OK. Create new destination. + destination = cmm->createDestination(destinationName); + destinationNameInvalid = false; + } + } catch (const std::exception&) { + OstTrace0( TRACE_NORMAL, DUP2_CPADDDESTINATIONENTRYITEMDATA_SETNEWDESTINATIONNAME, "CpAddDestinationEntryItemData::setNewDestinationName: exception caught" ); + return; + } + + if (!destinationNameInvalid) { + // Update view + if (mParent != 0) { + mParent->addDestination(destinationName, destination->id()); + } + } else { + showErrorNote(); + } + delete destination; + delete cmm; + OstTraceFunctionExit0(CPADDDESTINATIONENTRYITEMDATA_SETNEWDESTINATIONNAME_EXIT); +} + +/*! + Inherited member from CpSettingFormEntryItemData. This item does not + create new view because it does not need one. + + \return NULL + */ +CpBaseSettingView *CpAddDestinationEntryItemData::createSettingView() const +{ + OstTraceFunctionEntry0(CPADDDESTINATIONENTRYITEMDATA_CREATESETTINGVIEW_ENTRY); + OstTraceFunctionExit0(CPADDDESTINATIONENTRYITEMDATA_CREATESETTINGVIEW_EXIT); + return NULL; +} + +/*! + Function for checking if the given destination name is valid. Duplicate and + and empty names are rejected. + + @param[in] dest Name which user has entered to be the name of the new destination. + @param[in] cmm Pointer to CmManagerShim for accessing data in commsdat. + \return true if name is valid. + */ +bool CpAddDestinationEntryItemData::isDestinationNameValid(const QString dest, CmManagerShim *cmm) const +{ + OstTraceFunctionEntry0(CPADDDESTINATIONENTRYITEMDATA_ISDESTINATIONNAMEVALID_ENTRY); + bool retVal = true; + + if (dest.length() > 0) { + QList destinationList; + cmm->allDestinations(destinationList); + + for (int i = 0; i < destinationList.count(); i ++) { + CmDestinationShim *destination = cmm->destination(destinationList[i]); + if (0 == dest.compare(destination->name())) { + retVal = false; + break; + } + delete destination; + } + } else { + retVal = false; + } + OstTraceFunctionExit0(CPADDDESTINATIONENTRYITEMDATA_ISDESTINATIONNAMEVALID_EXIT); + return retVal; +} + +/*! + * Helper function for showing error note when user inputs + * invalid destination name. + */ +void CpAddDestinationEntryItemData::showErrorNote() +{ + OstTraceFunctionEntry0(CPADDDESTINATIONENTRYITEMDATA_SHOWERRORNOTE_ENTRY); + // Destination name NOK. Inform user and ask again. + HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeInformation); + note->clearActions(); + note->setAttribute(Qt::WA_DeleteOnClose); + QString info = hbTrId("txt_occ_info_invalid_name"); + note->setText(info); + note->setTimeout(HbPopup::NoTimeout); + HbAction *errorOk = new HbAction(hbTrId("txt_common_button_ok")); + bool connected = connect( + errorOk, + SIGNAL(triggered()), + this, + SLOT(onLaunchView())); + Q_ASSERT(connected); + note->addAction(errorOk); + note->show(); + OstTraceFunctionExit0(CPADDDESTINATIONENTRYITEMDATA_SHOWERRORNOTE_EXIT); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/src/cpdestinationentryitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/src/cpdestinationentryitem.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,759 @@ +/* +* 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 items represents one Destination in UI. +*/ + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// User includes +#include "cpiapitem.h" +#include "cpdestinationentryitem.h" +#include "cpdestinationgroup.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cpdestinationentryitemTraces.h" +#endif +/*! + \class CpDestinationEntryItemData + \brief This class represents destination in data model. + It takes care of all destination related operations. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. + + @param[in] itemDataHelper Helper for connecting signals and slots. + */ +CpDestinationEntryItemData::CpDestinationEntryItemData(CpItemDataHelper &itemDataHelper) + : CpSettingFormEntryItemData(itemDataHelper), + mDialog(0), + mOkAction(0) +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_CPDESTINATIONENTRYITEMDATA_ENTRY); + mAps = new QList(); + try { + mCmm = new CmManagerShim(); + } catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, CPDESTINATIONENTRYITEMDATA_CPDESTINATIONENTRYITEMDATA, "CpDestinationEntryItemData::CpDestinationEntryItemData: Exception caught"); + mCmm = NULL; + } + mList = new HbListWidget(); + bool connectionSuccessful = connect( + mList, + SIGNAL(released(HbListWidgetItem *)), + this, + SLOT(updateIndex(HbListWidgetItem*))); + Q_ASSERT(connectionSuccessful); + + // Fix connections + itemDataHelper.removeConnection(this,SIGNAL(pressed()),this,SLOT(onLaunchView())); + itemDataHelper.addConnection(this,SIGNAL(clicked()),this,SLOT(onLaunchView())); + itemDataHelper.addConnection(this,SIGNAL(longPress(QPointF)),this,SLOT(showItemMenu(QPointF))); + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_CPDESTINATIONENTRYITEMDATA_EXIT); +} + +/*! + Destructor + */ +CpDestinationEntryItemData::~CpDestinationEntryItemData() +{ + OstTraceFunctionEntry0(DUP1_CPDESTINATIONENTRYITEMDATA_CPDESTINATIONENTRYITEMDATA_ENTRY); + delete mList; + delete mCmm; + delete mAps; + delete mOkAction; + OstTraceFunctionExit0(DUP1_CPDESTINATIONENTRYITEMDATA_CPDESTINATIONENTRYITEMDATA_EXIT); +} + +/*! + \return unique destination ID of this item. + */ +int CpDestinationEntryItemData::destinationId() +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_DESTINATIONID_ENTRY); + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_DESTINATIONID_EXIT); + return mDestinationId; +} + +/*! + Sets destination ID to be given integer. + */ +void CpDestinationEntryItemData::setDestinationId(int destId) +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_SETDESTINATIONID_ENTRY); + mDestinationId = destId; + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_SETDESTINATIONID_EXIT); +} + +/*! + \return Returns destination name as QString + */ +QString CpDestinationEntryItemData::destinationName() +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_DESTINATIONNAME_ENTRY); + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_DESTINATIONNAME_EXIT); + return mDestinationName; +} + +/*! + Sets given QString to be destination name. + */ +void CpDestinationEntryItemData::setDestinationName(const QString destinationName) +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_SETDESTINATIONNAME_ENTRY); + mDestinationName = destinationName; + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_SETDESTINATIONNAME_EXIT); +} + +/*! + Inherited member from CpSettingFormEntryItemData. Returns view that contains + all access points included in this destination item. + */ +CpBaseSettingView *CpDestinationEntryItemData::createSettingView() const +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_CREATESETTINGVIEW_ENTRY); + CpBaseSettingView* view = new CpBaseSettingView(); + constructSettingView(view); + + // Toolbar. Allow arrange if more than one AP is shown + if (mDestinationId != 0 && mAps->count() > 1) { + HbToolBar *tb = view->toolBar(); + HbAction *arrangeAction = tb->addAction(hbTrId("txt_occ_button_arrange")); + bool connected = connect( + arrangeAction, + SIGNAL(triggered()), + this, + SLOT(activateArrangeMode())); + Q_ASSERT(connected); + } + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_CREATESETTINGVIEW_EXIT); + return view; +} + +/*! + Worker function for createSettingView(). Adds Access points to given view. + + @param[out] view Target view where settings are constructed. + */ +void CpDestinationEntryItemData::constructSettingView(CpBaseSettingView *view) const +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_CONSTRUCTSETTINGVIEW_ENTRY); + mAps->clear(); + CpItemDataHelper *itemDataHelper = new CpItemDataHelper(); + HbDataForm *form = new HbDataForm(); + HbDataFormModel *model = new HbDataFormModel; + form->setModel(model); + model->setParent(form); + view->setWidget(form); + CpPluginUtility::addCpItemPrototype(form); + QList > apList; + // Following won't throw exception + fetchReferencedAps(apList, mCmm); + form->setHeading(text()); + + for (int i = 0; i < apList.count(); i++) { + int apId = apList[i]->getIntAttribute(CMManagerShim::CmId); + CpBearerApPluginInterface *bearerPlugin = + static_cast(HbDataFormModelItem::parent())->findBearerPlugin(apId); + bool apProtected = false; + if (mDestinationId != 0) { + CmDestinationShim *destination = mCmm->destination(mDestinationId); + if (destination->protectionLevel() == CMManagerShim::ProtLevel3) { + apProtected = apList[i]->getBoolAttribute(CMManagerShim::CmProtected); + } + delete destination; + } + + CpIapItem *iapDataItem; + iapDataItem = new CpIapItem( + *itemDataHelper, + apId, + apList[i]->getStringAttribute(CMManagerShim::CmName), + mDestinationId, + apProtected, + bearerPlugin); + + // Add name to item + iapDataItem->setContentWidgetData( + QString("text"), + apList[i]->getStringAttribute(CMManagerShim::CmName)); + + // Add priority to item if not Uncategorised "Destination" + if (mDestinationId != 0) { + // Access Points are listed in priority order. + QString priority = hbTrId("txt_occ_dblist_val_priority_l1", i); + iapDataItem->setContentWidgetData(QString("additionalText"), priority); + } + + // Set item disabled if it is protected + if (apProtected) { + iapDataItem->setContentWidgetData(QString("enabled"), false); + } + + // Add to model + model->appendDataFormItem(iapDataItem); + + // Save and make connections + mAps->append(iapDataItem); + bool connected + = connect(iapDataItem, SIGNAL(iapChanged()), this, SLOT(updateDestinationView())); + Q_ASSERT(connected); + } + + itemDataHelper->bindToForm(form); + delete itemDataHelper; + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_CONSTRUCTSETTINGVIEW_EXIT); +} + +/*! + Rebuilds view with access points after access points have changed. + */ +void CpDestinationEntryItemData::updateDestinationView() +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_UPDATEDESTINATIONVIEW_ENTRY); + HbDataForm *form = static_cast(model()->parent()); + HbMainWindow *mainWnd = form->mainWindow(); + + if (mainWnd) { + HbView *view = mainWnd->currentView(); + CpBaseSettingView *cpView = static_cast(view); + constructSettingView(cpView); + + // Remove Toolbar if necessary + if (mDestinationId != 0 && mAps->count() <= 1) { + HbToolBar *tb = view->toolBar(); + tb->clearActions(); + } + } + OstTrace0(TRACE_NORMAL, CPDESTINATIONENTRYITEMDATA_UPDATEDESTINATIONVIEW, "CpDestinationEntryItemData::updateDestinationView: Emit destination changed"); + emit destChanged(); + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_UPDATEDESTINATIONVIEW_EXIT); +} + +/*! + Prompts user for action after long tap. Choices for actions are "Rename" and "Delete". + + @param[in] position The item specific menu is shown in given position. + */ +void CpDestinationEntryItemData::showItemMenu(QPointF position) +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_SHOWITEMMENU_ENTRY); + if (mDestinationId != 0) { + CmDestinationShim *destination = NULL; + CMManagerShim::CmmProtectionLevel protLvl = CMManagerShim::ProtLevel1; + + try { + destination = mCmm->destination(mDestinationId); + protLvl = destination->protectionLevel(); + delete destination; + } catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, CPDESTINATIONENTRYITEMDATA_SHOWITEMMENU, "CpDestinationEntryItemData::showItemMenu: Exception caught"); + if (destination != NULL) { + delete destination; + } + } + + HbMenu *menu = createItemMenu(protLvl, position); + menu->show(); + } + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_SHOWITEMMENU_EXIT); +} + +/*! + Prompts user for new destination name and makes + the change in commsdat if new name is valid. + + \sa isDestinationNameValid() + */ +void CpDestinationEntryItemData::renameDestination() +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_RENAMEDESTINATION_ENTRY); + mDialog = new HbInputDialog(); + mDialog->setAttribute(Qt::WA_DeleteOnClose); + mDialog->lineEdit()->setMaxLength(DestinationNameMaxLength); + mDialog->clearActions(); + mDialog->setPromptText(hbTrId("txt_occ_dialog_destination_name")); + mDialog->setInputMode(HbInputDialog::TextInput); + mOkAction = new HbAction(hbTrId("txt_common_button_ok")); + bool connected = connect(mOkAction, + SIGNAL(triggered()), + this, + SLOT(saveNewDestinationName())); + Q_ASSERT(connected); + HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel")); + mDialog->addAction(mOkAction); + mDialog->addAction(cancelAction); + mDialog->show(); + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_RENAMEDESTINATION_EXIT); +} + +/*! + Shows confirmation query for user before deleteting destination. + \sa deleteDestination() + */ +void CpDestinationEntryItemData::confirmDestinationDelete() +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_CONFIRMDESTINATIONDELETE_ENTRY); + HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeQuestion); + note->setAttribute(Qt::WA_DeleteOnClose); + note->setText(hbTrId("txt_occ_info_delete_snap").arg(mDestinationName)); + note->clearActions(); + HbAction *okAction = new HbAction(hbTrId("txt_common_button_yes")); + note->addAction(okAction); + bool connected = connect( + okAction, + SIGNAL(triggered()), + this, + SLOT(deleteDestination())); + Q_ASSERT(connected); + HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_no")); + note->addAction(cancelAction); + note->setTimeout(HbPopup::NoTimeout); + note->show(); + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_CONFIRMDESTINATIONDELETE_EXIT); +} + +/*! + Destination is deleted after user chooses "OK" from destination deletion + confirmation query. + \sa confirmDestinationDelete() + */ +void CpDestinationEntryItemData::deleteDestination() +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_DELETEDESTINATION_ENTRY); + CmDestinationShim *destination = NULL; + CmConnectionMethodShim *cm = NULL; + try { + destination = mCmm->destination(mDestinationId); + int cmCount = destination->connectionMethodCount(); + while (cmCount > 0) { + cm = destination->connectionMethod(0); + destination->removeConnectionMethod(cm); + cmCount--; + delete cm; + cm = NULL; + } + destination->update(); + destination->deleteDestination(); + CpDestinationGroup *parent + = static_cast(HbDataFormModelItem::parent()); + parent->deleteDestination(mDestinationId); + delete destination; + } catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, CPDESTINATIONENTRYITEMDATA_DELETEDESTINATION, "CpDestinationEntryItemData::deleteDestination: Exception caught"); + if (destination != NULL) { + delete destination; + } + if (cm != NULL) { + delete cm; + } + showErrorNote(hbTrId("txt_occ_info_unable_to_save_setting")); + } + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_DELETEDESTINATION_EXIT); +} + +/*! + Creates new view where access point priorities can + be changed by dragging and dropping and shows it to user. + */ +void CpDestinationEntryItemData::activateArrangeMode() +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_ACTIVATEARRANGEMODE_ENTRY); + mList = new HbListWidget(); + HbDataForm *form = static_cast(model()->parent()); + HbMainWindow *mainWnd = form->mainWindow(); + HbView *view = new HbView(); + createArrangeModeView(view); + + if (mainWnd && view) { + mPreView = mainWnd->currentView(); + mainWnd->addView(view); + mainWnd->setCurrentView(view, false); + HbAction *arrangeViewBackAction = new HbAction(Hb::BackAction, view); + bool connected = connect( + arrangeViewBackAction, + SIGNAL(triggered()), + this, + SLOT(viewCancel())); + Q_ASSERT(connected); + view->setNavigationAction(arrangeViewBackAction); + } + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_ACTIVATEARRANGEMODE_EXIT); +} + +/*! + This function is called when user returns from arrange mode with + toolbar command "Done" thus accapting the changes. New priorities + are saved to commsdat according to order of the items in the previous view. + */ +void CpDestinationEntryItemData::viewDone() +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_VIEWDONE_ENTRY); + try { + // Arrange items + CmDestinationShim *destination = mCmm->destination(mDestinationId); + for (int i = 0; i < mList->count(); i++) { + int apId = mList->item(i)->data(Hb::IndexFeedbackRole).toInt(); + CmConnectionMethodShim *cm = mCmm->connectionMethod(apId); + destination->modifyPriority(cm,i); + delete cm; + } + destination->update(); + delete destination; + } catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, CPDESTINATIONENTRYITEMDATA_VIEWDONE, "CpDestinationEntryItemData::viewDone: Exception caught"); + viewCancel(); + showErrorNote(QString("txt_occ_info_unable_to_save_setting")); + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_VIEWDONE_EXIT); + return; + } + + HbDataForm *form = static_cast(model()->parent()); + HbMainWindow *mainWnd = form->mainWindow(); + HbView* view = mainWnd->currentView(); + + if (mainWnd && view) { + //restore previous status + mainWnd->removeView(view); + mainWnd->setCurrentView(mPreView); + mPreView = NULL; + } + updateDestinationView(); + OstTraceFunctionExit0(DUP1_CPDESTINATIONENTRYITEMDATA_VIEWDONE_EXIT); +} + +/*! + User returns from view without accepting the changes to priorities. + */ +void CpDestinationEntryItemData::viewCancel() +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_VIEWCANCEL_ENTRY); + HbDataForm *form = static_cast(model()->parent()); + HbMainWindow *mainWnd = form->mainWindow(); + HbView* view = mainWnd->currentView(); + + if (mainWnd && view) { + //restore previous status + mainWnd->removeView(view); + view->deleteLater(); + mainWnd->setCurrentView(mPreView); + mPreView = NULL; + } + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_VIEWCANCEL_EXIT); +} + +/*! + This function updates access points priorities shown in UI + when user is in arrange mode. + + @param[in] widgetItem Unused. + + \sa activateArrangeMode() + */ +void CpDestinationEntryItemData::updateIndex(HbListWidgetItem *widgetItem) +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_UPDATEINDEX_ENTRY); + Q_UNUSED(widgetItem); + for (int i = 0; i < mList->count(); i++) { + HbListWidgetItem *item = mList->item(i); + QString priority = hbTrId("txt_occ_dblist_val_priority_l1", i); + item->setSecondaryText(priority); + } + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_UPDATEINDEX_EXIT); +} + +/*! + This function searches all connection methods from commsdat that are + connected to this destination item. Connection methods are returned in + apList reference parameter. + + @param[out] apList Constains list of this destination's accesspoints. + @param[in] cmm Pointer to CmManagerShim instance to avoid multiple session openings. + */ +void CpDestinationEntryItemData::fetchReferencedAps( + QList > &apList, + const CmManagerShim *cmm) const +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_FETCHREFERENCEDAPS_ENTRY); + CmDestinationShim *destination = NULL; + try { + if (mDestinationId == 0) { + QList apIds; + cmm->connectionMethod(apIds); + for (int i = 0; i < apIds.count(); i++) { + CmConnectionMethodShim *cm; + cm = cmm->connectionMethod(apIds.at(i)); + apList.append(QSharedPointer(cm)); + } + } else { + destination = cmm->destination(mDestinationId); + int apCount = destination->connectionMethodCount(); + for (int i = 0; i < apCount; i++) { + CmConnectionMethodShim *cm = NULL; + cm = destination->connectionMethod(i); + apList.append(QSharedPointer(cm)); + } + delete destination; + } + } catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, CPDESTINATIONENTRYITEMDATA_FETCHREFERENCEDAPS, "CpDestinationEntryItemData::fetchReferencedAps: Exception caught"); + if (destination != NULL) { + delete destination; + } + } + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_FETCHREFERENCEDAPS_EXIT); +} + +/*! + Function for checking if the given destination name is valid. Duplicate and + and empty names are rejected. + + @param[out] destination Constains the destination name to be validated. If name + is valid it remains unchanged. If the given name is invalid, appropriate + error text is set the variable. + @param[in] cmm Pointer to CmManagerShim instance to avoid multiple session openings. + + \return true if name is valid. + */ +bool CpDestinationEntryItemData::isDestinationNameValid( + QString &destination, + const CmManagerShim *cmm) +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_ISDESTINATIONNAMEVALID_ENTRY); + bool retVal = true; + + if (destination.length() > 0) { + QList destinationList; + cmm->allDestinations(destinationList); + + for (int i = 0; i < destinationList.count(); i ++) { + CmDestinationShim *dest = cmm->destination(destinationList[i]); + if (0 == destination.compare(dest->name())) { + destination = hbTrId("txt_occ_info_name_already_in_use"); + retVal = false; + break; + } + delete dest; + } + } else { + destination = hbTrId("txt_occ_info_invalid_name"); + retVal = false; + } + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_ISDESTINATIONNAMEVALID_EXIT); + return retVal; +} + +/*! + Worker function for activateArrangeMode(). Adds list of access points + to given view. + + @param[out] view Target view where the arrange mode is constructed. + + \sa activateArrangeMode() + */ +void CpDestinationEntryItemData::createArrangeModeView(HbView *view) +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_CREATEARRANGEMODEVIEW_ENTRY); + QList > apList; + fetchReferencedAps(apList, mCmm); + CmDestinationShim *destination = NULL; + + try { + destination = mCmm->destination(mDestinationId); + for (int i = 0; i < apList.count(); i++) { + HbListWidgetItem *item = new HbListWidgetItem(); + item->setText(apList[i]->getStringAttribute(CMManagerShim::CmName)); + item->setData(apList[i]->getIntAttribute(CMManagerShim::CmId), Hb::IndexFeedbackRole); + + uint pri = destination->priority(apList[i].data()); + QString priority = hbTrId("txt_occ_dblist_val_priority_l1", pri); + item->setSecondaryText(priority); + + mList->addItem(item); + } + mList->setArrangeMode(true); + view->setWidget(mList); + + // Toolbar + HbToolBar *tb = view->toolBar(); + HbAction *doneAction = tb->addAction(hbTrId("txt_common_button_ok")); + bool connected = connect( + doneAction, + SIGNAL(triggered()), + this, + SLOT(viewDone())); + Q_ASSERT(connected); + delete destination; + } catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, CPDESTINATIONENTRYITEMDATA_CREATEARRANGEMODEVIEW, "CpDestinationEntryItemData::createArrangeModeView: Exception caught"); + // return empty view + if (destination != NULL) { + delete destination; + } + while (mList->count() > 0) { + HbListWidgetItem *item = mList->item(0); + delete item; + } + mList->clear(); + } + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_CREATEARRANGEMODEVIEW_EXIT); +} + +/*! + Helper function for creating item specific menu. + + @param[in] protLvl Effective protection level for this + access point. + */ +HbMenu *CpDestinationEntryItemData::createItemMenu( + CMManagerShim::CmmProtectionLevel protLvl, + const QPointF position) +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_CREATEITEMMENU_ENTRY); + HbMenu *menu = new HbMenu(); + menu->setAttribute(Qt::WA_DeleteOnClose); + HbAction *renameDestAction = menu->addAction(hbTrId("txt_common_menu_rename_item")); + bool connected = + connect(renameDestAction, SIGNAL(triggered()), this, SLOT(renameDestination())); + Q_ASSERT(connected); + HbAction *deleteDestAction = menu->addAction(hbTrId("txt_common_menu_delete")); + connected = + connect(deleteDestAction, SIGNAL(triggered()), this, SLOT(confirmDestinationDelete())); + Q_ASSERT(connected); + + if (protLvl == CMManagerShim::ProtLevel1 + || protLvl == CMManagerShim::ProtLevel2 ) { + + // Disable operations for protected destinations + renameDestAction->setDisabled(true); + deleteDestAction->setDisabled(true); + } + + menu->setModal(true); + menu->setPreferredPos(position); + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_CREATEITEMMENU_EXIT); + return menu; +} + +/*! + This function is called when user selects OK from destination + name query popup. The given name is valited and if the name is + valid, new destination is created in commsdat with given name. + If validation fails user is promted again for destination name. + */ +void CpDestinationEntryItemData::saveNewDestinationName() +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_SAVENEWDESTINATIONNAME_ENTRY); + QString destinationName = mDialog->value().toString(); + bool destinationNameInvalid = true; + CmManagerShim *cmm = NULL; + CmDestinationShim *destination = NULL; + + try { + cmm = new CmManagerShim(); + if (isDestinationNameValid(destinationName, cmm)) { + cmm = new CmManagerShim(); + cmm->destination(mDestinationId)->setName(destinationName); + mDestinationName = destinationName; + destinationNameInvalid = false; + } + } catch (const std::exception&) { + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_SAVENEWDESTINATIONNAME_EXIT); + return; + } + delete destination; + delete cmm; + + if (destinationNameInvalid) { + // Validation function has modified destination name + // to be error string + showRenameError(destinationName); + } else { + OstTrace0(TRACE_NORMAL, CPDESTINATIONENTRYITEMDATA_SAVENEWDESTINATIONNAME, "CpDestinationEntryItemData::saveNewDestinationName: emit destination changed"); + emit destChanged(); + } + OstTraceFunctionExit0(DUP1_CPDESTINATIONENTRYITEMDATA_SAVENEWDESTINATIONNAME_EXIT); +} + +/*! + * Helper function for showing error note when user inputs + * invalid destination name. + */ +void CpDestinationEntryItemData::showRenameError(const QString &info) +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_SHOWRENAMEERROR_ENTRY); + // Destination name NOK. Inform user and ask again. + HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeInformation); + note->clearActions(); + note->setAttribute(Qt::WA_DeleteOnClose); + note->setText(info); + note->setTimeout(HbPopup::NoTimeout); + HbAction *errorOk = new HbAction(hbTrId("txt_common_button_ok")); + bool connected = connect( + errorOk, + SIGNAL(triggered()), + this, + SLOT(renameDestination())); + Q_ASSERT(connected); + note->addAction(errorOk); + note->show(); + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_SHOWRENAMEERROR_EXIT); +} + +/*! + Helper function for showing error notes. + + @param[in] info Info string to be shown in note. + */ +void CpDestinationEntryItemData::showErrorNote(const QString &info) +{ + OstTraceFunctionEntry0(CPDESTINATIONENTRYITEMDATA_SHOWERRORNOTE_ENTRY); + HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeInformation); + note->clearActions(); + note->setAttribute(Qt::WA_DeleteOnClose); + note->setText(info); + note->setTimeout(HbPopup::NoTimeout); + HbAction *errorOk = new HbAction(hbTrId("txt_common_button_ok")); + note->addAction(errorOk); + note->show(); + OstTraceFunctionExit0(CPDESTINATIONENTRYITEMDATA_SHOWERRORNOTE_EXIT); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/src/cpdestinationgroup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/src/cpdestinationgroup.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,345 @@ +/* +* 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: +* CpDestinationGroup contains all destination UI items as well as +* items for uncategorized access points and adding new destinations. +*/ + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// User includes +#include "cpdestinationgroup.h" +#include "cpdestinationentryitem.h" +#include "cpadddestinationentryitemdata.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cpdestinationgroupTraces.h" +#endif + +/*! + \class CpDestinationGroup + \brief This class contains all data items representing destinations + in commsdat. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + + Constructor. + + @param[in] itemDataHelper Helper for connecting signals and slots. + */ +CpDestinationGroup::CpDestinationGroup(CpItemDataHelper &itemDataHelper) : + CpSettingFormItemData(HbDataFormModelItem::GroupItem, + hbTrId("txt_occ_subhead_destinations_access_points")), + mItemDataHelper(&itemDataHelper), + mUncategorisedShown(false) +{ + OstTraceFunctionEntry0(CPDESTINATIONGROUP_CPDESTINATIONGROUP_ENTRY); + mCmManager = new CmManagerShim(); + mBearerPlugins = new QList(); + this->loadBearerPlugins(); + + QList > destinationList; + fetchDestinations(destinationList); + + // Create Destination list + for (int i = 0; i < destinationList.count(); i++) { + QString iapCount = + getDestinationAdditionalText(destinationList.at(i)->connectionMethodCount()); + + // Create new destination entry + CpDestinationEntryItemData *destDataItem; + destDataItem = new CpDestinationEntryItemData(itemDataHelper); + destDataItem->setContentWidgetData(QString("text"), destinationList.at(i)->name()); + destDataItem->setContentWidgetData(QString("additionalText"),iapCount); + destDataItem->setDestinationId(destinationList.at(i)->id()); + destDataItem->setDestinationName(destinationList.at(i)->name()); + bool connected = connect(destDataItem, + SIGNAL(destChanged()), + this, + SLOT(updateDestinationInformation())); + Q_ASSERT(connected); + this->appendChild(destDataItem); + } + + // Add "Uncategorised Iaps" button + createUncategorisedDestination(); + + // "Add Destination" button + CpSettingFormEntryItemData *addDest = new CpAddDestinationEntryItemData(itemDataHelper, this); + addDest->setContentWidgetData(QString("text"), hbTrId("txt_occ_button_add_destination")); + this->appendChild(addDest); + OstTraceFunctionExit0(CPDESTINATIONGROUP_CPDESTINATIONGROUP_EXIT); +} + +/*! + Destructor + */ +CpDestinationGroup::~CpDestinationGroup() +{ + OstTraceFunctionEntry0(DUP1_CPDESTINATIONGROUP_CPDESTINATIONGROUP_ENTRY); + delete mBearerPlugins; + delete mCmManager; + OstTraceFunctionExit0(DUP1_CPDESTINATIONGROUP_CPDESTINATIONGROUP_EXIT); +} + +/*! + addDestination() creates new destination item to Destinations group item. + The new destination is shown in the UI immediately. + */ +void CpDestinationGroup::addDestination(const QString &dest, int destId) +{ + OstTraceFunctionEntry0(CPDESTINATIONGROUP_ADDDESTINATION_ENTRY); + QString iapCount = getDestinationAdditionalText(0); + + // Create UI item for new destination + CpDestinationEntryItemData *destDataItem; + destDataItem = new CpDestinationEntryItemData(*mItemDataHelper); + destDataItem->setContentWidgetData(QString("text"), dest); + destDataItem->setContentWidgetData(QString("additionalText"), iapCount); + destDataItem->setDestinationId(destId); + destDataItem->setDestinationName(dest); + connect(destDataItem, SIGNAL(destChanged()), this, SLOT(updateDestinationInformation())); + + // Use ItemDataHelper to make connections + QObject* form = this->model()->parent(); + mItemDataHelper->bindToForm(static_cast(form)); + + // Insert Child to correct position + QList > destinationList; + fetchDestinations(destinationList); + insertChild(destinationList.count() - 1, destDataItem); + OstTraceFunctionExit0(CPDESTINATIONGROUP_ADDDESTINATION_EXIT); +} + +/*! + Deletes destination from commsdat and removes it from UI. + */ +void CpDestinationGroup::deleteDestination(int destId) +{ + OstTraceFunctionEntry0(CPDESTINATIONGROUP_DELETEDESTINATION_ENTRY); + // "Add Destination" child is removed from count (childCount() -1) + for (int i = 0; i < this->childCount() - 1; i++) { + CpDestinationEntryItemData *destDataItem = + static_cast(this->childAt(i)); + + if (destDataItem->destinationId() == destId) { + int index = this->indexOf(destDataItem); + this->removeChild(index); + + if (!mUncategorisedShown) { + // Return "Uncategorised" item to UI if necessary + createUncategorisedDestination(); + } + } + } + OstTraceFunctionExit0(CPDESTINATIONGROUP_DELETEDESTINATION_EXIT); +} + +/*! + Finds correct access point settings implementation according to + access point bearer type. + + \return Returns pointer to CpBearerApPluginInterface which implements + access point settins. + */ +CpBearerApPluginInterface *CpDestinationGroup::findBearerPlugin(int apId) +{ + OstTraceFunctionEntry0(CPDESTINATIONGROUP_FINDBEARERPLUGIN_ENTRY); + CpBearerApPluginInterface *retVal = NULL; + try { + CmConnectionMethodShim *cm = mCmManager->connectionMethod(apId); + int apBearerType = cm->getIntAttribute(CMManagerShim::CmBearerType); + + for (int i = 0; i < mBearerPlugins->count(); i++) { + if (mBearerPlugins->at(i)->bearerType() == apBearerType) { + retVal = mBearerPlugins->at(i); + break; + } + } + delete cm; + } + catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, CPDESTINATIONGROUP_FINDBEARERPLUGIN, "CpDestinationGroup::findBearerPlugin: Exception caught"); + // Let return value be NULL. + } + OstTraceFunctionExit0(CPDESTINATIONGROUP_FINDBEARERPLUGIN_EXIT); + return retVal; +} + +/*! + Updates all destination group items' destinations' information. + (Name and access point count) + */ +void CpDestinationGroup::updateDestinationInformation() +{ + OstTraceFunctionEntry0(CPDESTINATIONGROUP_UPDATEDESTINATIONINFORMATION_ENTRY); + int apCount = 0; + // "Add Destination" child is removed from count (childCount() -1) + for (int i = 0; i < childCount() - 1; i++) { + CpDestinationEntryItemData *destDataItem = + static_cast(this->childAt(i)); + + if (destDataItem->destinationId() == 0) { + // Uncategrised Iaps + QList apList; + mCmManager->connectionMethod(apList); + if (apList.count() == 0) { + // delete empty uncategorised IAPs destination + int index = this->indexOf(destDataItem); + this->removeChild(index); + mUncategorisedShown = false; + continue; + } + apCount = apList.count(); + } else { + CmDestinationShim *destination; + destination = mCmManager->destination(destDataItem->destinationId()); + apCount = destination->connectionMethodCount(); + delete destination; + } + + QString iapCount = getDestinationAdditionalText(apCount); + destDataItem->setContentWidgetData(QString("additionalText"), iapCount); + destDataItem->setContentWidgetData(QString("text"), destDataItem->destinationName()); + } + // Update UI + HbDataForm *form = static_cast(this->model()->parent()); + HbDataFormModel* model = static_cast(this->model()); + QModelIndex index = model->indexFromItem(this); + HbDataFormViewItem *viewItem = form->dataFormViewItem(index); + viewItem->setExpanded(false); + viewItem->setExpanded(true); + OstTraceFunctionExit0(CPDESTINATIONGROUP_UPDATEDESTINATIONINFORMATION_EXIT); +} + +/*! + Creates item for uncategorized access points to destination group item + if there is any. + */ +void CpDestinationGroup::createUncategorisedDestination() +{ + OstTraceFunctionEntry0(CPDESTINATIONGROUP_CREATEUNCATEGORISEDDESTINATION_ENTRY); + QList apList; + mCmManager->connectionMethod(apList); + if (apList.count() > 0) { + // Create new destination entry + CpDestinationEntryItemData *destDataItem; + destDataItem = new CpDestinationEntryItemData(*mItemDataHelper); + destDataItem->setContentWidgetData(QString("text"), hbTrId("txt_occ_dblist_uncategorized")); + QString iapCount = getDestinationAdditionalText(apList.count()); + destDataItem->setContentWidgetData(QString("additionalText"),iapCount); + destDataItem->setDestinationId(0); + destDataItem->setDestinationName(hbTrId("txt_occ_dblist_uncategorized")); + bool connected = connect( + destDataItem, + SIGNAL(destChanged()), + this, + SLOT(updateDestinationInformation())); + Q_ASSERT(connected); + QList > destinationList; + fetchDestinations(destinationList); + + insertChild(destinationList.count(), destDataItem); + mUncategorisedShown = true; + } + OstTraceFunctionExit0(CPDESTINATIONGROUP_CREATEUNCATEGORISEDDESTINATION_EXIT); +} + +/*! + Searches all destinations from commsdat. List of representing + CmDestinationShim * items returned on completion. + */ +void CpDestinationGroup::fetchDestinations( + QList > &destinationList) +{ + OstTraceFunctionEntry0(CPDESTINATIONGROUP_FETCHDESTINATIONS_ENTRY); + try { + QList destArray; + mCmManager->allDestinations(destArray); + + for (int i = 0; i < destArray.count(); i++) { + CmDestinationShim *destination; + destination = mCmManager->destination(destArray[i]); + if (!destination->isHidden()) { + destinationList.append(QSharedPointer(destination)); + } + } + } catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, CPDESTINATIONGROUP_FETCHDESTINATIONS, "CpDestinationGroup::fetchDestinations: exception caught, Reading destinations"); + } + OstTraceFunctionExit0(CPDESTINATIONGROUP_FETCHDESTINATIONS_EXIT); +} + +/*! + Searches all bearer plugins from fixed location and loads them. + + \sa findBearerPlugin() + */ +void CpDestinationGroup::loadBearerPlugins() +{ + OstTraceFunctionEntry0(CPDESTINATIONGROUP_LOADBEARERPLUGINS_ENTRY); + // Load bearer plugins + QDir pluginsDir("\\resource\\qt\\plugins\\controlpanel\\bearerap"); + foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { + + QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); + CpBearerApPluginInterface *plugin = + qobject_cast(loader.instance()); + if (plugin) { + mBearerPlugins->append(plugin); + } + } + OstTraceFunctionExit0(CPDESTINATIONGROUP_LOADBEARERPLUGINS_EXIT); +} + +/*! + Helper function to be used in localisation. + + \return Returns correct localized QString according to access point count. + */ +QString CpDestinationGroup::getDestinationAdditionalText(int iapCount) +{ + OstTraceFunctionEntry0(CPDESTINATIONGROUP_GETDESTINATIONADDITIONALTEXT_ENTRY); + QString result = ""; + if (iapCount > 0) { + result = hbTrId("txt_occ_dblist_internet_val_ln_access_points", iapCount); + } else { + result = hbTrId("txt_occ_dblist_internet_val_no_access_points"); + } + OstTrace0(TRACE_FLOW, CPDESTINATIONGROUP_GETDESTINATIONADDITIONALTEXT_EXIT, "Exit"); + return result; +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/src/cpdestinationplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/src/cpdestinationplugin.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,86 @@ +/* +* 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: +* Control Panel plugin for showing destinations and access points +* settings. +*/ + +// System includes +#include +#include +#include + +// User includes +#include "cpdestinationplugin.h" +#include "cpdestinationgroup.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cpdestinationpluginTraces.h" +#endif +/*! + \class CpDestinationPlugin + \brief This class is a Control Panel plugin for accessing + destination and access point settings. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. + */ +CpDestinationPlugin::CpDestinationPlugin() +{ + OstTraceFunctionEntry0(CPDESTINATIONPLUGIN_CPDESTINATIONPLUGIN_ENTRY); + // Install localization + QString lang = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + mTranslator = new QTranslator(this); + mTranslator->load(path + "cpdestinationplugin_" + lang); + qApp->installTranslator(mTranslator); + OstTraceFunctionExit0(CPDESTINATIONPLUGIN_CPDESTINATIONPLUGIN_EXIT); +} + +/*! + Destructor. + */ +CpDestinationPlugin::~CpDestinationPlugin() +{ + OstTraceFunctionEntry0(DUP1_CPDESTINATIONPLUGIN_CPDESTINATIONPLUGIN_ENTRY); + OstTraceFunctionExit0(DUP1_CPDESTINATIONPLUGIN_CPDESTINATIONPLUGIN_EXIT); +} + +/*! + Inherited member from CpPluginInterface. + + @param[in] itemDataHelper Helper for connecting signals and slots. + + \return Returns only one data item in QList. The item contains destination group item. + */ +QList CpDestinationPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const +{ + OstTraceFunctionEntry0(CPDESTINATIONPLUGIN_CREATESETTINGFORMITEMDATA_ENTRY); + QList settingFormData; + settingFormData.append(new CpDestinationGroup(itemDataHelper)); + + OstTraceFunctionExit0(CPDESTINATIONPLUGIN_CREATESETTINGFORMITEMDATA_EXIT); + return settingFormData; +} + +Q_EXPORT_PLUGIN2(cpdestinationplugin, CpDestinationPlugin); diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/src/cpiapitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/src/cpiapitem.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,527 @@ +/* +* 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: +* Data item for representing access points in UI. +*/ + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// User includes +#include "cpiapitem.h" +#include "cpdestinationentryitem.h" +#include "cpbearerapplugininterface.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cpiapitemTraces.h" +#endif +/*! + \class CpIapItem + \brief This class represents access point in data model. + It takes care of all access point related operations. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. + + @param[in] itemDataHelper Helper for connecting signals and slots. + @param[in] iapId Unique ID if the access point this object represents. + @param[in] iapName Name of the access point this object represents. + @param[in] destId Unique ID of the destination that contains reference to + the access point this object represents. + @param[in] bearerPlugin Pointer to the object that implements settings view + for this access point. + */ +CpIapItem::CpIapItem( + CpItemDataHelper &itemDataHelper, + int iapId, + const QString &iapName, + int destId, + bool apProtected, + CpBearerApPluginInterface *bearerPlugin) : + CpSettingFormEntryItemData(itemDataHelper), + mIapId(iapId), + mIapName(iapName), + mDestId(destId), + mProtected(apProtected), + mBearerPlugin(bearerPlugin), + mMoveOngoing(false), + mDialog(0), + mList(0) +{ + OstTraceFunctionEntry0(CPIAPITEM_CPIAPITEM_ENTRY); + try { + mCmm = new CmManagerShim(); + } catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, CPIAPITEM_CPIAPITEM, "CpIapItem::CpIapItem: Exception caught"); + mCmm = NULL; + } + + // Fix connections + itemDataHelper.removeConnection(this,SIGNAL(pressed()),this,SLOT(onLaunchView())); + itemDataHelper.addConnection( + this, + SIGNAL(longPress(QPointF)), + this, + SLOT(showItemMenu(QPointF))); + if (!apProtected) { + itemDataHelper.addConnection(this,SIGNAL(clicked()),this,SLOT(onLaunchView())); + } + OstTraceFunctionExit0(CPIAPITEM_CPIAPITEM_EXIT); +} + +/*! + Destructor + */ +CpIapItem::~CpIapItem() +{ + OstTraceFunctionEntry0(DUP1_CPIAPITEM_CPIAPITEM_ENTRY); + delete mCmm; + OstTraceFunctionExit0(DUP1_CPIAPITEM_CPIAPITEM_EXIT); +} + +/*! + \return Returns ID of this access point + */ +int CpIapItem::getIapId() const +{ + OstTraceFunctionEntry0(CPIAPITEM_GETIAPID_ENTRY); + OstTraceFunctionExit0(CPIAPITEM_GETIAPID_EXIT); + return mIapId; +} + +/*! + Shows user the item specific menu. The menu is triggered by long pressing + the access point item. + + @param[in] position Preferred position for the item specific menu. + */ +void CpIapItem::showItemMenu(QPointF position) +{ + OstTraceFunctionEntry0(CPIAPITEM_SHOWITEMMENU_ENTRY); + if (isCmManagerAvailable()) { + bool settingsReadSuccessful = true; + CMManagerShim::CmmProtectionLevel protLvl; + try { + if (mDestId == 0) { + protLvl = CMManagerShim::ProtLevel0; + } else { + CmDestinationShim *destination = mCmm->destination(mDestId); + protLvl = destination->protectionLevel(); + delete destination; + } + } + catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, CPIAPITEM_SHOWITEMMENU, "CpIapItem::showItemMenu: Exception caught"); + settingsReadSuccessful = false; + } + if (settingsReadSuccessful) { + // Settings could be read from commsdat: show menu. + createItemMenu(protLvl, position)->show(); + } + } + OstTraceFunctionExit0(CPIAPITEM_SHOWITEMMENU_EXIT); +} + +/*! + Prompts user for destination where access point is to be + added and then makes the move in commsdat. + */ +void CpIapItem::moveIap() +{ + OstTraceFunctionEntry0(CPIAPITEM_MOVEIAP_ENTRY); + mMoveOngoing = true; + queryDestination(); + OstTraceFunctionExit0(CPIAPITEM_MOVEIAP_EXIT); +} + +/*! + Shows confirmation query for access point deletion. + */ +void CpIapItem::showDeleteConfirmation() +{ + OstTraceFunctionEntry0(CPIAPITEM_SHOWDELETECONFIRMATION_ENTRY); + HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeQuestion); + note->clearActions(); + note->setAttribute(Qt::WA_DeleteOnClose); + note->setText(hbTrId("txt_occ_info_delete_access_point_1").arg(mIapName)); + HbAction *primaryAction = new HbAction(hbTrId("txt_common_button_yes")); + bool connected = connect( + primaryAction, + SIGNAL(triggered()), + this, + SLOT(deleteConfirmed())); + Q_ASSERT(connected); + note->addAction(primaryAction); + note->addAction(new HbAction(hbTrId("txt_common_button_no"))); + note->setTimeout(HbPopup::NoTimeout); + note->show(); + OstTraceFunctionExit0(CPIAPITEM_SHOWDELETECONFIRMATION_EXIT); +} + +/*! + Prompts user for target destination and then adds access point + that this object represents to the prompted destination. + */ +void CpIapItem::shareIap() +{ + OstTraceFunctionEntry0(CPIAPITEM_SHAREIAP_ENTRY); + mMoveOngoing = false; + queryDestination(); + OstTraceFunctionExit0(CPIAPITEM_SHAREIAP_EXIT); +} + +/*! + Completes either saving or sharing of access point by + making the move in commsdat. + */ +void CpIapItem::queryDialogClosed() +{ + OstTraceFunctionEntry0(CPIAPITEM_QUERYDIALOGCLOSED_ENTRY); + if (mMoveOngoing) { + saveMove(mDestinationList[mList->selected()]); + } else { + saveShare(mDestinationList[mList->selected()]); + } + OstTraceFunctionExit0(CPIAPITEM_QUERYDIALOGCLOSED_EXIT); +} + +/*! + Completes the deletion process by deleting access point from + commsdat. + */ +void CpIapItem::deleteConfirmed() +{ + OstTraceFunctionEntry0(CPIAPITEM_DELETECONFIRMED_ENTRY); + bool deleteSuccessful = true; + try { + if (mDestId != 0) { + CmDestinationShim *destination = mCmm->destination(mDestId); + CmConnectionMethodShim *cm = destination->connectionMethodByID(mIapId); + destination->deleteConnectionMethod(cm); + destination->update(); + delete destination; + } else { + CmConnectionMethodShim *cm = mCmm->connectionMethod(mIapId); + cm->deleteConnectionMethod(); + delete cm; + } + } catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, DUP1_CPIAPITEM_DELETECONFIRMED, "CpIapItem::deleteConfirmed: Exception caught"); + deleteSuccessful = false; + } + if (deleteSuccessful) { + HbDataForm *form = static_cast(model()->parent()); + QModelIndex index = static_cast(this->model())->indexFromItem(this); + HbDataFormViewItem *viewItem = form->dataFormViewItem(index); + viewItem->deleteLater(); + OstTrace0(TRACE_NORMAL, CPIAPITEM_DELETECONFIRMED, "CpIapItem::deleteConfirmed: Emit access point changed signal"); + emit iapChanged(); + } else { + showErrorNote(hbTrId("txt_occ_info_unable_to_save_setting")); + } + OstTraceFunctionExit0(CPIAPITEM_DELETECONFIRMED_EXIT); +} + +/*! + Updates access point item name when the item becomes visible. + */ +void CpIapItem::updateIap(const QModelIndex index) +{ + OstTrace0( TRACE_FLOW, CPIAPITEM_UPDATEIAP_ENTRY, "CpIapItem::updateIap entry" ); + Q_UNUSED(index); + try { + CmConnectionMethodShim *cm = mCmm->connectionMethod(mIapId); + this->setContentWidgetData("text", cm->getStringAttribute(CMManagerShim::CmName)); + delete cm; + } catch (const std::exception&) { + OstTrace0( TRACE_NORMAL, CPIAPITEM_UPDATEIAP, "CpIapItem::updateIap: exception caught, CM name reading failed" ); + } + // Disconnect because we need to do this only after returning + // from accees point settings view + HbDataForm *form = static_cast(model()->parent()); + disconnect( + form, + SIGNAL(itemShown(const QModelIndex)), + this, + SLOT(updateIap(const QModelIndex))); + OstTrace0( TRACE_FLOW, DUP1_CPIAPITEM_UPDATEIAP_EXIT, "CpIapItem::updateIap exit" ); +} + +/*! + Gets access point specific view from bearer plugin. + + \return Returns settings view containing access point settings. + */ +CpBaseSettingView *CpIapItem::createSettingView() const +{ + OstTraceFunctionEntry0(CPIAPITEM_CREATESETTINGVIEW_ENTRY); + CpBaseSettingView *view = NULL; + if (mBearerPlugin != NULL) { + HbDataForm *form = static_cast(model()->parent()); + bool connected = connect( + form, + SIGNAL(itemShown(const QModelIndex)), + this, + SLOT(updateIap(const QModelIndex))); + Q_ASSERT(connected); + view = mBearerPlugin->createSettingView(mIapId); + } + OstTraceFunctionExit0(CPIAPITEM_CREATESETTINGVIEW_EXIT); + return view; +} + +/*! + Prompts user for destination. + */ +void CpIapItem::queryDestination() +{ + OstTraceFunctionEntry0(CPIAPITEM_QUERYDESTINATION_ENTRY); + bool readingSuccessful = true; + QStringList destinations; + try { + mCmm->allDestinations(mDestinationList); + + for (int i = 0; i < mDestinationList.count(); i++) { + CmDestinationShim *destination = mCmm->destination(mDestinationList[i]); + if ((destination->id() != mDestId) + && !destination->isHidden()) { + + QString dest = destination->name(); + destinations.append(dest); + } else { + // Remove this destination from list to sync both lists + mDestinationList.removeAt(i); + i--; + } + delete destination; + } + } catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, CPIAPITEM_QUERYDESTINATION, "CpIapItem::queryDestination: exception caught"); + readingSuccessful = false; + } + + if (readingSuccessful) { + // Load DocML + bool ok = false; + HbDocumentLoader *loader = new HbDocumentLoader(); + loader->load(":/docml/cpdestinationplugindialogs.docml", &ok); + mDialog = qobject_cast(loader->findWidget("dialog")); + HbLabel *heading = qobject_cast(loader->findWidget("heading")); + heading->setPlainText(hbTrId("txt_occ_dialog_select_network_destination_to_be_ac")); + mList = qobject_cast(loader->findWidget("radioButtonList")); + mList->setItems(destinations); + mList->setSelected(0); + mOk = qobject_cast(loader->findObject("okAction")); + bool connected = connect(mOk, + SIGNAL(triggered()), + this, + SLOT(queryDialogClosed())); + Q_ASSERT(connected); + mDialog->show(); + delete loader; + } else { + OstTrace0(TRACE_NORMAL, DUP1_CPIAPITEM_QUERYDESTINATION, " CpIapItem::queryDestination: exception caught"); + showErrorNote(hbTrId("txt_occ_info_unable_to_read_settings")); + } + OstTraceFunctionExit0(CPIAPITEM_QUERYDESTINATION_EXIT); +} + +/*! + Shares access point to given destination. + + @param[in] id Target destination's ID + */ +void CpIapItem::saveShare(int id) +{ + OstTraceFunctionEntry0(CPIAPITEM_SAVESHARE_ENTRY); + try { + CmConnectionMethodShim *cm; + if (mDestId != 0) { + CmDestinationShim *source = mCmm->destination(mDestId); + cm = source->connectionMethodByID(mIapId); + delete source; + } else { + cm = mCmm->connectionMethod(mIapId); + } + CmDestinationShim *target = mCmm->destination(id); + target->addConnectionMethod(cm); + target->update(); + delete cm; + delete target; + OstTrace0(TRACE_NORMAL, CPIAPITEM_SAVESHARE, "CpIapItem::saveShare: Emit access point changed signal"); + emit iapChanged(); + } catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, DUP1_CPIAPITEM_SAVESHARE, "CpIapItem::saveShare: Exception caught"); + showErrorNote(hbTrId("txt_occ_info_unable_to_read_settings")); + } + OstTraceFunctionExit0(CPIAPITEM_SAVESHARE_EXIT); +} + +/*! + Moves access point from current destination to given destination. + + @param[in] id Target destination's ID + */ +void CpIapItem::saveMove(int id) +{ + OstTraceFunctionEntry0(CPIAPITEM_SAVEMOVE_ENTRY); + try { + // Make move in commsdat + CmConnectionMethodShim *cm = NULL; + if (mDestId != 0) { + CmDestinationShim *source = mCmm->destination(mDestId); + cm = source->connectionMethodByID(mIapId); + source->removeConnectionMethod(cm); + source->update(); + delete source; + } else { + cm = mCmm->connectionMethod(mIapId); + } + CmDestinationShim *target = mCmm->destination(id); + target->addConnectionMethod(cm); + target->update(); + delete target; + delete cm; + } + catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, DUP1_CPIAPITEM_SAVEMOVE, "CpIapItem::saveMove: Exception caught"); + showErrorNote(hbTrId("txt_occ_info_unable_to_save_setting")); + } + OstTrace0(TRACE_NORMAL, CPIAPITEM_SAVEMOVE, "CpIapItem::saveMove: Emit access point changed signal"); + emit iapChanged(); + OstTraceFunctionExit0(CPIAPITEM_SAVEMOVE_EXIT); +} + +/*! + Tests if CmManagerShim has been created successfully + earlier. If not, it retries. + */ +bool CpIapItem::isCmManagerAvailable() +{ + OstTraceFunctionEntry0(CPIAPITEM_ISCMMANAGERAVAILABLE_ENTRY); + bool retval = false; + if (mCmm == NULL) { + try { + mCmm = new CmManagerShim(); + retval = true; + } + catch (const std::exception&) { + OstTrace0(TRACE_NORMAL, CPIAPITEM_ISCMMANAGERAVAILABLE, "CpIapItem::isCmManagerAvailable: Exception caught"); + mCmm = NULL; + } + } else { + retval = true; + } + OstTraceFunctionExit0(CPIAPITEM_ISCMMANAGERAVAILABLE_EXIT); + return retval; +} + +/*! + Helper function for creating item specific menu. + + @param[in] protLvl Effective protection level for this + access point. + */ +HbMenu *CpIapItem::createItemMenu( + CMManagerShim::CmmProtectionLevel protLvl, + const QPointF &position) +{ + OstTraceFunctionEntry0(CPIAPITEM_CREATEITEMMENU_ENTRY); + HbMenu* menu = new HbMenu(); + menu->setAttribute(Qt::WA_DeleteOnClose); + HbAction* moveIapAction + = menu->addAction(hbTrId("txt_occ_menu_move_to_other_destination")); + bool connected = connect(moveIapAction, SIGNAL(triggered()), this, SLOT(moveIap())); + Q_ASSERT(connected); + HbAction* deleteIapAction + = menu->addAction(hbTrId("txt_common_menu_delete")); + connected = connect( + deleteIapAction, + SIGNAL(triggered()), + this, + SLOT(showDeleteConfirmation())); + Q_ASSERT(connected); + HbAction* shareIapAction + = menu->addAction(hbTrId("txt_occ_menu_share_to_other_destination")); + connected = connect(shareIapAction, SIGNAL(triggered()), this, SLOT(shareIap())); + Q_ASSERT(connected); + + if (protLvl == CMManagerShim::ProtLevel1) { + // Disable operations for protected destinations + moveIapAction->setDisabled(true); + deleteIapAction->setDisabled(true); + shareIapAction->setDisabled(true); + } else if (protLvl == CMManagerShim::ProtLevel3) { + // Disable operations for protected access points. + moveIapAction->setDisabled(mProtected); + deleteIapAction->setDisabled(mProtected); + shareIapAction->setDisabled(mProtected); + } + + // Can't share uncategorised APs + if (mDestId == 0) + { + shareIapAction->setDisabled(true); + } + + menu->setPreferredPos(position); + OstTraceFunctionExit0(CPIAPITEM_CREATEITEMMENU_EXIT); + return menu; +} + +/*! + Helper function for showing error notes. + + @param[in] info Info string to be shown in note. + */ +void CpIapItem::showErrorNote(const QString &info) +{ + OstTraceFunctionEntry0(CPIAPITEM_SHOWERRORNOTE_ENTRY); + HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeInformation); + note->clearActions(); + note->setAttribute(Qt::WA_DeleteOnClose); + note->setText(info); + note->setTimeout(HbPopup::NoTimeout); + HbAction *errorOk = new HbAction(hbTrId("txt_common_button_ok")); + note->addAction(errorOk); + note->show(); + OstTraceFunctionExit0(CPIAPITEM_SHOWERRORNOTE_EXIT); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpdestinationplugin/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpdestinationplugin/traces/OstTraceDefinitions.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,22 @@ +/* + * 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: + * OST trace header file. + * + */ + +#ifndef OSTTRACEDEFINITIONS_H +#define OSTTRACEDEFINITIONS_H +#include +#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpipsettingsplugin/cpipsettingsplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpipsettingsplugin/cpipsettingsplugin.pro Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,56 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = lib +TARGET = cpipsettingsplugin +DEPENDPATH += . +INCLUDEPATH += . ../inc ../../inc + +CONFIG += hb plugin + +MOC_DIR = moc +OBJECTS_DIR = obj +RCC_DIR = rcc + +LIBS += -lcpframework + +# Sources +HEADERS += inc/cpipsettingsplugin.h \ + inc/cpipsettingsview.h +SOURCES += src/cpipsettingsplugin.cpp \ + src/cpipsettingsview.cpp + +TRANSLATIONS = cpipsettingsplugin.ts + +symbian: +{ +TARGET.EPOCALLOWDLLDATA = 1 +TARGET.UID3 = 0x2002BC8F +TARGET.CAPABILITY = CAP_GENERAL_DLL + +deploy.path = C: +qtplugins.path = /resource/qt/plugins/controlpanel +qtplugins.sources += qmakepluginstubs/cpipsettingsplugin.qtplugin + +for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" + +BLD_INF_RULES.prj_exports += "rom/cpipsettingsplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cpipsettingsplugin.iby)" +BLD_INF_RULES.prj_exports += "rom/cpipsettingsplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(cpipsettingsplugin_resources.iby)" +} + +plugin.sources = cpipsettingsplugin.dll +plugin.path = \resource\qt\plugins\controlpanel +DEPLOYMENT += plugin diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpipsettingsplugin/inc/cpipsettingsplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpipsettingsplugin/inc/cpipsettingsplugin.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CPIPSETTINGSPLUGIN_H +#define CPIPSETTINGSPLUGIN_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class QTranslator; + +// External data types + +// Constants + +// Class declaration +class CpIpSettingsPlugin : public QObject, public CpPluginInterface +{ + Q_OBJECT + Q_INTERFACES(CpPluginInterface) + +public: + CpIpSettingsPlugin(); + ~CpIpSettingsPlugin(); + QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; + +signals: + +public slots: + +protected: + +protected slots: + +private: + +private slots: + +private: // data + QTranslator *mTranslator; +}; + +#endif // CPIPSETTINGSPLUGIN_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpipsettingsplugin/inc/cpipsettingsview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpipsettingsplugin/inc/cpipsettingsview.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,57 @@ +/* +* 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 CPIPSETTINGSVIEW_H +#define CPIPSETTINGSVIEW_H + +// System includes +#include + +// User includes + +// Forward declarations + +// External data types + +// Constants + +// Class declaration +class CpIpSettingsView : public CpBaseSettingView +{ + Q_OBJECT + +public: + CpIpSettingsView(QGraphicsItem *parent = 0); + ~CpIpSettingsView(); + +signals: + +public slots: + +protected: + +protected slots: + +private: + +private slots: + +public: // data + CpItemDataHelper *mItemDataHelper; +}; + +#endif // CPIPSETTINGSVIEW_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpipsettingsplugin/rom/cpipsettingsplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpipsettingsplugin/rom/cpipsettingsplugin.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,28 @@ +/* +* 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 __CPIPSETTINGSPLUGIN_IBY__ +#define __CPIPSETTINGSPLUGIN_IBY__ + +#include +#include + +file=ABI_DIR/BUILD_DIR/cpipsettingsplugin.dll SHARED_LIB_DIR/cpipsettingsplugin.dll + +data=/epoc32/data/c/resource/qt/plugins/controlpanel/cpipsettingsplugin.qtplugin resource/qt/plugins/controlpanel/cpipsettingsplugin.qtplugin + +#endif // __CPIPSETTINGSPLUGIN_IBY__ diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpipsettingsplugin/rom/cpipsettingsplugin_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpipsettingsplugin/rom/cpipsettingsplugin_resources.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,26 @@ +/* +* 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 __CPIPSETTINGSPLUGIN_RESOURCES_IBY__ +#define __CPIPSETTINGSPLUGIN_RESOURCES_IBY__ + +#include +#include + +data=DATAZ_/QT_TRANSLATIONS_DIR/cpipsettingsplugin.qm QT_TRANSLATIONS_DIR/cpipsettingsplugin.qm + +#endif // __CPIPSETTINGSPLUGIN_RESOURCES_IBY__ diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpipsettingsplugin/src/cpipsettingsplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpipsettingsplugin/src/cpipsettingsplugin.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,76 @@ +/* +* 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: +* +*/ + +// System includes +#include +#include +#include +#include + +// User includes +#include "cpipsettingsplugin.h" +#include "cpipsettingsview.h" + +/*! + \class CpIpSettingsPlugin + \brief Class implements the "Network Settings" entry item for + Control Panel. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. +*/ +CpIpSettingsPlugin::CpIpSettingsPlugin() +{ + // Install localization + QString lang = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + mTranslator = new QTranslator(this); + mTranslator->load(path + "cpipsettingsplugin_" + lang); + qApp->installTranslator(mTranslator); +} + +/*! + Destructor. +*/ +CpIpSettingsPlugin::~CpIpSettingsPlugin() +{ +} + +/*! + Creates and returns the entry item. +*/ +QList CpIpSettingsPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const +{ + QList settingFormData; + settingFormData.append(new CpSettingFormEntryItemDataImpl( + itemDataHelper, + hbTrId("txt_occ_dblist_network_settings"), + "", + HbIcon("qtg_large_network_settings"))); + return settingFormData; +} + +Q_EXPORT_PLUGIN2(cpipsettingsplugin, CpIpSettingsPlugin); diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpipsettingsplugin/src/cpipsettingsview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpipsettingsplugin/src/cpipsettingsview.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,93 @@ +/* +* 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: +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include + +// User includes +#include "cpipsettingsview.h" + +/*! + \class CpIpSettingsView + \brief Class implements the "Network Settings" Control Panel view. +*/ + +// External function prototypes + +// Local constants +static const QString ipSettingsPlugins[] = { + "cpwlansettingsplugin.qtplugin", + "cpdestinationplugin.qtplugin", + "cpvpnmanagementplugin.qtplugin", + "" // empty item terminates the list +}; + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. +*/ +CpIpSettingsView::CpIpSettingsView(QGraphicsItem *parent) : + CpBaseSettingView(0, parent) +{ + HbDataForm *form = settingForm(); + if (form) { + HbDataFormModelItem *modelItem; + CpPluginInterface *plugin = NULL; + QDir pluginsDir("\\resource\\qt\\plugins\\controlpanel"); + QPluginLoader pluginLoader; + + HbDataFormModel *model = new HbDataFormModel; + + mItemDataHelper = new CpItemDataHelper(); + mItemDataHelper->setParent(this); + + // Load listed child plugins + for (int i = 0; !ipSettingsPlugins[i].isEmpty(); i++) { + pluginLoader.setFileName(pluginsDir.absoluteFilePath(ipSettingsPlugins[i])); + plugin = qobject_cast(pluginLoader.instance()); + if (plugin) { + QList formDataItemList = + plugin->createSettingFormItemData(*mItemDataHelper); + for (int j = 0; j < formDataItemList.count(); j++) { + modelItem = formDataItemList.at(j); + if (modelItem) { + model->appendDataFormItem(modelItem); + } + } + } + } + + form->setModel(model); + model->setParent(form); + mItemDataHelper->bindToForm(form); + } +} + +/*! + Destructor. +*/ +CpIpSettingsView::~CpIpSettingsView() +{ +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/cppacketdataapplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/cppacketdataapplugin.pro Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,60 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# Project info file for Control Panel packet data AP plugin. +# + +TEMPLATE = lib +TARGET = cppacketdataapplugin +DEPENDPATH += . +INCLUDEPATH += . + +CONFIG += hb plugin + +MOC_DIR = moc +OBJECTS_DIR = obj +RCC_DIR = rcc + +LIBS += -lcpframework -lconnection_settings_shim + +# Sources +HEADERS += inc/cppacketdataapplugin.h \ + inc/cppacketdataapview.h \ + inc/cppacketdataapadvancedview.h \ + traces/OstTraceDefinitions.h +SOURCES += src/cppacketdataapplugin.cpp \ + src/cppacketdataapview.cpp \ + src/cppacketdataapadvancedview.cpp + +TRANSLATIONS = cpapplugin.ts + +symbian: +{ +TARGET.EPOCALLOWDLLDATA = 1 +TARGET.UID3 = 0x2002E694 +TARGET.CAPABILITY = CAP_GENERAL_DLL + +deploy.path = C: +qtplugins.path = /resource/qt/plugins/controlpanel/bearerap +qtplugins.sources += qmakepluginstubs/cppacketdataapplugin.qtplugin + +for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" + +BLD_INF_RULES.prj_exports += "rom/cppacketdataapplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cppacketdataapplugin.iby)" +BLD_INF_RULES.prj_exports += "rom/cppacketdataapplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(cppacketdataapplugin_resources.iby)" +} + +plugin.sources = cppacketdataapplugin.dll +plugin.path = /resource/qt/plugins/controlpanel/bearerap +DEPLOYMENT += plugin diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/inc/cppacketdataapadvancedview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/inc/cppacketdataapadvancedview.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Control Panel packet data AP advanced settings view header file. +* +*/ + +#ifndef CPPACKETDATAAPADVANCEDVIEW_H +#define CPPACKETDATAAPADVANCEDVIEW_H + +// System includes +#include + +// User includes + +// Forward declarations +class HbDataForm; +class HbDataFormModel; +class CmConnectionMethodShim; + +// External data types + +// Constants + +// Class declaration +class CpPacketDataApAdvancedView : public CpBaseSettingView +{ + Q_OBJECT + +public: + CpPacketDataApAdvancedView( + CmConnectionMethodShim *cmConnectionMethod, + QGraphicsItem *parent = 0); + ~CpPacketDataApAdvancedView(); + +signals: + +public slots: + +protected: + +protected slots: + +private: + void createAdvancedSettings(); + +private slots: + +private: // data + //! Dataform + HbDataForm *mForm; + //! Dataform model + HbDataFormModel *mModel; + //! Connection Settings Shim connection method pointer + CmConnectionMethodShim *mCmConnectionMethod; +}; + +#endif // CPPACKETDATAAPADVANCEDVIEW_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/inc/cppacketdataapplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/inc/cppacketdataapplugin.h Mon May 03 12:53:07 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: +* Control Panel packet data AP plugin header file. +* +*/ + +#ifndef CPPACKETDATAAPPLUGIN_H +#define CPPACKETDATAAPPLUGIN_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class QTranslator; +class CmManagerShim; +class CmConnectionMethodShim; + +// External data types + +// Constants + +// Class declaration +class CpPacketDataApPlugin : public QObject, public CpBearerApPluginInterface +{ + Q_OBJECT + Q_INTERFACES(CpBearerApPluginInterface) + +public: + CpPacketDataApPlugin(); + ~CpPacketDataApPlugin(); + + uint bearerType() const; + CpBaseSettingView *createSettingView(uint connectionMethod); + +signals: + +public slots: + +protected: + +protected slots: + +private: + +private slots: + +private: // data + //! Translator instance + QTranslator *mTranslator; + //! CM Manager Shim instance + CmManagerShim *mCmManager; + //! CM Connection Method Shim instance + CmConnectionMethodShim *mCmConnectionMethod; +}; + +#endif // CPPACKETDATAAPPLUGIN_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/inc/cppacketdataapview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/inc/cppacketdataapview.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,118 @@ +/* +* 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: +* Control Panel packet data AP settings view header file. +* +*/ + +#ifndef CPPACKETDATAAPVIEW_H +#define CPPACKETDATAAPVIEW_H + +// System includes +#include +#include +#include +#include + +// User includes + +// Forward declarations +class HbDataForm; +class HbDataFormModel; +class HbDataFormModelItem; +class HbMessageBox; +class CmConnectionMethodShim; +class CpPacketDataApPlugin; + +// External data types + +// Constants + +// Class declaration +class CpPacketDataApView : public CpBaseSettingView +{ + Q_OBJECT + +public: + CpPacketDataApView( + CmConnectionMethodShim *cmConnectionMethod, + QGraphicsItem *parent = 0); + ~CpPacketDataApView(); + +signals: + +public slots: + +protected: + +protected slots: + +private: + void createAccessPointSettingsGroup(); + void updateAccessPointSettingsGroup(); + void showMessageBox( + HbMessageBox::MessageBoxType type, + const QString &text); + bool tryUpdate(); + void handleUpdateError(); + +private slots: + void connectionNameChanged(); + void accessPointNameChanged(); + void userNameChanged(); + void promptForAuthChanged(int state); + void passwordChanged(); + void authenticationChanged(int index); + void homepageChanged(); + void menuActionTriggered(HbAction *action); + void restoreCurrentView(); + void setEditorPreferences(const QModelIndex modelIndex); + +private: // data + //! Dataform + HbDataForm *mForm; + //! Dataform model + HbDataFormModel *mModel; + //! "Access point settings" group + HbDataFormModelItem *mApSettingsGroupItem; + //! "Connection name" setting item + HbDataFormModelItem *mConnectionNameItem; + //! "Access point name" setting item + HbDataFormModelItem *mAccessPointNameItem; + //! "User name" setting item + HbDataFormModelItem *mUserNameItem; + //! "Prompt" setting item + HbDataFormModelItem *mPromptForAuthItem; + //! "Password" setting item + HbDataFormModelItem *mPasswordItem; + //! "Authentication" setting item + HbDataFormModelItem *mAuthenticationItem; + //! "Homepage" setting item + HbDataFormModelItem *mHomepageItem; + //! "Advanced settings" action for view menu + HbAction *mAdvancedSettingsAction; + //! Connection Settings Shim connection method pointer + CmConnectionMethodShim *mCmConnectionMethod; + //! Message box for info notes + QSharedPointer mMessageBox; + //! Maps checkbox value to CMManagerShim::PacketDataIFPromptForAuth value + QMap mPromptForAuthMap; + //! Maps authentication combobox index to CMManagerShim::PacketDataDisablePlainTextAuth value + QMap mAuthenticationMap; + + // Friend classes + friend class TestCpPacketDataApPlugin; +}; + +#endif // CPPACKETDATAAPVIEW_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/rom/cppacketdataapplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/rom/cppacketdataapplugin.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,28 @@ +/* +* 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: +* Control Panel packet data AP plugin iby file. +* +*/ + +#ifndef CPPACKETDATAAPPLUGIN_IBY +#define CPPACKETDATAAPPLUGIN_IBY + +#include + +file=ABI_DIR/BUILD_DIR/cppacketdataapplugin.dll SHARED_LIB_DIR/cppacketdataapplugin.dll + +data=/epoc32/data/c/resource/qt/plugins/controlpanel/bearerap/cppacketdataapplugin.qtplugin resource/qt/plugins/controlpanel/bearerap/cppacketdataapplugin.qtplugin + +#endif // CPPACKETDATAAPPLUGIN_IBY diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/rom/cppacketdataapplugin_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/rom/cppacketdataapplugin_resources.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,26 @@ +/* +* 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: +* Control Panel packet data AP plugin resources iby file. +* +*/ + +#ifndef CPPACKETDATAAPPLUGIN_RESOURCES_IBY +#define CPPACKETDATAAPPLUGIN_RESOURCES_IBY + +#include + +data=DATAZ_/QT_TRANSLATIONS_DIR/cpapplugin.qm QT_TRANSLATIONS_DIR/cpapplugin.qm + +#endif // CPPACKETDATAAPPLUGIN_RESOURCES_IBY diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/src/cppacketdataapadvancedview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/src/cppacketdataapadvancedview.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Control Panel packet data AP advanced settings view implementation. +* +*/ + +// System includes +#include +#include +#include +#include + +// User includes +#include "cppacketdataapadvancedview.h" + +/*! + \class CpPacketDataApAdvancedView + \brief Implements the advanced settings view for packet data bearer + access points. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. +*/ +CpPacketDataApAdvancedView::CpPacketDataApAdvancedView( + CmConnectionMethodShim *cmConnectionMethod, + QGraphicsItem *parent) : + CpBaseSettingView(0, parent), + mForm(0), + mModel(0), + mCmConnectionMethod(cmConnectionMethod) +{ + // Construct packet data AP settings UI + mForm = settingForm(); + if (mForm) { + mModel = new HbDataFormModel(mForm); + + // Add advanced settings groups + createAdvancedSettings(); + + mForm->setModel(mModel); + } +} + +/*! + Destructor. +*/ +CpPacketDataApAdvancedView::~CpPacketDataApAdvancedView() +{ +} + +/*! + Adds settings items to the model. +*/ +void CpPacketDataApAdvancedView::createAdvancedSettings() +{ + // TODO: Implement the advanced settings view. +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/src/cppacketdataapplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/src/cppacketdataapplugin.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Control Panel packet data AP plugin implementation. +* +*/ + +// System includes +#include +#include +#include +#include +#include + +// User includes +#include "cppacketdataapplugin.h" +#include "cppacketdataapview.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cppacketdataappluginTraces.h" +#endif + +/*! + \class CpPacketDataApPlugin + \brief Implements the packet data bearer AP (access point) Control Panel + plugin. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. +*/ +CpPacketDataApPlugin::CpPacketDataApPlugin() : + mTranslator(0), + mCmManager(0), + mCmConnectionMethod(0) +{ + OstTraceFunctionEntry0(CPPACKETDATAAPPLUGIN_CPPACKETDATAAPPLUGIN_ENTRY); + + // Install localization + QString lang = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + mTranslator = new QTranslator(this); + mTranslator->load(path + "cpapplugin_" + lang); + qApp->installTranslator(mTranslator); + + OstTraceFunctionExit0(CPPACKETDATAAPPLUGIN_CPPACKETDATAAPPLUGIN_EXIT); +} + +/*! + Destructor. +*/ +CpPacketDataApPlugin::~CpPacketDataApPlugin() +{ + OstTraceFunctionEntry0(DUP1_CPPACKETDATAAPPLUGIN_CPPACKETDATAAPPLUGIN_ENTRY); + + delete mCmConnectionMethod; + delete mCmManager; + + OstTraceFunctionExit0(DUP1_CPPACKETDATAAPPLUGIN_CPPACKETDATAAPPLUGIN_EXIT); +} + +/*! + Returns the bearer type handled by the plugin. +*/ +uint CpPacketDataApPlugin::bearerType() const +{ + OstTraceFunctionEntry0(CPPACKETDATAAPPLUGIN_BEARERTYPE_ENTRY); + + OstTraceFunctionExit0(CPPACKETDATAAPPLUGIN_BEARERTYPE_EXIT); + return CMManagerShim::BearerTypePacketData; +} + +/*! + Creates the packet data AP settings view. +*/ +CpBaseSettingView *CpPacketDataApPlugin::createSettingView( + uint connectionMethod) +{ + OstTraceFunctionEntry0(CPPACKETDATAAPPLUGIN_CREATESETTINGVIEW_ENTRY); + + // Find the connection method + try { + mCmManager = new CmManagerShim(); + mCmConnectionMethod = mCmManager->connectionMethod(connectionMethod); + } + catch (const std::exception&) { + // Error, don't create settings view, just return + OstTrace1( + TRACE_ERROR, + CPPACKETDATAAPPLUGIN_CREATESETTINGVIEW, + "Connection method loading failed;connectionMethod=%u", + connectionMethod); + + OstTraceFunctionExit0(DUP1_CPPACKETDATAAPPLUGIN_CREATESETTINGVIEW_EXIT); + return NULL; + } + + // Connection method found, create settings view + OstTraceFunctionExit0(CPPACKETDATAAPPLUGIN_CREATESETTINGVIEW_EXIT); + return new CpPacketDataApView(mCmConnectionMethod); +} + +Q_EXPORT_PLUGIN2(cppacketdataapplugin, CpPacketDataApPlugin); diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/src/cppacketdataapview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/src/cppacketdataapview.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,642 @@ +/* +* 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: +* Control Panel packet data AP settings view header file. +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// User includes +#include "cppacketdataapplugin.h" +#include "cppacketdataapview.h" +#include "cppacketdataapadvancedview.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cppacketdataapviewTraces.h" +#endif + +/*! + \class CpPacketDataApView + \brief Implements the settings view for packet data bearer access points. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. +*/ +CpPacketDataApView::CpPacketDataApView( + CmConnectionMethodShim *cmConnectionMethod, + QGraphicsItem *parent) : + CpBaseSettingView(0, parent), + mForm(0), + mModel(0), + mApSettingsGroupItem(0), + mConnectionNameItem(0), + mAccessPointNameItem(0), + mUserNameItem(0), + mPromptForAuthItem(0), + mPasswordItem(0), + mAuthenticationItem(0), + mHomepageItem(0), + mAdvancedSettingsAction(0), + mCmConnectionMethod(cmConnectionMethod), + mMessageBox(0) +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_CPPACKETDATAAPVIEW_ENTRY); + + HbMenu *menu = this->menu(); + mAdvancedSettingsAction = menu->addAction( + hbTrId("txt_occ_opt_advanced_settings")); + bool status = connect( + menu, + SIGNAL(triggered(HbAction*)), + this, + SLOT(menuActionTriggered(HbAction*))); + Q_ASSERT(status); + + // Construct packet data AP settings UI + mForm = settingForm(); + if (mForm) { + mModel = new HbDataFormModel(mForm); + + // Add access point settings group + createAccessPointSettingsGroup(); + + mForm->setModel(mModel); + + status = connect( + mForm, + SIGNAL(itemShown(const QModelIndex)), + this, + SLOT(setEditorPreferences(const QModelIndex))); + Q_ASSERT(status); + + // Expand Access point settings group + mForm->setExpanded(mModel->indexFromItem(mApSettingsGroupItem), true); + } + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_CPPACKETDATAAPVIEW_EXIT); +} + +/*! + Destructor. +*/ +CpPacketDataApView::~CpPacketDataApView() +{ + OstTraceFunctionEntry0(DUP1_CPPACKETDATAAPVIEW_CPPACKETDATAAPVIEW_ENTRY); + + OstTraceFunctionExit0(DUP1_CPPACKETDATAAPVIEW_CPPACKETDATAAPVIEW_EXIT); +} + +/*! + Adds settings group with all settings items to the model. +*/ +void CpPacketDataApView::createAccessPointSettingsGroup() +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_CREATEACCESSPOINTSETTINGSGROUP_ENTRY); + + // Access point settings group + mApSettingsGroupItem = new HbDataFormModelItem( + HbDataFormModelItem::GroupItem, + hbTrId("txt_occ_subhead_access_point_settings")); + mModel->appendDataFormItem(mApSettingsGroupItem); + + // Connection name + mConnectionNameItem = new CpSettingFormItemData( + HbDataFormModelItem::TextItem, + hbTrId("txt_occ_setlabel_connection_name")); + // Connect signal and add item to group + mForm->addConnection( + mConnectionNameItem, + SIGNAL(editingFinished()), + this, + SLOT(connectionNameChanged())); + mApSettingsGroupItem->appendChild(mConnectionNameItem); + + // Access point name + mAccessPointNameItem = new CpSettingFormItemData( + HbDataFormModelItem::TextItem, + hbTrId("txt_occ_setlabel_access_point_name")); + // Connect signal and add item to group + mForm->addConnection( + mAccessPointNameItem, + SIGNAL(editingFinished()), + this, + SLOT(accessPointNameChanged())); + mApSettingsGroupItem->appendChild(mAccessPointNameItem); + + // User name + mUserNameItem = new CpSettingFormItemData( + HbDataFormModelItem::TextItem, + hbTrId("txt_occ_setlabel_user_name")); + // Connect signal and add item to group + mForm->addConnection( + mUserNameItem, + SIGNAL(editingFinished()), + this, + SLOT(userNameChanged())); + mApSettingsGroupItem->appendChild(mUserNameItem); + + // Prompt for password + mPromptForAuthItem = new CpSettingFormItemData( + HbDataFormModelItem::CheckBoxItem, + hbTrId("txt_occ_setlabel_password")); + mPromptForAuthItem->setContentWidgetData("text", + hbTrId("txt_occ_setlabel_password_val_prompt")); + // Construct map to link item values to setting values + mPromptForAuthMap.insert(Qt::Unchecked, false); // Do not prompt + mPromptForAuthMap.insert(Qt::Checked, true); // Prompt for password + // Connect signal and add item to group + mForm->addConnection( + mPromptForAuthItem, + SIGNAL(stateChanged(int)), + this, + SLOT(promptForAuthChanged(int))); + mApSettingsGroupItem->appendChild(mPromptForAuthItem); + + // Password + mPasswordItem = new CpSettingFormItemData( + HbDataFormModelItem::TextItem, + hbTrId("txt_occ_setlabel_password")); + mPasswordItem->setContentWidgetData("echoMode", "Password"); + // Connect signal and add item to group + mForm->addConnection( + mPasswordItem, + SIGNAL(editingFinished()), + this, + SLOT(passwordChanged())); + mApSettingsGroupItem->appendChild(mPasswordItem); + + // Authentication + mAuthenticationItem = new CpSettingFormItemData( + HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_occ_setlabel_authentication")); + // Add items to combobox + QStringList authenticationItems; + authenticationItems + << hbTrId("txt_occ_setlabel_authentication_val_normal") + << hbTrId("txt_occ_setlabel_authentication_val_secure"); + mAuthenticationItem->setContentWidgetData("items", authenticationItems); + // Construct map to link item indexes to setting values + mAuthenticationMap.insert(0, false); // normal (plaintext allowed) + mAuthenticationMap.insert(1, true); // secure (plaintext disabled) + // Connect signal and add item to group + mForm->addConnection( + mAuthenticationItem, + SIGNAL(currentIndexChanged(int)), + this, + SLOT(authenticationChanged(int))); + mApSettingsGroupItem->appendChild(mAuthenticationItem); + + // Homepage + mHomepageItem = new CpSettingFormItemData( + HbDataFormModelItem::TextItem, + hbTrId("txt_occ_setlabel_homepage")); + // Connect signal and add item to group + mForm->addConnection( + mHomepageItem, + SIGNAL(editingFinished()), + this, + SLOT(homepageChanged())); + mApSettingsGroupItem->appendChild(mHomepageItem); + + // Read settings from CommsDat and update widgets + updateAccessPointSettingsGroup(); + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_CREATEACCESSPOINTSETTINGSGROUP_EXIT); +} + +/*! + Reads attribute values and updates "Access point settings" group settings. +*/ +void CpPacketDataApView::updateAccessPointSettingsGroup() +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_UPDATEACCESSPOINTSETTINGSGROUP_ENTRY); + + // Get attributes from CommsDat and set values to UI widgets + + // Connection name + QString connectionName = mCmConnectionMethod->getStringAttribute( + CMManagerShim::CmName); + mConnectionNameItem->setContentWidgetData("text", connectionName); + + // Access point name + QString accessPointName = mCmConnectionMethod->getStringAttribute( + CMManagerShim::PacketDataAPName); + mAccessPointNameItem->setContentWidgetData("text", accessPointName); + + // User name + QString userName = mCmConnectionMethod->getStringAttribute( + CMManagerShim::PacketDataIFAuthName); + mUserNameItem->setContentWidgetData("text", userName); + + // Prompt for password + bool promptForAuth = mCmConnectionMethod->getBoolAttribute( + CMManagerShim::PacketDataIFPromptForAuth); + mPromptForAuthItem->setContentWidgetData("checkState", + mPromptForAuthMap.key(promptForAuth)); + if (promptForAuth) { + mPasswordItem->setEnabled(false); + } else { + mPasswordItem->setEnabled(true); + } + + // Password + QString password = mCmConnectionMethod->getStringAttribute( + CMManagerShim::PacketDataIFAuthPass); + mPasswordItem->setContentWidgetData("text", password); + + // Authentication + bool disablePlainText = mCmConnectionMethod->getBoolAttribute( + CMManagerShim::PacketDataDisablePlainTextAuth); + mAuthenticationItem->setContentWidgetData("currentIndex", + mAuthenticationMap.key(disablePlainText)); + + // Homepage + QString homepage = mCmConnectionMethod->getStringAttribute( + CMManagerShim::CmStartPage); + mHomepageItem->setContentWidgetData("text", homepage); + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_UPDATEACCESSPOINTSETTINGSGROUP_EXIT); +} + +/*! + Shows message box with "OK" button using given text. +*/ +void CpPacketDataApView::showMessageBox( + HbMessageBox::MessageBoxType type, + const QString &text) +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_SHOWMESSAGEBOX_ENTRY); + + // Create a message box + mMessageBox = QSharedPointer(new HbMessageBox(type)); + mMessageBox->setText(text); + mMessageBox->setModal(true); + mMessageBox->setTimeout(HbPopup::NoTimeout); + mMessageBox->open(); + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_SHOWMESSAGEBOX_EXIT); +} + +/*! + Tries to update connection method changes to CommsDat. + Returns "true" if success, "false" if some error happened. +*/ +bool CpPacketDataApView::tryUpdate() +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_TRYUPDATE_ENTRY); + + // Try update + try { + mCmConnectionMethod->update(); + } + catch (const std::exception&) { + // Handle error + handleUpdateError(); + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_TRYUPDATE_EXIT); + return false; + } + + OstTraceFunctionExit0(DUP1_CPPACKETDATAAPVIEW_TRYUPDATE_EXIT); + return true; +} + +/*! + Handles failed CommsDat update. + */ +void CpPacketDataApView::handleUpdateError() +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_HANDLEUPDATEERROR_ENTRY); + + // Show error note to user + showMessageBox( + HbMessageBox::MessageTypeWarning, + hbTrId("txt_occ_info_unable_to_save_setting")); + // Reload settings from CommsDat and update UI + try { + mCmConnectionMethod->refresh(); + } + catch (const std::exception&) { + // Ignore error from refresh. Most likely this will not happen, but + // if it does, there isn't very much we can do. + OstTrace0( + TRACE_ERROR, + CPPACKETDATAAPVIEW_HANDLEUPDATEERROR, + "Refresh failed"); + }; + updateAccessPointSettingsGroup(); + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_HANDLEUPDATEERROR_EXIT); +} + +/*! + Updates connection name to CommsDat. +*/ +void CpPacketDataApView::connectionNameChanged() +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_CONNECTIONNAMECHANGED_ENTRY); + + QString connectionName = + mConnectionNameItem->contentWidgetData("text").toString(); + if (!connectionName.isEmpty()) { + // Update to CommsDat + mCmConnectionMethod->setStringAttribute( + CMManagerShim::CmName, + connectionName); + if (tryUpdate()) { + // Update successful + // Read name because in case the name already exists it will + // be made unique by CMManager + connectionName = mCmConnectionMethod->getStringAttribute( + CMManagerShim::CmName); + mConnectionNameItem->setContentWidgetData("text", connectionName); + } + } else { + // Inform user of invalid name + showMessageBox( + HbMessageBox::MessageTypeInformation, + hbTrId("txt_occ_info_invalid_name")); + + // Empty name not allowed, revert back to old value in CommsDat + connectionName = mCmConnectionMethod->getStringAttribute( + CMManagerShim::CmName); + mConnectionNameItem->setContentWidgetData("text", connectionName); + } + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_CONNECTIONNAMECHANGED_EXIT); +} + +/*! + Updates access point name to CommsDat. +*/ +void CpPacketDataApView::accessPointNameChanged() +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_ACCESSPOINTNAMECHANGED_ENTRY); + + // Update to CommsDat + QString accessPointName = + mAccessPointNameItem->contentWidgetData("text").toString(); + if (!accessPointName.isEmpty()) { + mCmConnectionMethod->setStringAttribute( + CMManagerShim::PacketDataAPName, + accessPointName); + (void)tryUpdate(); + } else { + // Inform user of invalid name + showMessageBox( + HbMessageBox::MessageTypeInformation, + hbTrId("txt_occ_info_invalid_name")); + + // Empty name not allowed, revert back to old value in CommsDat + accessPointName = mCmConnectionMethod->getStringAttribute( + CMManagerShim::PacketDataAPName); + mAccessPointNameItem->setContentWidgetData("text", accessPointName); + } + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_ACCESSPOINTNAMECHANGED_EXIT); +} + +/*! + Updates user name to CommsDat. +*/ +void CpPacketDataApView::userNameChanged() +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_USERNAMECHANGED_ENTRY); + + // Update to CommsDat + QVariant userName = mUserNameItem->contentWidgetData("text"); + mCmConnectionMethod->setStringAttribute( + CMManagerShim::PacketDataIFAuthName, + userName.toString()); + (void)tryUpdate(); + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_USERNAMECHANGED_EXIT); +} + +/*! + Updates prompt for password setting to CommsDat. +*/ +void CpPacketDataApView::promptForAuthChanged(int state) +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_PROMPTFORAUTHCHANGED_ENTRY); + + // If prompt for auth is selected, password edit should be disabled. + if (state == Qt::Checked) { + mPasswordItem->setEnabled(false); + } else { + mPasswordItem->setEnabled(true); + } + // Update to CommsDat + mCmConnectionMethod->setBoolAttribute( + CMManagerShim::PacketDataIFPromptForAuth, + mPromptForAuthMap.value(static_cast(state))); + (void)tryUpdate(); + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_PROMPTFORAUTHCHANGED_EXIT); +} + +/*! + Updates password to CommsDat. +*/ +void CpPacketDataApView::passwordChanged() +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_PASSWORDCHANGED_ENTRY); + + // Update to CommsDat + QVariant password = mPasswordItem->contentWidgetData("text"); + mCmConnectionMethod->setStringAttribute( + CMManagerShim::PacketDataIFAuthPass, + password.toString()); + (void)tryUpdate(); + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_PASSWORDCHANGED_EXIT); +} + +/*! + Updates authentication setting to CommsDat. +*/ +void CpPacketDataApView::authenticationChanged(int index) +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_AUTHENTICATIONCHANGED_ENTRY); + + // Update to CommsDat + mCmConnectionMethod->setBoolAttribute( + CMManagerShim::PacketDataDisablePlainTextAuth, + mAuthenticationMap.value(index)); + (void)tryUpdate(); + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_AUTHENTICATIONCHANGED_EXIT); +} + +/*! + Updates homepage to CommsDat. +*/ +void CpPacketDataApView::homepageChanged() +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_HOMEPAGECHANGED_ENTRY); + + // Update to CommsDat + QString homepage = mHomepageItem->contentWidgetData("text").toString(); + mCmConnectionMethod->setStringAttribute( + CMManagerShim::CmStartPage, homepage); + (void)tryUpdate(); + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_HOMEPAGECHANGED_EXIT); +} + +/*! + Handles menu actions. +*/ +void CpPacketDataApView::menuActionTriggered(HbAction *action) +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_MENUACTIONTRIGGERED_ENTRY); + + if (action == mAdvancedSettingsAction) { + // "Advanced settings" selected + HbMainWindow *mainWindow = this->mainWindow(); + + // Create the advanced settings view + HbView *newView = new CpPacketDataApAdvancedView(mCmConnectionMethod); + // Connect signal to return back to the previous view + bool status = QObject::connect( + newView, + SIGNAL(aboutToClose()), + this, + SLOT(restoreCurrentView())); + Q_ASSERT(status); + + // Show the advanced settings view + mainWindow->addView(newView); + mainWindow->setCurrentView(newView); + } + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_MENUACTIONTRIGGERED_EXIT); +} + +/*! + Deletes the current view and sets this view as the current one. +*/ +void CpPacketDataApView::restoreCurrentView() +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_RESTORECURRENTVIEW_ENTRY); + + HbMainWindow *mainWindow = this->mainWindow(); + + // Remove the previous view and delete it + HbView *prevView = mainWindow->currentView(); + mainWindow->removeView(prevView); + prevView->deleteLater(); + + // Set this view on top + mainWindow->setCurrentView(this); + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_RESTORECURRENTVIEW_EXIT); +} + +/*! + Sets editor preferences for all HbLineEdit items. +*/ +void CpPacketDataApView::setEditorPreferences(const QModelIndex modelIndex) +{ + OstTraceFunctionEntry0(CPPACKETDATAAPVIEW_SETEDITORPREFERENCES_ENTRY); + + HbDataFormViewItem *viewItem = mForm->dataFormViewItem(modelIndex); + HbDataFormModelItem *modelItem = mModel->itemFromIndex(modelIndex); + + if (modelItem == mConnectionNameItem + || modelItem == mAccessPointNameItem + || modelItem == mUserNameItem + || modelItem == mPasswordItem + || modelItem == mHomepageItem ) { + // HbLineEdit items, get editor and editor interface + HbLineEdit *edit = qobject_cast + (viewItem->dataItemContentWidget()); + HbEditorInterface editInterface(edit); + + if (modelItem == mConnectionNameItem) { + // Setup editor for connection name + editInterface.setConstraints(HbEditorConstraintLatinAlphabetOnly); + edit->setInputMethodHints(Qt::ImhNoPredictiveText); + edit->setMaxLength(CMManagerShim::CmNameLength); + } else if (modelItem == mAccessPointNameItem) { + // Setup editor for packet data AP name + editInterface.setInputMode(HbInputModeNone); + editInterface.setConstraints(HbEditorConstraintLatinAlphabetOnly); + editInterface.setLocalDigitType(HbDigitTypeNone); + edit->setInputMethodHints( + Qt::ImhNoPredictiveText + | Qt::ImhPreferLowercase); + edit->setMaxLength(CMManagerShim::PacketDataAPNameLength); + } else if (modelItem == mUserNameItem) { + // Setup editor for user name + editInterface.setInputMode(HbInputModeNone); + editInterface.setConstraints(HbEditorConstraintLatinAlphabetOnly); + editInterface.setEditorClass(HbInputEditorClassUsername); + editInterface.setLocalDigitType(HbDigitTypeNone); + edit->setInputMethodHints( + Qt::ImhNoPredictiveText + | Qt::ImhPreferLowercase); + edit->setMaxLength(CMManagerShim::PacketDataIFAuthNameLength); + } else if (modelItem == mPasswordItem) { + // Setup editor for password + editInterface.setInputMode(HbInputModeNone); + editInterface.setConstraints(HbEditorConstraintLatinAlphabetOnly); + editInterface.setEditorClass(HbInputEditorClassPassword); + editInterface.setLocalDigitType(HbDigitTypeNone); + edit->setInputMethodHints( + Qt::ImhNoPredictiveText + | Qt::ImhPreferLowercase); + edit->setMaxLength(CMManagerShim::PacketDataIFAuthPassLength); + } else { /* mHomepageItem */ + // Setup editor for URL + editInterface.setInputMode(HbInputModeNone); + editInterface.setConstraints(HbEditorConstraintLatinAlphabetOnly); + editInterface.setFilter(HbUrlFilter::instance()); + editInterface.setEditorClass(HbInputEditorClassUrl); + editInterface.setLocalDigitType(HbDigitTypeNone); + edit->setInputMethodHints( + Qt::ImhNoPredictiveText + | Qt::ImhPreferLowercase); + edit->setMaxLength(CMManagerShim::CmStartPageLength); + } + } + + OstTraceFunctionExit0(CPPACKETDATAAPVIEW_SETEDITORPREFERENCES_EXIT); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/traces/OstTraceDefinitions.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,22 @@ +/* + * 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: + * OST trace header file. + * + */ + +#ifndef OSTTRACEDEFINITIONS_H +#define OSTTRACEDEFINITIONS_H +#include +#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/tsrc/ut/hbautotest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/tsrc/ut/hbautotest.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,835 @@ +/* +* 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 "hbautotest.h" +#include +#include + + +const qreal STEP = 4; //How many pixels to drag before sending an event + +//Init static members +bool HbAutoTest::pointerPressed = false; +QPointF HbAutoTest::pressPoint = QPointF(); + +void HbAutoTest::mouseMove (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos, int delay) +{ + if (delay!=-1) { + QTest::qWait(delay); + } + QPointF targetPoint=QPointF(); + if (pos==QPointF()) { + targetPoint = middlePointOfWidget(widget); + } else { + targetPoint = widget->mapToScene(pos); + } + if (pointerPressed) { + //Now we should drag an item + drag(window, targetPoint); + HbAutoTestMouseEvent me ( + QEvent::MouseMove, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::NoButton, + Qt::NoButton, + Qt::NoModifier); + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + QTest::qWait(1); + } else { + HbAutoTestMouseEvent me ( + QEvent::MouseMove, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::NoButton, + Qt::NoButton, + Qt::NoModifier); + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + QTest::qWait(1); + + } + QTest::qWait(1); + QTest::qWait(1); +} + +void HbAutoTest::mousePress (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos, int delay) +{ + if (delay!=-1) { + QTest::qWait(delay); + } + pointerPressed=true; + QPointF targetPoint=QPointF(); + if (pos==QPointF()) { + targetPoint = middlePointOfWidget(widget); + } else { + targetPoint = widget->mapToScene(pos); + } + QCursor::setPos(window->mapToGlobal(targetPoint.toPoint())); + + pressPoint=targetPoint; + + HbAutoTestMouseEvent me ( + QEvent::MouseButtonPress, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::LeftButton, + Qt::LeftButton, + Qt::NoModifier); + + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + QCoreApplication::sendPostedEvents(); + QTest::qWait(1); +} + +void HbAutoTest::mouseRelease (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos, int delay) +{ + if (delay!=-1) { + QTest::qWait(delay); + } + pointerPressed=false; + QPointF targetPoint=QPointF(); + if (pos==QPointF()) { + targetPoint = middlePointOfWidget(widget); + } else { + targetPoint = widget->mapToScene(pos); + } + QCursor::setPos(window->mapToGlobal(targetPoint.toPoint())); + pressPoint=QPointF(); + HbAutoTestMouseEvent me ( + QEvent::MouseButtonRelease, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::LeftButton, + Qt::NoButton, + Qt::NoModifier); + + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + + QTest::qWait(1); + QTest::qWait(1); +} + +void HbAutoTest::mouseClick (HbAutoTestMainWindow *window, const HbWidget *widget, QPointF pos, int delay) +{ + if (delay!=-1) { + QTest::qWait(delay); + } + QPointF targetPoint=QPointF(); + if (pos==QPointF()) { + targetPoint = middlePointOfWidget(widget); + } else { + targetPoint = widget->mapToScene(pos); + } + + QCursor::setPos(window->mapToGlobal(targetPoint.toPoint())); + + HbAutoTestMouseEvent me ( + QEvent::MouseButtonPress, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::LeftButton, + Qt::LeftButton, + Qt::NoModifier); + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + //QTime currentTime = QTime::currentTime(); + //qDebug() << currentTime.toString("hh:mm:ss.zzz") << ": Left button down"; + QTest::qWait(1); + + if (delay!=-1) { + QTest::qWait(delay); + } + HbAutoTestMouseEvent me2 ( + QEvent::MouseButtonRelease, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::LeftButton, + Qt::NoButton, + Qt::NoModifier); + + QSpontaneKeyEvent::setSpontaneous(&me2); + qApp->notify((window->viewport()), &me2); + QCoreApplication::sendPostedEvents(); + //currentTime = QTime::currentTime(); + //qDebug() << currentTime.toString("hh:mm:ss.zzz") << ": Left button up"; + + QTest::qWait(1); + QTest::qWait(1); +} + +QPointF HbAutoTest::middlePointOfWidget( const HbWidget* widget) +{ + QRectF widgetRect = widget->rect(); + QRectF widgetSceneRect = widget->mapRectToScene(widgetRect); + qreal middleX = ((widgetSceneRect.right() - widgetSceneRect.left())/2)+widgetSceneRect.left(); + qreal middleY = ((widgetSceneRect.bottom() - widgetSceneRect.top())/2)+widgetSceneRect.top(); + return QPointF(middleX,middleY); +} + + + +void HbAutoTest::drag(HbAutoTestMainWindow *window, QPointF targetPoint) +{ + qreal tempX = targetPoint.x() - pressPoint.x(); + qreal tempY = targetPoint.y() - pressPoint.y(); + qreal totalTrip = sqrt ((tempX * tempX) + (tempY * tempY)); + + int numberOfSteps = qRound(totalTrip / STEP); + HbAutoTestMouseEvent me ( + QEvent::MouseMove, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::NoButton , + Qt::LeftButton, + Qt::NoModifier); + + QPointF nextPanPoint=pressPoint; + for (int i=1; imapToGlobal(nextPanPoint.toPoint())); + + me = HbAutoTestMouseEvent (QEvent::MouseMove, + nextPanPoint.toPoint(), + window->viewport()->mapToGlobal(nextPanPoint.toPoint()), + Qt::NoButton, + Qt::LeftButton, + Qt::NoModifier); + + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + } + + QCursor::setPos(window->mapToGlobal(targetPoint.toPoint())); + + //One more (or the only one) step to the target + me = HbAutoTestMouseEvent (QEvent::MouseMove, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::NoButton, + Qt::LeftButton, + Qt::NoModifier); + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); +} + + +void HbAutoTest::simulateEvent(QWidget *widget, bool press, int code, + Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + extern int Q_TESTLIB_EXPORT defaultKeyDelay(); + + if (delay == -1 || delay < 10) // defaultKeyDelay()) + delay = 10; //defaultKeyDelay(); + if(delay > 0) + QTest::qWait(delay); +// Q_UNUSED(delay); +// QTest::qWait(10); //TODO: Remove this and reveal above out-commented code + + HbAutoTestKeyEvent a(press ? QEvent::KeyPress : QEvent::KeyRelease, code, modifier, text, repeat); + QSpontaneKeyEvent::setSpontaneous(&a); + if (!qApp->notify(widget, &a)) + QTest::qWarn("Keyboard event not accepted by receiving widget"); + } + +void HbAutoTest::sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, + QString text, Qt::KeyboardModifiers modifier, int delay) + { + QTEST_ASSERT(qApp); + + if (!widget) + widget = QWidget::keyboardGrabber(); + if (!widget) { + if (QWidget *apw = QApplication::activePopupWidget()) + widget = apw->focusWidget() ? apw->focusWidget() : apw; + else + widget = QApplication::focusWidget(); + } + if (!widget) + widget = QApplication::activeWindow(); + + QTEST_ASSERT(widget); + + if (action == QTest::Click) { + QPointer ptr(widget); + sendKeyEvent(QTest::Press, widget, code, text, modifier, delay); + if (!ptr) { + // if we send key-events to embedded widgets, they might be destroyed + // when the user presses Return + return; + } + sendKeyEvent(QTest::Release, widget, code, text, modifier, delay); + return; + } + + bool repeat = false; + + if (action == QTest::Press) { + if (modifier & Qt::ShiftModifier) + simulateEvent(widget, true, Qt::Key_Shift, 0, QString(), false, delay); + + if (modifier & Qt::ControlModifier) + simulateEvent(widget, true, Qt::Key_Control, modifier & Qt::ShiftModifier, QString(), false, delay); + + if (modifier & Qt::AltModifier) + simulateEvent(widget, true, Qt::Key_Alt, + modifier & (Qt::ShiftModifier | Qt::ControlModifier), QString(), false, delay); + if (modifier & Qt::MetaModifier) + simulateEvent(widget, true, Qt::Key_Meta, modifier & (Qt::ShiftModifier + | Qt::ControlModifier | Qt::AltModifier), QString(), false, delay); + simulateEvent(widget, true, code, modifier, text, repeat, delay); + } else if (action == QTest::Release) { + simulateEvent(widget, false, code, modifier, text, repeat, delay); + + if (modifier & Qt::MetaModifier) + simulateEvent(widget, false, Qt::Key_Meta, modifier, QString(), false, delay); + if (modifier & Qt::AltModifier) + simulateEvent(widget, false, Qt::Key_Alt, modifier & + (Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier), QString(), false, delay); + + if (modifier & Qt::ControlModifier) + simulateEvent(widget, false, Qt::Key_Control, + modifier & (Qt::ShiftModifier | Qt::ControlModifier), QString(), false, delay); + + if (modifier & Qt::ShiftModifier) + simulateEvent(widget, false, Qt::Key_Shift, modifier & Qt::ShiftModifier, QString(), false, delay); + } + } + +void HbAutoTest::sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, + char ascii, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + QString text; + if (ascii) + text = QString(QChar::fromLatin1(ascii)); + sendKeyEvent(action, widget, code, text, modifier, delay); + } + +void HbAutoTest::keyEvent(QTest::KeyAction action, QWidget *widget, char ascii, + Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + sendKeyEvent(action, widget, asciiToKey(ascii), ascii, modifier, delay); + } + +void HbAutoTest::keyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key key, + Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + sendKeyEvent(action, widget, key, keyToAscii(key), modifier, delay); + } + +void HbAutoTest::keyClicks(QWidget *widget, const QString &sequence, + Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + for (int i=0; i < sequence.length(); i++) + keyEvent(QTest::Click, widget, sequence.at(i).toLatin1(), modifier, delay); + } + +void HbAutoTest::keyPress(QWidget *widget, char key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Press, widget, key, modifier, delay); + } + +void HbAutoTest::keyRelease(QWidget *widget, char key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Release, widget, key, modifier, delay); + } + +void HbAutoTest::keyClick(QWidget *widget, char key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Click, widget, key, modifier, delay); + } + +void HbAutoTest::keyPress(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Press, widget, key, modifier, delay); + } + +void HbAutoTest::keyRelease(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Release, widget, key, modifier, delay); } + +void HbAutoTest::keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Click, widget, key, modifier, delay); + } + +Qt::Key HbAutoTest::asciiToKey(char ascii) +{ + switch ((unsigned char)ascii) { + case 0x08: return Qt::Key_Backspace; + case 0x09: return Qt::Key_Tab; + case 0x0b: return Qt::Key_Backtab; + case 0x0d: return Qt::Key_Return; + case 0x1b: return Qt::Key_Escape; + case 0x20: return Qt::Key_Space; + case 0x21: return Qt::Key_Exclam; + case 0x22: return Qt::Key_QuoteDbl; + case 0x23: return Qt::Key_NumberSign; + case 0x24: return Qt::Key_Dollar; + case 0x25: return Qt::Key_Percent; + case 0x26: return Qt::Key_Ampersand; + case 0x27: return Qt::Key_Apostrophe; + case 0x28: return Qt::Key_ParenLeft; + case 0x29: return Qt::Key_ParenRight; + case 0x2a: return Qt::Key_Asterisk; + case 0x2b: return Qt::Key_Plus; + case 0x2c: return Qt::Key_Comma; + case 0x2d: return Qt::Key_Minus; + case 0x2e: return Qt::Key_Period; + case 0x2f: return Qt::Key_Slash; + case 0x30: return Qt::Key_0; + case 0x31: return Qt::Key_1; + case 0x32: return Qt::Key_2; + case 0x33: return Qt::Key_3; + case 0x34: return Qt::Key_4; + case 0x35: return Qt::Key_5; + case 0x36: return Qt::Key_6; + case 0x37: return Qt::Key_7; + case 0x38: return Qt::Key_8; + case 0x39: return Qt::Key_9; + case 0x3a: return Qt::Key_Colon; + case 0x3b: return Qt::Key_Semicolon; + case 0x3c: return Qt::Key_Less; + case 0x3d: return Qt::Key_Equal; + case 0x3e: return Qt::Key_Greater; + case 0x3f: return Qt::Key_Question; + case 0x40: return Qt::Key_At; + case 0x41: return Qt::Key_A; + case 0x42: return Qt::Key_B; + case 0x43: return Qt::Key_C; + case 0x44: return Qt::Key_D; + case 0x45: return Qt::Key_E; + case 0x46: return Qt::Key_F; + case 0x47: return Qt::Key_G; + case 0x48: return Qt::Key_H; + case 0x49: return Qt::Key_I; + case 0x4a: return Qt::Key_J; + case 0x4b: return Qt::Key_K; + case 0x4c: return Qt::Key_L; + case 0x4d: return Qt::Key_M; + case 0x4e: return Qt::Key_N; + case 0x4f: return Qt::Key_O; + case 0x50: return Qt::Key_P; + case 0x51: return Qt::Key_Q; + case 0x52: return Qt::Key_R; + case 0x53: return Qt::Key_S; + case 0x54: return Qt::Key_T; + case 0x55: return Qt::Key_U; + case 0x56: return Qt::Key_V; + case 0x57: return Qt::Key_W; + case 0x58: return Qt::Key_X; + case 0x59: return Qt::Key_Y; + case 0x5a: return Qt::Key_Z; + case 0x5b: return Qt::Key_BracketLeft; + case 0x5c: return Qt::Key_Backslash; + case 0x5d: return Qt::Key_BracketRight; + case 0x5e: return Qt::Key_AsciiCircum; + case 0x5f: return Qt::Key_Underscore; + case 0x60: return Qt::Key_QuoteLeft; + case 0x61: return Qt::Key_A; + case 0x62: return Qt::Key_B; + case 0x63: return Qt::Key_C; + case 0x64: return Qt::Key_D; + case 0x65: return Qt::Key_E; + case 0x66: return Qt::Key_F; + case 0x67: return Qt::Key_G; + case 0x68: return Qt::Key_H; + case 0x69: return Qt::Key_I; + case 0x6a: return Qt::Key_J; + case 0x6b: return Qt::Key_K; + case 0x6c: return Qt::Key_L; + case 0x6d: return Qt::Key_M; + case 0x6e: return Qt::Key_N; + case 0x6f: return Qt::Key_O; + case 0x70: return Qt::Key_P; + case 0x71: return Qt::Key_Q; + case 0x72: return Qt::Key_R; + case 0x73: return Qt::Key_S; + case 0x74: return Qt::Key_T; + case 0x75: return Qt::Key_U; + case 0x76: return Qt::Key_V; + case 0x77: return Qt::Key_W; + case 0x78: return Qt::Key_X; + case 0x79: return Qt::Key_Y; + case 0x7a: return Qt::Key_Z; + case 0x7b: return Qt::Key_BraceLeft; + case 0x7c: return Qt::Key_Bar; + case 0x7d: return Qt::Key_BraceRight; + case 0x7e: return Qt::Key_AsciiTilde; + + // Latin 1 codes adapted from X: keysymdef.h,v 1.21 94/08/28 16:17:06 + case 0xa0: return Qt::Key_nobreakspace; + case 0xa1: return Qt::Key_exclamdown; + case 0xa2: return Qt::Key_cent; + case 0xa3: return Qt::Key_sterling; + case 0xa4: return Qt::Key_currency; + case 0xa5: return Qt::Key_yen; + case 0xa6: return Qt::Key_brokenbar; + case 0xa7: return Qt::Key_section; + case 0xa8: return Qt::Key_diaeresis; + case 0xa9: return Qt::Key_copyright; + case 0xaa: return Qt::Key_ordfeminine; + case 0xab: return Qt::Key_guillemotleft; + case 0xac: return Qt::Key_notsign; + case 0xad: return Qt::Key_hyphen; + case 0xae: return Qt::Key_registered; + case 0xaf: return Qt::Key_macron; + case 0xb0: return Qt::Key_degree; + case 0xb1: return Qt::Key_plusminus; + case 0xb2: return Qt::Key_twosuperior; + case 0xb3: return Qt::Key_threesuperior; + case 0xb4: return Qt::Key_acute; + case 0xb5: return Qt::Key_mu; + case 0xb6: return Qt::Key_paragraph; + case 0xb7: return Qt::Key_periodcentered; + case 0xb8: return Qt::Key_cedilla; + case 0xb9: return Qt::Key_onesuperior; + case 0xba: return Qt::Key_masculine; + case 0xbb: return Qt::Key_guillemotright; + case 0xbc: return Qt::Key_onequarter; + case 0xbd: return Qt::Key_onehalf; + case 0xbe: return Qt::Key_threequarters; + case 0xbf: return Qt::Key_questiondown; + case 0xc0: return Qt::Key_Agrave; + case 0xc1: return Qt::Key_Aacute; + case 0xc2: return Qt::Key_Acircumflex; + case 0xc3: return Qt::Key_Atilde; + case 0xc4: return Qt::Key_Adiaeresis; + case 0xc5: return Qt::Key_Aring; + case 0xc6: return Qt::Key_AE; + case 0xc7: return Qt::Key_Ccedilla; + case 0xc8: return Qt::Key_Egrave; + case 0xc9: return Qt::Key_Eacute; + case 0xca: return Qt::Key_Ecircumflex; + case 0xcb: return Qt::Key_Ediaeresis; + case 0xcc: return Qt::Key_Igrave; + case 0xcd: return Qt::Key_Iacute; + case 0xce: return Qt::Key_Icircumflex; + case 0xcf: return Qt::Key_Idiaeresis; + case 0xd0: return Qt::Key_ETH; + case 0xd1: return Qt::Key_Ntilde; + case 0xd2: return Qt::Key_Ograve; + case 0xd3: return Qt::Key_Oacute; + case 0xd4: return Qt::Key_Ocircumflex; + case 0xd5: return Qt::Key_Otilde; + case 0xd6: return Qt::Key_Odiaeresis; + case 0xd7: return Qt::Key_multiply; + case 0xd8: return Qt::Key_Ooblique; + case 0xd9: return Qt::Key_Ugrave; + case 0xda: return Qt::Key_Uacute; + case 0xdb: return Qt::Key_Ucircumflex; + case 0xdc: return Qt::Key_Udiaeresis; + case 0xdd: return Qt::Key_Yacute; + case 0xde: return Qt::Key_THORN; + case 0xdf: return Qt::Key_ssharp; + case 0xe5: return Qt::Key_Aring; + case 0xe6: return Qt::Key_AE; + case 0xf7: return Qt::Key_division; + case 0xf8: return Qt::Key_Ooblique; + case 0xff: return Qt::Key_ydiaeresis; + default: QTEST_ASSERT(false); return Qt::Key(0); + } +} + +char HbAutoTest::keyToAscii(Qt::Key key) +{ + switch (key) { + case Qt::Key_Backspace: return 0x8; //BS + case Qt::Key_Tab: return 0x09; // HT + case Qt::Key_Backtab: return 0x0b; // VT + case Qt::Key_Enter: + case Qt::Key_Return: return 0x0d; // CR + case Qt::Key_Escape: return 0x1b; // ESC + case Qt::Key_Space: return 0x20; // 7 bit printable ASCII + case Qt::Key_Exclam: return 0x21; + case Qt::Key_QuoteDbl: return 0x22; + case Qt::Key_NumberSign: return 0x23; + case Qt::Key_Dollar: return 0x24; + case Qt::Key_Percent: return 0x25; + case Qt::Key_Ampersand: return 0x26; + case Qt::Key_Apostrophe: return 0x27; + case Qt::Key_ParenLeft: return 0x28; + case Qt::Key_ParenRight: return 0x29; + case Qt::Key_Asterisk: return 0x2a; + case Qt::Key_Plus: return 0x2b; + case Qt::Key_Comma: return 0x2c; + case Qt::Key_Minus: return 0x2d; + case Qt::Key_Period: return 0x2e; + case Qt::Key_Slash: return 0x2f; + case Qt::Key_0: return 0x30; + case Qt::Key_1: return 0x31; + case Qt::Key_2: return 0x32; + case Qt::Key_3: return 0x33; + case Qt::Key_4: return 0x34; + case Qt::Key_5: return 0x35; + case Qt::Key_6: return 0x36; + case Qt::Key_7: return 0x37; + case Qt::Key_8: return 0x38; + case Qt::Key_9: return 0x39; + case Qt::Key_Colon: return 0x3a; + case Qt::Key_Semicolon: return 0x3b; + case Qt::Key_Less: return 0x3c; + case Qt::Key_Equal: return 0x3d; + case Qt::Key_Greater: return 0x3e; + case Qt::Key_Question: return 0x3f; + case Qt::Key_At: return 0x40; + case Qt::Key_A: return 0x61; // 0x41 == 'A', 0x61 == 'a' + case Qt::Key_B: return 0x62; + case Qt::Key_C: return 0x63; + case Qt::Key_D: return 0x64; + case Qt::Key_E: return 0x65; + case Qt::Key_F: return 0x66; + case Qt::Key_G: return 0x67; + case Qt::Key_H: return 0x68; + case Qt::Key_I: return 0x69; + case Qt::Key_J: return 0x6a; + case Qt::Key_K: return 0x6b; + case Qt::Key_L: return 0x6c; + case Qt::Key_M: return 0x6d; + case Qt::Key_N: return 0x6e; + case Qt::Key_O: return 0x6f; + case Qt::Key_P: return 0x70; + case Qt::Key_Q: return 0x71; + case Qt::Key_R: return 0x72; + case Qt::Key_S: return 0x73; + case Qt::Key_T: return 0x74; + case Qt::Key_U: return 0x75; + case Qt::Key_V: return 0x76; + case Qt::Key_W: return 0x77; + case Qt::Key_X: return 0x78; + case Qt::Key_Y: return 0x79; + case Qt::Key_Z: return 0x7a; + case Qt::Key_BracketLeft: return 0x5b; + case Qt::Key_Backslash: return 0x5c; + case Qt::Key_BracketRight: return 0x5d; + case Qt::Key_AsciiCircum: return 0x5e; + case Qt::Key_Underscore: return 0x5f; + case Qt::Key_QuoteLeft: return 0x60; + + case Qt::Key_BraceLeft: return 0x7b; + case Qt::Key_Bar: return 0x7c; + case Qt::Key_BraceRight: return 0x7d; + case Qt::Key_AsciiTilde: return 0x7e; + + case Qt::Key_Delete: return 0; + case Qt::Key_Insert: return 0; // = 0x1006, + case Qt::Key_Pause: return 0; // = 0x1008, + case Qt::Key_Print: return 0; // = 0x1009, + case Qt::Key_SysReq: return 0; // = 0x100a, + + case Qt::Key_Clear: return 0; // = 0x100b, + + case Qt::Key_Home: return 0; // = 0x1010, // cursor movement + case Qt::Key_End: return 0; // = 0x1011, + case Qt::Key_Left: return 0; // = 0x1012, + case Qt::Key_Up: return 0; // = 0x1013, + case Qt::Key_Right: return 0; // = 0x1014, + case Qt::Key_Down: return 0; // = 0x1015, + case Qt::Key_PageUp: return 0; // = 0x1016, + case Qt::Key_PageDown: return 0; // = 0x1017, + case Qt::Key_Shift: return 0; // = 0x1020, // modifiers + case Qt::Key_Control: return 0; // = 0x1021, + case Qt::Key_Meta: return 0; // = 0x1022, + case Qt::Key_Alt: return 0; // = 0x1023, + case Qt::Key_CapsLock: return 0; // = 0x1024, + case Qt::Key_NumLock: return 0; // = 0x1025, + case Qt::Key_ScrollLock: return 0; // = 0x1026, + case Qt::Key_F1: return 0; // = 0x1030, // function keys + case Qt::Key_F2: return 0; // = 0x1031, + case Qt::Key_F3: return 0; // = 0x1032, + case Qt::Key_F4: return 0; // = 0x1033, + case Qt::Key_F5: return 0; // = 0x1034, + case Qt::Key_F6: return 0; // = 0x1035, + case Qt::Key_F7: return 0; // = 0x1036, + case Qt::Key_F8: return 0; // = 0x1037, + case Qt::Key_F9: return 0; // = 0x1038, + case Qt::Key_F10: return 0; // = 0x1039, + case Qt::Key_F11: return 0; // = 0x103a, + case Qt::Key_F12: return 0; // = 0x103b, + case Qt::Key_F13: return 0; // = 0x103c, + case Qt::Key_F14: return 0; // = 0x103d, + case Qt::Key_F15: return 0; // = 0x103e, + case Qt::Key_F16: return 0; // = 0x103f, + case Qt::Key_F17: return 0; // = 0x1040, + case Qt::Key_F18: return 0; // = 0x1041, + case Qt::Key_F19: return 0; // = 0x1042, + case Qt::Key_F20: return 0; // = 0x1043, + case Qt::Key_F21: return 0; // = 0x1044, + case Qt::Key_F22: return 0; // = 0x1045, + case Qt::Key_F23: return 0; // = 0x1046, + case Qt::Key_F24: return 0; // = 0x1047, + case Qt::Key_F25: return 0; // = 0x1048, // F25 .. F35 only on X11 + case Qt::Key_F26: return 0; // = 0x1049, + case Qt::Key_F27: return 0; // = 0x104a, + case Qt::Key_F28: return 0; // = 0x104b, + case Qt::Key_F29: return 0; // = 0x104c, + case Qt::Key_F30: return 0; // = 0x104d, + case Qt::Key_F31: return 0; // = 0x104e, + case Qt::Key_F32: return 0; // = 0x104f, + case Qt::Key_F33: return 0; // = 0x1050, + case Qt::Key_F34: return 0; // = 0x1051, + case Qt::Key_F35: return 0; // = 0x1052, + case Qt::Key_Super_L: return 0; // = 0x1053, // extra keys + case Qt::Key_Super_R: return 0; // = 0x1054, + case Qt::Key_Menu: return 0; // = 0x1055, + case Qt::Key_Hyper_L: return 0; // = 0x1056, + case Qt::Key_Hyper_R: return 0; // = 0x1057, + case Qt::Key_Help: return 0; // = 0x1058, + case Qt::Key_Direction_L: return 0; // = 0x1059, + case Qt::Key_Direction_R: return 0; // = 0x1060, + + // Latin 1 codes adapted from X: keysymdef.h,v 1.21 94/08/28 16:17:06 + case Qt::Key_nobreakspace: return char(0xa0); + case Qt::Key_exclamdown: return char(0xa1); + case Qt::Key_cent: return char(0xa2); + case Qt::Key_sterling: return char(0xa3); + case Qt::Key_currency: return char(0xa4); + case Qt::Key_yen: return char(0xa5); + case Qt::Key_brokenbar: return char(0xa6); + case Qt::Key_section: return char(0xa7); + case Qt::Key_diaeresis: return char(0xa8); + case Qt::Key_copyright: return char(0xa9); + case Qt::Key_ordfeminine: return char(0xaa); + case Qt::Key_guillemotleft: return char(0xab); // left angle quotation mar + case Qt::Key_notsign: return char(0xac); + case Qt::Key_hyphen: return char(0xad); + case Qt::Key_registered: return char(0xae); + case Qt::Key_macron: return char(0xaf); + case Qt::Key_degree: return char(0xb0); + case Qt::Key_plusminus: return char(0xb1); + case Qt::Key_twosuperior: return char(0xb2); + case Qt::Key_threesuperior: return char(0xb3); + case Qt::Key_acute: return char(0xb4); + case Qt::Key_mu: return char(0xb5); + case Qt::Key_paragraph: return char(0xb6); + case Qt::Key_periodcentered: return char(0xb7); + case Qt::Key_cedilla: return char(0xb8); + case Qt::Key_onesuperior: return char(0xb9); + case Qt::Key_masculine: return char(0xba); + case Qt::Key_guillemotright: return char(0xbb); // right angle quotation mar + case Qt::Key_onequarter: return char(0xbc); + case Qt::Key_onehalf: return char(0xbd); + case Qt::Key_threequarters: return char(0xbe); + case Qt::Key_questiondown: return char(0xbf); + case Qt::Key_Agrave: return char(0xc0); + case Qt::Key_Aacute: return char(0xc1); + case Qt::Key_Acircumflex: return char(0xc2); + case Qt::Key_Atilde: return char(0xc3); + case Qt::Key_Adiaeresis: return char(0xc4); + case Qt::Key_Aring: return char(0xe5); + case Qt::Key_AE: return char(0xe6); + case Qt::Key_Ccedilla: return char(0xc7); + case Qt::Key_Egrave: return char(0xc8); + case Qt::Key_Eacute: return char(0xc9); + case Qt::Key_Ecircumflex: return char(0xca); + case Qt::Key_Ediaeresis: return char(0xcb); + case Qt::Key_Igrave: return char(0xcc); + case Qt::Key_Iacute: return char(0xcd); + case Qt::Key_Icircumflex: return char(0xce); + case Qt::Key_Idiaeresis: return char(0xcf); + case Qt::Key_ETH: return char(0xd0); + case Qt::Key_Ntilde: return char(0xd1); + case Qt::Key_Ograve: return char(0xd2); + case Qt::Key_Oacute: return char(0xd3); + case Qt::Key_Ocircumflex: return char(0xd4); + case Qt::Key_Otilde: return char(0xd5); + case Qt::Key_Odiaeresis: return char(0xd6); + case Qt::Key_multiply: return char(0xd7); + case Qt::Key_Ooblique: return char(0xf8); + case Qt::Key_Ugrave: return char(0xd9); + case Qt::Key_Uacute: return char(0xda); + case Qt::Key_Ucircumflex: return char(0xdb); + case Qt::Key_Udiaeresis: return char(0xdc); + case Qt::Key_Yacute: return char(0xdd); + case Qt::Key_THORN: return char(0xde); + case Qt::Key_ssharp: return char(0xdf); + case Qt::Key_division: return char(0xf7); + case Qt::Key_ydiaeresis: return char(0xff); + + // multimedia/internet keys - ignored by default - see QKeyEvent c'tor + + case Qt::Key_Back : return 0; // = 0x1061, + case Qt::Key_Forward : return 0; // = 0x1062, + case Qt::Key_Stop : return 0; // = 0x1063, + case Qt::Key_Refresh : return 0; // = 0x1064, + + case Qt::Key_VolumeDown: return 0; // = 0x1070, + case Qt::Key_VolumeMute : return 0; // = 0x1071, + case Qt::Key_VolumeUp: return 0; // = 0x1072, + case Qt::Key_BassBoost: return 0; // = 0x1073, + case Qt::Key_BassUp: return 0; // = 0x1074, + case Qt::Key_BassDown: return 0; // = 0x1075, + case Qt::Key_TrebleUp: return 0; // = 0x1076, + case Qt::Key_TrebleDown: return 0; // = 0x1077, + + case Qt::Key_MediaPlay : return 0; // = 0x1080, + case Qt::Key_MediaStop : return 0; // = 0x1081, + case Qt::Key_MediaPrevious : return 0; // = 0x1082, + case Qt::Key_MediaNext : return 0; // = 0x1083, + case Qt::Key_MediaRecord: return 0; // = 0x1084, + + case Qt::Key_HomePage : return 0; // = 0x1090, + case Qt::Key_Favorites : return 0; // = 0x1091, + case Qt::Key_Search : return 0; // = 0x1092, + case Qt::Key_Standby: return 0; // = 0x1093, + case Qt::Key_OpenUrl: return 0; // = 0x1094, + + case Qt::Key_LaunchMail : return 0; // = 0x10a0, + case Qt::Key_LaunchMedia: return 0; // = 0x10a1, + case Qt::Key_Launch0 : return 0; // = 0x10a2, + case Qt::Key_Launch1 : return 0; // = 0x10a3, + case Qt::Key_Launch2 : return 0; // = 0x10a4, + case Qt::Key_Launch3 : return 0; // = 0x10a5, + case Qt::Key_Launch4 : return 0; // = 0x10a6, + case Qt::Key_Launch5 : return 0; // = 0x10a7, + case Qt::Key_Launch6 : return 0; // = 0x10a8, + case Qt::Key_Launch7 : return 0; // = 0x10a9, + case Qt::Key_Launch8 : return 0; // = 0x10aa, + case Qt::Key_Launch9 : return 0; // = 0x10ab, + case Qt::Key_LaunchA : return 0; // = 0x10ac, + case Qt::Key_LaunchB : return 0; // = 0x10ad, + case Qt::Key_LaunchC : return 0; // = 0x10ae, + case Qt::Key_LaunchD : return 0; // = 0x10af, + case Qt::Key_LaunchE : return 0; // = 0x10b0, + case Qt::Key_LaunchF : return 0; // = 0x10b1, + + default: QTEST_ASSERT(false); return 0; + } +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/tsrc/ut/hbautotest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/tsrc/ut/hbautotest.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,279 @@ +/* +* 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 HBAUTOTEST_H +#define HBAUTOTEST_H + +#include +#include +#include + +class HbMainWindow; +class HbWidget; +class HbAutoTestMainWindow; +class HbAutoTest; +class HbAutoTestMouseEvent; +/* +INSTRUCTIONS: +The class HbAutoTest is meant to be used with Orbit applications auto testing instead of GUI testing APIs of QTestLib. + +The functions of this class is to used similarily to the related QTestLib functions. + +Use HbAutoTestMainWindow (defined below) instead of HbMainWindow to enble filtering. +Filterin filters out UI events that are not sent by function defined in HbAutoTest class. + +*/ + +class HbAutoTestMouseEvent : public QMouseEvent +{ +public: + HbAutoTestMouseEvent(Type type, const QPoint & pos, const QPoint & globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers ) + : QMouseEvent(type,pos,globalPos,button,buttons,modifiers){} +}; + +class HbAutoTestKeyEvent : public QKeyEvent +{ +public: + HbAutoTestKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text = QString(), + bool autorep = false, ushort count = 1 ) + : QKeyEvent(type, key, modifiers, text, autorep, count){} +}; + +class HbAutoTest +{ +public: + + static void mouseMove (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos = QPointF(), int delay = -1 ); + static void mousePress (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos = QPointF(), int delay = -1); + static void mouseRelease (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos = QPointF(), int delay = -1); + static void mouseClick (HbAutoTestMainWindow *window, const HbWidget *widget, QPointF pos = QPointF(), int delay = -1); + +private: + static void drag(HbAutoTestMainWindow *window, QPointF targetPoint); + static QPointF middlePointOfWidget( const HbWidget* widget); + + static bool pointerPressed; + static QPointF pressPoint; + +//Key event Part: copy-pasted from QTestLib and modified to support HbAutoTestKeyEvent to enable filtering. +//see HbAutoTestMainWindow below. +public: + + static Qt::Key asciiToKey(char ascii); + static char keyToAscii(Qt::Key key); + + static void simulateEvent(QWidget *widget, bool press, int code, + Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay=-1); + + static void sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, + QString text, Qt::KeyboardModifiers modifier, int delay=-1); + + static void sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, + char ascii, Qt::KeyboardModifiers modifier, int delay=-1); + + static void keyEvent(QTest::KeyAction action, QWidget *widget, char ascii, + Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key key, + Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyClicks(QWidget *widget, const QString &sequence, + Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyPress(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyRelease(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyClick(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyPress(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyRelease(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); +}; + +class HbTestEvent +{ +public: + virtual void simulate(QWidget *w) = 0; + virtual HbTestEvent *clone() const = 0; + + virtual ~HbTestEvent() {} +}; + +class HbTestKeyEvent: public HbTestEvent +{ +public: + inline HbTestKeyEvent(QTest::KeyAction action, Qt::Key key, Qt::KeyboardModifiers modifiers, int delay) + : _action(action), _delay(delay), _modifiers(modifiers), _ascii(0), _key(key) {} + inline HbTestKeyEvent(QTest::KeyAction action, char ascii, Qt::KeyboardModifiers modifiers, int delay) + : _action(action), _delay(delay), _modifiers(modifiers), + _ascii(ascii), _key(Qt::Key_unknown) {} + inline HbTestEvent *clone() const { return new HbTestKeyEvent(*this); } + + inline void simulate(QWidget *w) + { + if (_ascii == 0) + HbAutoTest::keyEvent(_action, w, _key, _modifiers, _delay); + else + HbAutoTest::keyEvent(_action, w, _ascii, _modifiers, _delay); + } + +protected: + QTest::KeyAction _action; + int _delay; + Qt::KeyboardModifiers _modifiers; + char _ascii; + Qt::Key _key; +}; + +class HbTestKeyClicksEvent: public HbTestEvent +{ +public: + inline HbTestKeyClicksEvent(const QString &keys, Qt::KeyboardModifiers modifiers, int delay) + : _keys(keys), _modifiers(modifiers), _delay(delay) {} + inline HbTestEvent *clone() const { return new HbTestKeyClicksEvent(*this); } + + inline void simulate(QWidget *w) + { + HbAutoTest::keyClicks(w, _keys, _modifiers, _delay); + } + +private: + QString _keys; + Qt::KeyboardModifiers _modifiers; + int _delay; +}; + +class HbTestDelayEvent: public HbTestEvent +{ +public: + inline HbTestDelayEvent(int msecs): _delay(msecs) {} + inline HbTestEvent *clone() const { return new HbTestDelayEvent(*this); } + + inline void simulate(QWidget * /*w*/) { QTest::qWait(_delay); } + +private: + int _delay; +}; + +class HbTestEventList: public QList +{ +public: + inline HbTestEventList() {} + inline HbTestEventList(const HbTestEventList &other): QList() + { for (int i = 0; i < other.count(); ++i) append(other.at(i)->clone()); } + inline ~HbTestEventList() + { clear(); } + inline void clear() + { qDeleteAll(*this); QList::clear(); } + + inline void addKeyClick(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Click, qtKey, modifiers, msecs); } + inline void addKeyPress(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Press, qtKey, modifiers, msecs); } + inline void addKeyRelease(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Release, qtKey, modifiers, msecs); } + inline void addKeyEvent(QTest::KeyAction action, Qt::Key qtKey, + Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { append(new HbTestKeyEvent(action, qtKey, modifiers, msecs)); } + + inline void addKeyClick(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Click, ascii, modifiers, msecs); } + inline void addKeyPress(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Press, ascii, modifiers, msecs); } + inline void addKeyRelease(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Release, ascii, modifiers, msecs); } + inline void addKeyClicks(const QString &keys, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { append(new HbTestKeyClicksEvent(keys, modifiers, msecs)); } + inline void addKeyEvent(QTest::KeyAction action, char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { append(new HbTestKeyEvent(action, ascii, modifiers, msecs)); } + + inline void addDelay(int msecs) + { append(new HbTestDelayEvent(msecs)); } + + inline void simulate(QWidget *w) + { + for (int i = 0; i < count(); ++i) + at(i)->simulate(w); + } +}; + +class HbAutoTestMainWindow : public HbMainWindow +{ +public: + HbAutoTestMainWindow() : HbMainWindow() {} + + void mousePressEvent(QMouseEvent *event) + { + qDebug( + "HbAutoTestMainWindow::mousePressEvent: x(%d) y(%d)", + event->x(), + event->y()); + if ( dynamic_cast(event) ) { + HbMainWindow::mousePressEvent(event); + } else { + ;//Do nothing + } + } + + void mouseMoveEvent(QMouseEvent *event) + { + if ( dynamic_cast(event) ) { + HbMainWindow::mouseMoveEvent(event); + } else { + ;//Do nothing + } + } + + void mouseReleaseEvent(QMouseEvent *event) + { + if ( dynamic_cast(event) ) { + HbMainWindow::mouseReleaseEvent(event); + } else { + ;//Do nothing + } + } + + void keyPressEvent(QKeyEvent *event) + { + if ( dynamic_cast(event) ) { + HbMainWindow::keyPressEvent(event); + } else { + ;//Do nothing + } + } + void keyReleaseEvent(QKeyEvent *event) + { + if ( dynamic_cast(event) ) { + HbMainWindow::keyReleaseEvent(event); + } else { + ;//Do nothing + } + } + + void mouseDoubleClickEvent(QMouseEvent *event) + { + Q_UNUSED(event); + //Just ignore, not supported in Orbit + } +}; + + +Q_DECLARE_METATYPE(HbTestEventList) +#endif //HBAUTOTEST_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/tsrc/ut/testcppacketdataapplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/tsrc/ut/testcppacketdataapplugin.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,638 @@ +/* +* 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: +* Control Panel packet data AP plugin unit testing. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cppacketdataapview.h" + +#include "hbautotest.h" +#include "testcppacketdataapplugin.h" + +// ----------------------------------------------------------------------------- +// STATIC TEST DATA +// ----------------------------------------------------------------------------- + +// Connection method (AP) ID used for testing +static const uint testApId = 1; + +static const QString pluginDir = + "\\resource\\qt\\plugins\\controlpanel\\bearerap"; + +static const QString pluginName = "cppacketdataapplugin.dll"; + +// Time to wait before continuing after an UI step +static const int waitTime = 10; + +// UI coordinates +static const QPoint sideTop(350, 60); +static const QPoint scrollStart(350, 300); +static const QPoint scrollStop(350, 240); + +static const QPoint messageBoxOkButton(170, 320); + +// These are measured when view is scrolled to top +static const QPoint connectionNameLineEdit(330, 110); + +static const QPoint accessPointNameLineEdit(330, 190); + +static const QPoint userNameLineEdit(330, 265); + +// These are measured when view is scrolled to bottom +static const QPoint passwordPromptCheckbox(50, 295); +static const QPoint passwordLineEdit(330, 380); + +static const QPoint authenticationComboBox(175, 470); +static const QPoint authenticationSecure(100, 420); +static const QPoint authenticationNormal(100, 365); + +static const QPoint homepageLineEdit(330, 555); + +// ----------------------------------------------------------------------------- +// FRAMEWORK FUNCTIONS +// ----------------------------------------------------------------------------- + +/** + * Test main function. Runs all test cases. + */ +#ifndef TESTCMAPPLSETTINGSUI_NO_OUTPUT_REDIRECT +int main(int argc, char *argv[]) +{ + HbApplication app(argc, argv); + app.setApplicationName("TestCpPacketDataApPlugin"); + + char *pass[3]; + pass[0] = argv[0]; + pass[1] = "-o"; + pass[2] = "c:\\data\\TestCpPacketDataApPlugin.txt"; + + TestCpPacketDataApPlugin tc; + int res = QTest::qExec(&tc, 3, pass); + + return res; +} +#else +QTEST_MAIN(TestCpPacketDataApPlugin) +#endif + +/** + * This function is be called before the first test case is executed. + */ +void TestCpPacketDataApPlugin::initTestCase() +{ + mMainWindow = new HbAutoTestMainWindow; + //mMainWindow = new HbMainWindow; + mMainWindow->show(); + + // Load plugin + QDir dir(pluginDir); + QPluginLoader loader(dir.absoluteFilePath(pluginName)); + mPlugin = qobject_cast(loader.instance()); + QVERIFY(mPlugin != NULL); + + // Verify plugin bearer type + QVERIFY(mPlugin->bearerType() == CMManagerShim::BearerTypePacketData); + + // Create packet data settings view (connection method ID given) + subCreateSettingsView(testApId); +} + +/** + * This function is be called after the last test case was executed. + */ +void TestCpPacketDataApPlugin::cleanupTestCase() +{ + delete mMainWindow; + mMainWindow = 0; +} + +/** + * This function is be called before each test case is executed. + */ +void TestCpPacketDataApPlugin::init() +{ + QTest::qWait(1000); +} + +/** + * This function is be called after each test case is executed. + */ +void TestCpPacketDataApPlugin::cleanup() +{ +} + +// ----------------------------------------------------------------------------- +// TEST CASES +// ----------------------------------------------------------------------------- + +/** + * Tests changing of connection name. + */ +void TestCpPacketDataApPlugin::tcChangeConnectionName() +{ + QFETCH(QString, string); + QFETCH(QString, result); + + HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLineEdit); + + // Erase old string + subClearLineEdit(CMManagerShim::CmNameLength); + + // Enter new string + HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); + + HbAutoTest::mouseClick(mMainWindow, mTestView, sideTop); + + // Verify both commsdat and UI widget + subVerifyString( + CMManagerShim::CmName, + mTestView->mConnectionNameItem, + result); +} + +/** + * Test data for connection name change test case. + */ +void TestCpPacketDataApPlugin::tcChangeConnectionName_data() +{ + QTest::addColumn("string"); + QTest::addColumn("result"); + + QTest::newRow("maximum length") + << "really long name 1234567890123" + << "really long name 1234567890123"; + QTest::newRow("too long") + << "too long name 123456789012345678901234567890" + << "too long name 1234567890123456"; + QTest::newRow("basic") // last one must always fit on one line in UI + << "test packet AP" + << "test packet AP"; +} + +/** + * Tests that empty connection name is not accepted. + */ +void TestCpPacketDataApPlugin::tcConnectionNameEmpty() +{ + QString previous = + mTestView->mConnectionNameItem->contentWidgetData("text").toString(); + + HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLineEdit); + + // Erase old string + subClearLineEdit(CMManagerShim::CmNameLength); + + HbAutoTest::mouseClick(mMainWindow, mTestView, sideTop); + + QTest::qWait(100); + // Dismiss messagebox + HbAutoTest::mouseClick(mMainWindow, mTestView, messageBoxOkButton); + + // Verify both commsdat and UI widget + subVerifyString( + CMManagerShim::CmName, + mTestView->mConnectionNameItem, + previous); +} + +/** + * Tests changing of access point name. + */ +void TestCpPacketDataApPlugin::tcChangeAccessPointName() +{ + QFETCH(QString, string); + QFETCH(QString, result); + + HbAutoTest::mouseClick(mMainWindow, mTestView, accessPointNameLineEdit); + + // Erase old string + subClearLineEdit(CMManagerShim::PacketDataAPNameLength); + + // Enter new string + HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); + + HbAutoTest::mouseClick(mMainWindow, mTestView, sideTop); + + // Verify both commsdat and UI widget + subVerifyString( + CMManagerShim::PacketDataAPName, + mTestView->mAccessPointNameItem, + result); +} + +/** + * Test data for access point name change test case. + */ +void TestCpPacketDataApPlugin::tcChangeAccessPointName_data() +{ + QTest::addColumn("string"); + QTest::addColumn("result"); + + QTest::newRow("maximum length") + << "really long name 12345678901234567890123456789012345678901234567890123456789012345678901234567890123" + << "really long name 12345678901234567890123456789012345678901234567890123456789012345678901234567890123"; + QTest::newRow("too long") + << "too long name 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345" + << "too long name 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456"; + QTest::newRow("basic") // last one must always fit on one line in UI + << "test AP name" + << "test AP name"; +} + +/** + * Tests that empty access point name is not accepted. + */ +void TestCpPacketDataApPlugin::tcAccessPointNameEmpty() +{ + QString previous = + mTestView->mAccessPointNameItem->contentWidgetData("text").toString(); + + HbAutoTest::mouseClick(mMainWindow, mTestView, accessPointNameLineEdit); + + // Erase old string + subClearLineEdit(CMManagerShim::PacketDataAPNameLength); + + HbAutoTest::mouseClick(mMainWindow, mTestView, sideTop); + + QTest::qWait(100); + // Dismiss messagebox + HbAutoTest::mouseClick(mMainWindow, mTestView, messageBoxOkButton); + + // Verify both commsdat and UI widget + subVerifyString( + CMManagerShim::PacketDataAPName, + mTestView->mAccessPointNameItem, + previous); +} + +/** + * Tests changing of user name. + */ +void TestCpPacketDataApPlugin::tcChangeUserName() +{ + QFETCH(QString, string); + QFETCH(QString, result); + + HbAutoTest::mouseClick(mMainWindow, mTestView, userNameLineEdit); + + // Erase old string + subClearLineEdit(CMManagerShim::PacketDataIFAuthNameLength); + + // Enter new string + HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); + + HbAutoTest::mouseClick(mMainWindow, mTestView, sideTop); + + // Verify both commsdat and UI widget + subVerifyString( + CMManagerShim::PacketDataIFAuthName, + mTestView->mUserNameItem, + result); +} + +/** + * Test data for user name change test case. + */ +void TestCpPacketDataApPlugin::tcChangeUserName_data() +{ + QTest::addColumn("string"); + QTest::addColumn("result"); + +// Long strings don't work, Orbit bug? Screen goes blank +// QTest::newRow("maximum length") +// << "really long name 123456789012345678901234567890123" +// << "really long name 123456789012345678901234567890123"; +// QTest::newRow("too long") +// << "too long name 1234567890123456789012345678901234567890123" +// << "too long name 123456789012345678901234567890123456"; + QTest::newRow("basic") + << "username" + << "username"; + QTest::newRow("empty") // last one must always fit on one line in UI + << "" + << ""; +} + +/** + * Scrolls the tested view to the bottom. + */ +void TestCpPacketDataApPlugin::tcScrollToBottom() +{ + // Scroll to the bottom of the view + HbAutoTest::mousePress(mMainWindow, mTestView, scrollStart); + QTest::qWait(500); + HbAutoTest::mouseMove(mMainWindow, mTestView, scrollStop); + HbAutoTest::mouseRelease(mMainWindow, mTestView, scrollStop); +} + +/** + * Tests "prompt" password checkbox. + */ +void TestCpPacketDataApPlugin::tcChangePromptPassword() +{ + // Ensure prompt for password is unchecked + bool prompt = subGetBool(CMManagerShim::PacketDataIFPromptForAuth); + if (prompt) { + // Disable prompt for password + HbAutoTest::mouseClick( + mMainWindow, + mTestView, + passwordPromptCheckbox); + } + + // Enable prompt for password and verify + HbAutoTest::mouseClick(mMainWindow, mTestView, passwordPromptCheckbox); + subVerifyBool( + CMManagerShim::PacketDataIFPromptForAuth, + true); + + // Verify that password lineedit is disabled, following steps will + // fail if editing is allowed + HbAutoTest::mouseClick(mMainWindow, mTestView, passwordLineEdit); + QTest::qWait(waitTime); + + // Disable prompt for password and verify + HbAutoTest::mouseClick(mMainWindow, mTestView, passwordPromptCheckbox); + subVerifyBool( + CMManagerShim::PacketDataIFPromptForAuth, + false); +} + +/** + * Tests changing of password. + */ +void TestCpPacketDataApPlugin::tcChangePassword() +{ + QFETCH(QString, string); + QFETCH(QString, result); + + HbAutoTest::mouseClick(mMainWindow, mTestView, passwordLineEdit); + + // Erase old string + subClearLineEdit(CMManagerShim::PacketDataIFAuthPassLength); + + // Enter new string + HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); + + HbAutoTest::mouseClick(mMainWindow, mTestView, sideTop); + + // Verify both commsdat and UI widget + subVerifyString( + CMManagerShim::PacketDataIFAuthPass, + mTestView->mPasswordItem, + result); +} + +/** + * Test data for password change test case. + */ +void TestCpPacketDataApPlugin::tcChangePassword_data() +{ + QTest::addColumn("string"); + QTest::addColumn("result"); + +// Long strings don't work, Orbit bug? Screen goes blank +// QTest::newRow("maximum length") +// << "really long name 123456789012345678901234567890123" +// << "really long name 123456789012345678901234567890123"; +// QTest::newRow("too long") +// << "too long name 1234567890123456789012345678901234567890123" +// << "too long name 123456789012345678901234567890123456"; + QTest::newRow("basic") + << "password" + << "password"; + QTest::newRow("empty") // last one must always fit on one line in UI + << "" + << ""; +} + +/** + * Tests changing of authentication mode. + */ +void TestCpPacketDataApPlugin::tcChangeAuthenticationMode() +{ + // Set authentication mode to secure + HbAutoTest::mouseClick(mMainWindow, mTestView, authenticationComboBox, 100); + QTest::qWait(100); + HbAutoTest::mouseClick(mMainWindow, mTestView, authenticationSecure, 100); + + subVerifyBool( + CMManagerShim::PacketDataDisablePlainTextAuth, + true); + + // Set authentication mode to normal + HbAutoTest::mouseClick(mMainWindow, mTestView, authenticationComboBox, 100); + QTest::qWait(100); + HbAutoTest::mouseClick(mMainWindow, mTestView, authenticationNormal, 100); + + subVerifyBool( + CMManagerShim::PacketDataDisablePlainTextAuth, + false); +} + +/** + * Tests changing of homepage. + */ +void TestCpPacketDataApPlugin::tcChangeHomepage() +{ + QFETCH(QString, string); + QFETCH(QString, result); + + HbAutoTest::mouseClick(mMainWindow, mTestView, homepageLineEdit); + + // Erase old string + QString text = mTestView->mHomepageItem->contentWidgetData("text").toString(); + subClearLineEdit(text.size()); + + // Enter new string + HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); + + HbAutoTest::mouseClick(mMainWindow, mTestView, sideTop); + + // Verify both commsdat and UI widget + subVerifyString( + CMManagerShim::CmStartPage, + mTestView->mHomepageItem, + result); +} + +/** + * Test data for homepage change test case. + */ +void TestCpPacketDataApPlugin::tcChangeHomepage_data() +{ + QTest::addColumn("string"); + QTest::addColumn("result"); + +// Doesn't work always, view goes blank sometimes, Orbit bug? +// QTest::newRow("long") +// << "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html" +// << "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html"; + QTest::newRow("basic") // last one should always fit on one line in UI + << "http://www.symbian.org/" + << "http://www.symbian.org/"; + QTest::newRow("empty") + << "" + << ""; +} + +/** + * Tests advanced settings view (which is currently empty). + */ +void TestCpPacketDataApPlugin::tcAdvancedSettings() +{ + // Launch advanced settings view + bool status = connect( + this, + SIGNAL(menuActionTriggered(HbAction *)), + mTestView, + SLOT(menuActionTriggered(HbAction *))); + Q_ASSERT(status); + emit menuActionTriggered(mTestView->mAdvancedSettingsAction); + + QTest::qWait(2000); + + // Return from advanced settings view + subClickWidget("HbNavigationButton"); +} + +// ----------------------------------------------------------------------------- +// SUB TEST CASES +// ----------------------------------------------------------------------------- + +/** + * Creates the settings view and shows it. + */ +void TestCpPacketDataApPlugin::subCreateSettingsView(uint connectionMethodId) +{ + // Create settings view + HbView *view = mPlugin->createSettingView(connectionMethodId); + QVERIFY(view != NULL); + + // Display the view + mMainWindow->addView(view); + mMainWindow->setCurrentView(view); + // Store pointer to settings view class + mTestView = static_cast(view); +} + +/** + * Verifies that given string is correctly stored in CommsDat and shown on UI. + */ +void TestCpPacketDataApPlugin::subVerifyString( + CMManagerShim::ConnectionMethodAttribute attribute, + HbDataFormModelItem *item, + QString expected) +{ + // Read attribute value from CommsDat + QScopedPointer cmManager(new CmManagerShim); + QScopedPointer connectionMethod( + cmManager->connectionMethod(testApId)); + QString commsdat = connectionMethod->getStringAttribute(attribute); + + QCOMPARE(commsdat, expected); + + // Get value from UI widget + QString widget = item->contentWidgetData("text").toString(); + + QCOMPARE(widget, expected); +} + +/** + * Clears a HbLineEdit. + */ +void TestCpPacketDataApPlugin::subClearLineEdit( + uint length) +{ + // Erase old string + QTest::qWait(5000); // TODO: Remove this when item specific menu doesn't pop up anymore + + // Move cursor to end of string + //HbAutoTest::keyClick(mMainWindow, Qt::Key_End, 0, waitTime); // doesn't seem to do anything? + HbAutoTest::keyClick(mMainWindow, Qt::Key_Down, 0, waitTime); + HbAutoTest::keyClick(mMainWindow, Qt::Key_Down, 0, waitTime); + HbAutoTest::keyClick(mMainWindow, Qt::Key_Down, 0, waitTime); + for (int i=0; i<25; i++) { + HbAutoTest::keyClick(mMainWindow, Qt::Key_Right, 0, waitTime); + } + for (int i=0; i cmManager(new CmManagerShim); + QScopedPointer connectionMethod( + cmManager->connectionMethod(testApId)); + return connectionMethod->getBoolAttribute(attribute); +} + +/** + * Verifies that given attribute contains expected boolean value in CommsDat. + */ +void TestCpPacketDataApPlugin::subVerifyBool( + CMManagerShim::ConnectionMethodAttribute attribute, + bool expected) +{ + // Read attribute value from CommsDat + QScopedPointer cmManager(new CmManagerShim); + QScopedPointer connectionMethod( + cmManager->connectionMethod(testApId)); + bool commsdat = connectionMethod->getBoolAttribute(attribute); + + QCOMPARE(commsdat, expected); +} + +/** + * Clicks a widget currently on UI by class name. + */ +void TestCpPacketDataApPlugin::subClickWidget(const QString &name) +{ + QList itemList = mMainWindow->scene()->items(); + + QGraphicsItem *target = 0; + foreach (QGraphicsItem* item, itemList) { + if (item->isWidget()) { + QString widgetClassName(static_cast(item)->metaObject()->className()); + //qDebug() << widgetClassName; + + if (widgetClassName == name) { + target = item; + break; + } + } + } + + Q_ASSERT(target); + HbAutoTest::mouseClick(mMainWindow, static_cast(target)); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/tsrc/ut/testcppacketdataapplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/tsrc/ut/testcppacketdataapplugin.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,85 @@ +/* +* 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: +* Control Panel WLAN AP plugin unit testing. +*/ + +#include +#include +#include + +class HbDialog; +class HbMainWindow; +class HbAutoTestMainWindow; +class HbDataFormModelItem; +class HbAction; +class CpPacketDataApView; +class CpBearerApPluginInterface; + +class TestCpPacketDataApPlugin : public QObject +{ + Q_OBJECT + + signals: + // Test signals + void menuActionTriggered(HbAction *); + + public slots: + // Test framework functions + void initTestCase(); + void cleanupTestCase(); + void init(); + void cleanup(); + + private slots: + // Test cases + void tcChangeConnectionName(); + void tcChangeConnectionName_data(); + void tcConnectionNameEmpty(); + void tcChangeAccessPointName(); + void tcChangeAccessPointName_data(); + void tcAccessPointNameEmpty(); + void tcChangeUserName(); + void tcChangeUserName_data(); + void tcScrollToBottom(); + void tcChangePromptPassword(); + void tcChangePassword(); + void tcChangePassword_data(); + void tcChangeAuthenticationMode(); + void tcChangeHomepage(); + void tcChangeHomepage_data(); + void tcAdvancedSettings(); + + private: + // Sub test cases + void subCreateSettingsView(uint connetionMethodId); + void subVerifyString( + CMManagerShim::ConnectionMethodAttribute attribute, + HbDataFormModelItem *item, + QString expected); + void subClearLineEdit(uint length); + bool subGetBool(CMManagerShim::ConnectionMethodAttribute attribute); + void subVerifyBool( + CMManagerShim::ConnectionMethodAttribute attribute, + bool expected); + void subClickWidget(const QString &name); + + private: + // Code references + CpPacketDataApView *mTestView; + + // Test data + HbAutoTestMainWindow *mMainWindow; + CpBearerApPluginInterface *mPlugin; +}; diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/tsrc/ut/testcppacketdataapplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/tsrc/ut/testcppacketdataapplugin.pro Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,39 @@ +# +# 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 Control Panel packet data AP plugin unit tests. + +TEMPLATE = app + +TARGET = testcppacketdataapplugin + +CONFIG += hb qtestlib + +INCLUDEPATH += . ../../inc +DEPENDPATH += . + +HEADERS += \ + hbautotest.h \ + testcppacketdataapplugin.h +SOURCES += \ + hbautotest.cpp \ + testcppacketdataapplugin.cpp + +LIBS += \ + -lcppacketdataapplugin \ + -lconnection_settings_shim + +symbian: { + TARGET.CAPABILITY = ALL -TCB +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/tsrc/ut/tools/commsdat_restore.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/tsrc/ut/tools/commsdat_restore.bat Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,17 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem Script for restoring backup of commsdat. + +copy backup\cccccc00.cre \epoc32\winscw\c\private\10202be9\persists\cccccc00.cre diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/tsrc/ut/tools/commsdat_set.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/tsrc/ut/tools/commsdat_set.bat Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,19 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem Script for setting test commsdat. + +md backup +copy \epoc32\winscw\c\private\10202be9\persists\cccccc00.cre backup\ +copy default.cre \epoc32\winscw\c\private\10202be9\persists\cccccc00.cre diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/tsrc/ut/tools/cppacketdataapplugin_ctc.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cppacketdataapplugin/tsrc/ut/tools/cppacketdataapplugin_ctc.bat Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,90 @@ +:: +:: Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +:: All rights reserved. +:: This component and the accompanying materials are made available +:: under the terms of "Eclipse Public License v1.0" +:: which accompanies this distribution, and is available +:: at the URL "http://www.eclipse.org/legal/epl-v10.html". +:: +:: Initial Contributors: +:: Nokia Corporation - initial contribution. +:: +:: Contributors: +:: +:: Description: +:: Script running Control Panel packet data AP plugin test cases with CTC +:: analysis. + +@echo off + +:: ----------------------------------------------------------------------------- +:: Instructions +:: ----------------------------------------------------------------------------- +:: +:: Remember to use the test CommsDat that can be set and restored with the +:: helper scripts: +:: - commsdat_set.bat +:: - commsdat_restore.bat + +::----------------------------------------------------------------------------- +:: Set the local variables +::----------------------------------------------------------------------------- + +:: Control Panel packet data AP plugin base directory +set cppacketdataapplugin_dir=..\..\.. +pushd %cppacketdataapplugin_dir% + +:: CTC instrumentation excludes +set ctc_excludes=-C EXCLUDE=* -C NO_EXCLUDE=src\*.cpp + + +::----------------------------------------------------------------------------- +:: Remove old coverage data +::----------------------------------------------------------------------------- + +echo Cleaning up... +del MON.* ctcerr.txt profile.txt +rd /s /q CTCHTML +echo ...done + +::----------------------------------------------------------------------------- +:: Build & instrument code +::----------------------------------------------------------------------------- + +echo Building code and instrumenting.. +call del MON.* ctcerr.txt profile.txt +call make distclean +call qmake +call ctcwrap -i d -2comp %ctc_excludes% sbs -c winscw_udeb +echo ...done + +::----------------------------------------------------------------------------- +:: Build test code +::----------------------------------------------------------------------------- + +echo Building test code... +call cd tsrc\ut +call make distclean +call qmake +call sbs -c winscw_udeb +echo ...done + +::----------------------------------------------------------------------------- +:: Execute the tests +::----------------------------------------------------------------------------- + +echo Running tests.. +cd ..\.. +call \epoc32\release\winscw\udeb\testcppacketdataapplugin.exe +echo ...done + +::----------------------------------------------------------------------------- +:: Create coverage results +::----------------------------------------------------------------------------- + +echo Creating results... +call ctcpost -p profile.txt +call ctc2html -i profile.txt +echo ...done + +popd diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cppacketdataapplugin/tsrc/ut/tools/default.cre Binary file cmmanager/cppacketdataapplugin/tsrc/ut/tools/default.cre has changed diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/cpwlanapplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/cpwlanapplugin.pro Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,57 @@ +# +# 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 info file for Control Panel WLAN AP plugin. +# + +TEMPLATE = lib +TARGET = cpwlanapplugin +DEPENDPATH += . +INCLUDEPATH += . + +CONFIG += hb plugin + +MOC_DIR = moc +OBJECTS_DIR = obj +RCC_DIR = rcc + +LIBS += -lcpframework -lconnection_settings_shim + +# Sources +HEADERS += inc/cpwlanapplugin.h \ + inc/cpwlanapview.h \ + inc/cpwlanapadvancedview.h \ + traces/OstTraceDefinitions.h +SOURCES += src/cpwlanapplugin.cpp \ + src/cpwlanapview.cpp \ + src/cpwlanapadvancedview.cpp + +symbian: +{ +TARGET.EPOCALLOWDLLDATA = 1 +TARGET.UID3 = 0x2002C369 +TARGET.CAPABILITY = CAP_GENERAL_DLL + +deploy.path = C: +qtplugins.path = /resource/qt/plugins/controlpanel/bearerap +qtplugins.sources += qmakepluginstubs/cpwlanapplugin.qtplugin + +for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" + +BLD_INF_RULES.prj_exports += "rom/cpwlanapplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cpwlanapplugin.iby)" +} + +plugin.sources = cpwlanapplugin.dll +plugin.path = /resource/qt/plugins/controlpanel/bearerap +DEPLOYMENT += plugin diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/inc/cpwlanapadvancedview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/inc/cpwlanapadvancedview.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Control Panel WLAN AP advanced settings view header file. +* +*/ + +#ifndef CPWLANAPADVANCEDVIEW_H +#define CPWLANAPADVANCEDVIEW_H + +// System includes +#include + +// User includes + +// Forward declarations +class HbDataForm; +class HbDataFormModel; +class CmConnectionMethodShim; + +// External data types + +// Constants + +// Class declaration +class CpWlanApAdvancedView : public CpBaseSettingView +{ + Q_OBJECT + +public: + CpWlanApAdvancedView( + CmConnectionMethodShim *cmConnectionMethod, + QGraphicsItem *parent = 0); + ~CpWlanApAdvancedView(); + +signals: + +public slots: + +protected: + +protected slots: + +private: + void createAdvancedSettings(); + +private slots: + +private: // data + //! Dataform + HbDataForm *mForm; + //! Dataform model + HbDataFormModel *mModel; + //! Connection Settings Shim connection method pointer + CmConnectionMethodShim *mCmConnectionMethod; +}; + +#endif // CPWLANAPADVANCEDVIEW_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/inc/cpwlanapplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/inc/cpwlanapplugin.h Mon May 03 12:53:07 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: +* Control Panel WLAN AP plugin header file. +* +*/ + +#ifndef CPWLANAPPLUGIN_H +#define CPWLANAPPLUGIN_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class QTranslator; +class CmManagerShim; +class CmConnectionMethodShim; + +// External data types + +// Constants + +// Class declaration +class CpWlanApPlugin : public QObject, public CpBearerApPluginInterface +{ + Q_OBJECT + Q_INTERFACES(CpBearerApPluginInterface) + +public: + CpWlanApPlugin(); + ~CpWlanApPlugin(); + + uint bearerType() const; + CpBaseSettingView *createSettingView(uint connectionMethod); + +signals: + +public slots: + +protected: + +protected slots: + +private: + +private slots: + +private: // data + //! Translator instance + QTranslator *mTranslator; + //! CM Manager Shim instance + CmManagerShim *mCmManager; + //! CM Connection Method Shim instance + CmConnectionMethodShim *mCmConnectionMethod; +}; + +#endif // CPWLANAPPLUGIN_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/inc/cpwlanapview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/inc/cpwlanapview.h Mon May 03 12:53:07 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: +* Control Panel WLAN AP settings view header file. +* +*/ + +#ifndef CPWLANAPVIEW_H +#define CPWLANAPVIEW_H + +// System includes +#include +#include +#include +#include + +// User includes + +// Forward declarations +class HbDataForm; +class HbDataFormModel; +class HbDataFormModelItem; +class HbMessageBox; +class CmConnectionMethodShim; +class CpWlanApPlugin; +class CpWlanSecurityPluginInterface; + +// External data types + +// Constants + +// Class declaration +class CpWlanApView : public CpBaseSettingView +{ + Q_OBJECT + +public: + CpWlanApView( + CmConnectionMethodShim *cmConnectionMethod, + QGraphicsItem *parent = 0); + ~CpWlanApView(); + +signals: + +public slots: + +protected: + +protected slots: + +private: + void createAccessPointSettingsGroup(); + void updateAccessPointSettingsGroup(); + void loadSecurityPlugins(); + void updateSecurityGroup(int index); + void showMessageBox( + HbMessageBox::MessageBoxType type, + const QString &text); + bool tryUpdate(); + void handleUpdateError(); + +private slots: + void connectionNameChanged(); + void wlanNetworkNameChanged(); + void networkStatusChanged(int index); + void networkModeChanged(int index); + void securityModeChanged(int index); + void homepageChanged(); + void menuActionTriggered(HbAction *action); + void restoreCurrentView(); + void setEditorPreferences(const QModelIndex modelIndex); + +private: // data + //! Dataform + HbDataForm *mForm; + //! Dataform model + HbDataFormModel *mModel; + //! Control Panel item data helper for WLAN security plugins + CpItemDataHelper *mItemDataHelper; + //! "Access point settings" group + HbDataFormModelItem *mApSettingsGroupItem; + //! "Connection name" setting item + HbDataFormModelItem *mConnectionNameItem; + //! "WLAN network name" setting item + HbDataFormModelItem *mWlanNetworkNameItem; + //! "Network status" setting item + HbDataFormModelItem *mNetworkStatusItem; + //! "Network mode" setting item + HbDataFormModelItem *mNetworkModeItem; + //! "Security mode" setting item + HbDataFormModelItem *mSecurityModeItem; + //! "Homepage" setting item + HbDataFormModelItem *mHomepageItem; + //! "Security settings" group + HbDataFormModelItem *mSecuritySettingsGroupItem; + //! "Advanced settings" action for view menu + HbAction *mAdvancedSettingsAction; + //! Connection Settings Shim connection method pointer + CmConnectionMethodShim *mCmConnectionMethod; + //! Message box for info notes + QSharedPointer mMessageBox; + //! Maps network status combobox index to CMManagerShim::WlanScanSSID value + QMap mNetworkStatusMap; + //! Maps network mode combobox index to CMManagerShim::WlanConnectionMode value + QMap mNetworkModeMap; + //! Maps security mode combobox index to corresponding security plugin pointer + QMap mSecurityModeMap; + + // Friend classes + friend class TestCpWlanApPlugin; +}; + +#endif // CPWLANAPVIEW_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/rom/cpwlanapplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/rom/cpwlanapplugin.iby Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,33 @@ +/* +* 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: +* Control Panel WLAN AP plugin iby file. +* +*/ + +#ifndef CPWLANAPPLUGIN_IBY +#define CPWLANAPPLUGIN_IBY + +#include +#include + +#ifdef __PROTOCOL_WLAN + +file=ABI_DIR/BUILD_DIR/cpwlanapplugin.dll SHARED_LIB_DIR/cpwlanapplugin.dll + +data=/epoc32/data/c/resource/qt/plugins/controlpanel/bearerap/cpwlanapplugin.qtplugin resource/qt/plugins/controlpanel/bearerap/cpwlanapplugin.qtplugin + +#endif // __PROTOCOL_WLAN + +#endif // CPWLANAPPLUGIN_IBY diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/src/cpwlanapadvancedview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/src/cpwlanapadvancedview.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Control Panel WLAN AP advanced settings view implementation. +* +*/ + +// System includes +#include +#include +#include +#include + +// User includes +#include "cpwlanapadvancedview.h" + +/*! + \class CpWlanApAdvancedView + \brief This class implements the WLAN AP Control Panel advanced + settings view. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. +*/ +CpWlanApAdvancedView::CpWlanApAdvancedView( + CmConnectionMethodShim *cmConnectionMethod, + QGraphicsItem *parent) : + CpBaseSettingView(0, parent), + mForm(0), + mModel(0), + mCmConnectionMethod(cmConnectionMethod) +{ + // Construct packet data AP settings UI + mForm = settingForm(); + if (mForm) { + mModel = new HbDataFormModel(mForm); + + // Add advanced settings groups + createAdvancedSettings(); + + mForm->setModel(mModel); + } +} + +/*! + Destructor. +*/ +CpWlanApAdvancedView::~CpWlanApAdvancedView() +{ +} + +/*! + Creates all advanced settings groups. +*/ +void CpWlanApAdvancedView::createAdvancedSettings() +{ + // TODO: Implement the advanced settings view. +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/src/cpwlanapplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/src/cpwlanapplugin.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,118 @@ +/* +* 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: +* Control Panel WLAN AP plugin implementation. +* +*/ + +// System includes +#include +#include +#include + +// User includes +#include "cpwlanapplugin.h" +#include "cpwlanapview.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cpwlanappluginTraces.h" +#endif + +/*! + \class CpWlanApPlugin + \brief Implements the WLAN bearer AP (access point) Control Panel plugin. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. +*/ +CpWlanApPlugin::CpWlanApPlugin() : + mTranslator(0), + mCmManager(0), + mCmConnectionMethod(0) +{ + OstTraceFunctionEntry0(CPWLANAPPLUGIN_CPWLANAPPLUGIN_ENTRY); + + // Install localization + QString lang = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + mTranslator = new QTranslator(this); + mTranslator->load(path + "cpapplugin_" + lang); + qApp->installTranslator(mTranslator); + + OstTraceFunctionExit0(CPWLANAPPLUGIN_CPWLANAPPLUGIN_EXIT); +} + +/*! + Destructor. +*/ +CpWlanApPlugin::~CpWlanApPlugin() +{ + OstTraceFunctionEntry0(DUP1_CPWLANAPPLUGIN_CPWLANAPPLUGIN_ENTRY); + + delete mCmConnectionMethod; + delete mCmManager; + + OstTraceFunctionExit0(DUP1_CPWLANAPPLUGIN_CPWLANAPPLUGIN_EXIT); +} + +/*! + Returns the bearer type handled by the plugin. +*/ +uint CpWlanApPlugin::bearerType() const +{ + OstTraceFunctionEntry0(CPWLANAPPLUGIN_BEARERTYPE_ENTRY); + + OstTraceFunctionExit0(CPWLANAPPLUGIN_BEARERTYPE_EXIT); + return CMManagerShim::BearerTypeWlan; +} + +/*! + Creates the WLAN AP settings view. +*/ +CpBaseSettingView *CpWlanApPlugin::createSettingView(uint connectionMethod) +{ + OstTraceFunctionEntry0(CPWLANAPPLUGIN_CREATESETTINGVIEW_ENTRY); + + // Find the connection method + try { + mCmManager = new CmManagerShim(); + mCmConnectionMethod = mCmManager->connectionMethod(connectionMethod); + } + catch (const std::exception&) { + // Error, don't create settings view, just return + OstTrace1( + TRACE_ERROR, + CPWLANAPPLUGIN_CREATESETTINGVIEW, + "Connection method loading failed;connectionMethod=%u", + connectionMethod); + + OstTraceFunctionExit0(DUP1_CPWLANAPPLUGIN_CREATESETTINGVIEW_EXIT); + return NULL; + } + + // Connection method found, create settings view + OstTraceFunctionExit0(CPWLANAPPLUGIN_CREATESETTINGVIEW_EXIT); + return new CpWlanApView(mCmConnectionMethod); +} + +Q_EXPORT_PLUGIN2(cpwlanapplugin, CpWlanApPlugin); diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/src/cpwlanapview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/src/cpwlanapview.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,710 @@ +/* +* 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: +* Control Panel WLAN AP settings view implementation. +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// User includes +#include "cpwlanapplugin.h" +#include "cpwlanapview.h" +#include "cpwlanapadvancedview.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cpwlanapviewTraces.h" +#endif + +/*! + \class CpWlanApView + \brief This class implements the WLAN AP Control Panel settings view. +*/ + +// External function prototypes + +// Local constants + +static const QString wlanSecurityPluginsDir = + "\\resource\\qt\\plugins\\controlpanel\\wlansecurity"; + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. +*/ +CpWlanApView::CpWlanApView( + CmConnectionMethodShim *cmConnectionMethod, + QGraphicsItem *parent) : + CpBaseSettingView(0, parent), + mForm(0), + mModel(0), + mItemDataHelper(0), + mApSettingsGroupItem(0), + mConnectionNameItem(0), + mWlanNetworkNameItem(0), + mNetworkStatusItem(0), + mNetworkModeItem(0), + mSecurityModeItem(0), + mHomepageItem(0), + mSecuritySettingsGroupItem(0), + mAdvancedSettingsAction(0), + mCmConnectionMethod(cmConnectionMethod), + mMessageBox(0) +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_CPWLANAPVIEW_ENTRY); + + // Add "Advanced settings" menu item + HbMenu *menu = this->menu(); + mAdvancedSettingsAction = menu->addAction( + hbTrId("txt_occ_opt_advanced_settings")); + bool status = connect( + menu, + SIGNAL(triggered(HbAction*)), + this, + SLOT(menuActionTriggered(HbAction*))); + Q_ASSERT(status); + + // Construct WLAN AP settings UI + mForm = settingForm(); + if (mForm) { + mModel = new HbDataFormModel(mForm); + + // The parameter given as 0 is a HbDataForm pointer, not parent + mItemDataHelper = new CpItemDataHelper(0); + mItemDataHelper->setParent(this); + + // Add access point settings group + createAccessPointSettingsGroup(); + + mItemDataHelper->bindToForm(mForm); + mForm->setModel(mModel); + + status = connect( + mForm, + SIGNAL(itemShown(const QModelIndex)), + this, + SLOT(setEditorPreferences(const QModelIndex))); + Q_ASSERT(status); + + // Expand access point settings group + mForm->setExpanded(mModel->indexFromItem(mApSettingsGroupItem), TRUE); + + // Add security settings group if necessary + updateSecurityGroup( + mSecurityModeItem->contentWidgetData("currentIndex").toInt()); + } + + OstTraceFunctionExit0(CPWLANAPVIEW_CPWLANAPVIEW_EXIT); +} + +/*! + Destructor. +*/ +CpWlanApView::~CpWlanApView() +{ + OstTraceFunctionEntry0(DUP1_CPWLANAPVIEW_CPWLANAPVIEW_ENTRY); + + OstTraceFunctionExit0(DUP1_CPWLANAPVIEW_CPWLANAPVIEW_EXIT); +} + +/*! + Creates the WLAN "Access point settings" group. +*/ +void CpWlanApView::createAccessPointSettingsGroup() +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_CREATEACCESSPOINTSETTINGSGROUP_ENTRY); + + // Access point settings group + mApSettingsGroupItem = new HbDataFormModelItem( + HbDataFormModelItem::GroupItem, + hbTrId("txt_occ_subhead_access_point_settings")); + mModel->appendDataFormItem(mApSettingsGroupItem); + + // Connection name + mConnectionNameItem = new CpSettingFormItemData( + HbDataFormModelItem::TextItem, + hbTrId("txt_occ_setlabel_connection_name")); + // Connect signal and add item to group + mForm->addConnection( + mConnectionNameItem, + SIGNAL(editingFinished()), + this, + SLOT(connectionNameChanged())); + mApSettingsGroupItem->appendChild(mConnectionNameItem); + + // WLAN network name + mWlanNetworkNameItem = new CpSettingFormItemData( + HbDataFormModelItem::TextItem, + hbTrId("txt_occ_setlabel_wlan_network_name")); + // Connect signal and add item to group + mForm->addConnection( + mWlanNetworkNameItem, + SIGNAL(editingFinished()), + this, + SLOT(wlanNetworkNameChanged())); + mApSettingsGroupItem->appendChild(mWlanNetworkNameItem); + + // Network status + mNetworkStatusItem = new CpSettingFormItemData( + HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_occ_setlabel_network_status")); + // Add items to combobox + QStringList networkStatusItems; + networkStatusItems + << hbTrId("txt_occ_setlabel_network_status_val_public") + << hbTrId("txt_occ_setlabel_network_status_val_hidden"); + mNetworkStatusItem->setContentWidgetData("items", networkStatusItems); + // Construct map to link item indexes to setting values + mNetworkStatusMap.insert(0, false); // public + mNetworkStatusMap.insert(1, true); // hidden + // Connect signal and add item to group + mForm->addConnection( + mNetworkStatusItem, + SIGNAL(currentIndexChanged(int)), + this, + SLOT(networkStatusChanged(int))); + mApSettingsGroupItem->appendChild(mNetworkStatusItem); + + // Network mode + mNetworkModeItem = new CpSettingFormItemData( + HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_occ_setlabel_wlan_network_mode")); + // Add items to combobox + QStringList networkModeItems; + networkModeItems + << hbTrId("txt_occ_setlabel_wlan_network_mode_val_infrastruct") + << hbTrId("txt_occ_setlabel_wlan_network_mode_val_adhoc"); + mNetworkModeItem->setContentWidgetData("items", networkModeItems); + // Construct map to link item indexes to setting values + mNetworkModeMap.insert(0, CMManagerShim::Infra); // infrastructure + mNetworkModeMap.insert(1, CMManagerShim::Adhoc); // adhoc + // Connect signal and add item to group + mForm->addConnection( + mNetworkModeItem, + SIGNAL(currentIndexChanged(int)), + this, + SLOT(networkModeChanged(int))); + mApSettingsGroupItem->appendChild(mNetworkModeItem); + + // Security mode + mSecurityModeItem = new CpSettingFormItemData( + HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_occ_setlabel_wlan_security_mode")); + // Load WLAN security plugins and construct map + mSecurityModeMap.insert(0, NULL); // open mode + // Load all security plugins and construct map + loadSecurityPlugins(); + // Add items to combobox + QStringList securityModeItems; + foreach (CpWlanSecurityPluginInterface *plugin, mSecurityModeMap) { + if (plugin) { + // Add security mode from plugin + securityModeItems + << hbTrId(plugin->securityModeTextId().toLatin1()); + } else { + // Add open mode + securityModeItems + << hbTrId("txt_occ_setlabel_wlan_security_mode_val_open"); + } + } + mSecurityModeItem->setContentWidgetData("items", securityModeItems); + // Connect signal and add item to group + mForm->addConnection( + mSecurityModeItem, + SIGNAL(currentIndexChanged(int)), + this, + SLOT(securityModeChanged(int))); + mApSettingsGroupItem->appendChild(mSecurityModeItem); + + // Homepage + mHomepageItem = new CpSettingFormItemData( + HbDataFormModelItem::TextItem, + hbTrId("txt_occ_setlabel_homepage")); + // Connect signal and add item to group + mForm->addConnection( + mHomepageItem, + SIGNAL(editingFinished()), + this, + SLOT(homepageChanged())); + mApSettingsGroupItem->appendChild(mHomepageItem); + + // Read settings from CommsDat and update widgets + updateAccessPointSettingsGroup(); + + OstTraceFunctionExit0(CPWLANAPVIEW_CREATEACCESSPOINTSETTINGSGROUP_EXIT); +} + +/*! + Reads attribute values and updates "Access point settings" group settings. +*/ +void CpWlanApView::updateAccessPointSettingsGroup() +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_UPDATEACCESSPOINTSETTINGSGROUP_ENTRY); + + // Get attributes from CommsDat and set values to UI widgets + + // Connection name + QString connectionName = mCmConnectionMethod->getStringAttribute( + CMManagerShim::CmName); + mConnectionNameItem->setContentWidgetData("text", connectionName); + + // WLAN network name + QString networkName = mCmConnectionMethod->getStringAttribute( + CMManagerShim::WlanSSID); + mWlanNetworkNameItem->setContentWidgetData("text", networkName); + + // Network status + bool scanSsid = mCmConnectionMethod->getBoolAttribute( + CMManagerShim::WlanScanSSID); + mNetworkStatusItem->setContentWidgetData( + "currentIndex", + mNetworkStatusMap.key(scanSsid)); + + // Network mode + int networkMode = mCmConnectionMethod->getIntAttribute( + CMManagerShim::WlanConnectionMode); + mNetworkModeItem->setContentWidgetData( + "currentIndex", + mNetworkModeMap.key(networkMode)); + + // Security mode + QVariant securityMode = mCmConnectionMethod->getIntAttribute( + CMManagerShim::WlanSecurityMode); + // Iterate through the map to find correct security plugin and set + // mode index + int securityModeIndex = 0; + QMapIterator i(mSecurityModeMap); + while (i.hasNext()) { + i.next(); + if (i.value() + && i.value()->securityMode() == securityMode.toInt()) { + securityModeIndex = i.key(); + } + } + mSecurityModeItem->setContentWidgetData("currentIndex", + securityModeIndex); + + // Homepage + QString homepage = mCmConnectionMethod->getStringAttribute( + CMManagerShim::CmStartPage); + mHomepageItem->setContentWidgetData("text", homepage); + + OstTraceFunctionExit0(CPWLANAPVIEW_UPDATEACCESSPOINTSETTINGSGROUP_EXIT); +} + +/*! + Loads all WLAN security plugins. +*/ +void CpWlanApView::loadSecurityPlugins() +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_LOADSECURITYPLUGINS_ENTRY); + + // Load security plugins + QList plugins; + QDir pluginsDir(wlanSecurityPluginsDir); + foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { + QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); + CpWlanSecurityPluginInterface *plugin = + qobject_cast(loader.instance()); + if (plugin) { + // Sort items based on the orderNumber() + QList::iterator i; + for (i = plugins.begin(); i != plugins.end(); ++i) { + if ((*i)->orderNumber() > plugin->orderNumber()) { + plugins.insert(i, plugin); + plugin = NULL; + break; + } + } + if (plugin) { + plugins.append(plugin); + } + } + } + + // Add security plugins to map + int i; + i = mSecurityModeMap.size(); + foreach (CpWlanSecurityPluginInterface *plugin, plugins) { + mSecurityModeMap.insert(i, plugin); + i++; + } + + OstTraceFunctionExit0(CPWLANAPVIEW_LOADSECURITYPLUGINS_EXIT); +} + +/*! + Updates the "Security settings" group. +*/ +void CpWlanApView::updateSecurityGroup(int index) +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_UPDATESECURITYGROUP_ENTRY); + + // Remove old security settings group + if (mSecuritySettingsGroupItem) { + mModel->removeItem(mSecuritySettingsGroupItem); + mSecuritySettingsGroupItem = NULL; + } + + // Add new security settings group + if (index > 0) { + // Get correct security plugin + CpWlanSecurityPluginInterface *plugin = mSecurityModeMap.value(index); + if (plugin) { + // Ask plugin to create the security group + plugin->setReference( + mCmConnectionMethod, + mCmConnectionMethod->getIntAttribute(CMManagerShim::CmId)); + mSecuritySettingsGroupItem = plugin->uiInstance(*mItemDataHelper); + if (mSecuritySettingsGroupItem) { + // And add it to dataform + mModel->appendDataFormItem(mSecuritySettingsGroupItem); + } + } + } + + OstTraceFunctionExit0(CPWLANAPVIEW_UPDATESECURITYGROUP_EXIT); +} + +/*! + Shows message box with "OK" button using given text. +*/ +void CpWlanApView::showMessageBox( + HbMessageBox::MessageBoxType type, + const QString &text) +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_SHOWMESSAGEBOX_ENTRY); + + // Create a message box + mMessageBox = QSharedPointer(new HbMessageBox(type)); + mMessageBox->setText(text); + mMessageBox->setModal(true); + mMessageBox->setTimeout(HbPopup::NoTimeout); + mMessageBox->open(); + + OstTraceFunctionExit0(CPWLANAPVIEW_SHOWMESSAGEBOX_EXIT); +} + +/*! + Tries to update connection method changes to CommsDat. + Returns "true" if success, "false" if some error happened. +*/ +bool CpWlanApView::tryUpdate() +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_TRYUPDATE_ENTRY); + + // Try update + try { + mCmConnectionMethod->update(); + } + catch (const std::exception&) { + // Handle error + handleUpdateError(); + + OstTraceFunctionExit0(CPWLANAPVIEW_TRYUPDATE_EXIT); + return false; + } + + OstTraceFunctionExit0(DUP1_CPWLANAPVIEW_TRYUPDATE_EXIT); + return true; +} + +/*! + Handles failed CommsDat update. + */ +void CpWlanApView::handleUpdateError() +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_HANDLEUPDATEERROR_ENTRY); + + // Show error note to user + showMessageBox( + HbMessageBox::MessageTypeWarning, + hbTrId("txt_occ_info_unable_to_save_setting")); + // Reload settings from CommsDat and update UI + try { + mCmConnectionMethod->refresh(); + } + catch (const std::exception&) { + // Ignore error from refresh. Most likely this will not happen, but + // if it does, there isn't very much we can do. + OstTrace0( + TRACE_ERROR, + CPWLANAPPLUGIN_HANDLEUPDATEERROR, + "Refresh failed"); + }; + updateAccessPointSettingsGroup(); + + OstTraceFunctionExit0(CPWLANAPVIEW_HANDLEUPDATEERROR_EXIT); +} + +/*! + Stores connection name. +*/ +void CpWlanApView::connectionNameChanged() +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_CONNECTIONNAMECHANGED_ENTRY); + + QString connectionName = + mConnectionNameItem->contentWidgetData("text").toString(); + if (!connectionName.isEmpty()) { + // Update to CommsDat + mCmConnectionMethod->setStringAttribute( + CMManagerShim::CmName, + connectionName); + if (tryUpdate()) { + // Update successful + // Read name because in case the name already exists it will + // be made unique by CMManager + connectionName = mCmConnectionMethod->getStringAttribute( + CMManagerShim::CmName); + mConnectionNameItem->setContentWidgetData("text", connectionName); + } + } else { + // Inform user of invalid name + showMessageBox( + HbMessageBox::MessageTypeInformation, + hbTrId("txt_occ_info_invalid_name")); + + // Empty name not allowed, revert back to old value + connectionName = mCmConnectionMethod->getStringAttribute( + CMManagerShim::CmName); + mConnectionNameItem->setContentWidgetData("text", connectionName); + } + + OstTraceFunctionExit0(CPWLANAPVIEW_CONNECTIONNAMECHANGED_EXIT); +} + +/*! + Stores WLAN network name. +*/ +void CpWlanApView::wlanNetworkNameChanged() +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_WLANNETWORKNAMECHANGED_ENTRY); + + // Update to CommsDat + QString wlanNetworkName = + mWlanNetworkNameItem->contentWidgetData("text").toString(); + if (!wlanNetworkName.isEmpty()) { + mCmConnectionMethod->setStringAttribute( + CMManagerShim::WlanSSID, + wlanNetworkName); + (void)tryUpdate(); + } else { + // Inform user of invalid name + showMessageBox( + HbMessageBox::MessageTypeInformation, + hbTrId("txt_occ_info_invalid_name")); + + // Empty name not allowed, revert back to old value + wlanNetworkName = mCmConnectionMethod->getStringAttribute( + CMManagerShim::WlanSSID); + mWlanNetworkNameItem->setContentWidgetData("text", wlanNetworkName); + } + + OstTraceFunctionExit0(CPWLANAPVIEW_WLANNETWORKNAMECHANGED_EXIT); +} + +/*! + Stores WLAN network status. +*/ +void CpWlanApView::networkStatusChanged(int index) +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_NETWORKSTATUSCHANGED_ENTRY); + + // Update to CommsDat + mCmConnectionMethod->setBoolAttribute(CMManagerShim::WlanScanSSID, + mNetworkStatusMap.value(index)); + (void)tryUpdate(); + + OstTraceFunctionExit0(CPWLANAPVIEW_NETWORKSTATUSCHANGED_EXIT); +} + +/*! + Stores WLAN network mode. +*/ +void CpWlanApView::networkModeChanged(int index) +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_NETWORKMODECHANGED_ENTRY); + + // Update to CommsDat + mCmConnectionMethod->setIntAttribute(CMManagerShim::WlanConnectionMode, + mNetworkModeMap.value(index)); + (void)tryUpdate(); + + OstTraceFunctionExit0(CPWLANAPVIEW_NETWORKMODECHANGED_EXIT); +} + +/*! + Stores WLAN security mode. +*/ +void CpWlanApView::securityModeChanged(int index) +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_SECURITYMODECHANGED_ENTRY); + + // Get security plugin + CpWlanSecurityPluginInterface *plugin = mSecurityModeMap.value(index); + // Update to CommsDat + if (plugin) { + mCmConnectionMethod->setIntAttribute(CMManagerShim::WlanSecurityMode, + plugin->securityMode()); + } else { + mCmConnectionMethod->setIntAttribute(CMManagerShim::WlanSecurityMode, + CMManagerShim::WlanSecModeOpen); + } + (void)tryUpdate(); + + // Update UI + updateSecurityGroup( + mSecurityModeItem->contentWidgetData("currentIndex").toInt()); + + OstTraceFunctionExit0(CPWLANAPVIEW_SECURITYMODECHANGED_EXIT); +} + +/*! + Stores homepage. +*/ +void CpWlanApView::homepageChanged() +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_HOMEPAGECHANGED_ENTRY); + + // Update to CommsDat + QString homepage = mHomepageItem->contentWidgetData("text").toString(); + mCmConnectionMethod->setStringAttribute( + CMManagerShim::CmStartPage, + homepage); + (void)tryUpdate(); + + OstTraceFunctionExit0(CPWLANAPVIEW_HOMEPAGECHANGED_EXIT); +} + +/*! + Handles view menu actions. +*/ +void CpWlanApView::menuActionTriggered(HbAction *action) +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_MENUACTIONTRIGGERED_ENTRY); + + if (action == mAdvancedSettingsAction) { + HbMainWindow *mainWindow = this->mainWindow(); + + // Create the advanced settings view + HbView *newView = new CpWlanApAdvancedView(mCmConnectionMethod); + // Connect signal to return back to the previous view + bool status = QObject::connect( + newView, + SIGNAL(aboutToClose()), + this, + SLOT(restoreCurrentView())); + Q_ASSERT(status); + + mainWindow->addView(newView); + mainWindow->setCurrentView(newView); + } + + OstTraceFunctionExit0(CPWLANAPVIEW_MENUACTIONTRIGGERED_EXIT); +} + +/*! + Removes current view from main window and sets this view as the + current view. Used when "back" button is pressed in "Advanced settings" + view. +*/ +void CpWlanApView::restoreCurrentView() +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_RESTORECURRENTVIEW_ENTRY); + + HbMainWindow *mainWindow = this->mainWindow(); + + // Remove the previous view and delete it + HbView *prevView = mainWindow->currentView(); + mainWindow->removeView(prevView); + prevView->deleteLater(); + + // Set this view on top + mainWindow->setCurrentView(this); + + OstTraceFunctionExit0(CPWLANAPVIEW_RESTORECURRENTVIEW_EXIT); +} + +/*! + Sets editor preferences for all HbLineEdit items. +*/ +void CpWlanApView::setEditorPreferences(const QModelIndex modelIndex) +{ + OstTraceFunctionEntry0(CPWLANAPVIEW_SETEDITORPREFERENCES_ENTRY); + + HbDataFormViewItem *viewItem = mForm->dataFormViewItem(modelIndex); + HbDataFormModelItem *modelItem = mModel->itemFromIndex(modelIndex); + + if (modelItem == mConnectionNameItem + || modelItem == mWlanNetworkNameItem + || modelItem == mHomepageItem ) { + // HbLineEdit items, get editor and editor interface + HbLineEdit *edit = qobject_cast + (viewItem->dataItemContentWidget()); + HbEditorInterface editInterface(edit); + + if (modelItem == mConnectionNameItem) { + // Setup editor for connection name + editInterface.setConstraints(HbEditorConstraintLatinAlphabetOnly); + edit->setInputMethodHints(Qt::ImhNoPredictiveText); + edit->setMaxLength(CMManagerShim::CmNameLength); + } else if (modelItem == mWlanNetworkNameItem) { + // Setup editor for WLAN SSID + editInterface.setInputMode(HbInputModeNone); + editInterface.setConstraints(HbEditorConstraintLatinAlphabetOnly); + // TODO: Remove comment, should be in w12 + //editInterface.setEditorClass(HbInputEditorClassNetworkName); + editInterface.setLocalDigitType(HbDigitTypeNone); + edit->setInputMethodHints( + Qt::ImhNoPredictiveText | Qt::ImhPreferLowercase); + edit->setMaxLength(CMManagerShim::WlanSSIDLength); + } else { /* mHomepageItem */ + // Setup editor for URL + editInterface.setInputMode(HbInputModeNone); + editInterface.setConstraints(HbEditorConstraintLatinAlphabetOnly); + editInterface.setFilter(HbUrlFilter::instance()); + editInterface.setEditorClass(HbInputEditorClassUrl); + editInterface.setLocalDigitType(HbDigitTypeNone); + edit->setInputMethodHints( + Qt::ImhNoPredictiveText | Qt::ImhPreferLowercase); + edit->setMaxLength(CMManagerShim::CmStartPageLength); + } + } + + OstTraceFunctionExit0(CPWLANAPVIEW_SETEDITORPREFERENCES_EXIT); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/traces/OstTraceDefinitions.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,22 @@ +/* + * 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: + * OST trace header file. + * + */ + +#ifndef OSTTRACEDEFINITIONS_H +#define OSTTRACEDEFINITIONS_H +#include +#endif diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/tsrc/ut/hbautotest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/tsrc/ut/hbautotest.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,835 @@ +/* +* 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 "hbautotest.h" +#include +#include + + +const qreal STEP = 4; //How many pixels to drag before sending an event + +//Init static members +bool HbAutoTest::pointerPressed = false; +QPointF HbAutoTest::pressPoint = QPointF(); + +void HbAutoTest::mouseMove (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos, int delay) +{ + if (delay!=-1) { + QTest::qWait(delay); + } + QPointF targetPoint=QPointF(); + if (pos==QPointF()) { + targetPoint = middlePointOfWidget(widget); + } else { + targetPoint = widget->mapToScene(pos); + } + if (pointerPressed) { + //Now we should drag an item + drag(window, targetPoint); + HbAutoTestMouseEvent me ( + QEvent::MouseMove, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::NoButton, + Qt::NoButton, + Qt::NoModifier); + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + QTest::qWait(1); + } else { + HbAutoTestMouseEvent me ( + QEvent::MouseMove, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::NoButton, + Qt::NoButton, + Qt::NoModifier); + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + QTest::qWait(1); + + } + QTest::qWait(1); + QTest::qWait(1); +} + +void HbAutoTest::mousePress (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos, int delay) +{ + if (delay!=-1) { + QTest::qWait(delay); + } + pointerPressed=true; + QPointF targetPoint=QPointF(); + if (pos==QPointF()) { + targetPoint = middlePointOfWidget(widget); + } else { + targetPoint = widget->mapToScene(pos); + } + QCursor::setPos(window->mapToGlobal(targetPoint.toPoint())); + + pressPoint=targetPoint; + + HbAutoTestMouseEvent me ( + QEvent::MouseButtonPress, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::LeftButton, + Qt::LeftButton, + Qt::NoModifier); + + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + QCoreApplication::sendPostedEvents(); + QTest::qWait(1); +} + +void HbAutoTest::mouseRelease (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos, int delay) +{ + if (delay!=-1) { + QTest::qWait(delay); + } + pointerPressed=false; + QPointF targetPoint=QPointF(); + if (pos==QPointF()) { + targetPoint = middlePointOfWidget(widget); + } else { + targetPoint = widget->mapToScene(pos); + } + QCursor::setPos(window->mapToGlobal(targetPoint.toPoint())); + pressPoint=QPointF(); + HbAutoTestMouseEvent me ( + QEvent::MouseButtonRelease, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::LeftButton, + Qt::NoButton, + Qt::NoModifier); + + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + + QTest::qWait(1); + QTest::qWait(1); +} + +void HbAutoTest::mouseClick (HbAutoTestMainWindow *window, const HbWidget *widget, QPointF pos, int delay) +{ + if (delay!=-1) { + QTest::qWait(delay); + } + QPointF targetPoint=QPointF(); + if (pos==QPointF()) { + targetPoint = middlePointOfWidget(widget); + } else { + targetPoint = widget->mapToScene(pos); + } + + QCursor::setPos(window->mapToGlobal(targetPoint.toPoint())); + + HbAutoTestMouseEvent me ( + QEvent::MouseButtonPress, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::LeftButton, + Qt::LeftButton, + Qt::NoModifier); + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + //QTime currentTime = QTime::currentTime(); + //qDebug() << currentTime.toString("hh:mm:ss.zzz") << ": Left button down"; + QTest::qWait(1); + + if (delay!=-1) { + QTest::qWait(delay); + } + HbAutoTestMouseEvent me2 ( + QEvent::MouseButtonRelease, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::LeftButton, + Qt::NoButton, + Qt::NoModifier); + + QSpontaneKeyEvent::setSpontaneous(&me2); + qApp->notify((window->viewport()), &me2); + QCoreApplication::sendPostedEvents(); + //currentTime = QTime::currentTime(); + //qDebug() << currentTime.toString("hh:mm:ss.zzz") << ": Left button up"; + + QTest::qWait(1); + QTest::qWait(1); +} + +QPointF HbAutoTest::middlePointOfWidget( const HbWidget* widget) +{ + QRectF widgetRect = widget->rect(); + QRectF widgetSceneRect = widget->mapRectToScene(widgetRect); + qreal middleX = ((widgetSceneRect.right() - widgetSceneRect.left())/2)+widgetSceneRect.left(); + qreal middleY = ((widgetSceneRect.bottom() - widgetSceneRect.top())/2)+widgetSceneRect.top(); + return QPointF(middleX,middleY); +} + + + +void HbAutoTest::drag(HbAutoTestMainWindow *window, QPointF targetPoint) +{ + qreal tempX = targetPoint.x() - pressPoint.x(); + qreal tempY = targetPoint.y() - pressPoint.y(); + qreal totalTrip = sqrt ((tempX * tempX) + (tempY * tempY)); + + int numberOfSteps = qRound(totalTrip / STEP); + HbAutoTestMouseEvent me ( + QEvent::MouseMove, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::NoButton , + Qt::LeftButton, + Qt::NoModifier); + + QPointF nextPanPoint=pressPoint; + for (int i=1; imapToGlobal(nextPanPoint.toPoint())); + + me = HbAutoTestMouseEvent (QEvent::MouseMove, + nextPanPoint.toPoint(), + window->viewport()->mapToGlobal(nextPanPoint.toPoint()), + Qt::NoButton, + Qt::LeftButton, + Qt::NoModifier); + + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); + } + + QCursor::setPos(window->mapToGlobal(targetPoint.toPoint())); + + //One more (or the only one) step to the target + me = HbAutoTestMouseEvent (QEvent::MouseMove, + targetPoint.toPoint(), + window->viewport()->mapToGlobal(targetPoint.toPoint()), + Qt::NoButton, + Qt::LeftButton, + Qt::NoModifier); + QSpontaneKeyEvent::setSpontaneous(&me); + qApp->notify((window->viewport()), &me); + QCoreApplication::sendPostedEvents(); +} + + +void HbAutoTest::simulateEvent(QWidget *widget, bool press, int code, + Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + extern int Q_TESTLIB_EXPORT defaultKeyDelay(); + + if (delay == -1 || delay < 10) // defaultKeyDelay()) + delay = 10; //defaultKeyDelay(); + if(delay > 0) + QTest::qWait(delay); +// Q_UNUSED(delay); +// QTest::qWait(10); //TODO: Remove this and reveal above out-commented code + + HbAutoTestKeyEvent a(press ? QEvent::KeyPress : QEvent::KeyRelease, code, modifier, text, repeat); + QSpontaneKeyEvent::setSpontaneous(&a); + if (!qApp->notify(widget, &a)) + QTest::qWarn("Keyboard event not accepted by receiving widget"); + } + +void HbAutoTest::sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, + QString text, Qt::KeyboardModifiers modifier, int delay) + { + QTEST_ASSERT(qApp); + + if (!widget) + widget = QWidget::keyboardGrabber(); + if (!widget) { + if (QWidget *apw = QApplication::activePopupWidget()) + widget = apw->focusWidget() ? apw->focusWidget() : apw; + else + widget = QApplication::focusWidget(); + } + if (!widget) + widget = QApplication::activeWindow(); + + QTEST_ASSERT(widget); + + if (action == QTest::Click) { + QPointer ptr(widget); + sendKeyEvent(QTest::Press, widget, code, text, modifier, delay); + if (!ptr) { + // if we send key-events to embedded widgets, they might be destroyed + // when the user presses Return + return; + } + sendKeyEvent(QTest::Release, widget, code, text, modifier, delay); + return; + } + + bool repeat = false; + + if (action == QTest::Press) { + if (modifier & Qt::ShiftModifier) + simulateEvent(widget, true, Qt::Key_Shift, 0, QString(), false, delay); + + if (modifier & Qt::ControlModifier) + simulateEvent(widget, true, Qt::Key_Control, modifier & Qt::ShiftModifier, QString(), false, delay); + + if (modifier & Qt::AltModifier) + simulateEvent(widget, true, Qt::Key_Alt, + modifier & (Qt::ShiftModifier | Qt::ControlModifier), QString(), false, delay); + if (modifier & Qt::MetaModifier) + simulateEvent(widget, true, Qt::Key_Meta, modifier & (Qt::ShiftModifier + | Qt::ControlModifier | Qt::AltModifier), QString(), false, delay); + simulateEvent(widget, true, code, modifier, text, repeat, delay); + } else if (action == QTest::Release) { + simulateEvent(widget, false, code, modifier, text, repeat, delay); + + if (modifier & Qt::MetaModifier) + simulateEvent(widget, false, Qt::Key_Meta, modifier, QString(), false, delay); + if (modifier & Qt::AltModifier) + simulateEvent(widget, false, Qt::Key_Alt, modifier & + (Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier), QString(), false, delay); + + if (modifier & Qt::ControlModifier) + simulateEvent(widget, false, Qt::Key_Control, + modifier & (Qt::ShiftModifier | Qt::ControlModifier), QString(), false, delay); + + if (modifier & Qt::ShiftModifier) + simulateEvent(widget, false, Qt::Key_Shift, modifier & Qt::ShiftModifier, QString(), false, delay); + } + } + +void HbAutoTest::sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, + char ascii, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + QString text; + if (ascii) + text = QString(QChar::fromLatin1(ascii)); + sendKeyEvent(action, widget, code, text, modifier, delay); + } + +void HbAutoTest::keyEvent(QTest::KeyAction action, QWidget *widget, char ascii, + Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + sendKeyEvent(action, widget, asciiToKey(ascii), ascii, modifier, delay); + } + +void HbAutoTest::keyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key key, + Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + sendKeyEvent(action, widget, key, keyToAscii(key), modifier, delay); + } + +void HbAutoTest::keyClicks(QWidget *widget, const QString &sequence, + Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + for (int i=0; i < sequence.length(); i++) + keyEvent(QTest::Click, widget, sequence.at(i).toLatin1(), modifier, delay); + } + +void HbAutoTest::keyPress(QWidget *widget, char key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Press, widget, key, modifier, delay); + } + +void HbAutoTest::keyRelease(QWidget *widget, char key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Release, widget, key, modifier, delay); + } + +void HbAutoTest::keyClick(QWidget *widget, char key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Click, widget, key, modifier, delay); + } + +void HbAutoTest::keyPress(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Press, widget, key, modifier, delay); + } + +void HbAutoTest::keyRelease(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Release, widget, key, modifier, delay); } + +void HbAutoTest::keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier, int delay) + { + Q_ASSERT_X(dynamic_cast(( widget) ) != 0, "HbAutoTest", "Always use with HbAutoTestMainWindow"); + keyEvent(QTest::Click, widget, key, modifier, delay); + } + +Qt::Key HbAutoTest::asciiToKey(char ascii) +{ + switch ((unsigned char)ascii) { + case 0x08: return Qt::Key_Backspace; + case 0x09: return Qt::Key_Tab; + case 0x0b: return Qt::Key_Backtab; + case 0x0d: return Qt::Key_Return; + case 0x1b: return Qt::Key_Escape; + case 0x20: return Qt::Key_Space; + case 0x21: return Qt::Key_Exclam; + case 0x22: return Qt::Key_QuoteDbl; + case 0x23: return Qt::Key_NumberSign; + case 0x24: return Qt::Key_Dollar; + case 0x25: return Qt::Key_Percent; + case 0x26: return Qt::Key_Ampersand; + case 0x27: return Qt::Key_Apostrophe; + case 0x28: return Qt::Key_ParenLeft; + case 0x29: return Qt::Key_ParenRight; + case 0x2a: return Qt::Key_Asterisk; + case 0x2b: return Qt::Key_Plus; + case 0x2c: return Qt::Key_Comma; + case 0x2d: return Qt::Key_Minus; + case 0x2e: return Qt::Key_Period; + case 0x2f: return Qt::Key_Slash; + case 0x30: return Qt::Key_0; + case 0x31: return Qt::Key_1; + case 0x32: return Qt::Key_2; + case 0x33: return Qt::Key_3; + case 0x34: return Qt::Key_4; + case 0x35: return Qt::Key_5; + case 0x36: return Qt::Key_6; + case 0x37: return Qt::Key_7; + case 0x38: return Qt::Key_8; + case 0x39: return Qt::Key_9; + case 0x3a: return Qt::Key_Colon; + case 0x3b: return Qt::Key_Semicolon; + case 0x3c: return Qt::Key_Less; + case 0x3d: return Qt::Key_Equal; + case 0x3e: return Qt::Key_Greater; + case 0x3f: return Qt::Key_Question; + case 0x40: return Qt::Key_At; + case 0x41: return Qt::Key_A; + case 0x42: return Qt::Key_B; + case 0x43: return Qt::Key_C; + case 0x44: return Qt::Key_D; + case 0x45: return Qt::Key_E; + case 0x46: return Qt::Key_F; + case 0x47: return Qt::Key_G; + case 0x48: return Qt::Key_H; + case 0x49: return Qt::Key_I; + case 0x4a: return Qt::Key_J; + case 0x4b: return Qt::Key_K; + case 0x4c: return Qt::Key_L; + case 0x4d: return Qt::Key_M; + case 0x4e: return Qt::Key_N; + case 0x4f: return Qt::Key_O; + case 0x50: return Qt::Key_P; + case 0x51: return Qt::Key_Q; + case 0x52: return Qt::Key_R; + case 0x53: return Qt::Key_S; + case 0x54: return Qt::Key_T; + case 0x55: return Qt::Key_U; + case 0x56: return Qt::Key_V; + case 0x57: return Qt::Key_W; + case 0x58: return Qt::Key_X; + case 0x59: return Qt::Key_Y; + case 0x5a: return Qt::Key_Z; + case 0x5b: return Qt::Key_BracketLeft; + case 0x5c: return Qt::Key_Backslash; + case 0x5d: return Qt::Key_BracketRight; + case 0x5e: return Qt::Key_AsciiCircum; + case 0x5f: return Qt::Key_Underscore; + case 0x60: return Qt::Key_QuoteLeft; + case 0x61: return Qt::Key_A; + case 0x62: return Qt::Key_B; + case 0x63: return Qt::Key_C; + case 0x64: return Qt::Key_D; + case 0x65: return Qt::Key_E; + case 0x66: return Qt::Key_F; + case 0x67: return Qt::Key_G; + case 0x68: return Qt::Key_H; + case 0x69: return Qt::Key_I; + case 0x6a: return Qt::Key_J; + case 0x6b: return Qt::Key_K; + case 0x6c: return Qt::Key_L; + case 0x6d: return Qt::Key_M; + case 0x6e: return Qt::Key_N; + case 0x6f: return Qt::Key_O; + case 0x70: return Qt::Key_P; + case 0x71: return Qt::Key_Q; + case 0x72: return Qt::Key_R; + case 0x73: return Qt::Key_S; + case 0x74: return Qt::Key_T; + case 0x75: return Qt::Key_U; + case 0x76: return Qt::Key_V; + case 0x77: return Qt::Key_W; + case 0x78: return Qt::Key_X; + case 0x79: return Qt::Key_Y; + case 0x7a: return Qt::Key_Z; + case 0x7b: return Qt::Key_BraceLeft; + case 0x7c: return Qt::Key_Bar; + case 0x7d: return Qt::Key_BraceRight; + case 0x7e: return Qt::Key_AsciiTilde; + + // Latin 1 codes adapted from X: keysymdef.h,v 1.21 94/08/28 16:17:06 + case 0xa0: return Qt::Key_nobreakspace; + case 0xa1: return Qt::Key_exclamdown; + case 0xa2: return Qt::Key_cent; + case 0xa3: return Qt::Key_sterling; + case 0xa4: return Qt::Key_currency; + case 0xa5: return Qt::Key_yen; + case 0xa6: return Qt::Key_brokenbar; + case 0xa7: return Qt::Key_section; + case 0xa8: return Qt::Key_diaeresis; + case 0xa9: return Qt::Key_copyright; + case 0xaa: return Qt::Key_ordfeminine; + case 0xab: return Qt::Key_guillemotleft; + case 0xac: return Qt::Key_notsign; + case 0xad: return Qt::Key_hyphen; + case 0xae: return Qt::Key_registered; + case 0xaf: return Qt::Key_macron; + case 0xb0: return Qt::Key_degree; + case 0xb1: return Qt::Key_plusminus; + case 0xb2: return Qt::Key_twosuperior; + case 0xb3: return Qt::Key_threesuperior; + case 0xb4: return Qt::Key_acute; + case 0xb5: return Qt::Key_mu; + case 0xb6: return Qt::Key_paragraph; + case 0xb7: return Qt::Key_periodcentered; + case 0xb8: return Qt::Key_cedilla; + case 0xb9: return Qt::Key_onesuperior; + case 0xba: return Qt::Key_masculine; + case 0xbb: return Qt::Key_guillemotright; + case 0xbc: return Qt::Key_onequarter; + case 0xbd: return Qt::Key_onehalf; + case 0xbe: return Qt::Key_threequarters; + case 0xbf: return Qt::Key_questiondown; + case 0xc0: return Qt::Key_Agrave; + case 0xc1: return Qt::Key_Aacute; + case 0xc2: return Qt::Key_Acircumflex; + case 0xc3: return Qt::Key_Atilde; + case 0xc4: return Qt::Key_Adiaeresis; + case 0xc5: return Qt::Key_Aring; + case 0xc6: return Qt::Key_AE; + case 0xc7: return Qt::Key_Ccedilla; + case 0xc8: return Qt::Key_Egrave; + case 0xc9: return Qt::Key_Eacute; + case 0xca: return Qt::Key_Ecircumflex; + case 0xcb: return Qt::Key_Ediaeresis; + case 0xcc: return Qt::Key_Igrave; + case 0xcd: return Qt::Key_Iacute; + case 0xce: return Qt::Key_Icircumflex; + case 0xcf: return Qt::Key_Idiaeresis; + case 0xd0: return Qt::Key_ETH; + case 0xd1: return Qt::Key_Ntilde; + case 0xd2: return Qt::Key_Ograve; + case 0xd3: return Qt::Key_Oacute; + case 0xd4: return Qt::Key_Ocircumflex; + case 0xd5: return Qt::Key_Otilde; + case 0xd6: return Qt::Key_Odiaeresis; + case 0xd7: return Qt::Key_multiply; + case 0xd8: return Qt::Key_Ooblique; + case 0xd9: return Qt::Key_Ugrave; + case 0xda: return Qt::Key_Uacute; + case 0xdb: return Qt::Key_Ucircumflex; + case 0xdc: return Qt::Key_Udiaeresis; + case 0xdd: return Qt::Key_Yacute; + case 0xde: return Qt::Key_THORN; + case 0xdf: return Qt::Key_ssharp; + case 0xe5: return Qt::Key_Aring; + case 0xe6: return Qt::Key_AE; + case 0xf7: return Qt::Key_division; + case 0xf8: return Qt::Key_Ooblique; + case 0xff: return Qt::Key_ydiaeresis; + default: QTEST_ASSERT(false); return Qt::Key(0); + } +} + +char HbAutoTest::keyToAscii(Qt::Key key) +{ + switch (key) { + case Qt::Key_Backspace: return 0x8; //BS + case Qt::Key_Tab: return 0x09; // HT + case Qt::Key_Backtab: return 0x0b; // VT + case Qt::Key_Enter: + case Qt::Key_Return: return 0x0d; // CR + case Qt::Key_Escape: return 0x1b; // ESC + case Qt::Key_Space: return 0x20; // 7 bit printable ASCII + case Qt::Key_Exclam: return 0x21; + case Qt::Key_QuoteDbl: return 0x22; + case Qt::Key_NumberSign: return 0x23; + case Qt::Key_Dollar: return 0x24; + case Qt::Key_Percent: return 0x25; + case Qt::Key_Ampersand: return 0x26; + case Qt::Key_Apostrophe: return 0x27; + case Qt::Key_ParenLeft: return 0x28; + case Qt::Key_ParenRight: return 0x29; + case Qt::Key_Asterisk: return 0x2a; + case Qt::Key_Plus: return 0x2b; + case Qt::Key_Comma: return 0x2c; + case Qt::Key_Minus: return 0x2d; + case Qt::Key_Period: return 0x2e; + case Qt::Key_Slash: return 0x2f; + case Qt::Key_0: return 0x30; + case Qt::Key_1: return 0x31; + case Qt::Key_2: return 0x32; + case Qt::Key_3: return 0x33; + case Qt::Key_4: return 0x34; + case Qt::Key_5: return 0x35; + case Qt::Key_6: return 0x36; + case Qt::Key_7: return 0x37; + case Qt::Key_8: return 0x38; + case Qt::Key_9: return 0x39; + case Qt::Key_Colon: return 0x3a; + case Qt::Key_Semicolon: return 0x3b; + case Qt::Key_Less: return 0x3c; + case Qt::Key_Equal: return 0x3d; + case Qt::Key_Greater: return 0x3e; + case Qt::Key_Question: return 0x3f; + case Qt::Key_At: return 0x40; + case Qt::Key_A: return 0x61; // 0x41 == 'A', 0x61 == 'a' + case Qt::Key_B: return 0x62; + case Qt::Key_C: return 0x63; + case Qt::Key_D: return 0x64; + case Qt::Key_E: return 0x65; + case Qt::Key_F: return 0x66; + case Qt::Key_G: return 0x67; + case Qt::Key_H: return 0x68; + case Qt::Key_I: return 0x69; + case Qt::Key_J: return 0x6a; + case Qt::Key_K: return 0x6b; + case Qt::Key_L: return 0x6c; + case Qt::Key_M: return 0x6d; + case Qt::Key_N: return 0x6e; + case Qt::Key_O: return 0x6f; + case Qt::Key_P: return 0x70; + case Qt::Key_Q: return 0x71; + case Qt::Key_R: return 0x72; + case Qt::Key_S: return 0x73; + case Qt::Key_T: return 0x74; + case Qt::Key_U: return 0x75; + case Qt::Key_V: return 0x76; + case Qt::Key_W: return 0x77; + case Qt::Key_X: return 0x78; + case Qt::Key_Y: return 0x79; + case Qt::Key_Z: return 0x7a; + case Qt::Key_BracketLeft: return 0x5b; + case Qt::Key_Backslash: return 0x5c; + case Qt::Key_BracketRight: return 0x5d; + case Qt::Key_AsciiCircum: return 0x5e; + case Qt::Key_Underscore: return 0x5f; + case Qt::Key_QuoteLeft: return 0x60; + + case Qt::Key_BraceLeft: return 0x7b; + case Qt::Key_Bar: return 0x7c; + case Qt::Key_BraceRight: return 0x7d; + case Qt::Key_AsciiTilde: return 0x7e; + + case Qt::Key_Delete: return 0; + case Qt::Key_Insert: return 0; // = 0x1006, + case Qt::Key_Pause: return 0; // = 0x1008, + case Qt::Key_Print: return 0; // = 0x1009, + case Qt::Key_SysReq: return 0; // = 0x100a, + + case Qt::Key_Clear: return 0; // = 0x100b, + + case Qt::Key_Home: return 0; // = 0x1010, // cursor movement + case Qt::Key_End: return 0; // = 0x1011, + case Qt::Key_Left: return 0; // = 0x1012, + case Qt::Key_Up: return 0; // = 0x1013, + case Qt::Key_Right: return 0; // = 0x1014, + case Qt::Key_Down: return 0; // = 0x1015, + case Qt::Key_PageUp: return 0; // = 0x1016, + case Qt::Key_PageDown: return 0; // = 0x1017, + case Qt::Key_Shift: return 0; // = 0x1020, // modifiers + case Qt::Key_Control: return 0; // = 0x1021, + case Qt::Key_Meta: return 0; // = 0x1022, + case Qt::Key_Alt: return 0; // = 0x1023, + case Qt::Key_CapsLock: return 0; // = 0x1024, + case Qt::Key_NumLock: return 0; // = 0x1025, + case Qt::Key_ScrollLock: return 0; // = 0x1026, + case Qt::Key_F1: return 0; // = 0x1030, // function keys + case Qt::Key_F2: return 0; // = 0x1031, + case Qt::Key_F3: return 0; // = 0x1032, + case Qt::Key_F4: return 0; // = 0x1033, + case Qt::Key_F5: return 0; // = 0x1034, + case Qt::Key_F6: return 0; // = 0x1035, + case Qt::Key_F7: return 0; // = 0x1036, + case Qt::Key_F8: return 0; // = 0x1037, + case Qt::Key_F9: return 0; // = 0x1038, + case Qt::Key_F10: return 0; // = 0x1039, + case Qt::Key_F11: return 0; // = 0x103a, + case Qt::Key_F12: return 0; // = 0x103b, + case Qt::Key_F13: return 0; // = 0x103c, + case Qt::Key_F14: return 0; // = 0x103d, + case Qt::Key_F15: return 0; // = 0x103e, + case Qt::Key_F16: return 0; // = 0x103f, + case Qt::Key_F17: return 0; // = 0x1040, + case Qt::Key_F18: return 0; // = 0x1041, + case Qt::Key_F19: return 0; // = 0x1042, + case Qt::Key_F20: return 0; // = 0x1043, + case Qt::Key_F21: return 0; // = 0x1044, + case Qt::Key_F22: return 0; // = 0x1045, + case Qt::Key_F23: return 0; // = 0x1046, + case Qt::Key_F24: return 0; // = 0x1047, + case Qt::Key_F25: return 0; // = 0x1048, // F25 .. F35 only on X11 + case Qt::Key_F26: return 0; // = 0x1049, + case Qt::Key_F27: return 0; // = 0x104a, + case Qt::Key_F28: return 0; // = 0x104b, + case Qt::Key_F29: return 0; // = 0x104c, + case Qt::Key_F30: return 0; // = 0x104d, + case Qt::Key_F31: return 0; // = 0x104e, + case Qt::Key_F32: return 0; // = 0x104f, + case Qt::Key_F33: return 0; // = 0x1050, + case Qt::Key_F34: return 0; // = 0x1051, + case Qt::Key_F35: return 0; // = 0x1052, + case Qt::Key_Super_L: return 0; // = 0x1053, // extra keys + case Qt::Key_Super_R: return 0; // = 0x1054, + case Qt::Key_Menu: return 0; // = 0x1055, + case Qt::Key_Hyper_L: return 0; // = 0x1056, + case Qt::Key_Hyper_R: return 0; // = 0x1057, + case Qt::Key_Help: return 0; // = 0x1058, + case Qt::Key_Direction_L: return 0; // = 0x1059, + case Qt::Key_Direction_R: return 0; // = 0x1060, + + // Latin 1 codes adapted from X: keysymdef.h,v 1.21 94/08/28 16:17:06 + case Qt::Key_nobreakspace: return char(0xa0); + case Qt::Key_exclamdown: return char(0xa1); + case Qt::Key_cent: return char(0xa2); + case Qt::Key_sterling: return char(0xa3); + case Qt::Key_currency: return char(0xa4); + case Qt::Key_yen: return char(0xa5); + case Qt::Key_brokenbar: return char(0xa6); + case Qt::Key_section: return char(0xa7); + case Qt::Key_diaeresis: return char(0xa8); + case Qt::Key_copyright: return char(0xa9); + case Qt::Key_ordfeminine: return char(0xaa); + case Qt::Key_guillemotleft: return char(0xab); // left angle quotation mar + case Qt::Key_notsign: return char(0xac); + case Qt::Key_hyphen: return char(0xad); + case Qt::Key_registered: return char(0xae); + case Qt::Key_macron: return char(0xaf); + case Qt::Key_degree: return char(0xb0); + case Qt::Key_plusminus: return char(0xb1); + case Qt::Key_twosuperior: return char(0xb2); + case Qt::Key_threesuperior: return char(0xb3); + case Qt::Key_acute: return char(0xb4); + case Qt::Key_mu: return char(0xb5); + case Qt::Key_paragraph: return char(0xb6); + case Qt::Key_periodcentered: return char(0xb7); + case Qt::Key_cedilla: return char(0xb8); + case Qt::Key_onesuperior: return char(0xb9); + case Qt::Key_masculine: return char(0xba); + case Qt::Key_guillemotright: return char(0xbb); // right angle quotation mar + case Qt::Key_onequarter: return char(0xbc); + case Qt::Key_onehalf: return char(0xbd); + case Qt::Key_threequarters: return char(0xbe); + case Qt::Key_questiondown: return char(0xbf); + case Qt::Key_Agrave: return char(0xc0); + case Qt::Key_Aacute: return char(0xc1); + case Qt::Key_Acircumflex: return char(0xc2); + case Qt::Key_Atilde: return char(0xc3); + case Qt::Key_Adiaeresis: return char(0xc4); + case Qt::Key_Aring: return char(0xe5); + case Qt::Key_AE: return char(0xe6); + case Qt::Key_Ccedilla: return char(0xc7); + case Qt::Key_Egrave: return char(0xc8); + case Qt::Key_Eacute: return char(0xc9); + case Qt::Key_Ecircumflex: return char(0xca); + case Qt::Key_Ediaeresis: return char(0xcb); + case Qt::Key_Igrave: return char(0xcc); + case Qt::Key_Iacute: return char(0xcd); + case Qt::Key_Icircumflex: return char(0xce); + case Qt::Key_Idiaeresis: return char(0xcf); + case Qt::Key_ETH: return char(0xd0); + case Qt::Key_Ntilde: return char(0xd1); + case Qt::Key_Ograve: return char(0xd2); + case Qt::Key_Oacute: return char(0xd3); + case Qt::Key_Ocircumflex: return char(0xd4); + case Qt::Key_Otilde: return char(0xd5); + case Qt::Key_Odiaeresis: return char(0xd6); + case Qt::Key_multiply: return char(0xd7); + case Qt::Key_Ooblique: return char(0xf8); + case Qt::Key_Ugrave: return char(0xd9); + case Qt::Key_Uacute: return char(0xda); + case Qt::Key_Ucircumflex: return char(0xdb); + case Qt::Key_Udiaeresis: return char(0xdc); + case Qt::Key_Yacute: return char(0xdd); + case Qt::Key_THORN: return char(0xde); + case Qt::Key_ssharp: return char(0xdf); + case Qt::Key_division: return char(0xf7); + case Qt::Key_ydiaeresis: return char(0xff); + + // multimedia/internet keys - ignored by default - see QKeyEvent c'tor + + case Qt::Key_Back : return 0; // = 0x1061, + case Qt::Key_Forward : return 0; // = 0x1062, + case Qt::Key_Stop : return 0; // = 0x1063, + case Qt::Key_Refresh : return 0; // = 0x1064, + + case Qt::Key_VolumeDown: return 0; // = 0x1070, + case Qt::Key_VolumeMute : return 0; // = 0x1071, + case Qt::Key_VolumeUp: return 0; // = 0x1072, + case Qt::Key_BassBoost: return 0; // = 0x1073, + case Qt::Key_BassUp: return 0; // = 0x1074, + case Qt::Key_BassDown: return 0; // = 0x1075, + case Qt::Key_TrebleUp: return 0; // = 0x1076, + case Qt::Key_TrebleDown: return 0; // = 0x1077, + + case Qt::Key_MediaPlay : return 0; // = 0x1080, + case Qt::Key_MediaStop : return 0; // = 0x1081, + case Qt::Key_MediaPrevious : return 0; // = 0x1082, + case Qt::Key_MediaNext : return 0; // = 0x1083, + case Qt::Key_MediaRecord: return 0; // = 0x1084, + + case Qt::Key_HomePage : return 0; // = 0x1090, + case Qt::Key_Favorites : return 0; // = 0x1091, + case Qt::Key_Search : return 0; // = 0x1092, + case Qt::Key_Standby: return 0; // = 0x1093, + case Qt::Key_OpenUrl: return 0; // = 0x1094, + + case Qt::Key_LaunchMail : return 0; // = 0x10a0, + case Qt::Key_LaunchMedia: return 0; // = 0x10a1, + case Qt::Key_Launch0 : return 0; // = 0x10a2, + case Qt::Key_Launch1 : return 0; // = 0x10a3, + case Qt::Key_Launch2 : return 0; // = 0x10a4, + case Qt::Key_Launch3 : return 0; // = 0x10a5, + case Qt::Key_Launch4 : return 0; // = 0x10a6, + case Qt::Key_Launch5 : return 0; // = 0x10a7, + case Qt::Key_Launch6 : return 0; // = 0x10a8, + case Qt::Key_Launch7 : return 0; // = 0x10a9, + case Qt::Key_Launch8 : return 0; // = 0x10aa, + case Qt::Key_Launch9 : return 0; // = 0x10ab, + case Qt::Key_LaunchA : return 0; // = 0x10ac, + case Qt::Key_LaunchB : return 0; // = 0x10ad, + case Qt::Key_LaunchC : return 0; // = 0x10ae, + case Qt::Key_LaunchD : return 0; // = 0x10af, + case Qt::Key_LaunchE : return 0; // = 0x10b0, + case Qt::Key_LaunchF : return 0; // = 0x10b1, + + default: QTEST_ASSERT(false); return 0; + } +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/tsrc/ut/hbautotest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/tsrc/ut/hbautotest.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,279 @@ +/* +* 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 HBAUTOTEST_H +#define HBAUTOTEST_H + +#include +#include +#include + +class HbMainWindow; +class HbWidget; +class HbAutoTestMainWindow; +class HbAutoTest; +class HbAutoTestMouseEvent; +/* +INSTRUCTIONS: +The class HbAutoTest is meant to be used with Orbit applications auto testing instead of GUI testing APIs of QTestLib. + +The functions of this class is to used similarily to the related QTestLib functions. + +Use HbAutoTestMainWindow (defined below) instead of HbMainWindow to enble filtering. +Filterin filters out UI events that are not sent by function defined in HbAutoTest class. + +*/ + +class HbAutoTestMouseEvent : public QMouseEvent +{ +public: + HbAutoTestMouseEvent(Type type, const QPoint & pos, const QPoint & globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers ) + : QMouseEvent(type,pos,globalPos,button,buttons,modifiers){} +}; + +class HbAutoTestKeyEvent : public QKeyEvent +{ +public: + HbAutoTestKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text = QString(), + bool autorep = false, ushort count = 1 ) + : QKeyEvent(type, key, modifiers, text, autorep, count){} +}; + +class HbAutoTest +{ +public: + + static void mouseMove (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos = QPointF(), int delay = -1 ); + static void mousePress (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos = QPointF(), int delay = -1); + static void mouseRelease (HbAutoTestMainWindow *window, HbWidget *widget, QPointF pos = QPointF(), int delay = -1); + static void mouseClick (HbAutoTestMainWindow *window, const HbWidget *widget, QPointF pos = QPointF(), int delay = -1); + +private: + static void drag(HbAutoTestMainWindow *window, QPointF targetPoint); + static QPointF middlePointOfWidget( const HbWidget* widget); + + static bool pointerPressed; + static QPointF pressPoint; + +//Key event Part: copy-pasted from QTestLib and modified to support HbAutoTestKeyEvent to enable filtering. +//see HbAutoTestMainWindow below. +public: + + static Qt::Key asciiToKey(char ascii); + static char keyToAscii(Qt::Key key); + + static void simulateEvent(QWidget *widget, bool press, int code, + Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay=-1); + + static void sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, + QString text, Qt::KeyboardModifiers modifier, int delay=-1); + + static void sendKeyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key code, + char ascii, Qt::KeyboardModifiers modifier, int delay=-1); + + static void keyEvent(QTest::KeyAction action, QWidget *widget, char ascii, + Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyEvent(QTest::KeyAction action, QWidget *widget, Qt::Key key, + Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyClicks(QWidget *widget, const QString &sequence, + Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyPress(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyRelease(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyClick(QWidget *widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyPress(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyRelease(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); + + static void keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1); +}; + +class HbTestEvent +{ +public: + virtual void simulate(QWidget *w) = 0; + virtual HbTestEvent *clone() const = 0; + + virtual ~HbTestEvent() {} +}; + +class HbTestKeyEvent: public HbTestEvent +{ +public: + inline HbTestKeyEvent(QTest::KeyAction action, Qt::Key key, Qt::KeyboardModifiers modifiers, int delay) + : _action(action), _delay(delay), _modifiers(modifiers), _ascii(0), _key(key) {} + inline HbTestKeyEvent(QTest::KeyAction action, char ascii, Qt::KeyboardModifiers modifiers, int delay) + : _action(action), _delay(delay), _modifiers(modifiers), + _ascii(ascii), _key(Qt::Key_unknown) {} + inline HbTestEvent *clone() const { return new HbTestKeyEvent(*this); } + + inline void simulate(QWidget *w) + { + if (_ascii == 0) + HbAutoTest::keyEvent(_action, w, _key, _modifiers, _delay); + else + HbAutoTest::keyEvent(_action, w, _ascii, _modifiers, _delay); + } + +protected: + QTest::KeyAction _action; + int _delay; + Qt::KeyboardModifiers _modifiers; + char _ascii; + Qt::Key _key; +}; + +class HbTestKeyClicksEvent: public HbTestEvent +{ +public: + inline HbTestKeyClicksEvent(const QString &keys, Qt::KeyboardModifiers modifiers, int delay) + : _keys(keys), _modifiers(modifiers), _delay(delay) {} + inline HbTestEvent *clone() const { return new HbTestKeyClicksEvent(*this); } + + inline void simulate(QWidget *w) + { + HbAutoTest::keyClicks(w, _keys, _modifiers, _delay); + } + +private: + QString _keys; + Qt::KeyboardModifiers _modifiers; + int _delay; +}; + +class HbTestDelayEvent: public HbTestEvent +{ +public: + inline HbTestDelayEvent(int msecs): _delay(msecs) {} + inline HbTestEvent *clone() const { return new HbTestDelayEvent(*this); } + + inline void simulate(QWidget * /*w*/) { QTest::qWait(_delay); } + +private: + int _delay; +}; + +class HbTestEventList: public QList +{ +public: + inline HbTestEventList() {} + inline HbTestEventList(const HbTestEventList &other): QList() + { for (int i = 0; i < other.count(); ++i) append(other.at(i)->clone()); } + inline ~HbTestEventList() + { clear(); } + inline void clear() + { qDeleteAll(*this); QList::clear(); } + + inline void addKeyClick(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Click, qtKey, modifiers, msecs); } + inline void addKeyPress(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Press, qtKey, modifiers, msecs); } + inline void addKeyRelease(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Release, qtKey, modifiers, msecs); } + inline void addKeyEvent(QTest::KeyAction action, Qt::Key qtKey, + Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { append(new HbTestKeyEvent(action, qtKey, modifiers, msecs)); } + + inline void addKeyClick(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Click, ascii, modifiers, msecs); } + inline void addKeyPress(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Press, ascii, modifiers, msecs); } + inline void addKeyRelease(char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { addKeyEvent(QTest::Release, ascii, modifiers, msecs); } + inline void addKeyClicks(const QString &keys, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { append(new HbTestKeyClicksEvent(keys, modifiers, msecs)); } + inline void addKeyEvent(QTest::KeyAction action, char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1) + { append(new HbTestKeyEvent(action, ascii, modifiers, msecs)); } + + inline void addDelay(int msecs) + { append(new HbTestDelayEvent(msecs)); } + + inline void simulate(QWidget *w) + { + for (int i = 0; i < count(); ++i) + at(i)->simulate(w); + } +}; + +class HbAutoTestMainWindow : public HbMainWindow +{ +public: + HbAutoTestMainWindow() : HbMainWindow() {} + + void mousePressEvent(QMouseEvent *event) + { + qDebug( + "HbAutoTestMainWindow::mousePressEvent: x(%d) y(%d)", + event->x(), + event->y()); + if ( dynamic_cast(event) ) { + HbMainWindow::mousePressEvent(event); + } else { + ;//Do nothing + } + } + + void mouseMoveEvent(QMouseEvent *event) + { + if ( dynamic_cast(event) ) { + HbMainWindow::mouseMoveEvent(event); + } else { + ;//Do nothing + } + } + + void mouseReleaseEvent(QMouseEvent *event) + { + if ( dynamic_cast(event) ) { + HbMainWindow::mouseReleaseEvent(event); + } else { + ;//Do nothing + } + } + + void keyPressEvent(QKeyEvent *event) + { + if ( dynamic_cast(event) ) { + HbMainWindow::keyPressEvent(event); + } else { + ;//Do nothing + } + } + void keyReleaseEvent(QKeyEvent *event) + { + if ( dynamic_cast(event) ) { + HbMainWindow::keyReleaseEvent(event); + } else { + ;//Do nothing + } + } + + void mouseDoubleClickEvent(QMouseEvent *event) + { + Q_UNUSED(event); + //Just ignore, not supported in Orbit + } +}; + + +Q_DECLARE_METATYPE(HbTestEventList) +#endif //HBAUTOTEST_H diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/tsrc/ut/testcpwlanapplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/tsrc/ut/testcpwlanapplugin.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,560 @@ +/* +* 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: +* Control Panel WLAN AP plugin unit testing. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cpwlanapview.h" + +#include "hbautotest.h" +#include "testcpwlanapplugin.h" + +// Following flag must be defined if WLAN security settings plugins +// (WEP, WPA/WPA2 and WPA2) are available. Flag can be removed when the +// plugins are released. +#define WLAN_SECURITY_PLUGINS_AVAILABLE + +// ----------------------------------------------------------------------------- +// STATIC TEST DATA +// ----------------------------------------------------------------------------- + +// Connection method (AP) ID used for testing +static const uint testApId = 5; + +static const QString pluginDir = + "\\resource\\qt\\plugins\\controlpanel\\bearerap"; + +static const QString pluginName = "cpwlanapplugin.dll"; + +// Time to wait before continuing after an UI step +static const int waitTime = 10; + +// UI coordinates +static const QPoint connectionNameLabel(175, 70); + +static const QPoint connectionNameLineEdit(330, 110); + +static const QPoint wlanNetworkNameLineEdit(330, 190); + +static const QPoint networkStatusComboBox(175, 270); +static const QPoint networkStatusPublic(175, 325); +static const QPoint networkStatusHidden(175, 375); + +static const QPoint networkModeComboBox(175, 365); +static const QPoint networkModeIntrastructure(175, 415); +static const QPoint networkModeAdHoc(175, 465); + +static const QPoint securityModeComboBox(175, 460); +#ifndef WLAN_SECURITY_PLUGINS_AVAILABLE +static const QPoint securityModeOpen(175, 510); +#else +static const QPoint securityModeOpen(175, 260); +static const QPoint securityModeWep(175, 305); +static const QPoint securityModeWpaWpa2(175, 355); +static const QPoint securityModeWpa2(175, 405); +#endif + +static const QPoint homepageLineEdit(330, 545); + +static const QPoint messageBoxOkButton(170, 320); + +// ----------------------------------------------------------------------------- +// FRAMEWORK FUNCTIONS +// ----------------------------------------------------------------------------- + +/** + * Test main function. Runs all test cases. + */ +#ifndef TESTCMAPPLSETTINGSUI_NO_OUTPUT_REDIRECT +int main(int argc, char *argv[]) +{ + HbApplication app(argc, argv); + app.setApplicationName("TestCpWlanApPlugin"); + + char *pass[3]; + pass[0] = argv[0]; + pass[1] = "-o"; + pass[2] = "c:\\data\\TestCpWlanApPlugin.txt"; + + TestCpWlanApPlugin tc; + int res = QTest::qExec(&tc, 3, pass); + + return res; +} +#else +QTEST_MAIN(TestCpWlanApPlugin) +#endif + +/** + * This function is be called before the first test case is executed. + */ +void TestCpWlanApPlugin::initTestCase() +{ + mMainWindow = new HbAutoTestMainWindow; + //mMainWindow = new HbMainWindow; + mMainWindow->show(); + + // Load plugin + QDir dir(pluginDir); + QPluginLoader loader(dir.absoluteFilePath(pluginName)); + mPlugin = qobject_cast(loader.instance()); + QVERIFY(mPlugin != NULL); + + // Verify plugin bearer type + QVERIFY(mPlugin->bearerType() == CMManagerShim::BearerTypeWlan); + + // Create WLAN settings view (connection method ID given) + subCreateSettingsView(testApId); +} + +/** + * This function is be called after the last test case was executed. + */ +void TestCpWlanApPlugin::cleanupTestCase() +{ + delete mMainWindow; + mMainWindow = 0; +} + +/** + * This function is be called before each test case is executed. + */ +void TestCpWlanApPlugin::init() +{ + QTest::qWait(1000); +} + +/** + * This function is be called after each test case is executed. + */ +void TestCpWlanApPlugin::cleanup() +{ +} + +// ----------------------------------------------------------------------------- +// TEST CASES +// ----------------------------------------------------------------------------- + +/** + * Tests changing of connection name. + */ +void TestCpWlanApPlugin::tcChangeConnectionName() +{ + QFETCH(QString, string); + QFETCH(QString, result); + + HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLineEdit); + + // Erase old string + subClearLineEdit(CMManagerShim::CmNameLength); + + // Enter new string + HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); + + HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLabel); + + // Verify both commsdat and UI widget + subVerifyString( + CMManagerShim::CmName, + mTestView->mConnectionNameItem, + result); +} + +/** + * Test data for connection name change test case. + */ +void TestCpWlanApPlugin::tcChangeConnectionName_data() +{ + QTest::addColumn("string"); + QTest::addColumn("result"); + + QTest::newRow("maximum length") + << "really long name 1234567890123" + << "really long name 1234567890123"; + QTest::newRow("too long") + << "too long name 123456789012345678901234567890" + << "too long name 1234567890123456"; + QTest::newRow("basic") // last one must always fit on one line in UI + << "test WLAN AP" + << "test WLAN AP"; +} + +/** + * Tests that empty connection name is not accepted. + */ +void TestCpWlanApPlugin::tcConnectionNameEmpty() +{ + QString previous = + mTestView->mConnectionNameItem->contentWidgetData("text").toString(); + + HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLineEdit); + // Erase old string + subClearLineEdit(CMManagerShim::CmNameLength); + + HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLabel); + + QTest::qWait(100); + // Dismiss messagebox + HbAutoTest::mouseClick(mMainWindow, mTestView, messageBoxOkButton); + + // Verify both commsdat and UI widget + subVerifyString( + CMManagerShim::CmName, + mTestView->mConnectionNameItem, + previous); +} + +/** + * Tests changing of WLAN network name. + */ +void TestCpWlanApPlugin::tcChangeWlanNetworkName() +{ + QFETCH(QString, string); + QFETCH(QString, result); + + HbAutoTest::mouseClick(mMainWindow, mTestView, wlanNetworkNameLineEdit); + + // Erase old string + subClearLineEdit(CMManagerShim::WlanSSIDLength); + + // Enter new string + HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); + + HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLabel); + + // Verify both commsdat and UI widget + subVerifyString( + CMManagerShim::WlanSSID, + mTestView->mWlanNetworkNameItem, + result); +} + +/** + * Test data for WLAN network name change test case. + */ +void TestCpWlanApPlugin::tcChangeWlanNetworkName_data() +{ + QTest::addColumn("string"); + QTest::addColumn("result"); + + QTest::newRow("maximum length") + << "really long name 123456789012345" + << "really long name 123456789012345"; + QTest::newRow("too long") + << "too long name 123456789012345678901234567890" + << "too long name 123456789012345678"; + QTest::newRow("basic") // last one must always fit on one line in UI + << "test SSID" + << "test SSID"; +} + +/** + * Tests that empty WLAN network name is not accepted. + */ +void TestCpWlanApPlugin::tcWlanNetworkNameEmpty() +{ + QString previous = + mTestView->mWlanNetworkNameItem->contentWidgetData("text").toString(); + + HbAutoTest::mouseClick(mMainWindow, mTestView, wlanNetworkNameLineEdit); + + // Erase old string + subClearLineEdit(CMManagerShim::WlanSSIDLength); + + HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLabel); + + QTest::qWait(100); + // Dismiss messagebox + HbAutoTest::mouseClick(mMainWindow, mTestView, messageBoxOkButton); + + // Verify both commsdat and UI widget + subVerifyString( + CMManagerShim::WlanSSID, + mTestView->mWlanNetworkNameItem, + previous); +} + +/** + * Tests changing of WLAN network status. + */ +void TestCpWlanApPlugin::tcChangeNetworkStatus() +{ + // Set network status to hidden + HbAutoTest::mouseClick(mMainWindow, mTestView, networkStatusComboBox, 100); + HbAutoTest::mouseClick(mMainWindow, mTestView, networkStatusHidden, 100); + subVerifyNetworkStatus(HiddenStatus); + + // Set network status to public + HbAutoTest::mouseClick(mMainWindow, mTestView, networkStatusComboBox, 100); + HbAutoTest::mouseClick(mMainWindow, mTestView, networkStatusPublic, 100); + subVerifyNetworkStatus(PublicStatus); +} + +/** + * Tests changing of WLAN network mode. + */ +void TestCpWlanApPlugin::tcChangeNetworkMode() +{ + // Set network mode to ad-hoc + HbAutoTest::mouseClick(mMainWindow, mTestView, networkModeComboBox, 100); + HbAutoTest::mouseClick(mMainWindow, mTestView, networkModeAdHoc, 100); + subVerifyUint(CMManagerShim::WlanConnectionMode, CMManagerShim::Adhoc); + + // Set network mode to infrastructure + HbAutoTest::mouseClick(mMainWindow, mTestView, networkModeComboBox, 100); + HbAutoTest::mouseClick(mMainWindow, mTestView, networkModeIntrastructure, 100); + subVerifyUint(CMManagerShim::WlanConnectionMode, CMManagerShim::Infra); +} + +/** + * Tests changing of WLAN security mode. + */ +void TestCpWlanApPlugin::tcChangeSecurityMode() +{ +#ifdef WLAN_SECURITY_PLUGINS_AVAILABLE + // Ensure security mode is open + HbAutoTest::mouseClick(mMainWindow, mTestView, securityModeComboBox, 100); + QTest::qWait(100); + HbAutoTest::mouseClick(mMainWindow, mTestView, securityModeOpen, 100); + subVerifyUint( + CMManagerShim::WlanSecurityMode, + CMManagerShim::WlanSecModeOpen); + + QTest::qWait(1000); + + // Set security mode to WEP + HbAutoTest::mouseClick(mMainWindow, mTestView, securityModeComboBox, 100); + QTest::qWait(100); + HbAutoTest::mouseClick(mMainWindow, mTestView, securityModeWep, 100); + subVerifyUint( + CMManagerShim::WlanSecurityMode, + CMManagerShim::WlanSecModeWep); + + QTest::qWait(1000); +#endif + + // Set security mode to open + HbAutoTest::mouseClick(mMainWindow, mTestView, securityModeComboBox, 100); + QTest::qWait(100); + HbAutoTest::mouseClick(mMainWindow, mTestView, securityModeOpen, 100); + subVerifyUint( + CMManagerShim::WlanSecurityMode, + CMManagerShim::WlanSecModeOpen); +} + +/** + * Tests changing of homepage. + */ +void TestCpWlanApPlugin::tcChangeHomepage() +{ + QFETCH(QString, string); + QFETCH(QString, result); + + HbAutoTest::mouseClick(mMainWindow, mTestView, homepageLineEdit); + + // Erase old string + QString text = mTestView->mHomepageItem->contentWidgetData("text").toString(); + subClearLineEdit(text.size()); + + // Enter new string + HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); + + HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLabel); + + // Verify both commsdat and UI widget + subVerifyString( + CMManagerShim::CmStartPage, + mTestView->mHomepageItem, + result); +} + +/** + * Test data for homepage change test case. + */ +void TestCpWlanApPlugin::tcChangeHomepage_data() +{ + QTest::addColumn("string"); + QTest::addColumn("result"); + +// Doesn't work always, view goes blank sometimes, Orbit bug? +// QTest::newRow("long") +// << "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html" +// << "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html"; + QTest::newRow("basic") // last one should always fit on one line in UI + << "http://www.symbian.org/" + << "http://www.symbian.org/"; + QTest::newRow("empty") + << "" + << ""; +} + +/** + * Tests advanced settings view (which is currently empty). + */ +void TestCpWlanApPlugin::tcAdvancedSettings() +{ + // Launch advanced settings view + bool status = connect( + this, + SIGNAL(menuActionTriggered(HbAction *)), + mTestView, + SLOT(menuActionTriggered(HbAction *))); + Q_ASSERT(status); + emit menuActionTriggered(mTestView->mAdvancedSettingsAction); + + QTest::qWait(2000); + + // Return from advanced settings view + subClickWidget("HbNavigationButton"); +} + +// ----------------------------------------------------------------------------- +// SUB TEST CASES +// ----------------------------------------------------------------------------- + +/** + * Verifies that given string is correctly stored in CommsDat and shown on UI. + */ +void TestCpWlanApPlugin::subVerifyString( + CMManagerShim::ConnectionMethodAttribute attribute, + HbDataFormModelItem *item, + QString expected) +{ + // Read attribute value from CommsDat + QScopedPointer cmManager(new CmManagerShim); + QScopedPointer connectionMethod( + cmManager->connectionMethod(testApId)); + QString commsdat = connectionMethod->getStringAttribute(attribute); + + QCOMPARE(commsdat, expected); + + // Get value from UI widget + QString widget = item->contentWidgetData("text").toString(); + + QCOMPARE(widget, expected); +} + +/** + * Verifies that given attribute contains expected integer value in CommsDat. + */ +void TestCpWlanApPlugin::subVerifyUint( + CMManagerShim::ConnectionMethodAttribute attribute, + uint expected) +{ + // Read attribute value from CommsDat + QScopedPointer cmManager(new CmManagerShim); + QScopedPointer connectionMethod( + cmManager->connectionMethod(testApId)); + uint commsdat = connectionMethod->getIntAttribute(attribute); + + QCOMPARE(commsdat, expected); +} + +/** + * Verifies that WLAN network status in CommsDat is correct. + */ +void TestCpWlanApPlugin::subVerifyNetworkStatus( + NetworkStatus expected) +{ + // Read attribute value from CommsDat + QScopedPointer cmManager(new CmManagerShim); + QScopedPointer connectionMethod( + cmManager->connectionMethod(testApId)); + bool commsdatScanSsid = connectionMethod->getBoolAttribute( + CMManagerShim::WlanScanSSID); + + if (expected == HiddenStatus) { + QVERIFY(commsdatScanSsid == true); + } else if (expected == PublicStatus) { + QVERIFY(commsdatScanSsid == false); + } else { + Q_ASSERT(false); + } +} + +/** + * Clears a HbLineEdit. + */ +void TestCpWlanApPlugin::subClearLineEdit( + uint length) +{ + // Erase old string + QTest::qWait(5000); // TODO: Remove this when item specific menu doesn't pop up anymore + + // Move cursor to end of string + //HbAutoTest::keyClick(mMainWindow, Qt::Key_End, 0, waitTime); // doesn't seem to do anything? + HbAutoTest::keyClick(mMainWindow, Qt::Key_Down, 0, waitTime); + HbAutoTest::keyClick(mMainWindow, Qt::Key_Down, 0, waitTime); + HbAutoTest::keyClick(mMainWindow, Qt::Key_Down, 0, waitTime); + for (int i=0; i<25; i++) { + HbAutoTest::keyClick(mMainWindow, Qt::Key_Right, 0, waitTime); + } + for (int i=0; icreateSettingView(connectionMethodId); + QVERIFY(view != NULL); + + // Display the view + mMainWindow->addView(view); + mMainWindow->setCurrentView(view); + // Store pointer to settings view class + mTestView = static_cast(view); +} + +/** + * Clicks a widget currently on UI by class name. + */ +void TestCpWlanApPlugin::subClickWidget(const QString &name) +{ + QList itemList = mMainWindow->scene()->items(); + + QGraphicsItem *target = 0; + foreach (QGraphicsItem* item, itemList) { + if (item->isWidget()) { + QString widgetClassName(static_cast(item)->metaObject()->className()); + //qDebug() << widgetClassName; + + if (widgetClassName == name) { + target = item; + break; + } + } + } + + Q_ASSERT(target); + HbAutoTest::mouseClick(mMainWindow, static_cast(target)); +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/tsrc/ut/testcpwlanapplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/tsrc/ut/testcpwlanapplugin.h Mon May 03 12:53:07 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: +* Control Panel WLAN AP plugin unit testing. +*/ + +#include +#include +#include + +class HbDialog; +class HbMainWindow; +class HbAutoTestMainWindow; +class HbDataFormModelItem; +class HbAction; +class CpWlanApView; +class CpBearerApPluginInterface; + +enum NetworkStatus { + HiddenStatus, + PublicStatus +}; + +class TestCpWlanApPlugin : public QObject +{ + Q_OBJECT + + signals: + // Test signals + void menuActionTriggered(HbAction *); + + public slots: + // Test framework functions + void initTestCase(); + void cleanupTestCase(); + void init(); + void cleanup(); + + private slots: + // Test cases + void tcChangeConnectionName(); + void tcChangeConnectionName_data(); + void tcConnectionNameEmpty(); + void tcChangeWlanNetworkName(); + void tcChangeWlanNetworkName_data(); + void tcWlanNetworkNameEmpty(); + void tcChangeNetworkStatus(); + void tcChangeNetworkMode(); + void tcChangeSecurityMode(); + void tcChangeHomepage(); + void tcChangeHomepage_data(); + void tcAdvancedSettings(); + + private: + // Sub test cases + void subVerifyString( + CMManagerShim::ConnectionMethodAttribute attribute, + HbDataFormModelItem *item, + QString expected); + void subVerifyUint( + CMManagerShim::ConnectionMethodAttribute attribute, + uint expected); + void subVerifyNetworkStatus( + NetworkStatus expected); + void subClearLineEdit(uint length); + void subCreateSettingsView(uint connetionMethodId); + void subClickWidget(const QString &name); + + private: + // Code references + CpWlanApView *mTestView; + + // Test data + HbAutoTestMainWindow *mMainWindow; + CpBearerApPluginInterface *mPlugin; +}; diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/tsrc/ut/testcpwlanapplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/tsrc/ut/testcpwlanapplugin.pro Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,39 @@ +# +# 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 Control Panel WLAN AP plugin unit tests. + +TEMPLATE = app + +TARGET = testcpwlanapplugin + +CONFIG += hb qtestlib + +INCLUDEPATH += . ../../inc +DEPENDPATH += . + +HEADERS += \ + hbautotest.h \ + testcpwlanapplugin.h +SOURCES += \ + hbautotest.cpp \ + testcpwlanapplugin.cpp + +LIBS += \ + -lcpwlanapplugin \ + -lconnection_settings_shim + +symbian: { + TARGET.CAPABILITY = ALL -TCB +} diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/tsrc/ut/tools/commsdat_restore.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/tsrc/ut/tools/commsdat_restore.bat Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,17 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem Script for restoring backup of commsdat. + +copy backup\cccccc00.cre \epoc32\winscw\c\private\10202be9\persists\cccccc00.cre diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/tsrc/ut/tools/commsdat_set.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/tsrc/ut/tools/commsdat_set.bat Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,19 @@ +@rem +@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem Script for setting test commsdat. + +md backup +copy \epoc32\winscw\c\private\10202be9\persists\cccccc00.cre backup\ +copy default.cre \epoc32\winscw\c\private\10202be9\persists\cccccc00.cre diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/tsrc/ut/tools/cpwlanapplugin_ctc.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmmanager/cpwlanapplugin/tsrc/ut/tools/cpwlanapplugin_ctc.bat Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,89 @@ +:: +:: Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +:: All rights reserved. +:: This component and the accompanying materials are made available +:: under the terms of "Eclipse Public License v1.0" +:: which accompanies this distribution, and is available +:: at the URL "http://www.eclipse.org/legal/epl-v10.html". +:: +:: Initial Contributors: +:: Nokia Corporation - initial contribution. +:: +:: Contributors: +:: +:: Description: +:: Script running Control Panel WLAN AP plugin test cases with CTC analysis. + +@echo off + +:: ----------------------------------------------------------------------------- +:: Instructions +:: ----------------------------------------------------------------------------- +:: +:: Remember to use the test CommsDat that can be set and restored with the +:: helper scripts: +:: - commsdat_set.bat +:: - commsdat_restore.bat + +::----------------------------------------------------------------------------- +:: Set the local variables +::----------------------------------------------------------------------------- + +:: Control Panel WLAN AP plugin base directory +set cpwlanapplugin_dir=..\..\.. +pushd %cpwlanapplugin_dir% + +:: CTC instrumentation excludes +set ctc_excludes=-C EXCLUDE=* -C NO_EXCLUDE=src\*.cpp + + +::----------------------------------------------------------------------------- +:: Remove old coverage data +::----------------------------------------------------------------------------- + +echo Cleaning up... +del MON.* ctcerr.txt profile.txt +rd /s /q CTCHTML +echo ...done + +::----------------------------------------------------------------------------- +:: Build & instrument code +::----------------------------------------------------------------------------- + +echo Building code and instrumenting.. +call del MON.* ctcerr.txt profile.txt +call make distclean +call qmake +call ctcwrap -i d -2comp %ctc_excludes% sbs -c winscw_udeb +echo ...done + +::----------------------------------------------------------------------------- +:: Build test code +::----------------------------------------------------------------------------- + +echo Building test code... +call cd tsrc\ut +call make distclean +call qmake +call sbs -c winscw_udeb +echo ...done + +::----------------------------------------------------------------------------- +:: Execute the tests +::----------------------------------------------------------------------------- + +echo Running tests.. +cd ..\.. +call \epoc32\release\winscw\udeb\testcpwlanapplugin.exe +echo ...done + +::----------------------------------------------------------------------------- +:: Create coverage results +::----------------------------------------------------------------------------- + +echo Creating results... +call ctcpost -p profile.txt +call ctc2html -i profile.txt +echo ...done + +popd diff -r fcbbe021d614 -r 9c97ad6591ae cmmanager/cpwlanapplugin/tsrc/ut/tools/default.cre Binary file cmmanager/cpwlanapplugin/tsrc/ut/tools/default.cre has changed diff -r fcbbe021d614 -r 9c97ad6591ae connectionmonitoring/cellularindicatorplugin/inc/cellularindicatorplugin.h --- a/connectionmonitoring/cellularindicatorplugin/inc/cellularindicatorplugin.h Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionmonitoring/cellularindicatorplugin/inc/cellularindicatorplugin.h Mon May 03 12:53:07 2010 +0300 @@ -48,7 +48,7 @@ // Access is allowed allways bool accessAllowed(const QString &indicatorType, - const HbSecurityInfo *securityInfo) const; + const QVariantMap &securityInfo) const; // Create indicator. Currently installs translation. HbIndicatorInterface* createIndicator(const QString &indicatorType); diff -r fcbbe021d614 -r 9c97ad6591ae connectionmonitoring/cellularindicatorplugin/src/cellularindicatorplugin.cpp --- a/connectionmonitoring/cellularindicatorplugin/src/cellularindicatorplugin.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionmonitoring/cellularindicatorplugin/src/cellularindicatorplugin.cpp Mon May 03 12:53:07 2010 +0300 @@ -40,7 +40,7 @@ CellularIndicatorPlugin::CellularIndicatorPlugin */ CellularIndicatorPlugin::CellularIndicatorPlugin() : - HbIndicatorInterface(IndicatorType, GroupPriorityAverage, + HbIndicatorInterface(IndicatorType, SettingCategory, InteractionActivated), mError(0) { @@ -73,7 +73,7 @@ CellularIndicatorPlugin::accessAllowed */ bool CellularIndicatorPlugin::accessAllowed(const QString &indicatorType, - const HbSecurityInfo *securityInfo) const + const QVariantMap &securityInfo) const { OstTraceFunctionEntry0( CELLULARINDICATORPLUGIN_ACCESSALLOWED_ENTRY ); Q_UNUSED(indicatorType) @@ -217,7 +217,6 @@ } break; - case IconNameRole: case DecorationNameRole: // Return the icon ret = HbIcon("qtg_small_gprs"); diff -r fcbbe021d614 -r 9c97ad6591ae connectionmonitoring/connectionview/inc/connectionview.h --- a/connectionmonitoring/connectionview/inc/connectionview.h Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionmonitoring/connectionview/inc/connectionview.h Mon May 03 12:53:07 2010 +0300 @@ -111,6 +111,9 @@ /* Pointer to the main view of the window */ HbView *mMainView; + /* Pointer to the secondary view of the window */ + HbView *mNoConnView; + /* The main vertical layout which contains the group box container */ QGraphicsLinearLayout* mMainLayout; @@ -135,9 +138,6 @@ /* The toolbar action which can be used to disconnect all the connections */ HbAction *mDisconnectAction; - /* The label used to inform if there are no active connections */ - HbLabel *mInfoLabel; - /* The id of the timer used to close the application */ int mClosingTimer; diff -r fcbbe021d614 -r 9c97ad6591ae connectionmonitoring/connectionview/res/connectionview.css --- a/connectionmonitoring/connectionview/res/connectionview.css Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionmonitoring/connectionview/res/connectionview.css Mon May 03 12:53:07 2010 +0300 @@ -22,22 +22,7 @@ text-align: center; } -HbGroupBox#groupBox::headingWidget:portrait +HbPushButton#disconnectButton { - fixed-width: expr(var(hb-param-screen-width)-var(hb-param-margin-gene-left)-var(hb-param-margin-gene-right)); -} - -HbGroupBox#groupBox::contentWidget:portrait -{ - fixed-width: expr(var(hb-param-screen-width)-var(hb-param-margin-gene-left)-var(hb-param-margin-gene-right)); + max-width: expr(var(hb-param-screen-short-edge)-var(hb-param-margin-gene-left)-var(hb-param-margin-gene-right)); } - -HbGroupBox#groupBox::headingWidget:landscape -{ - fixed-width: expr(var(hb-param-screen-height)-var(hb-param-margin-gene-top)-var(hb-param-margin-gene-bottom)-var(hb-param-widget-toolbar-height)); -} - -HbGroupBox#groupBox::contentWidget:landscape -{ - fixed-width: expr(var(hb-param-screen-height)-var(hb-param-margin-gene-top)-var(hb-param-margin-gene-bottom)-var(hb-param-widget-toolbar-height)); -} diff -r fcbbe021d614 -r 9c97ad6591ae connectionmonitoring/connectionview/src/connectionview.cpp --- a/connectionmonitoring/connectionview/src/connectionview.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionmonitoring/connectionview/src/connectionview.cpp Mon May 03 12:53:07 2010 +0300 @@ -81,12 +81,9 @@ { OstTraceFunctionEntry0( DUP1_CONNECTIONVIEW_CONNECTIONVIEW_ENTRY ); // other widgets are childs of this widget, so they will be - // deleted along with mMainView. Add infolabel and scrollarea - // again under mainlayout, since one of them is only there at the time - // this way all the ui components are deleted at once - mInfoLabel->setParentLayoutItem(mMainLayout); - mScrollArea->setParentLayoutItem(mMainLayout); + // deleted along with mMainView. delete mMainView; + delete mNoConnView; OstTraceFunctionExit0( DUP1_CONNECTIONVIEW_CONNECTIONVIEW_EXIT ); } @@ -108,10 +105,20 @@ { OstTraceFunctionEntry0( CONNECTIONVIEW_CREATEVIEW_ENTRY ); - // Create the mainView and the layout for the window - mMainView = new HbView(); - addView(mMainView); - setCurrentView(mMainView); + // Create the secondary view for displaying the "No active connections"-text + mNoConnView = new HbView(); + mNoConnView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + addView(mNoConnView); + QGraphicsLinearLayout *noConnViewLayout = new QGraphicsLinearLayout(Qt::Vertical); + noConnViewLayout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + + HbLabel *infoLabel = new HbLabel; + infoLabel->setObjectName("mInfoLabel"); + infoLabel->setPlainText(hbTrId("txt_occ_info_no_active_connections")); + infoLabel->setAlignment(Qt::AlignCenter); + noConnViewLayout->addItem(infoLabel); + noConnViewLayout->setAlignment(infoLabel, Qt::AlignCenter); + mNoConnView->setLayout(noConnViewLayout); mMainLayout = new QGraphicsLinearLayout(Qt::Vertical); mMainLayout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -120,7 +127,9 @@ mScrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); mMainLayout->addItem(mScrollArea); - // Create the widgets and layouts for the scroll area + // Create the mainView and the layout for the window + mMainView = new HbView(); + addView(mMainView); ScrollAreaWidget *scrollContent = new ScrollAreaWidget(); scrollContent->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); mScrollArea->installEventFilter(scrollContent); @@ -142,12 +151,6 @@ this, SLOT(disconnectAll())); - // label for informing the user that there are no connections - mInfoLabel = new HbLabel; - mInfoLabel->setObjectName("mInfoLabel"); - mInfoLabel->setPlainText(hbTrId("txt_occ_info_no_active_connections")); - mInfoLabel->setAlignment(Qt::AlignCenter); - // Create the actual groupboxes for all the active connections createGroupBoxesForConnections(); show(); @@ -180,12 +183,9 @@ mToolBar->hide(); } - // if there are connections, then the label should be removed - // and the connection boxes drawn + // if there are connections, the main view with the connections is shown if (mConnectionCount > 0) { - mMainLayout->removeItem(mInfoLabel); - mInfoLabel->hide(); - mMainLayout->addItem(mScrollArea); + setCurrentView(mMainView); for (int i=0; iremoveItem(mScrollArea); - mInfoLabel->show(); - mMainLayout->addItem(mInfoLabel); - mMainLayout->setAlignment(mInfoLabel, Qt::AlignCenter); + setCurrentView(mNoConnView); // start the timer to close the application after 3 seconds if (mClosingTimer == 0) { mClosingTimer = startTimer(timerValue); @@ -308,6 +305,7 @@ // Create the disconnection button HbPushButton* button = new HbPushButton( hbTrId("txt_occ_button_disconnect"), mMainView); + button->setObjectName("disconnectButton"); button->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred, QSizePolicy::PushButton); diff -r fcbbe021d614 -r 9c97ad6591ae connectionmonitoring/connmon/connectionmonitor/BWINSCW/CONNMON_EKA2U.def --- a/connectionmonitoring/connmon/connectionmonitor/BWINSCW/CONNMON_EKA2U.def Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionmonitoring/connmon/connectionmonitor/BWINSCW/CONNMON_EKA2U.def Mon May 03 12:53:07 2010 +0300 @@ -94,4 +94,7 @@ ?ToBuf@CConnMonWlanProbeRawBuffer@@QBEPBVHBufC8@@XZ @ 93 NONAME ; class HBufC8 const * CConnMonWlanProbeRawBuffer::ToBuf(void) const ?Total@CConnMonWlanProbeRawBuffersPckg@@QBEIXZ @ 94 NONAME ; unsigned int CConnMonWlanProbeRawBuffersPckg::Total(void) const ?UnpackToL@CConnMonWlanProbeRawBuffersPckg@@QBEXAAV?$RPointerArray@VCConnMonWlanProbeRawBuffer@@@@@Z @ 95 NONAME ; void CConnMonWlanProbeRawBuffersPckg::UnpackToL(class RPointerArray &) const + ?NewL@CConnMonWlanNetwork@@SAPAV1@ABV?$TBuf@$0CA@@@IIIIIABV?$TBuf8@$05@@ABVTDesC16@@@Z @ 96 NONAME ; class CConnMonWlanNetwork * CConnMonWlanNetwork::NewL(class TBuf<32> const &, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, class TBuf8<6> const &, class TDesC16 const &) + ?SecurityModeV2@CConnMonWlanNetwork@@QAEIXZ @ 97 NONAME ; unsigned int CConnMonWlanNetwork::SecurityModeV2(void) + ?IsProtectedSetupSupported@CConnMonWlanNetwork@@QAEHXZ @ 98 NONAME ; int CConnMonWlanNetwork::IsProtectedSetupSupported(void) diff -r fcbbe021d614 -r 9c97ad6591ae connectionmonitoring/connmon/connectionmonitor/EABI/ConnMon_EKA2U.def --- a/connectionmonitoring/connmon/connectionmonitor/EABI/ConnMon_EKA2U.def Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionmonitoring/connmon/connectionmonitor/EABI/ConnMon_EKA2U.def Mon May 03 12:53:07 2010 +0300 @@ -105,8 +105,8 @@ _ZTV18TConnMonVirtualIap @ 104 NONAME ; ## _ZTV19ConnMonIdsArrayPckg @ 105 NONAME ; ## _ZTV19TConnMonWLANNetwork @ 106 NONAME ; ## - _ZTV20CCDIAPMetadataRecord @ 107 NONAME ABSENT; ## - _ZTV21CCDSNAPMetadataRecord @ 108 NONAME ABSENT ; ## + _ZTV20CCDIAPMetadataRecord @ 107 NONAME ABSENT ; ## + _ZTV21CCDSNAPMetadataRecord @ 108 NONAME ABSENT ; ## _ZTV22CCDMIPServiceExtRecord @ 109 NONAME ABSENT ; ## _ZTV25CConnMonCommsDataNotifier @ 110 NONAME ; ## _ZTV27CConnMonAvailabilityManager @ 111 NONAME ; ## @@ -137,25 +137,28 @@ _ZNK24CConnMonBearerInfoChange10BearerInfoEv @ 136 NONAME _ZNK25CConnMonBearerGroupChange12BearerGroupsERjS0_ @ 137 NONAME _ZNK25CConnMonBearerGroupChange8InternalEv @ 138 NONAME - _ZN26CConnMonWlanProbeRawBuffer4NewLEPK6HBufC8 @139 - _ZN26CConnMonWlanProbeRawBuffer4NewLERS_ @140 - _ZN26CConnMonWlanProbeRawBuffer4NewLEv @141 - _ZN26CConnMonWlanProbeRawBuffer8FromPtrCERK6TPtrC8PS_ @142 - _ZN26CConnMonWlanProbeRawBufferD0Ev @143 - _ZN26CConnMonWlanProbeRawBufferD1Ev @144 - _ZN26CConnMonWlanProbeRawBufferD2Ev @145 - _ZN26CConnMonWlanProbeRawBufferaSERS_ @146 - _ZN31CConnMonWlanProbeRawBuffersPckgC1Ej @147 - _ZN31CConnMonWlanProbeRawBuffersPckgC2Ej @148 - _ZN31CConnMonWlanProbeRawBuffersPckgD0Ev @149 - _ZN31CConnMonWlanProbeRawBuffersPckgD1Ev @150 - _ZN31CConnMonWlanProbeRawBuffersPckgD2Ev @151 - _ZNK26CConnMonWlanProbeRawBuffer5ToBufEv @152 - _ZNK31CConnMonWlanProbeRawBuffersPckg3BufEv @153 - _ZNK31CConnMonWlanProbeRawBuffersPckg9UnpackToLER13RPointerArrayI26CConnMonWlanProbeRawBufferE @154 - _ZTI31CConnMonWlanProbeRawBuffersPckg @155 - _ZTV31CConnMonWlanProbeRawBuffersPckg @156 - _ZNK26CConnMonWlanProbeRawBuffer9RawBufferEv @157 - _ZNK31CConnMonWlanProbeRawBuffersPckg5CountEv @158 - _ZNK31CConnMonWlanProbeRawBuffersPckg5TotalEv @159 + _ZN26CConnMonWlanProbeRawBuffer4NewLEPK6HBufC8 @ 139 NONAME + _ZN26CConnMonWlanProbeRawBuffer4NewLERS_ @ 140 NONAME + _ZN26CConnMonWlanProbeRawBuffer4NewLEv @ 141 NONAME + _ZN26CConnMonWlanProbeRawBuffer8FromPtrCERK6TPtrC8PS_ @ 142 NONAME + _ZN26CConnMonWlanProbeRawBufferD0Ev @ 143 NONAME + _ZN26CConnMonWlanProbeRawBufferD1Ev @ 144 NONAME + _ZN26CConnMonWlanProbeRawBufferD2Ev @ 145 NONAME + _ZN26CConnMonWlanProbeRawBufferaSERS_ @ 146 NONAME + _ZN31CConnMonWlanProbeRawBuffersPckgC1Ej @ 147 NONAME + _ZN31CConnMonWlanProbeRawBuffersPckgC2Ej @ 148 NONAME + _ZN31CConnMonWlanProbeRawBuffersPckgD0Ev @ 149 NONAME + _ZN31CConnMonWlanProbeRawBuffersPckgD1Ev @ 150 NONAME + _ZN31CConnMonWlanProbeRawBuffersPckgD2Ev @ 151 NONAME + _ZNK26CConnMonWlanProbeRawBuffer5ToBufEv @ 152 NONAME + _ZNK31CConnMonWlanProbeRawBuffersPckg3BufEv @ 153 NONAME + _ZNK31CConnMonWlanProbeRawBuffersPckg9UnpackToLER13RPointerArrayI26CConnMonWlanProbeRawBufferE @ 154 NONAME + _ZTI31CConnMonWlanProbeRawBuffersPckg @ 155 NONAME + _ZTV31CConnMonWlanProbeRawBuffersPckg @ 156 NONAME + _ZNK26CConnMonWlanProbeRawBuffer9RawBufferEv @ 157 NONAME + _ZNK31CConnMonWlanProbeRawBuffersPckg5CountEv @ 158 NONAME + _ZNK31CConnMonWlanProbeRawBuffersPckg5TotalEv @ 159 NONAME + _ZN19CConnMonWlanNetwork14SecurityModeV2Ev @ 160 NONAME + _ZN19CConnMonWlanNetwork25IsProtectedSetupSupportedEv @ 161 NONAME + _ZN19CConnMonWlanNetwork4NewLERK4TBufILi32EEjjjjjRK5TBuf8ILi6EERK7TDesC16 @ 162 NONAME diff -r fcbbe021d614 -r 9c97ad6591ae connectionmonitoring/connmon/connectionmonitor/inc/CWlanSupport.h --- a/connectionmonitoring/connmon/connectionmonitor/inc/CWlanSupport.h Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionmonitoring/connmon/connectionmonitor/inc/CWlanSupport.h Mon May 03 12:53:07 2010 +0300 @@ -369,6 +369,16 @@ */ TBool WlanRssGoodEnough(); + /** + * Converts a WLAN security mode from ConnMon's + * TConnMonSecurityModeV2-format to ConnMon's TConnMonSecurityMode-format. + * + * @since 5.2 + * @param aSecModeV2 Security mode in TConnMonSecurityModeV2-format. + * @return Security mode in TConnMonSecurityMode-format. + */ + TInt ConvertConMonSecModeV2ToConnMonSecMode( TInt aSecModeV2 ); + private: CWlanSupport( CConnMonServer* aServer ); @@ -376,6 +386,18 @@ * Second phase construction. */ void ConstructL(); + + /** + * Converts a WLAN security mode from WLAN engine's + * TWlanConnectionExtentedSecurityMode-format to ConnMon's + * TConnMonSecurityModeV2-format. + * + * @since 5.2 + * @param aWlanExtSecMode Security mode in + * TWlanConnectionExtentedSecurityMode-format. + * @return Security mode in TConnMonSecurityModeV2-format. + */ + TInt ConvertWlanExtSecModeToConnMonSecModeV2( TInt aWlanExtSecMode ); private: // Data // Pointer to server module diff -r fcbbe021d614 -r 9c97ad6591ae connectionmonitoring/connmon/connectionmonitor/src/CWlanSupport.cpp --- a/connectionmonitoring/connmon/connectionmonitor/src/CWlanSupport.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionmonitoring/connmon/connectionmonitor/src/CWlanSupport.cpp Mon May 03 12:53:07 2010 +0300 @@ -191,7 +191,7 @@ // ----------------------------------------------------------------------------- -// CWlanSupport::GetSignalStrength +// CWlanSupport::GetSignalStrengthL // ----------------------------------------------------------------------------- // TInt CWlanSupport::GetSignalStrengthL( @@ -416,7 +416,7 @@ } // ----------------------------------------------------------------------------- -// CWlanSupport::AppendAvailableIapsBySsid +// CWlanSupport::AppendAvailableIapsBySsidL // ----------------------------------------------------------------------------- // TInt CWlanSupport::AppendAvailableIapsBySsidL( RArray& aIdArray ) @@ -591,33 +591,13 @@ LOGENTRFN("CWlanSupport::GetConnectionSecurity()") TInt err( KErrNone ); - TWlanConnectionSecurityMode mode( EWlanConnectionSecurityOpen ); + TWlanConnectionExtentedSecurityMode mode( EWlanConnectionExtentedSecurityModeOpen ); // Get security mode - err = iWlanMgmt->GetConnectionSecurityMode( mode ); + err = iWlanMgmt->GetExtendedConnectionSecurityMode( mode ); if ( KErrNone == err ) { - switch ( mode ) - { - case EWlanConnectionSecurityOpen: - aConnectionSecurity = EConnMonSecurityOpen; - break; - case EWlanConnectionSecurityWep: - aConnectionSecurity = EConnMonSecurityWep; - break; - case EWlanConnectionSecurity802d1x: - aConnectionSecurity = EConnMonSecurity802d1x; - break; - case EWlanConnectionSecurityWpa: - aConnectionSecurity = EConnMonSecurityWpa; - break; - case EWlanConnectionSecurityWpaPsk: - aConnectionSecurity = EConnMonSecurityWpaPsk; - break; - default: - aConnectionSecurity = EConnMonSecurityOpen; - break; - } + aConnectionSecurity = ConvertWlanExtSecModeToConnMonSecModeV2( mode ); LOGIT1("GetConnectionSecurity: security mode %d", aConnectionSecurity) } @@ -773,28 +753,10 @@ TUint signalStrength(scanInfo->RXLevel()); LOGIT1("CWlanSupport::GetWLANNetworksL: signalStrength %d", signalStrength) - // SecurityMode - TUint8 ieLength( 0 ); - const TUint8* wpaData; - - TUint securityMode( EConnMonSecurityOpen ); - if ( scanInfo->Capability() & KWlan802Dot11CapabilityPrivacyMask ) - { - if ( ( scanInfo->InformationElement( - KWlan802Dot11RsnIE, - ieLength, - &wpaData ) == KErrNone ) || - ( scanInfo->WpaIE( - ieLength, - &wpaData ) == KErrNone ) ) - { - securityMode = EConnMonSecurityWpa; // WPA - } - else - { - securityMode = EConnMonSecurityWep; // WEP - } - } + // Security mode + TInt wlanExtSecurityMode( scanInfo->ExtendedSecurityMode() ); + TInt securityModeV2( ConvertWlanExtSecModeToConnMonSecModeV2( wlanExtSecurityMode ) ); + TInt securityMode( ConvertConMonSecModeV2ToConnMonSecMode( securityModeV2 ) ); LOGIT1("CWlanSupport::GetWLANNetworksL: securityMode %d", securityMode) // SSID == name @@ -867,7 +829,7 @@ // ----------------------------------------------------------------------------- -// CWlanSupport::ParseWlanNetworks +// CWlanSupport::ParseWlanNetworksL // ----------------------------------------------------------------------------- // void CWlanSupport::ParseWlanNetworksL( @@ -899,28 +861,13 @@ // Signal strength TUint signalStrength( aScanInfo->RXLevel() ); - // SecurityMode - TUint8 ieLength( 0 ); - const TUint8* wpaData; - - TUint securityMode( EConnMonSecurityOpen ); - if ( aScanInfo->Capability() & KWlan802Dot11CapabilityPrivacyMask ) - { - if ( ( aScanInfo->InformationElement( - KWlan802Dot11RsnIE, - ieLength, - &wpaData ) == KErrNone ) || - ( aScanInfo->WpaIE( - ieLength, - &wpaData ) == KErrNone ) ) - { - securityMode = EConnMonSecurityWpa; // WPA - } - else - { - securityMode = EConnMonSecurityWep; // WEP - } - } + // Security mode + TInt wlanExtSecurityMode( aScanInfo->ExtendedSecurityMode() ); + TInt securityModeV2( ConvertWlanExtSecModeToConnMonSecModeV2( wlanExtSecurityMode ) ); + TInt securityMode( ConvertConMonSecModeV2ToConnMonSecMode( securityModeV2 ) ); + + // Protected setup + TBool protectedSetupSupport( aScanInfo->IsProtectedSetupSupported() ); // SSID == name TBuf8 name8; @@ -955,6 +902,8 @@ connectionMode, signalStrength, securityMode, + securityModeV2, + protectedSetupSupport, bssid, KNullDesC() ); CleanupStack::PushL( net ); @@ -970,7 +919,7 @@ // ----------------------------------------------------------------------------- -// CWlanSupport::GetCurrentWlanNetwork +// CWlanSupport::GetCurrentWlanNetworkL // ----------------------------------------------------------------------------- // TInt CWlanSupport::GetCurrentWlanNetworkL( @@ -981,6 +930,7 @@ TInt connectionMode; TInt connectionSecurity; + TInt connectionSecurityV2; TInt connectionSignalQuality; TBuf connectionSsid; TBuf8 connectionBssid; @@ -990,7 +940,8 @@ if ( KErrNone == err ) { // Get connection security mode - err = GetConnectionSecurity( connectionSecurity ); + err = GetConnectionSecurity( connectionSecurityV2 ); + connectionSecurity = ConvertConMonSecModeV2ToConnMonSecMode( connectionSecurityV2 ); } if ( KErrNone == err ) { @@ -1015,6 +966,8 @@ connectionMode, connectionSignalQuality, connectionSecurity, + connectionSecurityV2, + 0, connectionBssid, KNullDesC() ); CleanupStack::PushL( net ); @@ -1045,7 +998,7 @@ // ----------------------------------------------------------------------------- -// CWlanSupport::ParseWlanNetworks +// CWlanSupport::ParseWlanProbeRawBuffersL // ----------------------------------------------------------------------------- // void CWlanSupport::ParseWlanProbeRawBuffersL( @@ -1200,7 +1153,7 @@ } // ----------------------------------------------------------------------------- -// CWlanSupport::SetIntAttribute +// CWlanSupport::SetIntAttributeL // ----------------------------------------------------------------------------- // TInt CWlanSupport::SetIntAttributeL( @@ -1232,7 +1185,7 @@ } // ----------------------------------------------------------------------------- -// CWlanSupport::SetUintAttribute +// CWlanSupport::SetUintAttributeL // ----------------------------------------------------------------------------- // TInt CWlanSupport::SetUintAttributeL( @@ -1264,7 +1217,7 @@ } // ----------------------------------------------------------------------------- -// CWlanSupport::GetIntAttribute +// CWlanSupport::GetIntAttributeL // ----------------------------------------------------------------------------- // TInt CWlanSupport::GetIntAttributeL( const RMessage2& aMessage, TInt& aValue ) @@ -1293,7 +1246,7 @@ } // ----------------------------------------------------------------------------- -// CWlanSupport::GetUintAttribute +// CWlanSupport::GetUintAttributeL // ----------------------------------------------------------------------------- // TInt CWlanSupport::GetUintAttributeL( const RMessage2& aMessage, TUint& aValue ) @@ -1322,7 +1275,7 @@ } // ----------------------------------------------------------------------------- -// CWlanSupport::SetStringAttribute +// CWlanSupport::SetStringAttributeL // // Currently assumes the descriptor attribute 'aValue' length has been checked // earlier and is short enough. @@ -1358,7 +1311,7 @@ } // ----------------------------------------------------------------------------- -// CWlanSupport::GetStringAttribute +// CWlanSupport::GetStringAttributeL // ----------------------------------------------------------------------------- // TInt CWlanSupport::GetStringAttributeL( @@ -1471,6 +1424,90 @@ return value; } +// ----------------------------------------------------------------------------- +// CWlanSupport::ConvertConMonSecModeV2ToConnMonSecMode +// ----------------------------------------------------------------------------- +// +TInt CWlanSupport::ConvertConMonSecModeV2ToConnMonSecMode( TInt aConnMonSecModeV2 ) + { + TInt connMonSecMode( EConnMonSecurityOpen ); + switch ( aConnMonSecModeV2 ) + { + case EConnMonSecurityV2Open: + connMonSecMode = EConnMonSecurityOpen; + break; + case EConnMonSecurityV2WepOpen: + case EConnMonSecurityV2WepShared: + connMonSecMode = EConnMonSecurityWep; + break; + case EConnMonSecurityV2802d1x: + connMonSecMode = EConnMonSecurity802d1x; + break; + case EConnMonSecurityV2Wpa: + case EConnMonSecurityV2Wpa2: + connMonSecMode = EConnMonSecurityWpa; + break; + case EConnMonSecurityV2WpaPsk: + case EConnMonSecurityV2Wpa2Psk: + connMonSecMode = EConnMonSecurityWpaPsk; + break; + case EConnMonSecurityV2Wapi: + case EConnMonSecurityV2WapiPsk: + connMonSecMode = EConnMonSecurity802d1x; + break; + default: + connMonSecMode = EConnMonSecurityOpen; + break; + } + return connMonSecMode; + } + +// ----------------------------------------------------------------------------- +// CWlanSupport::ConvertWlanExtSecModeToConnMonSecModeV2 +// ----------------------------------------------------------------------------- +// +TInt CWlanSupport::ConvertWlanExtSecModeToConnMonSecModeV2( TInt aWlanExtSecMode ) + { + TInt connMonSecModeV2( EConnMonSecurityV2Open ); + switch ( aWlanExtSecMode ) + { + case EWlanConnectionExtentedSecurityModeOpen: + connMonSecModeV2 = EConnMonSecurityV2Open; + break; + case EWlanConnectionExtentedSecurityModeWepOpen: + connMonSecModeV2 = EConnMonSecurityV2WepOpen; + break; + case EWlanConnectionExtentedSecurityModeWepShared: + connMonSecModeV2 = EConnMonSecurityV2WepShared; + break; + case EWlanConnectionExtentedSecurityMode802d1x: + connMonSecModeV2 = EConnMonSecurityV2802d1x; + break; + case EWlanConnectionExtentedSecurityModeWpa: + connMonSecModeV2 = EConnMonSecurityV2Wpa; + break; + case EWlanConnectionExtentedSecurityModeWpaPsk: + connMonSecModeV2 = EConnMonSecurityV2WpaPsk; + break; + case EWlanConnectionExtentedSecurityModeWpa2: + connMonSecModeV2 = EConnMonSecurityV2Wpa2; + break; + case EWlanConnectionExtentedSecurityModeWpa2Psk: + connMonSecModeV2 = EConnMonSecurityV2Wpa2Psk; + break; + case EWlanConnectionExtentedSecurityModeWapi: + connMonSecModeV2 = EConnMonSecurityV2Wapi; + break; + case EWlanConnectionExtentedSecurityModeWapiPsk: + connMonSecModeV2 = EConnMonSecurityV2WapiPsk; + break; + default: + connMonSecModeV2 = EConnMonSecurityV2Open; + break; + } + return connMonSecModeV2; + } + // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -1788,7 +1825,7 @@ } // ----------------------------------------------------------------------------- -// CWlanSession::GetScanResults +// CWlanSession::GetScanResultsL // ----------------------------------------------------------------------------- // void CWlanSession::GetScanResultsL( const RMessage2& aMessage ) @@ -2002,7 +2039,7 @@ } // ----------------------------------------------------------------------------- -// CWlanSession::CompleteActiveRequests +// CWlanSession::CompleteActiveRequestsL // ----------------------------------------------------------------------------- // void CWlanSession::CompleteActiveRequestsL( @@ -2176,7 +2213,7 @@ } // ----------------------------------------------------------------------------- -// CWlanSession::CompleteGetNetworkNamesRequest +// CWlanSession::CompleteGetNetworkNamesRequestL // Completes the asynchronous client request: GetPckgAttribute( KNetworkNames ) // ----------------------------------------------------------------------------- // @@ -2207,7 +2244,7 @@ } // ----------------------------------------------------------------------------- -// CWlanSession::CompleteGetWlanNetworksRequest +// CWlanSession::CompleteGetWlanNetworksRequestL // Completes the asynchronous client request: GetPckgAttribute( KWlanNetworks ) // ----------------------------------------------------------------------------- // @@ -2259,7 +2296,7 @@ } // ----------------------------------------------------------------------------- -// CWlanSession::CompleteGetWlanSsidNetworksRequest +// CWlanSession::CompleteGetWlanSsidNetworksRequestL // Completes the asynchronous client request: GetPckgAttribute( KWlanSsidNetworks ) // ----------------------------------------------------------------------------- // @@ -2311,7 +2348,7 @@ } // ----------------------------------------------------------------------------- -// CWlanSession::CompleteGetWlanProbeRawBuffersRequest +// CWlanSession::CompleteGetWlanProbeRawBuffersRequestL // Completes the asynchronous client request: GetPckgAttribute( KWlanProbeRawBuffers ) // ----------------------------------------------------------------------------- // diff -r fcbbe021d614 -r 9c97ad6591ae connectionmonitoring/connmon/connectionmonitor/src/ConnMonIAP.cpp --- a/connectionmonitoring/connmon/connectionmonitor/src/ConnMonIAP.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionmonitoring/connmon/connectionmonitor/src/ConnMonIAP.cpp Mon May 03 12:53:07 2010 +0300 @@ -1143,6 +1143,20 @@ { if ( iWlanSupport ) { + TInt secModeV2( EConnMonSecurityV2Open ); + ret = iWlanSupport->GetConnectionSecurity( secModeV2 ); + aValue = iWlanSupport->ConvertConMonSecModeV2ToConnMonSecMode( secModeV2 ); + } + } + break; + + case KSecurityMode_v2: + // SECURITY MODE V2 + ret = KErrNotSupported; + if ( iConnInfos[index].iBearer == EBearerWLAN ) + { + if ( iWlanSupport ) + { ret = iWlanSupport->GetConnectionSecurity( aValue ); } } diff -r fcbbe021d614 -r 9c97ad6591ae connectionmonitoring/connmon/connectionmonitor/src/ConnMonWLANNetwork.cpp --- a/connectionmonitoring/connmon/connectionmonitor/src/ConnMonWLANNetwork.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionmonitoring/connmon/connectionmonitor/src/ConnMonWLANNetwork.cpp Mon May 03 12:53:07 2010 +0300 @@ -123,8 +123,10 @@ { buf.Append( aPtrC[len+EBufBase+i] ); } - - return TConnMonWLANNetwork( name, connectionMode, signalStrength, securityMode, buf ); + TConnMonWLANNetwork connMonWLANNetwork = TConnMonWLANNetwork( name, + connectionMode, signalStrength, securityMode, buf ); + buf.Close(); + return connMonWLANNetwork; } // End-of-file diff -r fcbbe021d614 -r 9c97ad6591ae connectionmonitoring/connmon/connectionmonitor/src/connmonwlannetwork_v2.cpp --- a/connectionmonitoring/connmon/connectionmonitor/src/connmonwlannetwork_v2.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionmonitoring/connmon/connectionmonitor/src/connmonwlannetwork_v2.cpp Mon May 03 12:53:07 2010 +0300 @@ -75,6 +75,40 @@ // Constructor // --------------------------------------------------------------------------- // +CConnMonWlanNetwork::CConnMonWlanNetwork( + const TBuf& aName, + TUint aConnectionMode, + TUint aSignalStrength, + TUint aSecurityMode, + TUint aSecurityModeV2, + TUint aProtectedSetupSupport, + const TBuf8& aBssId, + const TDesC& aVendorData ) + : + iName( aName ), + iConnectionMode( aConnectionMode ), + iSignalStrength( aSignalStrength ), + iSecurityMode( aSecurityMode ), + iWlanBssId( aBssId ), + iVendorData( NULL ), + iSecurityModeV2( aSecurityModeV2 ), + iProtectedSetupSupport( aProtectedSetupSupport ) + { + if ( aVendorData != KNullDesC() && aVendorData.Length() > 0 ) + { + // Can't leave here, copy contents only if enough memory + iVendorData = HBufC::New( aVendorData.Length() ); + if ( iVendorData ) + { + iVendorData->Des().Copy( aVendorData ); + } + } + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// EXPORT_C CConnMonWlanNetwork* CConnMonWlanNetwork::NewL( const TBuf& aName, TUint aConnectionMode, @@ -95,6 +129,33 @@ } // --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +EXPORT_C CConnMonWlanNetwork* CConnMonWlanNetwork::NewL( + const TBuf& aName, + TUint aConnectionMode, + TUint aSignalStrength, + TUint aSecurityMode, + TUint aSecurityModeV2, + TUint aProtectedSetupSupport, + const TBuf8& aBssId, + const TDesC& aVendorData ) + { + CConnMonWlanNetwork* wlanNet = new( ELeave ) CConnMonWlanNetwork( + aName, + aConnectionMode, + aSignalStrength, + aSecurityMode, + aSecurityModeV2, + aProtectedSetupSupport, + aBssId, + aVendorData ); + + return wlanNet; + } + +// --------------------------------------------------------------------------- // Second-phase constructor // --------------------------------------------------------------------------- // @@ -117,6 +178,8 @@ aConnMonWlanNetwork.iConnectionMode, aConnMonWlanNetwork.iSignalStrength, aConnMonWlanNetwork.iSecurityMode, + aConnMonWlanNetwork.iSecurityModeV2, + aConnMonWlanNetwork.iProtectedSetupSupport, aConnMonWlanNetwork.iWlanBssId, aConnMonWlanNetwork.iVendorData->Des() ); } @@ -127,6 +190,8 @@ aConnMonWlanNetwork.iConnectionMode, aConnMonWlanNetwork.iSignalStrength, aConnMonWlanNetwork.iSecurityMode, + aConnMonWlanNetwork.iSecurityModeV2, + aConnMonWlanNetwork.iProtectedSetupSupport, aConnMonWlanNetwork.iWlanBssId, KNullDesC() ); } @@ -155,6 +220,8 @@ iConnectionMode = aConnMonWlanNetwork.ConnectionMode(); iSignalStrength = aConnMonWlanNetwork.SignalStrength(); iSecurityMode = aConnMonWlanNetwork.SecurityMode(); + iSecurityModeV2 = aConnMonWlanNetwork.SecurityModeV2(); + iProtectedSetupSupport = aConnMonWlanNetwork.IsProtectedSetupSupported(); iWlanBssId = aConnMonWlanNetwork.WlanBssid(); if ( aConnMonWlanNetwork.iVendorData ) @@ -199,6 +266,29 @@ } // --------------------------------------------------------------------------- +// Obtains the more detailed security mode of the network. +// --------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonWlanNetwork::SecurityModeV2() + { + return iSecurityModeV2; + } + +// --------------------------------------------------------------------------- +// Finds whether Wi-Fi Protected Setup is supported. +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CConnMonWlanNetwork::IsProtectedSetupSupported() + { + TBool result( EFalse ); + if ( iProtectedSetupSupport ) + { + result = ETrue; + } + return result; + } + +// --------------------------------------------------------------------------- // Packages object to HBufC descriptor // --------------------------------------------------------------------------- // diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/BWinsCw/ConnectionUiUtilities_PROTU.def --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/BWinsCw/ConnectionUiUtilities_PROTU.def Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/BWinsCw/ConnectionUiUtilities_PROTU.def Mon May 03 12:53:07 2010 +0300 @@ -53,4 +53,6 @@ ?ConfirmMethodUsageQuery@CConnectionUiUtilities@@QAEXAAW4TMsgQueryLinkedResults@@HAAVTRequestStatus@@@Z @ 52 NONAME ; void CConnectionUiUtilities::ConfirmMethodUsageQuery(enum TMsgQueryLinkedResults &, int, class TRequestStatus &) ?ConnectingViaDiscreetPopup@CConnectionUiUtilities@@QAEXABKH@Z @ 53 NONAME ; void CConnectionUiUtilities::ConnectingViaDiscreetPopup(unsigned long const &, int) ?ConnectionErrorDiscreetPopup@CConnectionUiUtilities@@QAEXABH@Z @ 54 NONAME ; void CConnectionUiUtilities::ConnectionErrorDiscreetPopup(int const &) + ?CancelConnectingViaDiscreetPopup@CConnectionUiUtilities@@QAEXXZ @ 55 NONAME ; void CConnectionUiUtilities::CancelConnectingViaDiscreetPopup(void) + ?ConnectingViaDiscreetPopup@CConnectionUiUtilities@@QAEXXZ @ 56 NONAME ; void CConnectionUiUtilities::ConnectingViaDiscreetPopup(void) diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/EABI/ConnectionUiUtilities_PROTU.def --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/EABI/ConnectionUiUtilities_PROTU.def Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/EABI/ConnectionUiUtilities_PROTU.def Mon May 03 12:53:07 2010 +0300 @@ -55,4 +55,6 @@ _ZN22CConnectionUiUtilities26ConnectingViaDiscreetPopupERKmi @ 54 NONAME _ZN22CConnectionUiUtilities27NoWLANNetworksAvailableNoteEv @ 55 NONAME _ZN22CConnectionUiUtilities28ConnectionErrorDiscreetPopupERKi @ 56 NONAME + _ZN22CConnectionUiUtilities32CancelConnectingViaDiscreetPopupEv @ 57 NONAME + _ZN22CConnectionUiUtilities26ConnectingViaDiscreetPopupEv @ 58 NONAME diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/ActiveConnectViaNote.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/ActiveConnectViaNote.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of CActiveConnectViaNote -* -*/ - - -#ifndef __ACTIVE_CONNECT_VIA_NOTE_H__ -#define __ACTIVE_CONNECT_VIA_NOTE_H__ - -// INCLUDES -#include "ConnectionUiUtilitiesCommon.h" -#include -#include - -// FORWARD DECLARATIONS -class CConnectViaNoteNotif; -class CGulIcon; -class CEikImage; - - -/** - * CActiveConnectViaNote class, - * an active object for COfflineWlanDisabledNoteNotif - */ -NONSHARABLE_CLASS( CActiveConnectViaNote ) : public CActive -{ -public: - /** - * Constructor - */ - CActiveConnectViaNote( CConnectViaNoteNotif* aNotif, - const TConnUiUiDestConnMethodNoteId aData ); - - /** - * Launch ConnectViaNote setactive and starts active object - */ - void LaunchActiveConnectViaNote(); - - /** - * Destructor - */ - virtual ~CActiveConnectViaNote(); - -protected: - /** - * DoCancel from CActive - */ - virtual void DoCancel(); - - /** - * RunL from CActive - */ - virtual void RunL(); - - /** - * GetDialogTextL() - * @return - */ - HBufC* GetDialogTextL(); - - /** - * GetDestinationNameLC() - * @param aDestId - * @return - */ - HBufC* GetDestinationNameLC( const TUint32 aDestId ); - - /** - * GetConnectionMethodNameLC - * @param aConnMId - * @return - */ - HBufC* GetConnectionMethodNameLC( const TUint32 aConnMId ); - - /** - * CreateEikImageFromCGulIconLC - * @return CEikImage* - */ - CEikImage* CreateEikImageFromCGulIconLC(); - -protected: - TRequestStatus* iClientStatus; ///< used for complete runl, not owned - CConnectViaNoteNotif* iNotif; ///< poiter to notifer, not owned - CGulIcon* iIcon; - - TConnUiUiDestConnMethodNoteId iData; - RCmManager iCmManager; -}; - -#endif // __ACTIVE_CONNECT_VIA_NOTE_H__ - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/ConnectViaNoteNotif.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/ConnectViaNoteNotif.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of CConnectViaNoteNotif -* -*/ - - - -#ifndef __CONNECT_VIA_NOTE_H__ -#define __CONNECT_VIA_NOTE_H__ - - -// INCLUDES -#include "ConnectionDialogsNotifBase.h" - -// FORWARD DECLARAIONS -class CActiveConnectViaNote; -/** - * ConnectViaNoteNotif class - */ -NONSHARABLE_CLASS( CConnectViaNoteNotif ) : public CConnectionDialogsNotifBase - { -public: - - /** - * NewL function - * @param - - * return CConnectViaNoteNotif* - */ - static CConnectViaNoteNotif* NewL( const TBool aResourceFileResponsible ); - - /** - * RegisterL register the client notifier function - * @param - - * return TNotifierInfo - */ - TNotifierInfo RegisterL(); - - /** - * Start the Notifier - * @param aBuffer Buffer - * @param aReplySlot Identifies which message argument to use for the - * reply. This message argument will refer to a - * modifiable descriptor, a TDes8 type, into which data - * can be returned. - * @param aMessage Message - * return - - */ - void StartL( const TDesC8& aBuffer, TInt aReplySlot, - const RMessagePtr2& aMessage ); - - /** - * Cancel() the notifier - * @param - - * return - - */ - void Cancel(); - -public: - /** - * CompleteL the notifier is complete - * @param aStatus status - * return - - */ - void CompleteL( TInt aStatus ); - -private: - CActiveConnectViaNote* iActiveNote; // owned - - }; - - -#endif // __CONNECT_VIA_NOTE_H__ - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/connectingviadiscreetpopup.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/connectingviadiscreetpopup.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Declaration of CConnectingViaDiscreetPopup - * - */ - -#ifndef CCONNECTINGVIADISCREETPOPUP_H -#define CCONNECTINGVIADISCREETPOPUP_H - -// INCLUDES -#include // For CActive, link against: euser.lib -#include - -#include "connectingviadiscreetpopupnotif.h" - -/** - * CConnectingViaDiscreetPopup class - */ -NONSHARABLE_CLASS( CConnectingViaDiscreetPopup ) : public CActive - { -public: - /** - * Destructor - * Cancel and destroy - */ - ~CConnectingViaDiscreetPopup(); - - /** - * NewL function - * Two-phased constructor. - * @param aNotif a pointer to notifier plugin - */ - static CConnectingViaDiscreetPopup* NewL( - CConnectingViaDiscreetPopupNotif* aNotif); - - /** - * NewL function - * Two-phased constructor. - * @param aNotif a pointer to notifier plugin - */ - static CConnectingViaDiscreetPopup* NewLC( - CConnectingViaDiscreetPopupNotif* aNotif); - -public: - /** - * StartL Function for making the initial request - */ - void StartL(TUint32 aIapId, TBool aConnectionAlreadyActive); - -private: - /** - * C++ constructor - */ - CConnectingViaDiscreetPopup(CConnectingViaDiscreetPopupNotif* aNotif); - - /** - * Second-phase constructor - */ - void ConstructL(); - -private: - /** - * From CActive - */ - void RunL(); - - /** - * From CActive - */ - void DoCancel(); - - /** - * From CActive - */ - TInt RunError(TInt aError); - -private: - - // Used for complete runl, not owned - TRequestStatus* iClientStatus; - - // Pointer to notifer, not owned - CConnectingViaDiscreetPopupNotif* iNotif; - - // Handle to cmmanager interface - RCmManager icmManager; - - // Bearer type from cmmanager - TUint iBearerType; - - // Connection name - owned - HBufC* iConnectionName; - - // Popup flags - TInt iPopupFlags; - - }; - -#endif // CCONNECTINGVIADISCREETPOPUP_H diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/connectingviadiscreetpopupnotif.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/connectingviadiscreetpopupnotif.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Declaration of Generic Connection Ui Utilities Notifier - * - */ - -#ifndef __CONNECTINGVIADISCREETPOPUPNOTIF_H__ -#define __CONNECTINGVIADISCREETPOPUPNOTIF_H__ - -// INCLUDES -#include "ConnectionDialogsNotifBase.h" - -//FORWARD DECLARATION -class CConnectingViaDiscreetPopup; - -/** - * CConnectingViaDiscreetPopupNotif class - */ -NONSHARABLE_CLASS( CConnectingViaDiscreetPopupNotif ) : public CConnectionDialogsNotifBase - { -public: - /** - * NewL function - * @param - - * return CConnectingViaDiscreetPopupNotif* - */ - static CConnectingViaDiscreetPopupNotif* NewL( - const TBool aResourceFileResponsible); - - /** - * RegisterL register the client notifier function - * @param - - * return TNotifierInfo - */ - TNotifierInfo RegisterL(); - - /** - * Start the Notifier - * @param aBuffer Buffer - * @param aReplySlot Identifies which message argument to use for the - * reply. This message argument will refer to a - * modifiable descriptor, a TDes8 type, into which - * data can be returned. - * @param aMessage Message - * return - - */ - void StartL(const TDesC8& aBuffer, TInt aReplySlot, - const RMessagePtr2& aMessage); - - /** - * Cancel() the notifier - * @param - - * return - - */ - void Cancel(); - - /** - * CompleteL the notifier is complete - * @param aStatus status - * return - - */ - void CompleteL(TInt aStatus); - -protected: - /** - * Constructor - */ - CConnectingViaDiscreetPopupNotif(); - -protected: - - // pointer to active object, owned - CConnectingViaDiscreetPopup* iActiveNote; - - }; - -#endif //__CONNECTINGVIADISCREETPOPUPNOTIF_H__ -// End of File - diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/connectionerrordiscreetpopup.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/connectionerrordiscreetpopup.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Declaration of CConnectingViaDiscreetPopup - * - */ - -#ifndef CCONNECTIONERRORDISCREETPOPUP_H -#define CCONNECTIONERRORDISCREETPOPUP_H - -// INCLUDES -#include // For CActive, link against: euser.lib -#include - -#include "connectionerrordiscreetpopupnotif.h" - -/** - * CConnectingViaDiscreetPopup class - */ -NONSHARABLE_CLASS( CConnectionErrorDiscreetPopup ) : public CActive - { -public: - /** - * Destructor - * Cancel and destroy - */ - ~CConnectionErrorDiscreetPopup(); - - /** - * NewL function - * Two-phased constructor. - * @param aNotif a pointer to notifier plugin - */ - static CConnectionErrorDiscreetPopup* NewL( - CConnectionErrorDiscreetPopupNotif* aNotif ); - - /** - * NewL function - * Two-phased constructor. - * @param aNotif a pointer to notifier plugin - */ - static CConnectionErrorDiscreetPopup* NewLC( - CConnectionErrorDiscreetPopupNotif* aNotif ); - -public: - /** - * StartL Function for making the initial request - */ - void StartL( TUint32 aErrCode ); - -private: - /** - * C++ constructor - */ - CConnectionErrorDiscreetPopup( CConnectionErrorDiscreetPopupNotif* aNotif ); - - /** - * Second-phase constructor - */ - void ConstructL(); - -private: - /** - * From CActive - */ - void RunL(); - - /** - * From CActive - */ - void DoCancel(); - - /** - * From CActive - */ - TInt RunError( TInt aError ); - - /** - * Resolves error code saved in iErrorCode. - * @return EFalse when resolve failed. - */ - TBool ResolveErrorCode( TInt& aText1, TInt& aText2, - TInt& aBitmap, TInt& aMask ); - -private: - - // Used for complete runl, not owned - TRequestStatus* iClientStatus; - - // Pointer to notifer, not owned - CConnectionErrorDiscreetPopupNotif* iNotif; - - // Error code to be shown - TInt iErrorCode; - - // Handle to cmmanager interface - RCmManager icmManager; - - }; - -#endif // CCONNECTIONERRORDISCREETPOPUP_H diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/connectionerrordiscreetpopupnotif.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/connectionerrordiscreetpopupnotif.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Declaration of Generic Connection Ui Utilities Notifier - * - */ - -#ifndef __CONNECTIONERRORDISCREETPOPUPNOTIF_H__ -#define __CONNECTIONERRORDISCREETPOPUPNOTIF_H__ - -// INCLUDES -#include "ConnectionDialogsNotifBase.h" - -//FORWARD DECLARATION -class CConnectionErrorDiscreetPopup; - -/** - * CConnectionErrorDiscreetPopupNotif class - */ -NONSHARABLE_CLASS( CConnectionErrorDiscreetPopupNotif ) : -public CConnectionDialogsNotifBase - { -public: - /** - * NewL function - * @param - - * return CConnectionErrorDiscreetPopupNotif* - */ - static CConnectionErrorDiscreetPopupNotif* NewL( - const TBool aResourceFileResponsible ); - - /** - * RegisterL register the client notifier function - * @param - - * return TNotifierInfo - */ - TNotifierInfo RegisterL(); - - /** - * Start the Notifier - * @param aBuffer Buffer - * @param aReplySlot Identifies which message argument to use for the - * reply. This message argument will refer to a - * modifiable descriptor, a TDes8 type, into which - * data can be returned. - * @param aMessage Message - * return - - */ - void StartL( const TDesC8& aBuffer, TInt aReplySlot, - const RMessagePtr2& aMessage ); - - /** - * Cancel() the notifier - * @param - - * return - - */ - void Cancel(); - - /** - * CompleteL the notifier is complete - * @param aStatus status - * return - - */ - void CompleteL( TInt aStatus ); - -protected: - /** - * Constructor - */ - CConnectionErrorDiscreetPopupNotif(); - -protected: - - // pointer to active object, owned - CConnectionErrorDiscreetPopup* iActiveNote; - - }; - -#endif //__CONNECTINGVIADISCREETPOPUPNOTIF_H__ -// End of File - diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/devicedialogobserver.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/devicedialogobserver.h Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/devicedialogobserver.h Mon May 03 12:53:07 2010 +0300 @@ -18,7 +18,7 @@ #ifndef __DEVICEDIALOGOBSERVER_H__ #define __DEVICEDIALOGOBSERVER_H__ -#include "cellulardataconfirmation.h" +#include "CellularDataConfirmation.h" NONSHARABLE_CLASS ( CDeviceDialogObserver ) : public CBase, public MHbDeviceDialogObserver { diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/nowlannetworksavailablenotif.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/nowlannetworksavailablenotif.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of CNoWLANNetworksAvailableNotif -* -*/ - - - -#ifndef __NO_WLAN_NETWORKS_AVAILABLE_NOTE_H__ -#define __NO_WLAN_NETWORKS_AVAILABLE_NOTE_H__ - -// INCLUDES -#include "ConnectionDialogsNotifBase.h" -#include "nowlansdiscreetpopup.h" - -//FORWARD DECLARATION -class CNoWlansDiscreetPopup; - -/** - * CNoWLANNetworksAvailableNotif class - */ -NONSHARABLE_CLASS( CNoWLANNetworksAvailableNotif ) - : public CConnectionDialogsNotifBase - { - public: - /** - * NewL function - * @param - - * return CNoWLANNetworksAvailableNotif* - */ - static CNoWLANNetworksAvailableNotif* NewL( - const TBool aResourceFileResponsible ); - - /** - * RegisterL register the client notifier function - * @param - - * return TNotifierInfo - */ - TNotifierInfo RegisterL(); - - /** - * Start the Notifier - * @param aBuffer Buffer - * @param aReplySlot Identifies which message argument to use for the - * reply. This message argument will refer to a - * modifiable descriptor, a TDes8 type, into which - * data can be returned. - * @param aMessage Message - * return - - */ - void StartL( const TDesC8& aBuffer, TInt aReplySlot, - const RMessagePtr2& aMessage ); - - /** - * Cancel() the notifier - * @param - - * return - - */ - void Cancel(); - - /** - * CompleteL the notifier is complete - * @param aStatus status - * return - - */ - void CompleteL( TInt aStatus ); - - protected: - /** - * Constructor - */ - CNoWLANNetworksAvailableNotif(); - - protected: - // pointer to active object, owned - CNoWlansDiscreetPopup* iActiveNote; - - }; - -#endif //__NO_WLAN_NETWORKS_AVAILABLE_NOTE_H__ - -// End of File - diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/nowlansdiscreetpopup.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifInc/nowlansdiscreetpopup.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Declaration of CNoWlansDiscreetPopup - * - */ - -#ifndef CNOWLANSDISCREETPOPUP_H -#define CNOWLANSDISCREETPOPUP_H - -// INCLUDES -#include // For CActive, link against: euser.lib - -#include "ConnectionDialogsNotifBase.h" - -/** - * CConnectingViaDiscreetPopup class - */ -NONSHARABLE_CLASS( CNoWlansDiscreetPopup ) : public CActive - { -public: - /** - * Destructor - * Cancel and destroy - */ - virtual ~CNoWlansDiscreetPopup(); - - /** - * NewL function - * Two-phased constructor. - * @param aNotif a pointer to notifier plugin - */ - static CNoWlansDiscreetPopup* NewL( - CConnectionDialogsNotifBase* aNotif ); - - /** - * NewL function - * Two-phased constructor. - * @param aNotif a pointer to notifier plugin - */ - static CNoWlansDiscreetPopup* NewLC( - CConnectionDialogsNotifBase* aNotif ); - -public: - /** - * StartL Function for making the initial request - */ - void StartL(); - -private: - /** - * C++ constructor - */ - CNoWlansDiscreetPopup( CConnectionDialogsNotifBase* aNotif ); - - /** - * Second-phase constructor - */ - void ConstructL(); - -private: - /** - * From CActive - */ - void RunL(); - - /** - * From CActive - */ - void DoCancel(); - - /** - * From CActive - */ - TInt RunError( TInt aError ); - -private: - // Used for complete runl, not owned - TRequestStatus* iClientStatus; - - // Pointer to notifer, not owned - CConnectionDialogsNotifBase* iNotif; - }; - -#endif // CNOWLANSDISCREETPOPUP_H diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ActiveConnectViaNote.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ActiveConnectViaNote.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,305 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CActiveConnectViaNote. -* -*/ - - -// INCLUDE FILES -#include "ActiveConnectViaNote.h" -#include "ConnectViaNoteNotif.h" -#include "NoteDlgSuppressingSwitch.h" -#include "ConnectionDialogsLogger.h" - -#include -#include - -#include -#include - -#include -#include - -#ifndef __WINS__ -#include -#include -#include -#endif // !__WINS__ - -// CONSTANTS - -LOCAL_D const TInt KStringsGranularity = 2; - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// CActiveConnectViaNote::CActiveConnectViaNote() -// --------------------------------------------------------- -// -CActiveConnectViaNote::CActiveConnectViaNote( - CConnectViaNoteNotif* aNotif, - const TConnUiUiDestConnMethodNoteId aData ) -: CActive( KErrNone ), - iNotif( aNotif ), - iIcon( NULL ), - iData( aData ) - { - CActiveScheduler::Add( this ); - } - -// --------------------------------------------------------- -// CActiveConnectViaNote::DoCancel() -// --------------------------------------------------------- -// -void CActiveConnectViaNote::DoCancel() - { - } - -// --------------------------------------------------------- -// CActiveConnectViaNote::RunL() -// --------------------------------------------------------- -// -void CActiveConnectViaNote::RunL() - { - CLOG_ENTERFN( "CActiveConnectViaNote::RunL" ); - - if( iStatus == KErrNone ) - { - iCmManager.OpenL(); - - HBufC* noteText = GetDialogTextL(); - CleanupStack::PushL( noteText ); - - CNoteDlgSuppressingSwitch* dialog = new (ELeave) - CNoteDlgSuppressingSwitch( - REINTERPRET_CAST( CEikDialog**, &dialog ) ); - CleanupStack::PushL( dialog ); - - CEikImage* image = CreateEikImageFromCGulIconLC(); - dialog->SetIconL( image ); //The dialog takes ownership of the pointer - CleanupStack::Pop( image ); - - CleanupStack::Pop( dialog ); - - TInt resId = R_CONNECTING_VIA_INFO_NOTE; - switch( iData.iNoteId ) - { - case EConnectedViaDestConnMethodConfirmationNote: - case EConnectedViaConnMethodConfirmationNote: - { - resId = R_CONNECTED_VIA_CONFIRM_NOTE; - break; - } - case EConnectingToConnMethodInfoNote: - default : - { - break; - } - } - - dialog->PrepareLC( resId ); - dialog->ActivateL(); - dialog->SetCurrentLabelL( EGeneralNote, noteText->Des() ); - - dialog->RunDlgLD( CAknNoteDialog::ELongTimeout, - CAknNoteDialog::ENoTone ); - - CleanupStack::PopAndDestroy( noteText ); - - CLOG_WRITE( "CActiveConnectViaNote::RunL: Completing with KErrNone" ); - - iNotif->CompleteL( KErrNone ); - } - - CLOG_LEAVEFN( "CActiveConnectViaNote::RunL" ); - } - -// --------------------------------------------------------- -// CActiveConnectViaNote::LaunchActiveConnectViaNote() -// --------------------------------------------------------- -// -void CActiveConnectViaNote::LaunchActiveConnectViaNote() - { - CLOG_ENTERFN( "CActiveConnectViaNote::LaunchActiveConnectViaNote" ); - - SetActive(); - iClientStatus = &iStatus; - User::RequestComplete( iClientStatus, KErrNone ); - } - - -// --------------------------------------------------------- -// CActiveConnectViaNote::~CActiveConnectViaNote() -// --------------------------------------------------------- -// -CActiveConnectViaNote::~CActiveConnectViaNote() - { - Cancel(); - iCmManager.Close(); - - delete iIcon; - iIcon = NULL; - } - -// --------------------------------------------------------- -// CActiveConnectViaNote::GetDialogTextL() -// --------------------------------------------------------- -// -HBufC* CActiveConnectViaNote::GetDialogTextL() - { - HBufC* tempText = NULL; - switch( iData.iNoteId ) - { - case EConnectedViaDestConnMethodConfirmationNote: - { - HBufC* destName = GetDestinationNameLC( iData.iDestination ); - HBufC* cmName = GetConnectionMethodNameLC( - iData.iConnectionMethod ); - CDesCArrayFlat* strings = new( ELeave ) CDesCArrayFlat( - KStringsGranularity ); - CleanupStack::PushL( strings ); - - strings->AppendL( *destName ); - strings->AppendL( *cmName ); - tempText = StringLoader::LoadL( - R_QTN_NETW_CONSET_CONF_CONNECTED_TO, - *strings ); - - CleanupStack::PopAndDestroy( strings ); - CleanupStack::PopAndDestroy( cmName ); - CleanupStack::PopAndDestroy( destName ); - break; - } - - case EConnectedViaConnMethodConfirmationNote: - case EConnectingToConnMethodInfoNote: - default: - { - HBufC* cmNname = GetConnectionMethodNameLC( - iData.iConnectionMethod ); - tempText = StringLoader::LoadL( - ( iData.iNoteId == EConnectedViaConnMethodConfirmationNote ) ? - R_QTN_NETW_CONSET_CONF_CONNECTED_VIA_METHOD : - R_QTN_NETW_CONSET_INFO_ROAMING_TO, - *cmNname ); - CleanupStack::PopAndDestroy( cmNname ); - break; - } - } - - return tempText; - } - -// --------------------------------------------------------- -// CActiveConnectViaNote::GetDestinationNameLC() -// --------------------------------------------------------- -// -HBufC* CActiveConnectViaNote::GetDestinationNameLC( const TUint32 aDestId ) - { - HBufC* tempDestName( NULL ); - - RCmDestination destination = iCmManager.DestinationL( aDestId ); - CleanupClosePushL( destination ); - - tempDestName = destination.NameLC(); - CleanupStack::Pop( tempDestName ); // tempDestName - - CleanupStack::PopAndDestroy(); // destination - CleanupStack::PushL( tempDestName ); - - return tempDestName; - } - -// --------------------------------------------------------- -// CActiveConnectViaNote::GetConnectionMethodNameLC() -// --------------------------------------------------------- -// -HBufC* CActiveConnectViaNote::GetConnectionMethodNameLC( - const TUint32 aConnMId ) - { - HBufC* tempCMName( NULL ); - TBool isEasyWlan = EFalse; - -#ifndef __WINS__ - - FeatureManager::InitializeLibL(); - TBool isWlanSupported = - FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ); - FeatureManager::UnInitializeLib(); - - if ( isWlanSupported ) - { - if ( iCmManager.EasyWlanIdL() == iData.iConnectionMethod ) - { - TWlanSsid ssidConn; - CWlanMgmtClient *wlanMgmtClient = CWlanMgmtClient::NewL(); - CleanupStack::PushL( wlanMgmtClient ); - - if ( !wlanMgmtClient->GetConnectionSsid( ssidConn ) ) - { - tempCMName = HBufC::NewL( ssidConn.Length() ); - tempCMName->Des().Copy( ssidConn ); - isEasyWlan = ETrue; - } - - wlanMgmtClient->CancelNotifications(); - CleanupStack::PopAndDestroy( wlanMgmtClient ); - } - } -#endif // !__WINS__ - - CLOG_WRITEF( _L( "Connection Method id in CActiveConnectViaNote: %d" ), aConnMId ); - - RCmConnectionMethod connMethod = iCmManager.ConnectionMethodL( aConnMId ); - CleanupClosePushL( connMethod ); - - TInt tempIcon = connMethod.GetIntAttributeL( CMManager::ECmBearerIcon ); - CLOG_WRITEF( _L( "tempIcon in CActiveConnectViaNote: %d" ), tempIcon ); - iIcon = REINTERPRET_CAST( CGulIcon*, tempIcon ); - - if ( !isEasyWlan ) - { - tempCMName = connMethod.GetStringAttributeL( CMManager::ECmName ); - } - - CleanupStack::PopAndDestroy(); // connMethod - CleanupStack::PushL( tempCMName ); - - return tempCMName; - } - -// --------------------------------------------------------- -// CActiveConnectViaNote::CreateEikImageFromCGulIconLC() -// --------------------------------------------------------- -// -CEikImage* CActiveConnectViaNote::CreateEikImageFromCGulIconLC() - { - CEikImage* tempImage = new ( ELeave ) CEikImage(); - - if( iIcon ) - { - CFbsBitmap* bm = iIcon->Bitmap(); - CFbsBitmap* m = iIcon->Mask(); - tempImage->SetPicture( bm, m ); - iIcon->SetBitmapsOwnedExternally( ETrue ); - } - - CleanupStack::PushL( tempImage ); - return tempImage; - } - - - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ConnUiUtilsNotif.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ConnUiUtilsNotif.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ConnUiUtilsNotif.cpp Mon May 03 12:53:07 2010 +0300 @@ -26,12 +26,8 @@ #include "EasyWepDlgNotif.h" #include "EasyWpaDlgNotif.h" #include "WLANNetworkUnavailableNoteNotif.h" -#include "ConnectViaNoteNotif.h" #include "wlanpowersavetestnotif.h" #include "easywapidlgnotif.h" -#include "nowlannetworksavailablenotif.h" -#include "connectingviadiscreetpopupnotif.h" -#include "connectionerrordiscreetpopupnotif.h" #include "cellulardataconfirmation.h" // CONSTANTS @@ -119,11 +115,6 @@ aNotifiers->AppendL( serNotify ); CleanupStack::Pop( serNotify ); - serNotify = CConnectViaNoteNotif::NewL( resourceFileResponsible ); - CleanupStack::PushL( serNotify ); - aNotifiers->AppendL( serNotify ); - CleanupStack::Pop( serNotify ); - serNotify = CWlanPowerSaveQueryNotif::NewL( resourceFileResponsible ); CleanupStack::PushL( serNotify ); aNotifiers->AppendL( serNotify ); @@ -134,20 +125,6 @@ aNotifiers->AppendL( serNotify ); CleanupStack::Pop( serNotify ); - serNotify = CConnectingViaDiscreetPopupNotif::NewL( resourceFileResponsible ); - CleanupStack::PushL( serNotify ); - aNotifiers->AppendL( serNotify ); - CleanupStack::Pop( serNotify ); - - serNotify = CNoWLANNetworksAvailableNotif::NewL( resourceFileResponsible ); - CleanupStack::PushL( serNotify ); - aNotifiers->AppendL( serNotify ); - CleanupStack::Pop( serNotify ); - - serNotify = CConnectionErrorDiscreetPopupNotif::NewL( resourceFileResponsible ); - CleanupStack::PushL( serNotify ); - aNotifiers->AppendL( serNotify ); - CleanupStack::Pop( serNotify ); } // End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ConnectViaNoteNotif.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/ConnectViaNoteNotif.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CConnectViaNoteNotif. -* -*/ - - -// INCLUDE FILES -#include "ConnectViaNoteNotif.h" -#include "ConnectionUiUtilitiesCommon.h" -#include "ActiveConnectViaNote.h" -#include "ConnUiUtilsNotif.h" -#include "ConnectionDialogsLogger.h" - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// CConnectViaNoteNotif::TNotifierInfo CConnectViaNoteNotif::RegisterL() -// --------------------------------------------------------- -// -CConnectViaNoteNotif::TNotifierInfo CConnectViaNoteNotif::RegisterL() - { - iInfo.iUid = KUidConnectViaNote; - iInfo.iPriority = ENotifierPriorityHigh; - iInfo.iChannel = KUidConnectViaNote; - - return iInfo; - } - -// --------------------------------------------------------- -// void CConnectViaNoteNotif::StartL -// --------------------------------------------------------- -// -void CConnectViaNoteNotif::StartL( const TDesC8& aBuffer, - TInt aReplySlot, - const RMessagePtr2& aMessage ) - { - CLOG_ENTERFN( "CConnectViaNoteNotif::StartL" ); - - TPckgBuf input; - input.Copy( aBuffer ); - TConnUiUiDestConnMethodNoteId info = input(); - - iReplySlot = aReplySlot; - iMessage = aMessage; - iCancelled = EFalse; - - iActiveNote = new( ELeave ) CActiveConnectViaNote( this, info ); - - iActiveNote->LaunchActiveConnectViaNote(); - } - -// --------------------------------------------------------- -// void CConnectViaNoteNotif::Cancel() -// --------------------------------------------------------- -// -void CConnectViaNoteNotif::Cancel() - { - CLOG_ENTERFN( "CConnectViaNoteNotif::Cancel" ); - - if ( !iCancelled ) - { - iCancelled = ETrue; - if ( !iMessage.IsNull() ) - { // No need to return an error code, we are just completing! - CLOG_WRITEF( _L( "Completing CConnectViaNoteNotif with KErrNone" ) ); - iMessage.Complete( KErrNone ); - } - - delete iActiveNote; - iActiveNote = NULL; - } - - CLOG_LEAVEFN( "CConnectViaNoteNotif::Cancel" ); - } - -// --------------------------------------------------------- -// void CConnectViaNoteNotif::CompleteL( TInt aStatus ) -// --------------------------------------------------------- -// -void CConnectViaNoteNotif::CompleteL( TInt aStatus ) - { - CLOG_ENTERFN( "CConnectViaNoteNotif::CompleteL" ); - CLOG_WRITEF( _L( "aStatus: %d" ), aStatus ); - - delete iActiveNote; - iActiveNote = NULL; - iCancelled = ETrue; - if ( !iMessage.IsNull() ) - { - CLOG_WRITEF( _L( "Completing CConnectViaNoteNotif with %d" ), aStatus ); - iMessage.Complete( aStatus ); - } - CLOG_LEAVEFN( "CConnectViaNoteNotif::CompleteL" ); - } - - -// --------------------------------------------------------- -// CConnectViaNoteNotif* CConnectViaNoteNotif::NewL() -// --------------------------------------------------------- -// -CConnectViaNoteNotif* CConnectViaNoteNotif::NewL( - const TBool aResourceFileResponsible ) - { - CConnectViaNoteNotif* self = new ( ELeave ) CConnectViaNoteNotif(); - CleanupStack::PushL( self ); - self->ConstructL( KResourceFileName, aResourceFileResponsible ); - CleanupStack::Pop(); - return self; - } - - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/connectingviadiscreetpopup.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/connectingviadiscreetpopup.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,227 +0,0 @@ -/* - * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Implementation of CConnectingViaDiscreetPopup. - * - */ - -// INCLUDE FILES -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "connectingviadiscreetpopup.h" - -// Connection Manager UIDs -const TUid KDiscreetPopupUid = - { - 0x101F84D0 - }; -const TUid KDiscreetPopupViewUid = - { - 0x2 - }; -// Path of the app's iconfile -_LIT( KIconFileName, "\\resource\\apps\\connectionuiutilities.mif" ); - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// CConnectingViaDiscreetPopup::CConnectingViaDiscreetPopup -// --------------------------------------------------------- -// -CConnectingViaDiscreetPopup::CConnectingViaDiscreetPopup( - CConnectingViaDiscreetPopupNotif* aNotif) : - CActive(EPriorityUserInput), // Standard priority - iNotif(aNotif), iBearerType(0), - iConnectionName(NULL), iPopupFlags(0) - { - } - -// --------------------------------------------------------- -// CConnectingViaDiscreetPopup::NewLC -// --------------------------------------------------------- -// -CConnectingViaDiscreetPopup* CConnectingViaDiscreetPopup::NewLC( - CConnectingViaDiscreetPopupNotif* aNotif) - { - CConnectingViaDiscreetPopup* self = - new (ELeave) CConnectingViaDiscreetPopup(aNotif); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------- -// CConnectingViaDiscreetPopup::NewL -// --------------------------------------------------------- -// -CConnectingViaDiscreetPopup* CConnectingViaDiscreetPopup::NewL( - CConnectingViaDiscreetPopupNotif* aNotif) - { - CConnectingViaDiscreetPopup* self = CConnectingViaDiscreetPopup::NewLC( - aNotif); - CleanupStack::Pop(); // self; - return self; - } - -// --------------------------------------------------------- -// CConnectingViaDiscreetPopup::ConstructL -// --------------------------------------------------------- -// -void CConnectingViaDiscreetPopup::ConstructL() - { - CActiveScheduler::Add(this); // Add to scheduler - icmManager.OpenL(); - } - -// --------------------------------------------------------- -// CConnectingViaDiscreetPopup::~CConnectingViaDiscreetPopup -// --------------------------------------------------------- -// -CConnectingViaDiscreetPopup::~CConnectingViaDiscreetPopup() - { - Cancel(); // Cancel any request, if outstanding - icmManager.Close(); - // Delete instance variables if any - if (iConnectionName) - { - delete iConnectionName; - } - } - -// --------------------------------------------------------- -// CConnectingViaDiscreetPopup::DoCancel -// --------------------------------------------------------- -// -void CConnectingViaDiscreetPopup::DoCancel() - { - } - -// --------------------------------------------------------- -// CConnectingViaDiscreetPopup::StartL -// --------------------------------------------------------- -// -void CConnectingViaDiscreetPopup::StartL(TUint32 aIapId, - TBool aConnectionAlreadyActive) - { - Cancel(); // Cancel any request, just to be sure - iBearerType = 0; - delete iConnectionName; - iConnectionName = NULL; - - if (!aConnectionAlreadyActive) - { - iPopupFlags = KAknDiscreetPopupDurationLong; - } - - RCmConnectionMethod plugin; - CleanupClosePushL(plugin); - if (aIapId) - { - plugin = icmManager.ConnectionMethodL(aIapId); - iBearerType = plugin.GetIntAttributeL(CMManager::ECmBearerType); - TUint32 easyWLANIapId = icmManager.EasyWlanIdL(); - if (easyWLANIapId != aIapId) - { - iConnectionName = plugin.GetStringAttributeL(CMManager::ECmName); - } - else - { - iConnectionName = plugin.GetStringAttributeL(CMManager::EWlanUsedSSID); - } - } - CleanupStack::PopAndDestroy(&plugin); - - SetActive(); // Tell scheduler a request is active - iClientStatus = &iStatus; - User::RequestComplete(iClientStatus, KErrNone); - - // Complete client request before launching dialog - iNotif->SetCancelledFlag(ETrue); - iNotif->CompleteL(KErrNone); - } - -// --------------------------------------------------------- -// CConnectingViaDiscreetPopup::RunL -// --------------------------------------------------------- -// -void CConnectingViaDiscreetPopup::RunL() - { - if (iStatus == KErrNone) - { - TUint bitmapId = 0; - TUint maskId = 0; - if (iBearerType == KUidWlanBearerType) - { - bitmapId = EMbmConnectionuiutilitiesQgn_prop_wlan_bearer; - maskId = EMbmConnectionuiutilitiesQgn_prop_wlan_bearer_mask; - } - else - { - bitmapId = EMbmConnectionuiutilitiesQgn_prop_wml_gprs; - maskId = EMbmConnectionuiutilitiesQgn_prop_wml_gprs_mask; - } - - // Load strings from resources - HBufC* stringText1 = StringLoader::LoadLC( - R_QTN_OCC_CONNECTING_DISCREET_POPUP_TEXT1); - - HBufC* stringText2 = NULL; - if (iConnectionName) - { - stringText2 = StringLoader::LoadLC( - R_QTN_OCC_CONNECTING_DISCREET_POPUP_TEXT2, - *iConnectionName); - } - else - { - stringText2 = _L("''").AllocLC(); - } - - CAknDiscreetPopup::ShowGlobalPopupL(*stringText1, // first text row - *stringText2, // second text row - KAknsIIDDefault, // icon skin id - KIconFileName, // bitmap file path - bitmapId, // bitmap id - maskId, // mask id - iPopupFlags, // flags - 0, // command id - NULL, // command observer - KDiscreetPopupUid, // application to be launched - KDiscreetPopupViewUid); // view to be activated - CleanupStack::PopAndDestroy(2); - } - - // Cleanup - iNotif->Cancel(); - } - -// --------------------------------------------------------- -// CConnectingViaDiscreetPopup::RunError -// --------------------------------------------------------- -// -TInt CConnectingViaDiscreetPopup::RunError(TInt aError) - { - return aError; - } diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/connectingviadiscreetpopupnotif.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/connectingviadiscreetpopupnotif.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Implementation of CConnectingViaDiscreetPopupNotif. - * - */ - -// INCLUDE FILES -#include "connectingviadiscreetpopupnotif.h" -#include "connectingviadiscreetpopup.h" -#include "ConnUiUtilsNotif.h" -#include "ConnectionDialogsUidDefs.h" -#include "ConnectionUiUtilitiesCommon.h" - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// CConnectingViaDiscreetPopupNotif::TNotifierInfo -// CConnectingViaDiscreetPopupNotif::RegisterL() -// --------------------------------------------------------- -// -CConnectingViaDiscreetPopupNotif::TNotifierInfo CConnectingViaDiscreetPopupNotif::RegisterL() - { - iInfo.iUid = KUidConnectingViaDiscreetPopup; - iInfo.iPriority = ENotifierPriorityVHigh; - iInfo.iChannel = KUidConnectingViaDiscreetPopup; - - return iInfo; - } - -// --------------------------------------------------------- -// void CConnectingViaDiscreetPopupNotif::StartL() -// --------------------------------------------------------- -// -void CConnectingViaDiscreetPopupNotif::StartL(const TDesC8& aBuffer, - TInt aReplySlot, const RMessagePtr2& aMessage) - { - if ( iActiveNote ) - { - // Note is already active - aMessage.Complete( KErrNone ); - return; - } - - iReplySlot = aReplySlot; - iMessage = aMessage; - iCancelled = ETrue; - iActiveNote = CConnectingViaDiscreetPopup::NewL(this); - - TPckgBuf data; - data.Copy(aBuffer); - - iActiveNote->StartL( data().iIapId, data().iConnectionAlreadyActive ); - iCancelled = EFalse; - } - -// --------------------------------------------------------- -// void CConnectingViaDiscreetPopupNotif::CompleteL( TInt aStatus ) -// --------------------------------------------------------- -// -void CConnectingViaDiscreetPopupNotif::CompleteL(TInt aStatus) - { - iCancelled = ETrue; - if (!iMessage.IsNull()) - { - iMessage.Complete(aStatus); - } - } - -// --------------------------------------------------------- -// CConnectingViaDiscreetPopupNotif* CConnectingViaDiscreetPopupNotif::NewL() -// --------------------------------------------------------- -// -CConnectingViaDiscreetPopupNotif* CConnectingViaDiscreetPopupNotif::NewL( - const TBool aResourceFileResponsible) - { - CConnectingViaDiscreetPopupNotif* self = - new (ELeave) CConnectingViaDiscreetPopupNotif(); - CleanupStack::PushL(self); - self->ConstructL(KResourceFileName, aResourceFileResponsible); - CleanupStack::Pop(); - - return self; - } - -// --------------------------------------------------------- -// CConnectingViaDiscreetPopupNotif::CConnectingViaDiscreetPopupNotif() -// --------------------------------------------------------- -// -CConnectingViaDiscreetPopupNotif::CConnectingViaDiscreetPopupNotif() : - CConnectionDialogsNotifBase(), iActiveNote(NULL) - { - } - -// --------------------------------------------------------- -// void CConnectingViaDiscreetPopupNotif::Cancel() -// --------------------------------------------------------- -// -void CConnectingViaDiscreetPopupNotif::Cancel() - { - if (!iCancelled) - { - iCancelled = ETrue; - if (!iMessage.IsNull()) - { - iMessage.Complete(KErrCancel); - } - } - if ( iActiveNote ) - { - delete iActiveNote; - iActiveNote = NULL; - } - } - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/connectionerrordiscreetpopup.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/connectionerrordiscreetpopup.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,432 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Implementation of CConnectionErrorDiscreetPopup. - * - */ - -// INCLUDE FILES -#include "connectionerrordiscreetpopup.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef _DEBUG -#include -#endif - -// Error code definitions are from these headers -#include // WLAN-specific error code definitions -#include -#include // GPRS-specific causes for Session Management -#include // NetDial errors -#include // IPv6 error constants -#include - -// Errors in UI spec not found elsewhere -const TInt KErrPDPMaxContextsReached = -6000; -const TInt KErrDndNameNotFound = -5120; -const TInt KErrGeneralConnection = -50000; -const TInt KErrGenConnNoGPRSNetwork = -3609; - -// No discreet popup => Uid 0 -const TUid KDiscreetPopupUidNone = - { - 0x0 - }; -// Path of the app's iconfile -_LIT( KIconFileName, "\\resource\\apps\\connectionuiutilities.mif" ); - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// CConnectionErrorDiscreetPopup::CConnectionErrorDiscreetPopup -// --------------------------------------------------------- -// -CConnectionErrorDiscreetPopup::CConnectionErrorDiscreetPopup( - CConnectionErrorDiscreetPopupNotif* aNotif) : - CActive(EPriorityUserInput), // Standard priority - iNotif(aNotif), iErrorCode(KErrNone) - { - } - -// --------------------------------------------------------- -// CConnectionErrorDiscreetPopup::NewLC -// --------------------------------------------------------- -// -CConnectionErrorDiscreetPopup* CConnectionErrorDiscreetPopup::NewLC( - CConnectionErrorDiscreetPopupNotif* aNotif) - { - CConnectionErrorDiscreetPopup* self = - new (ELeave) CConnectionErrorDiscreetPopup(aNotif); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------- -// CConnectionErrorDiscreetPopup::NewL -// --------------------------------------------------------- -// -CConnectionErrorDiscreetPopup* CConnectionErrorDiscreetPopup::NewL( - CConnectionErrorDiscreetPopupNotif* aNotif) - { - CConnectionErrorDiscreetPopup* self = - CConnectionErrorDiscreetPopup::NewLC(aNotif); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------- -// CConnectionErrorDiscreetPopup::ConstructL -// --------------------------------------------------------- -// -void CConnectionErrorDiscreetPopup::ConstructL() - { - CActiveScheduler::Add(this); // Add to scheduler - icmManager.OpenL(); - } - -// --------------------------------------------------------- -// CConnectionErrorDiscreetPopup::~CConnectionErrorDiscreetPopup -// --------------------------------------------------------- -// -CConnectionErrorDiscreetPopup::~CConnectionErrorDiscreetPopup() - { - Cancel(); // Cancel any request, if outstanding - icmManager.Close(); - // Delete instance variables if any - } - -// --------------------------------------------------------- -// CConnectionErrorDiscreetPopup::DoCancel -// --------------------------------------------------------- -// -void CConnectionErrorDiscreetPopup::DoCancel() - { - } - -// --------------------------------------------------------- -// CConnectionErrorDiscreetPopup::StartL -// --------------------------------------------------------- -// -void CConnectionErrorDiscreetPopup::StartL(TUint32 aErrCode) - { - Cancel(); // Cancel any request, just to be sure - - iErrorCode = aErrCode; - - SetActive(); // Tell scheduler a request is active - iClientStatus = &iStatus; - User::RequestComplete(iClientStatus, KErrNone); - - // Complete the note so client can continue its tasks - // immediately - iNotif->SetCancelledFlag(ETrue); - iNotif->CompleteL(KErrNone); - } - -// --------------------------------------------------------- -// CConnectionErrorDiscreetPopup::RunL -// --------------------------------------------------------- -// -void CConnectionErrorDiscreetPopup::RunL() - { - if (iStatus == KErrNone) - { - TInt text1 = 0; - TInt text2 = 0; - TInt bitmapId = 0; - TInt maskId = 0; - // Show only if error code can be resolved - if (ResolveErrorCode(text1, text2, bitmapId, maskId)) - { - // Load strings from resources - HBufC* stringText1 = StringLoader::LoadLC(text1); - HBufC* stringText2 = StringLoader::LoadLC(text2); - CAknDiscreetPopup::ShowGlobalPopupL(*stringText1, // 1st text row - *stringText2, // second text row - KAknsIIDDefault, // icon skin id - KIconFileName, // bitmap file path - bitmapId, // bitmap id - maskId, // mask id - KAknDiscreetPopupDurationLong, // flags - 0, // command id - NULL, // command observer - KDiscreetPopupUidNone, // application to be launched - KDiscreetPopupUidNone); // view to be activated - - CleanupStack::PopAndDestroy(2, stringText1); - } - } - - // Cleanup - iNotif->Cancel(); - } - -// --------------------------------------------------------- -// CConnectionErrorDiscreetPopup::RunError -// --------------------------------------------------------- -// -TInt CConnectionErrorDiscreetPopup::RunError(TInt aError) - { - return aError; - } - -// --------------------------------------------------------- -// CConnectionErrorDiscreetPopup::ResolveErrorCode -// --------------------------------------------------------- -// -TInt CConnectionErrorDiscreetPopup::ResolveErrorCode(TInt& aText1, - TInt& aText2, TInt& aBitmap, TInt& aMask) - { - -#ifdef _DEBUG - RDebug::Print( _L("CConnectionErrorDiscreetPopup::ResolveErrorCode - code %d"), - iErrorCode ); -#endif - - // Icons, which are resolved at the end - enum TIconType - { - EIconWlan, EIconCellular, EIconNone - }; - - // For most cases, icon is WLAN - TIconType icon = EIconWlan; - - // For most cases, aText1 = "Connection failed" - aText1 = R_QTN_OCC_CONNECTION_FAILED_DISCREET_POPUP_TEXT1; - - // Resolve aText1, aText2 and icon of error code. - // Groups are from OCC GUI spec 1.0 - switch (iErrorCode) - { - - // Group 1 - case KErrIfChangingPassword: - icon = EIconCellular; - // These were GPRS; fall through - case KErrWlanInternalError: - aText2 = R_QTN_OCC_INTERNAL_ERROR_DISCREET_POPUP_TEXT2; - break; - - // Group 2 - case KErrWlanNetworkNotFound: - aText2 = R_QTN_OCC_WLAN_NOT_FOUND_DISCREET_POPUP_TEXT2; - break; - - // Group 3 - case KErrGprsUserAuthenticationFailure: - icon = EIconCellular; - // These were GPRS; fall through - case KErrWlanOpenAuthFailed: - case KErrWlanSharedKeyAuthRequired: - case KErrWlanWpaAuthRequired: - case KErrWlanWpaAuthFailed: - case KErrWlan802dot1xAuthFailed: - case KErrWlanWpaCounterMeasuresActive: - case KErrWlanPskModeRequired: - case KErrWlanEapModeRequired: - case KErrWlanEapSimFailed: - case KErrWlanEapTlsFailed: - case KErrWlanEapPeapFailed: - case KErrWlanEapMsChapv2: // Is the same as KErrWlanEapMsChaPFailed - case KErrWlanEapAkaFailed: - case KErrWlanEapTtlsFailed: - case KErrWlanLeapFailed: - case KErrWlanEapGtcFailed: - case KErrWlanWpa2OnlyModeNotSupported: - case KErrWlanEapFastTunnelCompromiseError: - case KErrWlanEapFastUnexpextedTlvExhanged: - case KErrWlanEapFastNoPacNorCertsToAuthenticateWithProvDisabled: - case KErrWlanEapFastNoMatchingPacForAid: - case KErrWlanEapFastAuthFailed: - case KErrWlanEapFastPacStoreCorrupted: - aText2 = R_QTN_OCC_AUTH_ERROR_DISCREET_POPUP_TEXT2; - break; - - // Group 4 - case KErrWlanSharedKeyAuthFailed: - case KErrWlanIllegalWpaPskKey: - case KErrWlanIllegalEncryptionKeys: - aText2 = R_QTN_OCC_CHECK_KEY_DISCREET_POPUP_TEXT2; - break; - - // Group 5 - case KErrExitModemError: - case KErrExitLoginFail: - case KErrExitScriptTimeOut: - case KErrExitScriptError: - case KErrIfAuthenticationFailure: - case KErrIfAuthNotSecure: - case KErrIfAccountDisabled: - case KErrIfRestrictedLogonHours: - case KErrIfPasswdExpired: - case KErrIfNoDialInPermission: - case KErrGprsMissingorUnknownAPN: - icon = EIconCellular; - aText2 = R_QTN_OCC_CHECK_SETTINGS_DISCREET_POPUP_TEXT2; - break; - - // Group 6 - case KErrWlanSimNotInstalled: - aText2 = R_QTN_OCC_SIM_ERROR_DISCREET_POPUP_TEXT2; - break; - - // Group 7 - case KErrWlanNotSubscribed: - case KErrWlanAccessBarred: - aText2 = R_QTN_OCC_SERVICE_ERROR_DISCREET_POPUP_TEXT2; - break; - - // Group 8 - case KErrPermissionDenied: - icon = EIconNone; // Permission denied may come with any bearer. - // Fall through - case KErrWlanPasswordExpired: - case KErrWlanNoDialinPermissions: - case KErrWlanAccountDisabled: - case KErrWlanRestrictedLogonHours: - case KErrWlanServerCertificateExpired: - case KErrWlanCerficateVerifyFailed: - case KErrWlanNoUserCertificate: - case KErrWlanNoCipherSuite: - case KErrWlanUserRejected: - case KErrWlanUserCertificateExpired: - aText2 = R_QTN_OCC_ACCESS_ERROR_DISCREET_POPUP_TEXT2; - break; - - // Group 9 - case KErrPDPMaxContextsReached: - icon = EIconCellular; - // These were GPRS; fall through - case KErrWlanConnAlreadyActive: - aText2 = R_QTN_OCC_ALREADY_ACT_DISCREET_POPUP_TEXT2; - break; - - // Group 10 - case KErrWlanSignalTooWeak: - aText2 = R_QTN_OCC_WLAN_WEAK_DISCREET_POPUP_TEXT2; - break; - - // Group 11 - case KErrIfCallbackNotAcceptable: - case KErrIfDNSNotFound: - case KErrIfLRDBadLine: - case KErrNetUnreach: - case KErrHostUnreach: - case KErrNoProtocolOpt: - case KErrUrgentData: - case KErrInet6NoRoute: - case KErrDndNameNotFound: - case KErrGeneralConnection: - case KErrGprsMSCTemporarilyNotReachable: - case KErrGprsLlcOrSndcpFailure: - case KErrGprsInsufficientResources: - case KErrGprsActivationRejectedByGGSN: - case KErrPacketDataTsyInvalidAPN: - icon = EIconCellular; - // These were GPRS; fall through - case KErrWlanRoamingFailed: - aText2 = R_QTN_OCC_TRY_AGAIN_DISCREET_POPUP_TEXT2; - break; - - // Group 12 - case KErrGenConnNoGPRSNetwork: - case KErrGprsServicesNotAllowed: - case KErrGprsAndNonGprsServicesNotAllowed: - case KErrGprsMSIdentityCannotBeDerivedByTheNetwork: - case KErrGprsMSImplicitlyDetached: - case KErrGsmMMNetworkFailure: - case KErrGprsUnknownPDPAddress: - case KErrGprsActivationRejected: - case KErrGsmMMServiceOptionNotSubscribed: - case KErrGsmMMServiceOptionTemporaryOutOfOrder: - case KErrGprsNSAPIAlreadyUsed: - case KErrGprsQoSNotAccepted: - case KErrGprsReactivationRequested: - icon = EIconCellular; - aText2 = R_QTN_OCC_CONN_UNAVAILABLE_DISCREET_POPUP_TEXT2; - break; - - // Group 13 - case KErrWlanProtectedSetupDevicePasswordAuthFailure: - case KErrWlanProtectedSetupPINMethodNotSupported: - case KErrWlanProtectedSetupPBMethodNotSupported: - aText1 = R_QTN_OCC_CONFIG_FAILED_DISCREET_POPUP_TEXT1; - aText2 = R_QTN_OCC_AUTH_ERROR_DISCREET_POPUP_TEXT2; - break; - - // Group 14 - case KErrWlanProtectedSetupOOBInterfaceReadError: - case KErrWlanProtectedSetupDecryptionCRCFailure: - case KErrWlanProtectedSetup2_4ChannelNotSupported: - case KErrWlanProtectedSetup5_0ChannelNotSupported: - case KErrWlanProtectedSetupNetworkAuthFailure: - case KErrWlanProtectedSetupNoDHCPResponse: - case KErrWlanProtectedSetupFailedDHCPConfig: - case KErrWlanProtectedSetupIPAddressConflict: - case KErrWlanProtectedSetupCouldNotConnectToRegistrar: - case KErrWlanProtectedSetupMultiplePBCSessionsDetected: - case KErrWlanProtectedSetupRogueActivitySuspected: - case KErrWlanProtectedSetupDeviceBusy: - case KErrWlanProtectedSetupSetupLocked: - case KErrWlanProtectedSetupMessageTimeout: - case KErrWlanProtectedSetupRegistrationSessionTimeout: - aText1 = R_QTN_OCC_CONFIG_FAILED_DISCREET_POPUP_TEXT1; - aText2 = R_QTN_OCC_TRY_AGAIN_DISCREET_POPUP_TEXT2; - break; - - // Skipped errors, for which popup is not shown. - case KErrNone: - case KErrConnectionTerminated: - case KErrDisconnected: - case KErrCancel: - return EFalse; - - // For error values not specifically mapped to any error message - // the discreet pop-up #12 is used. - default: - aText2 = R_QTN_OCC_CONN_UNAVAILABLE_DISCREET_POPUP_TEXT2; - icon = EIconNone; - break; - } - - // Resolve icon to aBitmap & aMask - switch (icon) - { - case EIconWlan: - aBitmap = EMbmConnectionuiutilitiesQgn_prop_wlan_bearer; - aMask = EMbmConnectionuiutilitiesQgn_prop_wlan_bearer_mask; - break; - case EIconCellular: - aBitmap = EMbmConnectionuiutilitiesQgn_prop_wml_gprs; - aMask = EMbmConnectionuiutilitiesQgn_prop_wml_gprs_mask; - break; - default: - ASSERT(icon == EIconNone); - aBitmap = -1; - aMask = -1; - break; - } - - return ETrue; - } diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/connectionerrordiscreetpopupnotif.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/connectionerrordiscreetpopupnotif.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: Implementation of CConnectionErrorDiscreetPopupNotif. - * - */ - -// INCLUDE FILES -#include "connectionerrordiscreetpopupnotif.h" -#include "connectionerrordiscreetpopup.h" -#include "ConnUiUtilsNotif.h" -#include "ConnectionDialogsUidDefs.h" -#include "ConnectionUiUtilitiesCommon.h" - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// CConnectionErrorDiscreetPopupNotif::TNotifierInfo -// CConnectionErrorDiscreetPopupNotif::RegisterL() -// --------------------------------------------------------- -// -CConnectionErrorDiscreetPopupNotif::TNotifierInfo - CConnectionErrorDiscreetPopupNotif::RegisterL() - { - iInfo.iUid = KUidConnectionErrorDiscreetPopup; - iInfo.iPriority = ENotifierPriorityVHigh; - iInfo.iChannel = KUidConnectionErrorDiscreetPopup; - - return iInfo; - } - -// --------------------------------------------------------- -// void CConnectionErrorDiscreetPopupNotif::StartL() -// --------------------------------------------------------- -// -void CConnectionErrorDiscreetPopupNotif::StartL( const TDesC8& aBuffer, - TInt aReplySlot, const RMessagePtr2& aMessage ) - { - if ( iActiveNote ) - { - // Note is already active - aMessage.Complete( KErrNone ); - return; - } - iReplySlot = aReplySlot; - iMessage = aMessage; - iCancelled = EFalse; - - iActiveNote = CConnectionErrorDiscreetPopup::NewL( this ); - - TPckgBuf data; - data.Copy( aBuffer ); - - iActiveNote->StartL( data() ); - iCancelled = EFalse; - } - -// --------------------------------------------------------- -// void CConnectionErrorDiscreetPopupNotif::CompleteL( TInt aStatus ) -// --------------------------------------------------------- -// -void CConnectionErrorDiscreetPopupNotif::CompleteL( TInt aStatus ) - { - iCancelled = ETrue; - if ( !iMessage.IsNull() ) - { - iMessage.Complete( aStatus ); - } - } - -// --------------------------------------------------------- -// CConnectionErrorDiscreetPopupNotif* -// CConnectionErrorDiscreetPopupNotif::NewL() -// --------------------------------------------------------- -// -CConnectionErrorDiscreetPopupNotif* CConnectionErrorDiscreetPopupNotif::NewL( - const TBool aResourceFileResponsible ) - { - CConnectionErrorDiscreetPopupNotif* self = - new (ELeave) CConnectionErrorDiscreetPopupNotif(); - CleanupStack::PushL( self ); - self->ConstructL( KResourceFileName, aResourceFileResponsible ); - CleanupStack::Pop( self ); - - return self; - } - -// --------------------------------------------------------- -// CConnectionErrorDiscreetPopupNotif::CConnectionErrorDiscreetPopupNotif() -// --------------------------------------------------------- -// -CConnectionErrorDiscreetPopupNotif::CConnectionErrorDiscreetPopupNotif() : - CConnectionDialogsNotifBase(), iActiveNote( NULL ) - { - } - -// --------------------------------------------------------- -// void CConnectionErrorDiscreetPopupNotif::Cancel() -// --------------------------------------------------------- -// -void CConnectionErrorDiscreetPopupNotif::Cancel() - { - if ( !iCancelled ) - { - iCancelled = ETrue; - if ( !iMessage.IsNull() ) - { - iMessage.Complete( KErrCancel ); - } - } - if ( iActiveNote ) - { - delete iActiveNote; - iActiveNote = NULL; - } - } - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/nowlannetworksavailablenotif.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/nowlannetworksavailablenotif.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CNoWLANNetworksAvailableNotif. -* -*/ - -// INCLUDE FILES -#include "ConnectionDialogsUidDefs.h" -#include "nowlannetworksavailablenotif.h" -#include "nowlansdiscreetpopup.h" -#include "ConnUiUtilsNotif.h" - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// CNoWLANNetworksAvailableNotif::TNotifierInfo -// CNoWLANNetworksAvailableNotif::RegisterL() -// --------------------------------------------------------- -// -CNoWLANNetworksAvailableNotif::TNotifierInfo - CNoWLANNetworksAvailableNotif::RegisterL() - { - iInfo.iUid = KUidNoWLANNetworksAvailableNote; - iInfo.iPriority = ENotifierPriorityVHigh; - iInfo.iChannel = KUidNoWLANNetworksAvailableNote; - - return iInfo; - } - - -// --------------------------------------------------------- -// void CNoWLANNetworksAvailableNotif::StartL() -// --------------------------------------------------------- -// -void CNoWLANNetworksAvailableNotif::StartL( const TDesC8& /*aBuffer*/, - TInt aReplySlot, - const RMessagePtr2& aMessage ) - { - if ( iActiveNote ) - { - // Note is already active - aMessage.Complete( KErrNone ); - return; - } - - iReplySlot = aReplySlot; - iMessage = aMessage; - iCancelled = EFalse; - - iActiveNote = CNoWlansDiscreetPopup::NewL( this ); - - iActiveNote->StartL(); - } - -// --------------------------------------------------------- -// void CNoWLANNetworksAvailableNotif::CompleteL( TInt aStatus ) -// --------------------------------------------------------- -// -void CNoWLANNetworksAvailableNotif::CompleteL( TInt aStatus ) - { - iCancelled = ETrue; - - if ( !iMessage.IsNull() ) - { - iMessage.Complete( aStatus ); - } - } - -// --------------------------------------------------------- -// CNoWLANNetworksAvailableNotif* CNoWLANNetworksAvailableNotif::NewL() -// --------------------------------------------------------- -// -CNoWLANNetworksAvailableNotif* CNoWLANNetworksAvailableNotif::NewL( - const TBool aResourceFileResponsible ) - { - CNoWLANNetworksAvailableNotif* self = - new( ELeave ) CNoWLANNetworksAvailableNotif(); - CleanupStack::PushL( self ); - self->ConstructL( KResourceFileName, aResourceFileResponsible ); - CleanupStack::Pop(); - - return self; - } - - -// --------------------------------------------------------- -// CNoWLANNetworksAvailableNotif::CNoWLANNetworksAvailableNotif() -// --------------------------------------------------------- -// -CNoWLANNetworksAvailableNotif::CNoWLANNetworksAvailableNotif() -: CConnectionDialogsNotifBase(), - iActiveNote( NULL ) -{ -} - -// --------------------------------------------------------- -// void CNoWLANNetworksAvailableNotif::Cancel() -// --------------------------------------------------------- -// -void CNoWLANNetworksAvailableNotif::Cancel() - { - if ( !iCancelled ) - { - iCancelled = ETrue; - - if ( !iMessage.IsNull() ) - { - iMessage.Complete( KErrCancel ); - } - } - - if ( iActiveNote ) - { - delete iActiveNote; - iActiveNote = NULL; - } - } - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/ActiveWrapper.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/ActiveWrapper.h Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/ActiveWrapper.h Mon May 03 12:53:07 2010 +0300 @@ -26,7 +26,7 @@ // CONSTANTS -const TUint KNumberOfWrappedDialogs = 13; +const TUint KNumberOfWrappedDialogs = 7; enum TWrappedDialogs { @@ -34,15 +34,9 @@ EOffLineWlan, EWlanDisabled, EWlanNetwUnavail, - EConnViaDestCM, - EChangingConnTo, - EConnViaCM, EWlanEasyWep, EWlanEasyWpa, - EWlanEasyWapi, - ENoWlanNetwsAvail, - EConnectingViaDiscreetPopup, - EConnectionErrorDiscreetPopup + EWlanEasyWapi }; @@ -96,10 +90,6 @@ TInt StartEasyWapiDlg( TPckgBuf< TBuf< KEasyWapiQueryMaxLength > >& aKey ); - void StartConnectingViaDiscreetPopup(TPckgBuf< TConnUiConnectingViaDiscreetPopup>& aInfo); - - void StartConnectionErrorDiscreetPopup( TPckgBuf& aErrCode); - public: // Functions from base classes void DoCancel(); diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/ConnectionUiUtilitiesClient.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/ConnectionUiUtilitiesClient.h Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/ConnectionUiUtilitiesClient.h Mon May 03 12:53:07 2010 +0300 @@ -135,36 +135,6 @@ void WLANNetworkUnavailableNote( TRequestStatus& aStatus ); /** - * Confirmation note is used after the connection has been successfully - * established via destination and connection method. - * @param aDestId Id of used destination. - * @param aConnMId Id of used connection method. - * @param aStatus Status object of notifier. - */ - void ConnectedViaDestAndConnMethodNote( const TUint32 aDestId, - const TUint32 aConnMId, - TRequestStatus& aStatus ); - /** - * Cancel ConnectedViaDestAndConnMethodNote notifier. - */ - void CancelConnectedViaDestAndConnMethodNote(); - - /** - * Information note is used when "Automatically" roaming is enabled - * The actual connection establishment take places in the background - * (no wait note). - * @param aConnMId Id of used connection method. - * @param aStatus Status object of notifier. - */ - void ChangingConnectionToNote( const TUint32 aConnMId, - TRequestStatus& aStatus ); - - /** - * Cancel ChangingConnectionToNote notifier. - */ - void CancelChangingConnectionToNote(); - - /** * Notifier. Shows a query, "Connect to\n '%0U' via\n '%1U'?" * @param aResult Result of user selection, ETrue if user accepted * roaming, to more preferred method, EFlase otherwise @@ -180,20 +150,6 @@ */ void CancelConfirmMethodUsageQuery(); - - /** - * Confirmation note is used after the connection has been successfully - * established via a connection method. - * @param aConnMId Id of used connection method. - * @param aStatus Status object of notifier. - */ - void ConnectedViaConnMethodNote( const TUint32 aConnMId, - TRequestStatus& aStatus ); - /** - * Cancel ConnectedViaConnMethodNote notifier. - */ - void CancelConnectedViaConnMethodNote(); - /** * This note is displayed when power-save feature of the WLAN station * is incompatible and thus battery consumption of the mobile will increase. @@ -221,36 +177,6 @@ */ void CancelEasyWapiDlg(); - /** - * Pops up an information note: - * "No WLAN networks are available at the moment. Connection not available." - */ - void NoWLANNetworksAvailableNote( TRequestStatus& aStatus ); - - /** - * Discreet popup. Shows "connecting via %U" discreet popup. - * @param aInfo Information about bearer. - */ - void ConnectingViaDiscreetPopup( TPckgBuf< TConnUiConnectingViaDiscreetPopup>& aInfo, - TRequestStatus& aStatus ); - - /** - * Cancel ConnectingViaDiscreetPopup notifier. - */ - void CancelConnectingViaDiscreetPopup(); - - /** - * Discreet popup. Shows discreet popup about connection error. - * @param aErrCode Error code. - */ - void ConnectionErrorDiscreetPopup( TPckgBuf< TInt >& aErrCode, - TRequestStatus& aStatus ); - - /** - * Cancel ConnectionErrorDiscreetPopup notifier. - */ - void CancelConnectionErrorDiscreetPopup(); - private: // Pointer to the client interface @@ -273,8 +199,6 @@ TPckgBuf iPassedInfo; - // used for get response from notifier - TBuf8<8> iResponseStrNoWLANNetworksAvailableNote; }; diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/ConnectionUiUtilitiesCommon.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/ConnectionUiUtilitiesCommon.h Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/ConnectionUiUtilitiesCommon.h Mon May 03 12:53:07 2010 +0300 @@ -83,13 +83,6 @@ }; -class TConnUiConnectingViaDiscreetPopup - { -public: - TUint32 iIapId; - TBool iConnectionAlreadyActive; - }; - #endif // CONNECTIONUIUTILITIES_COMMON_H diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/ConnectionUiUtilitiesImpl.h --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/ConnectionUiUtilitiesImpl.h Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/ConnectionUiUtilitiesImpl.h Mon May 03 12:53:07 2010 +0300 @@ -40,7 +40,7 @@ class CCommsDatabase; class TConnectionPrefs; class CAknGlobalNote; - +class CConnectionStatusPopup; // CLASS DECLARATION @@ -370,56 +370,6 @@ void WLANNetworkUnavailableNote(); /** - * DEPRECATED, PLEASE USE ASYNC VERSION! - * Confirmation note is used after the connection has been successfully - * established via destination and connection method. - * @param aDestId Id of used destination. - * @param aConnMId Id of used connection method. - */ - void ConnectedViaDestAndConnMethodNote( const TUint32 aDestId, - const TUint32 aConnMId ); - - /** - * Confirmation note is used after the connection has been successfully - * established via destination and connection method. - * @param aDestId Id of used destination. - * @param aConnMId Id of used connection method. - * @param aStatus caller's TRequestStatus to handle asynchronous call. - */ - void ConnectedViaDestAndConnMethodNote( const TUint32 aDestId, - const TUint32 aConnMId, - TRequestStatus& aStatus ); - - /** - * Cancel ConnectedViaDestAndConnMethodNote notifier. - */ - void CancelConnectedViaDestAndConnMethodNote(); - - - /** - * Information note is used when "Automatically" roaming is enabled. The - * actual connection establishment take places in the background - * (no wait note). - * @param aConnMId Id of used connection method. - */ - void ChangingConnectionToNote( const TUint32 aConnMId ); - - /** - * Information note is used when "Automatically" roaming is enabled. The - * actual connection establishment take places in the background - * (no wait note). - * @param aConnMId Id of used connection method. - * @param aStatus Status object of notifier. - */ - void ChangingConnectionToNote( const TUint32 aConnMId, - TRequestStatus& aStatus ); - - /** - * Cancel ChangingConnectionToNote notifier. - */ - void CancelChangingConnectionToNote(); - - /** * Notifier. Shows a query, "Connect to\n '%0U' via\n '%1U'?" * @param aResult Result of user selection, ETrue if user accepted * roaming, to more preferred method, EFlase otherwise @@ -436,27 +386,6 @@ void CancelConfirmMethodUsageQuery(); /** - * DEPRECATED, PLEASE USE ASYNC VERSION! - * Confirmation note is used after the connection has been successfully - * established via a connection method. - * @param aConnMId Id of used connection method. - */ - void ConnectedViaConnMethodNote( const TUint32 aConnMId ); - - /** - * Confirmation note is used after the connection has been successfully - * established via a connection method. - * @param aConnMId Id of used connection method. - * @param aStatus caller's TRequestStatus to handle asynchronous call. - */ - void ConnectedViaConnMethodNote( const TUint32 aConnMId, - TRequestStatus& aStatus ); - /** - * Cancel ConnectedViaConnMethodNote notifier. - */ - void CancelConnectedViaConnMethodNote(); - - /** * This note is displayed when power-save feature of the WLAN station * is incompatible and thus battery consumption of the mobile will increase. * @param aDisable ETrue if user wants to disable this note in the future. @@ -477,20 +406,25 @@ */ TBool EasyWapiDlg( TDes* aKey ); - /** - * Pops up an information note: - * "No WLAN networks are available at the moment. Connection not available." - */ - void NoWLANNetworksAvailableNote(); + /** + * Discreet popup. Shows "Connecting" discreet popup + */ + void ConnectingViaDiscreetPopup( ); /** * Discreet popup. Shows "Connecting via %U" discreet popup * @param aIapId IAP id of the access point. + * @param aConnectionAlreadyActive True if connection is already active + * (shared). */ void ConnectingViaDiscreetPopup( const TUint32& aIapId, TBool aConnectionAlreadyActive ); - + /** + * Cancels (hides) "Connecting via %U" discreet popup. + */ + void CancelConnectingViaDiscreetPopup(); + /** * Discreet popup. Shows discreet popup about connection errors * @param aErrorCode Error code @@ -542,8 +476,8 @@ // buffer for passing WAPI key between client and server TPckgBuf< TBuf< KEasyWapiQueryMaxLength > > iWapiKey; - // buffer for passing connecting discreet popup info - TPckgBuf< TConnUiConnectingViaDiscreetPopup > iConnInfo; + // Connection status (via, error) implementation + CConnectionStatusPopup* iConnStatusPopup; }; diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/connectionstatuspopup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/inc/connectionstatuspopup.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 CConnectionStatusPopup +* +*/ +#ifndef __CCONNECTIONSTATUSPOPUP_H_ +#define __CCONNECTIONSTATUSPOPUP_H_ + +// INCLUDES +#include +#include "HbDeviceNotificationDialogSymbian.h" + +/** + * CConnectionStatusPopup + * Handler for connection status popups + */ +NONSHARABLE_CLASS( CConnectionStatusPopup ) : public CBase, + public MHbDeviceNotificationDialogObserver + { +public: // Constructors and destructor + + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed CConnectionStatusPopup object. + */ + static CConnectionStatusPopup* NewL(); + + /** + * Destructor + */ + virtual ~CConnectionStatusPopup(); + +public: + + /** + * Shows "Connecting" discreet popup. + */ + void ConnectingViaDiscreetPopup( ); + + /** + * Shows "Connecting via '%U'" discreet popup. + */ + void ConnectingViaDiscreetPopup( TUint32 aIAPId, + TBool aConnectionAlreadyActive ); + /** + * Cancels the "Connecting via '%U'" discreet popup. + */ + void CancelConnectingViaDiscreetPopup(); + + /** + * Shows connection error discreet popup. + */ + void ConnectionErrorDiscreetPopup( TInt aErrorCode ); + +public: // MHbDeviceNotificationDialogObserver + + void NotificationDialogActivated( + const CHbDeviceNotificationDialogSymbian* aDialog ); + + void NotificationDialogClosed( + const CHbDeviceNotificationDialogSymbian* aDialog, + TInt aCompletionCode ); + +private: + + /** + * Defines long enough timeout for the popup to be considered shown + * "forever". + */ + const static TInt KForeverTimeout = 3*60*1000*1000; + + /** + * The state of the popup + */ + enum TPopupState + { + /** + * Not shown + */ + EPopupClosed, + /** + * "Connecting" one-liner + */ + EPopupConnecting, + /** + * "Connecting" with iap name on second row + */ + EPopupConnectingIap, + /** + * "Connection failed/error" + */ + EPopupError + }; + + /** + * Constructor + */ + CConnectionStatusPopup(); + + /** + * Second-phase constructor + */ + void ConstructL(); + + /** + * Sets the new state for the popup. + */ + void SetState( TPopupState aNewState ); + + /** + * Formats iap info for Connecting via -popup. + */ + void FormatIapInfoL( TUint32 aIapId ); + + /** + * Prepares popup for error code. + * @return ETrue when popup should be shown. + */ + TBool ResolveErrorCodeL( TInt aErrorCode ); + +private: + + // Popup dialog + CHbDeviceNotificationDialogSymbian* iPopup; + + // The state of the popup + TPopupState iPopupState; + }; + +#endif /* __CCONNECTIONSTATUSPOPUP_H_ */ diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/ActiveWrapper.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/ActiveWrapper.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/ActiveWrapper.cpp Mon May 03 12:53:07 2010 +0300 @@ -199,23 +199,6 @@ break; } - case EConnViaDestCM: - { - iNotif.CancelConnectedViaDestAndConnMethodNote(); - break; - } - - case EChangingConnTo: - { - iNotif.CancelChangingConnectionToNote(); - break; - } - - case EConnViaCM: - { - iNotif.CancelConnectedViaConnMethodNote(); - break; - } case EWlanEasyWep: { iNotif.CancelEasyWepDlg(); @@ -437,31 +420,6 @@ break; } - case EConnViaDestCM: - { - iNotif.ConnectedViaDestAndConnMethodNote( aDestId, aConnMId, - iStatus ); - break; - } - - case EChangingConnTo: - { - iNotif.ChangingConnectionToNote( aConnMId, iStatus ); - break; - } - - case EConnViaCM: - { - iNotif.ConnectedViaConnMethodNote( aConnMId, iStatus ); - break; - } - - case ENoWlanNetwsAvail: - { - iNotif.NoWLANNetworksAvailableNote( iStatus ); - break; - } - default: { return; @@ -496,41 +454,4 @@ return iStatus.Int(); } -// --------------------------------------------------------- -// CActiveWrapper::StartConnectingViaDiscreetPopup -// -// Starts the active object -// --------------------------------------------------------- -// -void CActiveWrapper::StartConnectingViaDiscreetPopup( TPckgBuf< TConnUiConnectingViaDiscreetPopup>& aInfo ) - { - if ( IsActive() == EFalse ) - { - iIndexOfNote = EConnectingViaDiscreetPopup; - iNotif.ConnectingViaDiscreetPopup( aInfo, iStatus ); - SetActive(); - iWait.Start(); - } - - } - - -// --------------------------------------------------------- -// CActiveWrapper::StartConnectionErrorDiscreetPopup -// -// Starts the active object -// --------------------------------------------------------- -// -void CActiveWrapper::StartConnectionErrorDiscreetPopup( TPckgBuf& aErrCode ) - { - if ( IsActive() == EFalse ) - { - iIndexOfNote = EConnectionErrorDiscreetPopup; - iNotif.ConnectionErrorDiscreetPopup( aErrCode, iStatus ); - SetActive(); - iWait.Start(); - } - - } - // End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/ConnectionUiUtilities.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/ConnectionUiUtilities.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/ConnectionUiUtilities.cpp Mon May 03 12:53:07 2010 +0300 @@ -278,10 +278,10 @@ // --------------------------------------------------------- // EXPORT_C void CConnectionUiUtilities::ConnectedViaDestAndConnMethodNote( - const TUint32 aDestId, - const TUint32 aConnMId ) + const TUint32 /*aDestId*/, + const TUint32 /*aConnMId*/ ) { - iImpl->ConnectedViaDestAndConnMethodNote( aDestId, aConnMId ); + // Deprecated. } // --------------------------------------------------------- @@ -289,11 +289,11 @@ // --------------------------------------------------------- // EXPORT_C void CConnectionUiUtilities::ConnectedViaDestAndConnMethodNote( - const TUint32 aDestId, - const TUint32 aConnMId, - TRequestStatus& aStatus ) + const TUint32 /*aDestId*/, + const TUint32 /*aConnMId*/, + TRequestStatus& /*aStatus*/ ) { - iImpl->ConnectedViaDestAndConnMethodNote( aDestId, aConnMId, aStatus ); + // Deprecated. } // --------------------------------------------------------- @@ -302,7 +302,7 @@ // EXPORT_C void CConnectionUiUtilities::CancelConnectedViaDestAndConnMethodNote() { - iImpl->CancelConnectedViaDestAndConnMethodNote(); + // Deprecated. } // --------------------------------------------------------- @@ -354,19 +354,19 @@ // --------------------------------------------------------- // EXPORT_C void CConnectionUiUtilities::ChangingConnectionToNote( - const TUint32 aConnMId ) + const TUint32 /*aConnMId*/ ) { - iImpl->ChangingConnectionToNote( aConnMId ); + // Deprecated. } // --------------------------------------------------------- // CConnectionUiUtilities::ChangingConnectionToNote // --------------------------------------------------------- // -EXPORT_C void CConnectionUiUtilities::ChangingConnectionToNote( const TUint32 aConnMId, - TRequestStatus& aStatus ) +EXPORT_C void CConnectionUiUtilities::ChangingConnectionToNote( const TUint32 /*aConnMId*/, + TRequestStatus& /*aStatus*/ ) { - iImpl->ChangingConnectionToNote( aConnMId, aStatus ); + // Deprecated. } // --------------------------------------------------------- @@ -375,7 +375,7 @@ // EXPORT_C void CConnectionUiUtilities::CancelChangingConnectionToNote() { - iImpl->CancelChangingConnectionToNote(); + // Deprecated. } // --------------------------------------------------------- @@ -408,9 +408,9 @@ // --------------------------------------------------------- // EXPORT_C void CConnectionUiUtilities::ConnectedViaConnMethodNote( - const TUint32 aConnMId ) + const TUint32 /*aConnMId*/ ) { - iImpl->ConnectedViaConnMethodNote( aConnMId ); + // Deprecated. } // --------------------------------------------------------- @@ -418,10 +418,10 @@ // --------------------------------------------------------- // EXPORT_C void CConnectionUiUtilities::ConnectedViaConnMethodNote( - const TUint32 aConnMId, - TRequestStatus& aStatus ) + const TUint32 /*aConnMId*/, + TRequestStatus& /*aStatus*/ ) { - iImpl->ConnectedViaConnMethodNote( aConnMId , aStatus ); + // Deprecated. } // --------------------------------------------------------- @@ -430,7 +430,7 @@ // EXPORT_C void CConnectionUiUtilities::CancelConnectedViaConnMethodNote() { - iImpl->CancelConnectedViaConnMethodNote(); + // Deprecated. } @@ -524,7 +524,7 @@ // EXPORT_C void CConnectionUiUtilities::NoWLANNetworksAvailableNote() { - iImpl->NoWLANNetworksAvailableNote(); + // Note removed. } // --------------------------------------------------------- @@ -607,6 +607,15 @@ // CConnectionUiUtilities::ConnectingViaDiscreetPopup // --------------------------------------------------------- // +EXPORT_C void CConnectionUiUtilities::ConnectingViaDiscreetPopup( ) + { + iImpl->ConnectingViaDiscreetPopup( ); + } + +// --------------------------------------------------------- +// CConnectionUiUtilities::ConnectingViaDiscreetPopup +// --------------------------------------------------------- +// EXPORT_C void CConnectionUiUtilities::ConnectingViaDiscreetPopup( const TUint32& aIapId, TBool aConnectionAlreadyActive ) @@ -615,6 +624,15 @@ } // --------------------------------------------------------- +// CConnectionUiUtilities::CancelConnectingViaDiscreetPopup +// --------------------------------------------------------- +// +EXPORT_C void CConnectionUiUtilities::CancelConnectingViaDiscreetPopup() + { + iImpl->CancelConnectingViaDiscreetPopup(); + } + +// --------------------------------------------------------- // CConnectionUiUtilities::ConnectionErrorDiscreetPopup // --------------------------------------------------------- // diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/ConnectionUiUtilitiesClient.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/ConnectionUiUtilitiesClient.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/ConnectionUiUtilitiesClient.cpp Mon May 03 12:53:07 2010 +0300 @@ -263,98 +263,6 @@ } // --------------------------------------------------------- -// RConnectionUiUtilitiesSession::ConnectedViaDestAndConnMethodNote -// --------------------------------------------------------- -// -void RConnectionUiUtilitiesSession::ConnectedViaDestAndConnMethodNote( - const TUint32 aDestId, - const TUint32 aConnMId, - TRequestStatus& aStatus ) - { - CLOG_ENTERFN( "RConnectionUiUtilitiesSession::ConnectedViaDestAndConnMethodNote" ); - - ::new( &iPassedInfo ) TPckgBuf( - TConnUiUiDestConnMethodNoteId() ); - - iPassedInfo().iDestination = aDestId; - iPassedInfo().iConnectionMethod = aConnMId; - iPassedInfo().iNoteId = EConnectedViaDestConnMethodConfirmationNote; - iPassedInfo().iNextBestExists = EFalse; - - if ( iNotifier ) - { - iNotifier->StartNotifierAndGetResponse( aStatus, - KUidConnectViaNote, - iPassedInfo, - iBool ); - } - - CLOG_LEAVEFN( "RConnectionUiUtilitiesSession::ConnectedViaDestAndConnMethodNote" ); - } - -// --------------------------------------------------------- -// RConnectionUiUtilitiesSession::CancelConnectedViaDestAndConnMethodNote -// --------------------------------------------------------- -// -void RConnectionUiUtilitiesSession::CancelConnectedViaDestAndConnMethodNote() - { - CLOG_ENTERFN( "RConnectionUiUtilitiesSession::CancelConnectedViaDestAndConnMethodNote" ); - - if ( iNotifier ) - { - iNotifier->CancelNotifier( KUidConnectViaNote ); - } - - CLOG_LEAVEFN( "RConnectionUiUtilitiesSession::CancelConnectedViaDestAndConnMethodNote" ); - } - - -// --------------------------------------------------------- -// RConnectionUiUtilitiesSession::ChangingConnectionToNote -// --------------------------------------------------------- -// -void RConnectionUiUtilitiesSession::ChangingConnectionToNote( - const TUint32 aConnMId, - TRequestStatus& aStatus ) - { - CLOG_ENTERFN( "RConnectionUiUtilitiesSession::ChangingConnectionToNote" ); - - ::new( &iPassedInfo ) TPckgBuf( - TConnUiUiDestConnMethodNoteId() ); - - iPassedInfo().iDestination = 0; - iPassedInfo().iConnectionMethod = aConnMId; - iPassedInfo().iNoteId = EConnectingToConnMethodInfoNote; - iPassedInfo().iNextBestExists = EFalse; - - if ( iNotifier ) - { - iNotifier->StartNotifierAndGetResponse( aStatus, - KUidConnectViaNote, - iPassedInfo, - iBool ); - } - - CLOG_LEAVEFN( "RConnectionUiUtilitiesSession::ChangingConnectionToNote" ); - } - -// --------------------------------------------------------- -// RConnectionUiUtilitiesSession::CancelChangingConnectionToNote -// --------------------------------------------------------- -// -void RConnectionUiUtilitiesSession::CancelChangingConnectionToNote() - { - CLOG_ENTERFN( "RConnectionUiUtilitiesSession::CancelChangingConnectionToNote" ); - - if ( iNotifier ) - { - iNotifier->CancelNotifier( KUidConnectViaNote ); - } - - CLOG_LEAVEFN( "RConnectionUiUtilitiesSession::CancelChangingConnectionToNote" ); - } - -// --------------------------------------------------------- // RConnectionUiUtilitiesSession::ConfirmMethodUsageQuery() // --------------------------------------------------------- // @@ -406,52 +314,6 @@ CLOG_LEAVEFN( "RConnectionUiUtilitiesSession::CancelConfirmMethodUsageQuery" ); } - -// --------------------------------------------------------- -// RConnectionUiUtilitiesSession::ConnectedViaConnMethodNote -// --------------------------------------------------------- -// -void RConnectionUiUtilitiesSession::ConnectedViaConnMethodNote( - const TUint32 aConnMId, - TRequestStatus& aStatus ) - { - CLOG_ENTERFN( "RConnectionUiUtilitiesSession::ConnectedViaConnMethodNote" ); - - ::new( &iPassedInfo ) TPckgBuf( - TConnUiUiDestConnMethodNoteId() ); - - iPassedInfo().iDestination = 0; - iPassedInfo().iConnectionMethod = aConnMId; - iPassedInfo().iNoteId = EConnectedViaConnMethodConfirmationNote; - iPassedInfo().iNextBestExists = EFalse; - - if ( iNotifier ) - { - iNotifier->StartNotifierAndGetResponse( aStatus, - KUidConnectViaNote, - iPassedInfo, - iBool ); - } - - CLOG_LEAVEFN( "RConnectionUiUtilitiesSession::ConnectedViaConnMethodNote" ); - } - -// --------------------------------------------------------- -// RConnectionUiUtilitiesSession::CancelConnectedViaConnMethodNote -// --------------------------------------------------------- -// -void RConnectionUiUtilitiesSession::CancelConnectedViaConnMethodNote() - { - CLOG_ENTERFN( "RConnectionUiUtilitiesSession::CancelConnectedViaConnMethodNote" ); - - if ( iNotifier ) - { - iNotifier->CancelNotifier( KUidConnectViaNote ); - } - - CLOG_LEAVEFN( "RConnectionUiUtilitiesSession::CancelConnectedViaConnMethodNote" ); - } - // --------------------------------------------------------- // RConnectionUiUtilitiesSession::CWlanPowerSaveTestNote // --------------------------------------------------------- @@ -526,95 +388,4 @@ CLOG_LEAVEFN( "RConnectionUiUtilitiesSession::CancelEasyWapiDlg" ); } -// --------------------------------------------------------- -// RConnectionUiUtilitiesSession::NoWLANNetworksAvailableNote() -// --------------------------------------------------------- -// -void RConnectionUiUtilitiesSession::NoWLANNetworksAvailableNote( - TRequestStatus& aStatus ) - { - CLOG_ENTERFN( "RConnectionUiUtilitiesSession::NoWLANNetworksAvailableNote" ); - - if ( iNotifier ) - { - iNotifier->StartNotifierAndGetResponse( aStatus, - KUidNoWLANNetworksAvailableNote, - KNullDesC8(), - iResponseStrNoWLANNetworksAvailableNote ); - } - - CLOG_LEAVEFN( "RConnectionUiUtilitiesSession::NoWLANNetworksAvailableNote" ); - } - -// --------------------------------------------------------- -// RConnectionUiUtilitiesSession::ConnectingViaDiscreetPopup() -// --------------------------------------------------------- -// -void RConnectionUiUtilitiesSession::ConnectingViaDiscreetPopup( - TPckgBuf< TConnUiConnectingViaDiscreetPopup>& aInfo, - TRequestStatus& aStatus ) - { - CLOG_ENTERFN( "RConnectionUiUtilitiesSession::ConnectingViaDiscreetPopup" ); - - if ( iNotifier ) - { - iNotifier->StartNotifierAndGetResponse( aStatus, KUidConnectingViaDiscreetPopup, - aInfo, aInfo ); - } - - CLOG_LEAVEFN( "RConnectionUiUtilitiesSession::ConnectingViaDiscreetPopup" ); - } - -// --------------------------------------------------------- -// RConnectionUiUtilitiesSession::CancelConnectingViaDiscreetPopup() -// --------------------------------------------------------- -// -void RConnectionUiUtilitiesSession::CancelConnectingViaDiscreetPopup() - { - CLOG_ENTERFN( "RConnectionUiUtilitiesSession::CancelConnectingViaDiscreetPopup" ); - - if ( iNotifier ) - { - iNotifier->CancelNotifier( KUidConnectingViaDiscreetPopup ); - } - - CLOG_LEAVEFN( "RConnectionUiUtilitiesSession::CancelConnectingViaDiscreetPopup" ); - } - - -// --------------------------------------------------------- -// RConnectionUiUtilitiesSession::ConnectionErrorDiscreetPopup() -// --------------------------------------------------------- -// -void RConnectionUiUtilitiesSession::ConnectionErrorDiscreetPopup( - TPckgBuf< TInt >& aErrCode, - TRequestStatus& aStatus ) - { - CLOG_ENTERFN( "RConnectionUiUtilitiesSession::ConnectionErrorDiscreetPopup" ); - - if ( iNotifier ) - { - iNotifier->StartNotifierAndGetResponse( aStatus, KUidConnectionErrorDiscreetPopup, - aErrCode, aErrCode ); - } - - CLOG_LEAVEFN( "RConnectionUiUtilitiesSession::ConnectionErrorDiscreetPopup" ); - } - -// --------------------------------------------------------- -// RConnectionUiUtilitiesSession::CancelConnectionErrorDiscreetPopup() -// --------------------------------------------------------- -// -void RConnectionUiUtilitiesSession::CancelConnectionErrorDiscreetPopup() - { - CLOG_ENTERFN( "RConnectionUiUtilitiesSession::CancelConnectionErrorDiscreetPopup" ); - - if ( iNotifier ) - { - iNotifier->CancelNotifier( KUidConnectionErrorDiscreetPopup ); - } - - CLOG_LEAVEFN( "RConnectionUiUtilitiesSession::CancelConnectionErrorDiscreetPopup" ); - } - // End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/ConnectionUiUtilitiesImpl.cpp --- a/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/ConnectionUiUtilitiesImpl.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/ConnectionUiUtilitiesImpl.cpp Mon May 03 12:53:07 2010 +0300 @@ -44,6 +44,7 @@ #include "ConnectionUiUtilitiesImpl.h" #include "ChangeConnectionDlg.h" #include "ActiveCChangeConnectionDlg.h" +#include "connectionstatuspopup.h" #include #include @@ -105,6 +106,7 @@ iIsWlanSupported = FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ); FeatureManager::UnInitializeLib(); + iConnStatusPopup = CConnectionStatusPopup::NewL(); } @@ -124,6 +126,8 @@ { delete iActiveWrapper[i]; } + + delete iConnStatusPopup; } // --------------------------------------------------------- @@ -900,89 +904,6 @@ CLOG_LEAVEFN( "CConnectionUiUtilitiesImpl::SearchWLANNetworkAsync" ); } -// --------------------------------------------------------- -// CConnectionUiUtilitiesImpl::ConnectedViaDestAndConnMethodNote -// --------------------------------------------------------- -// -void CConnectionUiUtilitiesImpl::ConnectedViaDestAndConnMethodNote( - const TUint32 aDestId, - const TUint32 aConnMId ) - { - if ( !iActiveWrapper[EConnViaDestCM] ) - { - TRAP_IGNORE( iActiveWrapper[EConnViaDestCM] = - CActiveWrapper::NewL( EConnViaDestCM ) ); - } - - if ( iActiveWrapper[EConnViaDestCM] ) - { - iActiveWrapper[EConnViaDestCM]->StartGenericNote( EConnViaDestCM, - aConnMId, aDestId ); - } - } - -// --------------------------------------------------------- -// CConnectionUiUtilitiesImpl::ConnectedViaDestAndConnMethodNote -// --------------------------------------------------------- -// -void CConnectionUiUtilitiesImpl::ConnectedViaDestAndConnMethodNote( - const TUint32 aDestId, - const TUint32 aConnMId, - TRequestStatus& aStatus ) - { - iNotif.ConnectedViaDestAndConnMethodNote( aDestId, aConnMId, aStatus ); - } - -// --------------------------------------------------------- -// CConnectionUiUtilitiesImpl::CancelConnectedViaDestAndConnMethodNote -// --------------------------------------------------------- -// -void CConnectionUiUtilitiesImpl::CancelConnectedViaDestAndConnMethodNote() - { - iNotif.CancelConnectedViaDestAndConnMethodNote(); - } - -// --------------------------------------------------------- -// CConnectionUiUtilitiesImpl::ChangingConnectionToNote -// --------------------------------------------------------- -// -void CConnectionUiUtilitiesImpl::ChangingConnectionToNote( - const TUint32 aConnMId ) - { - if ( !iActiveWrapper[EChangingConnTo] ) - { - TRAP_IGNORE( iActiveWrapper[EChangingConnTo] = - CActiveWrapper::NewL( EChangingConnTo ) ); - } - - if ( iActiveWrapper[EChangingConnTo] ) - { - iActiveWrapper[EChangingConnTo]->StartGenericNote( EChangingConnTo, - aConnMId ); - } - } - -// --------------------------------------------------------- -// CConnectionUiUtilitiesImpl::ChangingConnectionToNote -// --------------------------------------------------------- -// -void CConnectionUiUtilitiesImpl::ChangingConnectionToNote( - const TUint32 aConnMId, - TRequestStatus& aStatus ) - { - iNotif.ChangingConnectionToNote( aConnMId, aStatus ); - } - - -// --------------------------------------------------------- -// CConnectionUiUtilitiesImpl::CancelChangingConnectionToNote -// --------------------------------------------------------- -// -void CConnectionUiUtilitiesImpl::CancelChangingConnectionToNote() - { - iActiveWrapper[EChangingConnTo]->Cancel(); - } - // --------------------------------------------------------- // CConnectionUiUtilitiesImpl::ConfirmMethodUsageQuery // --------------------------------------------------------- @@ -1004,47 +925,6 @@ iNotif.CancelConfirmMethodUsageQuery(); } - -// --------------------------------------------------------- -// CConnectionUiUtilitiesImpl::ConnectedViaConnMethodNote -// --------------------------------------------------------- -// -void CConnectionUiUtilitiesImpl::ConnectedViaConnMethodNote( - const TUint32 aConnMId ) - { - if ( !iActiveWrapper[EConnViaCM] ) - { - TRAP_IGNORE( iActiveWrapper[EConnViaCM] = - CActiveWrapper::NewL( EConnViaCM ) ); - } - - if ( iActiveWrapper[EConnViaCM] ) - { - iActiveWrapper[EConnViaCM]->StartGenericNote( EConnViaCM, aConnMId ); - } - } - -// --------------------------------------------------------- -// CConnectionUiUtilitiesImpl::ConnectedViaConnMethodNote -// --------------------------------------------------------- -// -void CConnectionUiUtilitiesImpl::ConnectedViaConnMethodNote( - const TUint32 aConnMId, - TRequestStatus& aStatus ) - { - iNotif.ConnectedViaConnMethodNote( aConnMId, aStatus ); - } - - -// --------------------------------------------------------- -// CConnectionUiUtilitiesImpl::CancelConnectedViaConnMethodNote -// --------------------------------------------------------- -// -void CConnectionUiUtilitiesImpl::CancelConnectedViaConnMethodNote() - { - iNotif.CancelConnectedViaConnMethodNote(); - } - // --------------------------------------------------------- // CConnectionUiUtilitiesImpl::WlanPowerSaveTestNote @@ -1095,26 +975,13 @@ return ( status == KErrNone ) ? ETrue : EFalse; } -// --------------------------------------------------------- -// CConnectionUiUtilitiesImpl::NoWLANNetworksAvailableNote +// --------------------------------------------------------- +// CConnectionUiUtilitiesImpl::ConnectingViaDiscreetPopup // --------------------------------------------------------- // -void CConnectionUiUtilitiesImpl::NoWLANNetworksAvailableNote() - { - if ( iIsWlanSupported ) - { - if ( !iActiveWrapper[ ENoWlanNetwsAvail ] ) - { - TRAP_IGNORE( iActiveWrapper[ ENoWlanNetwsAvail ] = - CActiveWrapper::NewL( ENoWlanNetwsAvail ) ); - } - - if ( iActiveWrapper[ ENoWlanNetwsAvail ] ) - { - iActiveWrapper[ ENoWlanNetwsAvail ]->StartGenericNote( - ENoWlanNetwsAvail ); - } - } +void CConnectionUiUtilitiesImpl::ConnectingViaDiscreetPopup( ) + { + iConnStatusPopup->ConnectingViaDiscreetPopup( ); } @@ -1122,46 +989,33 @@ // CConnectionUiUtilitiesImpl::ConnectingViaDiscreetPopup // --------------------------------------------------------- // -void CConnectionUiUtilitiesImpl::ConnectingViaDiscreetPopup( const TUint32& aIapId, TBool aConnectionAlreadyActive ) +void CConnectionUiUtilitiesImpl::ConnectingViaDiscreetPopup( + const TUint32& aIapId, + TBool aConnectionAlreadyActive ) { - iConnInfo().iIapId = aIapId; - iConnInfo().iConnectionAlreadyActive = aConnectionAlreadyActive; - - if ( !iActiveWrapper[ EConnectingViaDiscreetPopup ] ) - { - TRAP_IGNORE( iActiveWrapper[ EConnectingViaDiscreetPopup ] = - CActiveWrapper::NewL( EConnectingViaDiscreetPopup ) ); - } - - if ( iActiveWrapper[ EConnectingViaDiscreetPopup ] ) - { - iActiveWrapper[ EConnectingViaDiscreetPopup ] - ->StartConnectingViaDiscreetPopup( iConnInfo ); - } + iConnStatusPopup->ConnectingViaDiscreetPopup( aIapId, + aConnectionAlreadyActive ); } +// --------------------------------------------------------- +// CConnectionUiUtilitiesImpl::CancelConnectingViaDiscreetPopup +// --------------------------------------------------------- +// +void CConnectionUiUtilitiesImpl::CancelConnectingViaDiscreetPopup() + { + iConnStatusPopup->CancelConnectingViaDiscreetPopup(); + } + // --------------------------------------------------------- // CConnectionUiUtilitiesImpl::ConnectionErrorDiscreetPopup // --------------------------------------------------------- // -void CConnectionUiUtilitiesImpl::ConnectionErrorDiscreetPopup( const TInt& aErrCode ) +void CConnectionUiUtilitiesImpl::ConnectionErrorDiscreetPopup( + const TInt& aErrCode ) { - TPckgBuf< TInt > buf; - buf() = aErrCode; - - if ( !iActiveWrapper[ EConnectionErrorDiscreetPopup ] ) - { - TRAP_IGNORE( iActiveWrapper[ EConnectionErrorDiscreetPopup ] = - CActiveWrapper::NewL( EConnectionErrorDiscreetPopup ) ); - } - - if ( iActiveWrapper[ EConnectionErrorDiscreetPopup ] ) - { - iActiveWrapper[ EConnectionErrorDiscreetPopup ] - ->StartConnectionErrorDiscreetPopup( buf ); - } + iConnStatusPopup->ConnectionErrorDiscreetPopup( aErrCode ); } // End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/connectionstatuspopup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/ConnectionDialogs/ConnectionUiUtilities/src/connectionstatuspopup.cpp Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,647 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Implementation of class CConnectionStatusPopup. +* +* +*/ + +#include "connectionstatuspopup.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "connectionstatuspopupTraces.h" +#endif + +// Error code definitions are from these headers +#include // WLAN-specific error code definitions +#include +#include // GPRS-specific causes for Session Managemeei saant +#include // NetDial errors +#include // IPv6 error constants +#include + +// Errors in UI spec not found elsewhere +const TInt KErrPDPMaxContextsReached = -6000; +const TInt KErrDndNameNotFound = -5120; +const TInt KErrGeneralConnection = -50000; +const TInt KErrGenConnNoGPRSNetwork = -3609; + +// Icons representing bearer +_LIT( KIconCellular, "pri_small_wlan.svg" ); +_LIT( KIconWlan, "pri_small_gprs.svg" ); +_LIT( KIconVpn, "pri_small_vpn.svg" ); +_LIT( KIconNone, "" ); + +// Empty text +_LIT( KTextNone, "" ); + +// Programs to fire at tap +_LIT( KWlanViewExeFile, "wlansniffer.exe" ); +_LIT( KConnViewExeFile, "connview.exe" ); +// Command line +_LIT( KExeFileCmd, "" ); + +// Localization files and texts +_LIT(KTrFile, "connectionstatuspopups_"); +_LIT(KTrFilePath, "z:\\resource\\qt\\translations"); + +_LIT(Ktxt_occ_dpophead_connecting, + "txt_occ_dpophead_connecting"); +_LIT(Ktxt_occ_dpophead_connection_failed, + "txt_occ_dpophead_connection_failed"); +_LIT(Ktxt_occ_dpopinfo_internal_error, + "txt_occ_dpopinfo_internal_error"); +_LIT(Ktxt_occ_dpopinfo_wlan_network_not_found, + "txt_occ_dpopinfo_wlan_network_not_found"); +_LIT(Ktxt_occ_dpopinfo_authentication_unsuccessful, + "txt_occ_dpopinfo_authentication_unsuccessful"); +_LIT(Ktxt_occ_dpopinfo_check_security_key, + "txt_occ_dpopinfo_check_security_key"); +_LIT(Ktxt_occ_dpopinfo_check_connection_settings, + "txt_occ_dpopinfo_check_connection_settings"); +_LIT(Ktxt_occ_dpopinfo_sim_card_missing, + "txt_occ_dpopinfo_sim_card_missing"); +_LIT(Ktxt_occ_dpopinfo_service_unreachable, + "txt_occ_dpopinfo_service_unreachable"); +_LIT(Ktxt_occ_dpopinfo_permission_denied, + "txt_occ_dpopinfo_permission_denied"); +_LIT(Ktxt_occ_dpopinfo_connection_already_active, + "txt_occ_dpopinfo_connection_already_active"); +_LIT(Ktxt_occ_dpopinfo_signal_too_weak, + "txt_occ_dpopinfo_signal_too_weak"); +_LIT(Ktxt_occ_dpopinfo_please_try_again, + "txt_occ_dpopinfo_please_try_again"); +_LIT(Ktxt_occ_dpopinfo_connection_unavailable, + "txt_occ_dpopinfo_connection_unavailable"); +_LIT(Ktxt_occ_dpophead_configuration_failed, + "txt_occ_dpophead_configuration_failed"); + + +//----------------------------------------------------------------------------- +// CConnectionStatusPopup::CConnectionStatusPopup() +//----------------------------------------------------------------------------- +// +CConnectionStatusPopup::CConnectionStatusPopup() +:iPopup( NULL ), iPopupState( EPopupClosed ) + { + } + +//----------------------------------------------------------------------------- +// CConnectionStatusPopup::NewL() +//----------------------------------------------------------------------------- +// +CConnectionStatusPopup* CConnectionStatusPopup::NewL() + { + OstTraceFunctionEntry0( CCONNECTIONSTATUSPOPUP_NEWL_ENTRY ); + + CConnectionStatusPopup* popup = new ( ELeave ) CConnectionStatusPopup(); + CleanupStack::PushL( popup ); + popup->ConstructL(); + CleanupStack::Pop( popup ); + + OstTraceFunctionExit0( CCONNECTIONSTATUSPOPUP_NEWL_EXIT ); + return popup; + } + +//----------------------------------------------------------------------------- +// CConnectionStatusPopup::ConstructL() +//----------------------------------------------------------------------------- +// +void CConnectionStatusPopup::ConstructL() + { + OstTraceFunctionEntry0( CCONNECTIONSTATUSPOPUP_CONSTRUCTL_ENTRY ); + + iPopup = CHbDeviceNotificationDialogSymbian::NewL( this ); + + TBool result = HbTextResolverSymbian::Init( KTrFile, KTrFilePath ); + if (!result) + { + OstTrace0( TRACE_FLOW, CCONNECTIONSTATUSPOPUP_CONSTRUCTL,"CConnectionStatusPopup::ConstructL; Loading of localization failed!" ); + } + + OstTraceFunctionExit0( CCONNECTIONSTATUSPOPUP_CONSTRUCTL_EXIT ); + } + +//----------------------------------------------------------------------------- +// CConnectionStatusPopup::~CConnectionStatusPopup() +//----------------------------------------------------------------------------- +// +CConnectionStatusPopup::~CConnectionStatusPopup() + { + OstTraceFunctionEntry0( CCONNECTIONSTATUSPOPUP_CCONNECTIONSTATUSPOPUP_ENTRY ); + + if (iPopup) + { + iPopup->Close(); + delete iPopup; + } + + OstTraceFunctionExit0( CCONNECTIONSTATUSPOPUP_CCONNECTIONSTATUSPOPUP_EXIT ); + } + +//----------------------------------------------------------------------------- +// CConnectionStatusPopup::ConnectingDiscreetPopup() +//----------------------------------------------------------------------------- +// +void CConnectionStatusPopup::ConnectingViaDiscreetPopup( ) + { + OstTraceFunctionEntry0( CCONNECTIONSTATUSPOPUP_CONNECTINGVIADISCREETPOPUP_ENTRY ); + + TRAP_IGNORE( + HBufC* title = HbTextResolverSymbian::LoadLC( + Ktxt_occ_dpophead_connecting ); + iPopup->SetTitleL( title->Des() ); + CleanupStack::PopAndDestroy( title ); + iPopup->SetTextL( KTextNone ); + iPopup->SetIconNameL( KIconNone ); + ); + + SetState( EPopupConnecting ); + + OstTraceFunctionExit0( CCONNECTIONSTATUSPOPUP_CONNECTINGVIADISCREETPOPUP_EXIT ); + } + + +//----------------------------------------------------------------------------- +// CConnectionStatusPopup::ConnectingViaDiscreetPopup() +//----------------------------------------------------------------------------- +// +void CConnectionStatusPopup::ConnectingViaDiscreetPopup( + TUint32 aIapId, + TBool aConnectionAlreadyActive ) + { + OstTraceFunctionEntry0( DUP1_CCONNECTIONSTATUSPOPUP_CONNECTINGVIADISCREETPOPUP_ENTRY ); + OstTraceExt2( TRACE_FLOW, CCONNECTIONSTATUSPOPUP_CONNECTINGVIADISCREETPOPUP, "CConnectionStatusPopup::ConnectingViaDiscreetPopup;aIapId=%u;aConnectionAlreadyActive=%u", aIapId, aConnectionAlreadyActive ); + + // Grab iap info even if we do not need it yet (when sharing), + // because icon may be used later if general error happens. + TRAP_IGNORE( FormatIapInfoL( aIapId ); ); + + if (aConnectionAlreadyActive) + { + // If sharing a connection, do not show the popup. + SetState( EPopupClosed ); + } + else + { + SetState( EPopupConnectingIap ); + } + + OstTraceFunctionExit0( DUP1_CCONNECTIONSTATUSPOPUP_CONNECTINGVIADISCREETPOPUP_EXIT ); + } + +//----------------------------------------------------------------------------- +// CConnectionStatusPopup::CancelConnectingViaDiscreetPopup() +//----------------------------------------------------------------------------- +// +void CConnectionStatusPopup::CancelConnectingViaDiscreetPopup() + { + OstTraceFunctionEntry0( CCONNECTIONSTATUSPOPUP_CANCELCONNECTINGVIADISCREETPOPUP_ENTRY ); + + SetState( EPopupClosed ); + + OstTraceFunctionExit0( CCONNECTIONSTATUSPOPUP_CANCELCONNECTINGVIADISCREETPOPUP_EXIT ); + } + +//----------------------------------------------------------------------------- +// CConnectionStatusPopup::ConnectionErrorDiscreetPopup() +//----------------------------------------------------------------------------- +// +void CConnectionStatusPopup::ConnectionErrorDiscreetPopup( TInt aErrorCode ) + { + OstTraceFunctionEntry0( CCONNECTIONSTATUSPOPUP_CONNECTIONERRORDISCREETPOPUP_ENTRY ); + + TBool showPopup( EFalse ); + TRAP_IGNORE( showPopup = ResolveErrorCodeL( aErrorCode ); ); + + OstTraceExt2( TRACE_FLOW, CCONNECTIONSTATUSPOPUP_CONNECTIONERRORDISCREETPOPUP, "CConnectionStatusPopup::ConnectionErrorDiscreetPopup;aErrorCode=%d;showPopup=%u", aErrorCode, showPopup ); + + if (showPopup) + { + SetState( EPopupError ); + } + + OstTraceFunctionExit0( CCONNECTIONSTATUSPOPUP_CONNECTIONERRORDISCREETPOPUP_EXIT ); + } + +//----------------------------------------------------------------------------- +// CConnectionStatusPopup::SetState() +//----------------------------------------------------------------------------- +// +void CConnectionStatusPopup::SetState( TPopupState aNewState ) + { + OstTraceExt2( TRACE_FLOW, CCONNECTIONSTATUSPOPUP_SETSTATE, "CConnectionStatusPopup::SetState;iPopupState=%u;aNewState=%u", iPopupState, aNewState ); + + switch (aNewState) + { + + case EPopupClosed: + // Close popup if it's not already closing or closed + if (iPopupState != EPopupClosed && iPopupState != EPopupError) + { + iPopup->Close(); + } + break; + + case EPopupConnecting: + iPopup->EnableTouchActivation( EFalse ); + iPopup->SetTimeout( KForeverTimeout ); + break; + + case EPopupConnectingIap: + iPopup->EnableTouchActivation( ETrue ); + iPopup->SetTimeout( KForeverTimeout ); + break; + + default: // EPopupError + __ASSERT_DEBUG( aNewState == EPopupError, User::Invariant() ); + iPopup->EnableTouchActivation( EFalse ); + iPopup->SetTimeout( KHbLongNotificationDialogTimeout ); + break; + } + + if (aNewState != EPopupClosed) + { + // Show or update popup + if (iPopupState == EPopupClosed) + { + TRAP_IGNORE( iPopup->ShowL() ); + } + else + { + TRAP_IGNORE( iPopup->UpdateL() ); + } + } + + iPopupState = aNewState; + } + +//----------------------------------------------------------------------------- +// CConnectionStatusPopup::FormatIapInfoL() +//----------------------------------------------------------------------------- +// +void CConnectionStatusPopup::FormatIapInfoL( TUint32 aIapId ) + { + OstTraceFunctionEntry0( CCONNECTIONSTATUSPOPUP_FORMATIAPINFOL_ENTRY ); + + // Title + HBufC* title = HbTextResolverSymbian::LoadLC( + Ktxt_occ_dpophead_connecting ); + iPopup->SetTitleL( title->Des() ); + CleanupStack::PopAndDestroy( title ); + + // Load iap info from cmmanager + HBufC* connectionName( NULL ); + TUint bearerType( 0 ); + + RCmManager cmMgr; + CleanupClosePushL( cmMgr ); + RCmConnectionMethod plugin; + CleanupClosePushL( plugin ); + cmMgr.OpenL(); + plugin = cmMgr.ConnectionMethodL( aIapId ); + bearerType = plugin.GetIntAttributeL( CMManager::ECmBearerType ); + connectionName = plugin.GetStringAttributeL( CMManager::ECmName ); + CleanupStack::PopAndDestroy( &plugin ); + CleanupStack::PopAndDestroy( &cmMgr ); + + // Text + CleanupStack::PushL( connectionName ); + if (connectionName) + { + iPopup->SetTextL( connectionName->Des() ); + } + else + { + iPopup->SetTextL( KTextNone ); + } + CleanupStack::PopAndDestroy( connectionName ); + + // Icon + switch (bearerType) + { + case KUidWlanBearerType: + iPopup->SetIconNameL( KIconWlan ); + break; + case KPluginVPNBearerTypeUid: + iPopup->SetIconNameL( KIconVpn ); + break; + default: + iPopup->SetIconNameL( KIconCellular ); + } + + OstTraceFunctionExit0( CCONNECTIONSTATUSPOPUP_FORMATIAPINFOL_EXIT ); + } + +//----------------------------------------------------------------------------- +// CConnectionStatusPopup::ResolveErrorCodeL() +//----------------------------------------------------------------------------- +// +TBool CConnectionStatusPopup::ResolveErrorCodeL( TInt aErrorCode ) + { + OstTraceFunctionEntry0( CCONNECTIONSTATUSPOPUP_RESOLVEERRORCODEL_ENTRY ); + + // Icons, which are resolved at the end + enum TIconType + { + EIconWlan, EIconCellular, EIconNone + }; + TIconType icon = EIconWlan; + + TPtrC titlePtr; + titlePtr.Set( Ktxt_occ_dpophead_connection_failed ); + TPtrC textPtr; + + // Resolve title, text and icon of error code. + // Groups are from OCC UI spec 1.0 + switch (aErrorCode) + { + + // Skipped errors, for which the popup is not shown. + case KErrNone: + case KErrConnectionTerminated: + case KErrDisconnected: + case KErrCancel: + return EFalse; + + // Group 1 + case KErrIfChangingPassword: + icon = EIconCellular; + // These were GPRS; fall through + case KErrWlanInternalError: + textPtr.Set( Ktxt_occ_dpopinfo_internal_error ); + break; + + // Group 2 + case KErrWlanNetworkNotFound: + textPtr.Set( Ktxt_occ_dpopinfo_wlan_network_not_found ); + break; + + // Group 3 + case KErrGprsUserAuthenticationFailure: + icon = EIconCellular; + // These were GPRS; fall through + case KErrWlanOpenAuthFailed: + case KErrWlanSharedKeyAuthRequired: + case KErrWlanWpaAuthRequired: + case KErrWlanWpaAuthFailed: + case KErrWlan802dot1xAuthFailed: + case KErrWlanWpaCounterMeasuresActive: + case KErrWlanPskModeRequired: + case KErrWlanEapModeRequired: + case KErrWlanEapSimFailed: + case KErrWlanEapTlsFailed: + case KErrWlanEapPeapFailed: + case KErrWlanEapMsChapv2: // Is the same as KErrWlanEapMsChaPFailed + case KErrWlanEapAkaFailed: + case KErrWlanEapTtlsFailed: + case KErrWlanLeapFailed: + case KErrWlanEapGtcFailed: + case KErrWlanWpa2OnlyModeNotSupported: + case KErrWlanEapFastTunnelCompromiseError: + case KErrWlanEapFastUnexpextedTlvExhanged: + case KErrWlanEapFastNoPacNorCertsToAuthenticateWithProvDisabled: + case KErrWlanEapFastNoMatchingPacForAid: + case KErrWlanEapFastAuthFailed: + case KErrWlanEapFastPacStoreCorrupted: + textPtr.Set( Ktxt_occ_dpopinfo_authentication_unsuccessful ); + break; + + // Group 4 + case KErrWlanSharedKeyAuthFailed: + case KErrWlanIllegalWpaPskKey: + case KErrWlanIllegalEncryptionKeys: + textPtr.Set( Ktxt_occ_dpopinfo_check_security_key ); + break; + + // Group 5 + case KErrExitModemError: + case KErrExitLoginFail: + case KErrExitScriptTimeOut: + case KErrExitScriptError: + case KErrIfAuthenticationFailure: + case KErrIfAuthNotSecure: + case KErrIfAccountDisabled: + case KErrIfRestrictedLogonHours: + case KErrIfPasswdExpired: + case KErrIfNoDialInPermission: + case KErrGprsMissingorUnknownAPN: + icon = EIconCellular; + textPtr.Set( Ktxt_occ_dpopinfo_check_connection_settings ); + break; + + // Group 6 + case KErrWlanSimNotInstalled: + textPtr.Set( Ktxt_occ_dpopinfo_sim_card_missing ); + break; + + // Group 7 + case KErrWlanNotSubscribed: + case KErrWlanAccessBarred: + textPtr.Set( Ktxt_occ_dpopinfo_service_unreachable ); + break; + + // Group 8 + case KErrPermissionDenied: + case KErrWlanPasswordExpired: + case KErrWlanNoDialinPermissions: + case KErrWlanAccountDisabled: + case KErrWlanRestrictedLogonHours: + case KErrWlanServerCertificateExpired: + case KErrWlanCerficateVerifyFailed: + case KErrWlanNoUserCertificate: + case KErrWlanNoCipherSuite: + case KErrWlanUserRejected: + case KErrWlanUserCertificateExpired: + textPtr.Set( Ktxt_occ_dpopinfo_permission_denied ); + break; + + // Group 9 + case KErrPDPMaxContextsReached: + icon = EIconCellular; + // These were GPRS; fall through + case KErrWlanConnAlreadyActive: + textPtr.Set( Ktxt_occ_dpopinfo_connection_already_active ); + break; + + // Group 10 + case KErrWlanSignalTooWeak: + textPtr.Set( Ktxt_occ_dpopinfo_signal_too_weak ); + break; + + // Group 11 + case KErrIfCallbackNotAcceptable: + case KErrIfDNSNotFound: + case KErrIfLRDBadLine: + case KErrNetUnreach: + case KErrHostUnreach: + case KErrNoProtocolOpt: + case KErrUrgentData: + case KErrInet6NoRoute: + case KErrDndNameNotFound: + case KErrGeneralConnection: + case KErrGprsMSCTemporarilyNotReachable: + case KErrGprsLlcOrSndcpFailure: + case KErrGprsInsufficientResources: + case KErrGprsActivationRejectedByGGSN: + case KErrPacketDataTsyInvalidAPN: + icon = EIconCellular; + // These were GPRS; fall through + case KErrWlanRoamingFailed: + textPtr.Set( Ktxt_occ_dpopinfo_please_try_again ); + break; + + // Group 12 + case KErrGenConnNoGPRSNetwork: + case KErrGprsServicesNotAllowed: + case KErrGprsAndNonGprsServicesNotAllowed: + case KErrGprsMSIdentityCannotBeDerivedByTheNetwork: + case KErrGprsMSImplicitlyDetached: + case KErrGsmMMNetworkFailure: + case KErrGprsUnknownPDPAddress: + case KErrGprsActivationRejected: + case KErrGsmMMServiceOptionNotSubscribed: + case KErrGsmMMServiceOptionTemporaryOutOfOrder: + case KErrGprsNSAPIAlreadyUsed: + case KErrGprsQoSNotAccepted: + case KErrGprsReactivationRequested: + icon = EIconCellular; + textPtr.Set( Ktxt_occ_dpopinfo_connection_unavailable ); + break; + + // Group 13 + case KErrWlanProtectedSetupDevicePasswordAuthFailure: + case KErrWlanProtectedSetupPINMethodNotSupported: + case KErrWlanProtectedSetupPBMethodNotSupported: + titlePtr.Set( Ktxt_occ_dpophead_configuration_failed ); + textPtr.Set( Ktxt_occ_dpopinfo_authentication_unsuccessful ); + break; + + // Group 14 + case KErrWlanProtectedSetupOOBInterfaceReadError: + case KErrWlanProtectedSetupDecryptionCRCFailure: + case KErrWlanProtectedSetup2_4ChannelNotSupported: + case KErrWlanProtectedSetup5_0ChannelNotSupported: + case KErrWlanProtectedSetupNetworkAuthFailure: + case KErrWlanProtectedSetupNoDHCPResponse: + case KErrWlanProtectedSetupFailedDHCPConfig: + case KErrWlanProtectedSetupIPAddressConflict: + case KErrWlanProtectedSetupCouldNotConnectToRegistrar: + case KErrWlanProtectedSetupMultiplePBCSessionsDetected: + case KErrWlanProtectedSetupRogueActivitySuspected: + case KErrWlanProtectedSetupDeviceBusy: + case KErrWlanProtectedSetupSetupLocked: + case KErrWlanProtectedSetupMessageTimeout: + case KErrWlanProtectedSetupRegistrationSessionTimeout: + titlePtr.Set( Ktxt_occ_dpophead_configuration_failed ); + textPtr.Set( Ktxt_occ_dpopinfo_please_try_again ); + break; + + // For error values not specifically mapped to any error message + // the discreet pop-up #12 is used. + default: + icon = EIconNone; + textPtr.Set( Ktxt_occ_dpopinfo_connection_unavailable ); + break; + } + + // Load and set title, text and icon + HBufC* titleBuf = HbTextResolverSymbian::LoadLC( titlePtr ); + iPopup->SetTitleL( titleBuf->Des() ); + HBufC* textBuf = HbTextResolverSymbian::LoadLC( textPtr ); + iPopup->SetTextL( textBuf->Des() ); + CleanupStack::PopAndDestroy( 2, titleBuf ); + + switch (icon) + { + case EIconWlan: + iPopup->SetIconNameL( KIconWlan ); + break; + case EIconCellular: + iPopup->SetIconNameL( KIconCellular ); + break; + default: + __ASSERT_DEBUG( icon == EIconNone, User::Invariant()); + // Leave icon as-is, either set by ConnectingViaDiscreetPopup + // or undefined. + break; + } + + OstTraceFunctionExit0( CCONNECTIONSTATUSPOPUP_RESOLVEERRORCODEL_EXIT ); + return ETrue; + } + + +//----------------------------------------------------------------------------- +// CConnectionStatusPopup::NotificationDialogActivated() +//----------------------------------------------------------------------------- +// +void CConnectionStatusPopup::NotificationDialogActivated( + const CHbDeviceNotificationDialogSymbian* /*aDialog*/ ) + { + OstTraceFunctionEntry0( CCONNECTIONSTATUSPOPUP_NOTIFICATIONDIALOGACTIVATED_ENTRY ); + + // Launch wlan view or connection view depending of bearer + TPtrC procName; + if (iPopup->IconName().Compare( KIconWlan ) == 0) + { + procName.Set( KWlanViewExeFile ); + } + else if (iPopup->IconName().Compare( KIconCellular ) == 0) + { + procName.Set( KConnViewExeFile ); + } + else + { + OstTraceFunctionExit0( CCONNECTIONSTATUSPOPUP_NOTIFICATIONDIALOGACTIVATED_EXIT ); + + return; + } + + RProcess proc; + TInt procError = proc.Create( procName, KExeFileCmd ); + OstTrace1( TRACE_FLOW, CCONNECTIONSTATUSPOPUP_NOTIFICATIONDIALOGACTIVATED, "CConnectionStatusPopup::NotificationDialogActivated;procError=%d", procError ); + if (!procError) + { + proc.Resume(); + proc.Close(); // Closes the handle, not the process. + } + + OstTraceFunctionExit0( DUP1_CCONNECTIONSTATUSPOPUP_NOTIFICATIONDIALOGACTIVATED_EXIT ); + } + +//----------------------------------------------------------------------------- +// CConnectionStatusPopup::NotificationDialogClosed() +//----------------------------------------------------------------------------- +// +void CConnectionStatusPopup::NotificationDialogClosed( + const CHbDeviceNotificationDialogSymbian* /*aDialog*/, + TInt /*aCompletionCode*/ ) + { + OstTraceFunctionEntry0( CCONNECTIONSTATUSPOPUP_NOTIFICATIONDIALOGCLOSED_ENTRY ); + + SetState( EPopupClosed ); + + OstTraceFunctionExit0( CCONNECTIONSTATUSPOPUP_NOTIFICATIONDIALOGCLOSED_EXIT ); + } diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/clientinc/ActiveLogin.h --- a/connectionutilities/ConnectionDialogs/cconndlg/clientinc/ActiveLogin.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - - -#ifndef __ACTIVELOGIN_H__ -#define __ACTIVELOGIN_H__ - -// INCLUDES -#include "ConnDlgPlugin.h" -#include - - -// CLASS DECLARATION - -/** -* ActiveObject for asynchronous operations -*/ -NONSHARABLE_CLASS( CActiveLogin ) : public CActive - { - private: - /** - * C++ default constructor. - * @param aUsername The address where the caller of the Authenticate - * dialog needs to save the username data inserted by - * the user. - * @param aPassword The address where the caller of the Authenticate - * dialog needs to save the password data inserted by - * the user. - */ - CActiveLogin( TDes& aUsername, TDes& aPassword ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - - public: // Constructors and destructor - /** - * Two-phased constructor. - * @param aUsername The address where the caller of the Authenticate - * dialog needs to save the username data inserted by - * the user. - * @param aPassword The address where the caller of the Authenticate - * dialog needs to save the password data inserted by - * the user. - */ - static CActiveLogin* NewL( TDes& aUsername, TDes& aPassword ); - - /** - * Destructor. - */ - virtual ~CActiveLogin(); - - - public: // From base class - /** - * This function is called when the scheduled function ends. - */ - void RunL(); - - /** - * Cancel operations. - */ - void DoCancel(); - - - public: // New functions - /** - * Add this class on the ActiveScheduler and puts itself active. - * @param aStatus The status that is checked by the caller of the - * Authenticate dialog. - */ - void Observe( TRequestStatus &aStatus ); - - /** - * Returns the TAuthenticationPairBuff - * @return A pointer to iAuthenticationPairBuff. - */ - TPckgBuf* GetBuffer(); - - - private: // Data - // The status that is checked by the caller of the Authentication - // dialog. Not owned. - TRequestStatus* iRs; - - // The address of the area where the caller of the Authentication - // dialog expects the value for username. Not owned. - TDes* iUsername; - - // The address of the area where the caller of the Authentication - // dialog expects the value for password. Not owned. - TDes* iPassword; - - // Packed buffer containing user name and password used as input and - // output for Authentication dialog. - TPckgBuf iAuthenticationPairBuff; - }; - - -#endif - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/clientsrc/ActiveLogin.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/clientsrc/ActiveLogin.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -/* -* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CActiveLogin class -* -*/ - - -// INCLUDE FILES -#include "ActiveLogin.h" - - -// ================= MEMBER FUNCTIONS ======================= -// -// ---------------------------------------------------------------------------- -// CActiveLogin::CActiveLogin -// ---------------------------------------------------------------------------- -// -CActiveLogin::CActiveLogin( TDes& aUsername, TDes& aPassword ) -: CActive( CActive::EPriorityUserInput ), - iUsername( &aUsername ), - iPassword( &aPassword ) - { - iAuthenticationPairBuff().iUsername = aUsername; - iAuthenticationPairBuff().iPassword = aPassword; - } - - -// ---------------------------------------------------------------------------- -// CActiveLogin::NewL -// ---------------------------------------------------------------------------- -// -CActiveLogin* CActiveLogin::NewL( TDes& aUsername, TDes& aPassword ) - { - CActiveLogin* self = new( ELeave )CActiveLogin( aUsername, aPassword ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - - -// ---------------------------------------------------------------------------- -// CActiveLogin::ConstructL -// ---------------------------------------------------------------------------- -// -void CActiveLogin::ConstructL() - { - } - - -// ---------------------------------------------------- -// CActiveLogin::~CActiveLogin() -// ---------------------------------------------------- -// -CActiveLogin::~CActiveLogin() - { - Cancel(); - } - - -// ---------------------------------------------------------------------------- -// CActiveLogin::RunL -// ---------------------------------------------------------------------------- -// -void CActiveLogin::RunL() - { - if ( iStatus.Int() == KErrNone ) - { - *iUsername = iAuthenticationPairBuff().iUsername; - *iPassword = iAuthenticationPairBuff().iPassword; - } - - TRequestStatus* pS = iRs; - User::RequestComplete( pS, iStatus.Int() ); - - delete this; - } - - -// ---------------------------------------------------------------------------- -// CActiveLogin::DoCancel -// ---------------------------------------------------------------------------- -// -void CActiveLogin::DoCancel() - { - TRequestStatus* pS = iRs; - User::RequestComplete( pS, KErrCancel ); - } - - -// ---------------------------------------------------------------------------- -// CActiveLogin::Observe -// ---------------------------------------------------------------------------- -// -void CActiveLogin::Observe( TRequestStatus &aStatus ) - { - CActiveScheduler::Add( this ); - - iRs = &aStatus; - *iRs = KRequestPending; - - SetActive(); - } - - -// ---------------------------------------------------------------------------- -// CActiveLogin::GetBuffer -// ---------------------------------------------------------------------------- -// -TPckgBuf* CActiveLogin::GetBuffer() - { - return &iAuthenticationPairBuff; - } - - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/clientsrc/GenConAgentDialogServer.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/clientsrc/GenConAgentDialogServer.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/cconndlg/clientsrc/GenConAgentDialogServer.cpp Mon May 03 12:53:07 2010 +0300 @@ -20,11 +20,14 @@ // INCLUDE FILES #include "GenConAgentDialogServer.h" #include "ConnectionDialogsUidDefs.h" -#include "ActiveLogin.h" #include "ConnectionDialogsLogger.h" #include +// NOTE that the functionality this file is DEPRECATED +// None on the methods have UI functionality, the plugins complete the requests +// immediately when they are started + // --------------------------------------------------------- // ThreadFunction @@ -223,31 +226,20 @@ { CLOG_ENTERFN( "RGenConAgentDialogServer::Authenticate" ); - CActiveLogin* activeLogin = NULL; - - TRAPD( err, activeLogin = CActiveLogin::NewL( aUsername, aPassword ) ); - - iNotUsed() = ( TUint32 )activeLogin; + // To get rid of compile warnings; + aPassword = aPassword; + aUsername = aUsername; - if ( err != KErrNone ) - { - TRequestStatus* pS = &aStatus; - User::RequestComplete( pS, err ); - } - else + + // temporaty variable to get the notifier started + TPckgBuf notUsed; + + if ( iNotifier ) { - activeLogin->Observe( aStatus ); - - TPckgBuf* authenticationPairBuff = - activeLogin->GetBuffer(); - - if ( iNotifier ) - { - iNotifier->StartNotifierAndGetResponse( activeLogin->iStatus, - KUidCConnDlgAuthentication, - *authenticationPairBuff, - *authenticationPairBuff ); - } + iNotifier->StartNotifierAndGetResponse( aStatus, + KUidCConnDlgAuthentication, + notUsed, + notUsed ); } CLOG_LEAVEFN( "RGenConAgentDialogServer::Authenticate" ); @@ -439,11 +431,6 @@ iNotifier->CancelNotifier( KUidCConnDlgAuthentication ); } - CActiveLogin* activeLogin = ( CActiveLogin* )iNotUsed(); - - activeLogin->Cancel(); - delete activeLogin; - CLOG_LEAVEFN( "RGenConAgentDialogServer::CancelAuthenticate" ); } diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/data/CConnDlgPlugin.rss --- a/connectionutilities/ConnectionDialogs/cconndlg/data/CConnDlgPlugin.rss Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,364 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: resorce of CConnDLGPLUGIN. -* -*/ - - -// RESOURCE IDENTIFIER -NAME CDLG - - -// INCLUDES -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include "ConnectionDialogs.hrh" - - -// RESOURCE DEFINITIONS - -RESOURCE RSS_SIGNATURE { } - - -RESOURCE CBA r_softkeys_done_cancel__select - { - buttons = - { - CBA_BUTTON { id = EAknSoftkeyDone; txt = text_softkey_done; }, - CBA_BUTTON { id = EAknSoftkeyCancel; txt = text_softkey_cancel; }, - CBA_BUTTON { id = EAknSoftkeyDone; txt = qtn_msk_select; } - }; - } - - -RESOURCE DIALOG r_conndlg_authentication - { - flags = EEikDialogFlagNotifyEsc | EEikDialogFlagNoDrag | - EEikDialogFlagNoTitleBar | EEikDialogFlagCbaButtons; - buttons = r_softkeys_done_cancel__select; - items= - { - DLG_LINE - { - type = EAknCtMultilineQuery; - id = EMultilineFirstLine; - control = AVKON_DATA_QUERY - { - layout = EMultiDataFirstEdwin; - label = qtn_netw_iap_auth_username; - control = EDWIN - { - avkon_flags = EAknEditorFlagLatinInputModesOnly; - allowed_input_modes = EAknEditorTextInputMode | - EAknEditorNumericInputMode; - width = 50; - lines = 1; - maxlength = 50; - }; - }; - }, - - DLG_LINE - { - type = EAknCtMultilineQuery; - id = EMultilineSecondLine; - control = AVKON_DATA_QUERY - { - layout = EMultiDataSecondSecEd; - label = qtn_netw_iap_auth_password; - control = SECRETED - { - num_letters = 50; - }; - }; - } - }; - } - - -RESOURCE DIALOG r_conndlg_reconnect - { - flags = EEikDialogFlagNotifyEsc | EEikDialogFlagCbaButtons | - EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar | - EEikDialogFlagCbaButtons; - buttons = R_AVKON_SOFTKEYS_YES_NO__YES; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control= AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationLayout; - label = qtn_ics_q_conn_lost_reconn; - }; - } - }; - } - - -RESOURCE DIALOG r_conndlg_qos - { - flags = EEikDialogFlagNotifyEsc | EEikDialogFlagCbaButtons | - EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar | - EEikDialogFlagCbaButtons; - buttons = R_AVKON_SOFTKEYS_YES_NO__YES; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationLayout; - label = qtn_ics_q_conn_qos_reconn; - }; - } - }; - } - - -RESOURCE AVKON_LIST_QUERY r_list_query - { - softkeys = R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT; - flags = EEikDialogFlagNotifyEsc | EEikDialogFlagCbaButtons | - EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar; - - items = - { - AVKON_LIST_QUERY_DLG_LINE - { - id = EListQueryControl; - control = AVKON_LIST_QUERY_CONTROL - { - listtype = EAknCtSingleGraphicPopupMenuListBox; - listbox = AVKON_LIST_QUERY_LIST - { - flags = EAknListBoxSelectionList; - }; - - heading = qtn_ics_ap_list_title; - }; - } - }; - } - - -RESOURCE DIALOG r_conndlg_new_iap - { - flags = EEikDialogFlagNotifyEsc | EEikDialogFlagCbaButtons | - EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar; - buttons = R_AVKON_SOFTKEYS_YES_NO__YES; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control= AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationLayout; - }; - } - }; - } - - -RESOURCE TBUF r_conndlg_new_connection_attempt - { - buf = qtn_ics_ap_connect_text; - } - - -RESOURCE TBUF r_wlan_search_for_networks - { - buf = qtn_wlan_search_for_networks; - } - - -RESOURCE DIALOG r_searching_wait_note - { - flags = EAknWaitNoteFlags; - buttons=R_AVKON_SOFTKEYS_EMPTY; - items= - { - DLG_LINE - { - type = EAknCtNote; - id = 0x112; // - control= AVKON_NOTE - { - layout = EWaitLayout; - singular_label = qtn_netw_wait_checking_avail_conn; - imagefile = AVKON_ICON_FILE; - imageid = EMbmAvkonQgn_note_progress; - imagemask = EMbmAvkonQgn_note_progress_mask; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } - - -RESOURCE TBUF r_wlan_easy_wlan - { - buf = qtn_netw_conset_easy_wlan; - } - - -RESOURCE TBUF r_list_uncategorized - { - buf = qtn_netw_conset_dest_uncategorized; - } - - -RESOURCE TBUF r_conn_methods_many - { - buf = qtn_netw_conset_conn_methods_amount_many; - } - - -RESOURCE TBUF r_conn_methods_one - { - buf = qtn_netw_conset_conn_methods_amount_one; - } - - -RESOURCE CBA r_softkeys_options_cancel__connect - { - buttons = - { - CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON { id = EAknSoftkeyCancel; txt = text_softkey_cancel; }, - CBA_BUTTON { id = EAknSoftkeyDone; txt = qtn_msk_connect; } - }; - } - - - -RESOURCE AVKON_LIST_QUERY r_select_connection_query - { - softkeys = r_softkeys_options_cancel__connect; - flags = EEikDialogFlagNotifyEsc | EEikDialogFlagCbaButtons | - EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar; - - items = - { - AVKON_LIST_QUERY_DLG_LINE - { - id = EListQueryControl; - control = AVKON_LIST_QUERY_CONTROL - { - listtype = EAknCtDoubleLargeGraphicPopupMenuListBox; - listbox = AVKON_LIST_QUERY_LIST - { - }; - - heading = qtn_netw_conset_prmpt_select_connection; - }; - } - }; - } - - -RESOURCE MENU_BAR r_select_connection_menubar - { - titles = - { - MENU_TITLE { menu_pane = r_select_connection_menu_pane; txt = ""; } - }; - } - - -RESOURCE MENU_PANE r_select_connection_menu_pane - { - items = - { - MENU_ITEM - { - command = ESelectConnectionCmdSelect; - txt = qtn_set_cmd_select; - flags = EEikMenuItemAction; - }, - - MENU_ITEM - { - command = ESelectConnectionCmdConnect; - txt = qtn_set_cmd_connect; - flags = EEikMenuItemAction; - }, - - MENU_ITEM - { - command = ESelectConnectionCmdChooseMethod; - txt = qtn_netw_conset_options_select_method; - flags = EEikMenuItemSpecific; - } - }; - } - - -RESOURCE CBA r_softkeys_connect_cancel__select - { - buttons = - { - CBA_BUTTON { id = EAknSoftkeySelect; txt = qtn_netw_conset_softkey_connect; }, - CBA_BUTTON { id = EAknSoftkeyCancel; txt = text_softkey_cancel; }, - CBA_BUTTON { id = EAknSoftkeySelect; txt = qtn_msk_select; } - }; - } - - -RESOURCE AVKON_LIST_QUERY r_list_explicit_query - { - softkeys = r_softkeys_connect_cancel__select; - flags = EEikDialogFlagNotifyEsc | EEikDialogFlagCbaButtons | - EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar; - - items = - { - AVKON_LIST_QUERY_DLG_LINE - { - id = EListQueryControl; - control = AVKON_LIST_QUERY_CONTROL - { - listtype = EAknCtSingleGraphicPopupMenuListBox; - listbox = AVKON_LIST_QUERY_LIST - { - flags = EAknListBoxSelectionList; - }; - - heading = qtn_netw_conset_prmpt_select_conn_method; - }; - } - }; - } - - -// End of File - - diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/ActiveBase.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/ActiveBase.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of a CActive base class -* -*/ - - - -#ifndef __ACTIVEBASE_H__ -#define __ACTIVEBASE_H__ - - -// INCLUDES -#include - - -// CLASS DECLARATION - -/** - * CActiveBase class, an active object for selection plugin - */ -NONSHARABLE_CLASS( CActiveBase ) : public CActive - { - public: - /** - * NewL function - */ - static CActiveBase* NewL(); - - /** - * Destructor - */ - virtual ~CActiveBase(); - - /** - * Cancels the active object - */ - void Cancel(); - - /** - * Timer callback of iPeridoc. - */ - static TInt Tick( TAny* aObject ); - - - protected: - /** - * ConstructL - */ - void ConstructL(); - - /** - * Constructor - */ - CActiveBase(); - - /** - * DoCancel from CActive - */ - virtual void DoCancel(); - - /** - * RunL from CActive - */ - virtual void RunL(); - - /** - * Starts Timer - * @param aTickInterval refersh interval - */ - void StartTimerL( TInt aTickInterval ); - - /** - * Stops Timer - */ - void StopTimer(); - - - protected: - - // Timer, to refresh iaps of networks. Owned. - CPeriodic* iPeriodic; - - // used for complete runl, not owned. - TRequestStatus* iClientStatus; - }; - - -#endif - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/ActiveIapPlugin.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/ActiveIapPlugin.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of Active Iap -* -*/ - - - -#ifndef __ACTIVEIAPPLUGIN_H__ -#define __ACTIVEIAPPLUGIN_H__ - - -// INCLUDES -#include "ConnDlgPlugin.h" -#include "ActiveIAPListing.h" - - -// FORWARD DECLARATION -class CIapDialog; - - -// CLASS DECLARATION - -/** - * CActiveCConnDlgIapPlugin class, - * an active object for CConnDlgIapPlugin - */ -NONSHARABLE_CLASS( CActiveCConnDlgIapPlugin ) : public CActiveIAPListing - { - public: - /** - * NewL function - * @param aPlugin a pointer to notifier plugin - * @param aIAPId iap id - * @param aPrefs preferences pointer - */ - static CActiveCConnDlgIapPlugin* NewL( CConnDlgIapPlugin* aPlugin, - const TConnectionPrefs& aPrefs ); - - /** - * StartSearchIAPsL setactive and starts active object - */ - void StartSearchIAPsL(); - - /** - * Destructor - */ - virtual ~CActiveCConnDlgIapPlugin(); - - /** - * Cancels the active object - */ - void Cancel(); - - - protected: - /** - * ConstructL - */ - void ConstructL(); - - /** - * Constructor - * @param aPlugin a pointer to notifier plugin - * @param aIAPId iap id - * @param aPrefs preferences pointer - */ - CActiveCConnDlgIapPlugin( CConnDlgIapPlugin* aPlugin, - const TConnectionPrefs& aPrefs ); - - /** - * DoCancel from CActive - */ - virtual void DoCancel(); - - /** - * RunL from CActive - */ - virtual void RunL(); - - /** - * Gives back, refresh interval of scan for network - */ - TInt GetRefreshInterval(); - - - protected: - - // a pointer to notifer, not owned - CConnDlgIapPlugin* iPlugin; - - ///< Pointer to the dialog, not owned - CIapDialog* iDialog; - - TBool isDialogDeleting; - - }; - - -#endif - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/ActiveSelectConnectionPlugin.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/ActiveSelectConnectionPlugin.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of Active SelectConnection -* -*/ - - - -#ifndef __ACTIVESELECTCONNECTIONPLUGIN_H__ -#define __ACTIVESELECTCONNECTIONPLUGIN_H__ - - -// INCLUDES -#include -#include -#include -#include -#include "ActiveBase.h" - - -// FORWARD DECLARATION -class CSelectConnectionDialog; -class CConnectionInfoArray; -class MEikSrvNotifierBase2; -class CGulIcon; -class TSortSnapUtils; - -// CLASS DECLARATION - -/** - * CActiveSelectConnectionPlugin class, - * an active object for selection plugin - */ -NONSHARABLE_CLASS( CActiveSelectConnectionPlugin ) : public CActiveBase - { - public: - /** - * NewL function - * @param aPlugin a pointer to notifier plugin - * @param aIAPId iap id - * @param aPrefs preferences pointer - */ - static CActiveSelectConnectionPlugin* NewL( - MEikSrvNotifierBase2* aPlugin, - const TUint32 aElementId, - TUint32 aBearerSet ); - - /** - * Setactive and starts active object - */ - void ShowSelectConnectionL(); - - /** - * Destructor - */ - virtual ~CActiveSelectConnectionPlugin(); - - /** - * Cancels the active object - */ - void Cancel(); - - /** - * Sets the preferred iap into db. - * calls iActivePlugin - * @param aIAPId id of the preferred iap - * @param aDestinationId id of the preferred Destination - */ - TUint32 GetElementIDL( TUint32 aIAPId, TUint32 aDestinationId ); - - - protected: - /** - * ConstructL - */ - void ConstructL(); - - /** - * Constructor - * @param aPlugin a pointer to notifier plugin - * @param aIAPId iap id - * @param aPrefs preferences pointer - */ - CActiveSelectConnectionPlugin( MEikSrvNotifierBase2* aPlugin, - const TUint32 aElementId, - TUint32 aBearerSet ); - - /** - * DoCancel from CActive - */ - virtual void DoCancel(); - - /** - * RunL from CActive - */ - virtual void RunL(); - - /** - * BuildConnectionListL - * @param - - */ - void BuildConnectionListL(); - - void AddSearchForWLanItemL(); - - void AddDestinationItemsL(); - void AddDestinationItemL( RCmDestinationExt aDestination, - TUint32 aDestId, TBool aFirstItem, - TBool aDefaultDest, - TSortSnapUtils& aSortSnapUtils ); - - void AddUncategorizedItemL( TSortSnapUtils& aSortSnapUtils ); - - /** - * Gives back, refresh interval of scan for network - */ - TInt GetRefreshIntervalL(); - - /** - * Counts the number of ad-hoc WLAN iaps - */ - TInt CountAdhocWlanIapsL(); - - protected: - // contains all iaps from db, owned - CConnectionInfoArray *iItems; - - // Selected preferences - TUint32 iBearerSet; - - // Requested bearer set preference - TUint32 iReqBearerSet; - - // Selected preferences - TUint32 iElementId; - - // a pointer to notifer, not owned - MEikSrvNotifierBase2* iPlugin; - - ///< Pointer to the dialog, not owned - CSelectConnectionDialog* iDialogConn; - - TBool iIsWLANFeatureSupported; - - TInt iRefreshInterval; - - TInt iHighlightedItem; - - CArrayPtr< CGulIcon >* iIcons; - - RMPM iMPM; - - RCmManagerExt iCmManagerExt; - - TUint iDefaultDestId; - - TUint iDefaultCMId; - }; - - -#endif - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/ActiveSelectExplicit.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/ActiveSelectExplicit.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of Active Iap -* -*/ - - - -#ifndef __ACTIVESELECTEXPLICIT_H__ -#define __ACTIVESELECTEXPLICIT_H__ - - -// INCLUDES -#include "ConnDlgPlugin.h" -#include "ActiveIAPListing.h" -#include "SelectConnectionDialog.h" -#include "ActiveBase.h" -#include -#include - - -// FORWARD DECLARATION -class CSelectExplicitDialog; - - -// CLASS DECLARATION - -/** - * CActiveSelectExplicit class, - * an active object for SelectExplicit - */ -NONSHARABLE_CLASS( CActiveSelectExplicit ) : public CActiveBase - { - public: - /** - * NewL function - * @param aPlugin a pointer to notifier plugin - * @param aIAPId iap id - * @param aPrefs preferences pointer - */ - static CActiveSelectExplicit* NewL( - CSelectConnectionDialog* aCallerDialog, - TUint aDestId, - TInt aRefreshInterval, - TUint32 aBearerSet, - TBool aIsWLANFeatureSupported, - TUint aDefaultCMId ); - - /** - * Setactive and starts active object - */ - void ShowSelectExplicitL(); - - /** - * Destructor - */ - virtual ~CActiveSelectExplicit(); - - /** - * Cancels the active object - */ - void Cancel(); - - /** - * Gives back the id of preferred iap. - * @return the id of iap - */ - TUint32 GetPreferredIapIdL(); - - - /** - * Sets the preferred iap into db. - * @param aIAPId id of the preferred iap - */ - void SetPreferredIapIdL( TUint32 aIAPId ); - - - protected: - /** - * ConstructL - */ - void ConstructL(); - - /** - * Constructor - * @param aPlugin a pointer to notifier plugin - * @param aIAPId iap id - * @param aPrefs preferences pointer - */ - CActiveSelectExplicit( CSelectConnectionDialog* aCallerDialog, - TUint aDestId, - TInt aRefreshInterval, - TUint32 aBearerSet, - TBool aIsWLANFeatureSupported, - TUint aDefaultCMId ); - - - /** - * DoCancel from CActive - */ - virtual void DoCancel(); - - /** - * RunL from CActive - */ - virtual void RunL(); - - /** - * BuildConnectionListL - * @param - - */ - void BuildConnectionListL(); - - void AddConnectionMethodItemL( TUint32 aId, - TBool aCheckForEasyWlan, - TBool& aEasyWlanIsInDb, - TBool aDefaultCM ); - - void AddAdhocWlanIapsL(); - - - protected: - // contains all iaps from db, owned - CConnectionInfoArray *iItems; - - CSelectConnectionDialog* iCallerDialog; - - TUint iDestId; - - ///< Pointer to the dialog, not owned - CSelectExplicitDialog* iDialog; - - TInt iRefreshInterval; - - CArrayPtr< CGulIcon >* iIcons; - - RMPM iMPM; - RCmManagerExt iCmManagerExt; - - TUint32 iBearerSet; - TBool iIsWLANFeatureSupported; - TUint iDefaultCMId; - }; - - -#endif - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/AuthenticationDialog.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/AuthenticationDialog.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of class CAuthenticationDialog. -* -*/ - - -#ifndef __AUTHENTICATIONDIALOG_H__ -#define __AUTHENTICATIONDIALOG_H__ - - -// INCLUDES -#include -#include - -#include "ExpiryTimerCallback.h" - -// FORWARD DECLARATION -class CConnDlgAuthenticationPlugin; -class CExpiryTimer; - -// CLASS DECLARATION -/** - * Class implementing Authentication (username and password) dialog - */ -NONSHARABLE_CLASS( CAuthenticationDialog ) : - public CAknMultiLineDataQueryDialog, public MExpiryTimerCallback - { - public: - /** - * NewL function - * @param aPlugin plugin pointer - * @param aDb database pointer - * @param aUsername username - * @param aPassword password - * return CAuthenticationDialog* - */ - static CAuthenticationDialog* NewL( - CConnDlgAuthenticationPlugin* aPlugin, - TDes& aUsername, - TDes& aPassword ); - - private: - /** - * CAuthenticationDialog default constructor - * @param aPlugin plugin pointer - * @param aDb database pointer - * @param aUsername username - * @param aPassword password - */ - CAuthenticationDialog( CConnDlgAuthenticationPlugin* aPlugin ); - - /** - * OkToExitL destructor - * @param aButtonId button exit id - * @return TBool exit or no - */ - virtual TBool OkToExitL( TInt aButtonId ); - - /** - * ~CAuthenticationDialog destructor - * @param - - */ - ~CAuthenticationDialog(); - - /** - * HandleQueryEditorStateEventL function - * @param aQueryControl Control to be queried - * @param aEventType Type of event (not used) - * @param aStatus Status of the control (empty or not) - * return TBool - */ - TBool HandleQueryEditorStateEventL( CAknQueryControl* aQueryControl, - TQueryControlEvent aEventType, - TQueryValidationStatus aStatus ); - - /** - * Dialog expiration timeout callback - */ - void HandleTimedOut(); - - private: - /** - * PreLayoutDynInitL function - * @param - - */ - virtual void PreLayoutDynInitL(); - - /** - * SetInitialCurrentLine function - * @param - - */ - virtual void SetInitialCurrentLine(); - - - private: - // Status of username field (empty or not) - TBool iFirstEmpty; - - // Status of password field (empty or not) - TBool iSecondEmpty; - - // Pointer to the plugin - CConnDlgAuthenticationPlugin* iPlugin; - - // Pointer for dialog expiration timer - CExpiryTimer* iExpiryTimer; - }; - - -#endif - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/CConnDlgPrivateCRKeys.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/CConnDlgPrivateCRKeys.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Defining local variation for the module -* -* -*/ - - -#ifndef CCONNDLGPRIVATECRKEYS_H -#define CCONNDLGPRIVATECRKEYS_H - -const TUid KCRUidCConnDlg = {0x10008D55}; - -// Local variation for CConnDlg - -// KCConnDlgScanInterval defines the WLAN scanning interval for IAP dialog in -// microseconds -const TUint32 KCConnDlgScanInterval = 0x00000001; - - -#endif // CCONNDLGPRIVATECRKEYS_H \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/ConnDlgPlugin.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/ConnDlgPlugin.h Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/cconndlg/inc/ConnDlgPlugin.h Mon May 03 12:53:07 2010 +0300 @@ -16,6 +16,10 @@ */ +// NOTE that the functionality this header contains is DEPRECATED +// None on the methods have UI functionality, the plugins complete the requests +// immediately when they are started + #ifndef __CONNDLGPLUGIN_H__ #define __CONNDLGPLUGIN_H__ @@ -87,8 +91,6 @@ // FORWARD DECLARATION class CAknMultiLineDataQueryDialog; class CAknQueryDialog; -class CActiveCConnDlgIapPlugin; -class CActiveSelectConnectionPlugin; // CLASS DECLARATION @@ -111,7 +113,65 @@ * @param - * return CConnDlgIapPlugin* */ - static CConnDlgIapPlugin* NewL( const TBool aResourceFileResponsible ); + static CConnDlgIapPlugin* NewL( const TBool /*aResourceFileResponsible*/ ); + + /** + * RegisterL register the client notifier function + * @param - + * return TNotifierInfo + */ + TNotifierInfo RegisterL(); + + /** + * Start the Notifier + * @param aBuffer Buffer + * @param aReplySlot Identifies which message argument to use for the + * reply. This message argument will refer to a + * modifiable descriptor, a TDes8 type, into which data + * can be returned. + * @param aMessage Message + * return - + */ + void StartL( const TDesC8& aBuffer, TInt aReplySlot, + const RMessagePtr2& aMessage ); + + /** + * Cancel() the notifier + * @param - + * return - + */ + void Cancel(); + +public: + + /** + * CompleteL the notifier is complete + * @param aStatus status + * return - + */ + void CompleteL( TInt aStatus ); + +private: + TUint32 iIAP; // Internet Access Point + }; + + +/** + * Authentication Plugin class + */ +NONSHARABLE_CLASS( CConnDlgAuthenticationPlugin ) : + public CConnectionDialogsNotifBase + { +public: + CConnDlgAuthenticationPlugin::CConnDlgAuthenticationPlugin(); + + /** + * NewL function + * @param - + * return CConnDlgAuthenticationPlugin* + */ + static CConnDlgAuthenticationPlugin* NewL( + const TBool /*aResourceFileResponsible*/ ); /** * RegisterL register the client notifier function @@ -148,102 +208,6 @@ * return - */ void CompleteL( TInt aStatus ); - - /** - * Sets the preferred iap into db. - * calls iActivePlugin - * @param aIAPId id of the preferred iap - */ - void SetPreferredIapIdL( TUint32 aIAPId ); - -private: - - /** - * Gets user connection info. - * @param aIapId id of the iap - */ - TInt GetUserConnection( TInt& aIapId ); - - /** - * Gets active connection info. - * @param aIapId id of the iap - * @param aBearer bearer type - */ - TInt GetActiveConnection( TInt& aIapId, TInt& aBearer ); - -private: - TUint32 iIAP; // Internet Access Point - TPckgBuf iPrefs; // Selected preferences - CActiveCConnDlgIapPlugin* iActivePlugin; // pointer to active object - }; - - -/** - * Authentication Plugin class - */ -NONSHARABLE_CLASS( CConnDlgAuthenticationPlugin ) : - public CConnectionDialogsNotifBase - { -public: - CConnDlgAuthenticationPlugin::CConnDlgAuthenticationPlugin(); - - /** - * NewL function - * @param - - * return CConnDlgAuthenticationPlugin* - */ - static CConnDlgAuthenticationPlugin* NewL( - const TBool aResourceFileResponsible ); - - /** - * RegisterL register the client notifier function - * @param - - * return TNotifierInfo - */ - TNotifierInfo RegisterL(); - - /** - * Start the Notifier - * @param aBuffer Buffer - * @param aReplySlot Identifies which message argument to use for the - * reply. This message argument will refer to a - * modifiable descriptor, a TDes8 type, into which data - * can be returned. - * @param aMessage Message - * return - - */ - void StartL( const TDesC8& aBuffer, TInt aReplySlot, - const RMessagePtr2& aMessage ); - - /** - * Cancel() the notifier - * @param - - * return - - */ - void Cancel(); - -public: - - /** - * GetAuthenticationL() show the Authenticate dialog - * @param - - * return - - */ - void GetAuthenticationL(); - - /** - * CompleteL the notifier is complete - * @param aStatus status - * return - - */ - void CompleteL( TInt aStatus ); - -private: - TPckgBuf iAuthPair; // Authentication pair - // (username and password) - TPckgBuf iAuthPairBuff; // Authentication pair - // (username and password) - CAknMultiLineDataQueryDialog *iDialog; // Pointer to the dialog }; @@ -261,7 +225,7 @@ * return CConnDlgReconnectPlugin* */ static CConnDlgReconnectPlugin* NewL( - const TBool aResourceFileResponsible ); + const TBool /*aResourceFileResponsible*/ ); /** * RegisterL register the client notifier function @@ -293,22 +257,11 @@ public: /** - * GetReconnectL() call the reconnect dialog - * @param - - * return - - */ - void GetReconnectL(); - - /** * CompleteL the notifier is complete * @param aStatus status * return - */ void CompleteL(TInt aStatus); - -private: - CAknQueryDialog* iDialog; // Pointer to the dialog - TBool iBool; // Tells if it has to connect to the IAP }; @@ -324,137 +277,7 @@ * @param - * return CConnDlgReconnectPlugin* */ - static CConnDlgQosPlugin* NewL( const TBool aResourceFileResponsible ); - - /** - * RegisterL register the client notifier function - * @param - - * return TNotifierInfo - */ - TNotifierInfo RegisterL(); - - /** - * Start the Notifier - * @param aBuffer Buffer - * @param aReplySlot Identifies which message argument to use for the - * reply. This message argument will refer to a - * modifiable descriptor, a TDes8 type, into which data - * can be returned. - * @param aMessage Message - * return - - */ - void StartL( const TDesC8& aBuffer, TInt aReplySlot, - const RMessagePtr2& aMessage ); - - /** - * Cancel() the notifier - * @param - - * return - - */ - void Cancel(); - -public: - - /** - * GetReconnectL() call the reconnect dialog - * @param - - * return - - */ - void GetReconnectL(); - - /** - * CompleteL the notifier is complete - * @param aStatus status - * return - - */ - void CompleteL( TInt aStatus ); - -private: - CAknQueryDialog* iDialog; // Pointer to the dialog - TBool iBool; // Tells if it has to connect to the IAP - }; - - -/** - * New IAP Plugin class - */ -NONSHARABLE_CLASS( CConnDlgNewIapPlugin ) : public CConnectionDialogsNotifBase - { -public: - - /** - * NewL function - * @param - - * return CConnDlgNewIapPlugin* - */ - static CConnDlgNewIapPlugin* NewL( const TBool aResourceFileResponsible ); - - /** - * RegisterL register the client notifier function - * @param - - * return TNotifierInfo - */ - TNotifierInfo RegisterL(); - - /** - * Start the Notifier - * @param aBuffer Buffer - * @param aReplySlot Identifies which message argument to use for the - * reply. This message argument will refer to a - * modifiable descriptor, a TDes8 type, into which data - * can be returned. - * @param aMessage Message - * return - - */ - void StartL( const TDesC8& aBuffer, TInt aReplySlot, - const RMessagePtr2& aMessage ); - - /** - * Cancel() the notifier - * @param - - * return - - */ - void Cancel(); - -public: - - /** - * GetNewIapL show NewIap dialog - * @param - - * return - - */ - void GetNewIapL(); - - /** - * CompleteL the notifier is complete - * @param aStatus status - * return - - */ - void CompleteL( TInt aStatus ); - -private: - CAknQueryDialog* iDialog; // Pointer to the dialog - TBool iConnect; // Tells if it has to connect - // to the IAP - TPckgBuf iPrefs; // Selected preferences - }; - - - -/** - * Connection Selection Plugin class - */ -NONSHARABLE_CLASS( CConnDlgSelectConnectionPlugin ) : - public CConnectionDialogsNotifBase - { -public: - /** - * NewL function - * @param - - * return CConnDlgSelectConnectionPlugin* - */ - static CConnDlgSelectConnectionPlugin* NewL( - const TBool aResourceFileResponsible ); + static CConnDlgQosPlugin* NewL( const TBool /*aResourceFileResponsible*/ ); /** * RegisterL register the client notifier function @@ -491,36 +314,115 @@ * return - */ void CompleteL( TInt aStatus ); - + }; + + +/** + * New IAP Plugin class + */ +NONSHARABLE_CLASS( CConnDlgNewIapPlugin ) : public CConnectionDialogsNotifBase + { +public: + + /** + * NewL function + * @param - + * return CConnDlgNewIapPlugin* + */ + static CConnDlgNewIapPlugin* NewL( const TBool /*aResourceFileResponsible*/ ); + /** - * Sets the preferred iap into db. - * calls iActivePlugin - * @param aIAPId id of the preferred iap - * @param aDestinationId id of the preferred Destination + * RegisterL register the client notifier function + * @param - + * return TNotifierInfo */ - void SetElementIDL( TUint32 aIAPId, TUint32 aDestinationId ); - -private: + TNotifierInfo RegisterL(); + + /** + * Start the Notifier + * @param aBuffer Buffer + * @param aReplySlot Identifies which message argument to use for the + * reply. This message argument will refer to a + * modifiable descriptor, a TDes8 type, into which data + * can be returned. + * @param aMessage Message + * return - + */ + void StartL( const TDesC8& aBuffer, TInt aReplySlot, + const RMessagePtr2& aMessage ); + + /** + * Cancel() the notifier + * @param - + * return - + */ + void Cancel(); + +public: /** - * Gets user connection info. - * @param aIapId id of the iap - * @param aSnapId id of the destination + * CompleteL the notifier is complete + * @param aStatus status + * return - */ - TInt GetUserConnection( TInt& aIapId, TInt& aSnapId ); - + void CompleteL( TInt aStatus ); + }; + + + +/** + * Connection Selection Plugin class + */ +NONSHARABLE_CLASS( CConnDlgSelectConnectionPlugin ) : + public CConnectionDialogsNotifBase + { +public: + /** + * NewL function + * @param - + * return CConnDlgSelectConnectionPlugin* + */ + static CConnDlgSelectConnectionPlugin* NewL( + const TBool /*aResourceFileResponsible*/ ); + /** - * Gets active connection info. - * @param aIapId id of the iap - * @param aSnapId id of the destination - * @param aBearer bearer type - */ - TInt GetActiveConnection( TInt& aIapId, TInt& aSnapId, TInt& aBearer ); + * RegisterL register the client notifier function + * @param - + * return TNotifierInfo + */ + TNotifierInfo RegisterL(); + + /** + * Start the Notifier + * @param aBuffer Buffer + * @param aReplySlot Identifies which message argument to use for the + * reply. This message argument will refer to a + * modifiable descriptor, a TDes8 type, into which data + * can be returned. + * @param aMessage Message + * return - + */ + void StartL( const TDesC8& /*aBuffer*/, TInt aReplySlot, + const RMessagePtr2& aMessage ); + + /** + * Cancel() the notifier + * @param - + * return - + */ + void Cancel(); + +public: + + /** + * CompleteL the notifier is complete + * @param aStatus status + * return - + */ + void CompleteL( TInt aStatus ); private: TUint32 iElementID; - TPckgBuf iPrefs; // Selected preferences - CActiveSelectConnectionPlugin* iActivePlugin; // pointer to active object }; #endif diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/IAPDialog.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/IAPDialog.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of class CIapDialog. -* -*/ - - -#ifndef __IAPDIALOG_H__ -#define __IAPDIALOG_H__ - - -// INCLUDES -#include -#include - -#include "ExpiryTimerCallback.h" - -// FORWARD DECLARATION -class CConnDlgIapPlugin; -class CConnectionInfoArray; -class CExpiryTimer; - -// CLASS DECLARATION -/** - * Class implementing IAP dialog - */ -NONSHARABLE_CLASS( CIapDialog ) : public CAknListQueryDialog, public MExpiryTimerCallback - { - private: - /** - * CIapDialog constructor - * @param aPlugin plugin pointer - */ - CIapDialog( CConnDlgIapPlugin* aPlugin ); - - /** - * Symbian default constructor. - */ - void ConstructL(); - - - public: - /** - * NewL function - * @param aPlugin plugin pointer - * return CIapDialog* - */ - static CIapDialog* NewL( CConnDlgIapPlugin* aPlugin ); - - /** - * ~CIapDialog destructor - */ - ~CIapDialog(); - - /** - * Exit function OF the CIapDialog - * @param aButtonId button exit id - * @return TBool exit or no - */ - virtual TBool OkToExitL( TInt aButtonId ); - - /** - * from CCoeControl - * @param aKeyEvent Event to handled. - * @param aType Type of the key event. - * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType); - - /** - * Dialog refreshing - */ - void RefreshDialogL( CConnectionInfoArray* aIAP, - TBool aIsReallyRefreshing ); - - /** - * - * @return The value of iFromOkToExit. - */ - inline TBool GetOkToExit(); - - /** - * Dialog expiration timeout callback - */ - void HandleTimedOut(); - - - private: - /** - * PreLayoutDynInitL - * @param - - */ - virtual void PreLayoutDynInitL(); - - - private: - /** - * Sets graphic icons - * @param - - */ - void SetIconsL(); - - - private: // Data - - // Pointer to the plugin, not owned - CConnDlgIapPlugin* iPlugin; - - RArray iIAPIds; - - // For base class, unused. - TInt iDummy; - - TBool iFromOkToExit; ///< closed the dialof from OkToExitL or not - - // Pointer for dialog expiration timer - CExpiryTimer* iExpiryTimer; - }; - - -#include "IapDialog.inl" - -#endif - - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/IapDialog.inl --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/IapDialog.inl Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Inline method definitions of the class IAPDIALOG. -* -* -*/ - - - -#ifndef __IAPDIALOG_H__INL -#define __IAPDIALOG_H__INL - - -// ================= MEMBER FUNCTIONS ======================= -// ---------------------------------------------------------------------------- -// void CIapDialog::GetOkToExit -// ---------------------------------------------------------------------------- -// -TBool CIapDialog::GetOkToExit() - { - return iFromOkToExit; - } - - - -#endif // __IAPDIALOG_H__INL - -// End of File \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/NewIapDialog.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/NewIapDialog.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of class CNewIapDialog. -* -*/ - - -#ifndef __NEWIAPDIALOG_H__ -#define __NEWIAPDIALOG_H__ - - -// INCLUDES -#include -#include -#include -#include "ExpiryTimerCallback.h" - -// FORWARD DECLARATIONS -class CConnDlgNewIapPlugin; -class CExpiryTimer; - -// CLASS DECLARATIONS - -/** - * Class implementing New IAP warning dialog. - */ -NONSHARABLE_CLASS( CNewIapDialog ) : public CAknQueryDialog, public MExpiryTimerCallback - { - public: - - /** - * Constructor the CNewIapDialog class - * @param aPlugin plugin pointer - * @param aConnect connect to the IAP - * @param aPrefs preferences infomation - * @return - - */ - CNewIapDialog( CConnDlgNewIapPlugin* aPlugin, - TBool& aConnect, - const TNewIapConnectionPrefs& aPrefs ); - - /** - * Destructor - */ - virtual ~CNewIapDialog(); - - /** - * CBA handling function - * @param aButtonId button Uid - * @return TBool exit or no - */ - virtual TBool OkToExitL( TInt aButtonId ); - - /** - * Dialog expiration timeout callback - */ - void HandleTimedOut(); - - private: - /** - * PreLayoutDynInitL function - * @param - - * @return - - */ - void PreLayoutDynInitL(); - - private: - // Pointer to the plugin - CConnDlgNewIapPlugin* iPlugin; - - // Specifies way of closing of the dialog. ETrue when 'Yes' or 'Done' - // softkeys pressed. - TBool& iConnect; - - // Selected preferences - const TNewIapConnectionPrefs& iPrefs; - - // Pointer for dialog expiration timer - CExpiryTimer* iExpiryTimer; - }; - - -#endif - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/QosDialog.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/QosDialog.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CQosDialog. -* -*/ - - -#ifndef __QOSDIALOG_H__ -#define __QOSDIALOG_H__ - - -// INCLUDES -#include -#include -#include "ExpiryTimerCallback.h" - -// FORWARD DECLARATIONS -class CConnDlgQosPlugin; -class CExpiryTimer; - -// CLASS DECLARATIONS - -/** - * Class implementing Quality of services dialog. - */ -NONSHARABLE_CLASS( CQosDialog ) : public CAknQueryDialog, public MExpiryTimerCallback - { - public: - /** - * Constructor the CQosDialog class - * @param aPlugin plugin pointer - * @param aBool reconnect to the Qos - * @return - - */ - CQosDialog( CConnDlgQosPlugin* aPlugin, TBool& aBool ); - - /** - * Exit function the CQosDialog - * @param aButtonId plugin pointer - * @param aBool reconnect to the IAP - * @return TBool exit or no - */ - virtual TBool OkToExitL( TInt aButtonId ); - - /** - * Dialog expiration timeout callback - */ - void HandleTimedOut(); - - /** - * Destructor - */ - virtual ~CQosDialog(); - - - private: - /** - * PreLayoutDynInitL - * @param - - */ - virtual void PreLayoutDynInitL(); - - - private: - // Pointer to the plugin - CConnDlgQosPlugin* iPlugin; - - // Specifies way of closing of the dialog. ETrue when 'Yes' or 'Done' - // softkeys pressed. - TBool& iBool; - - // Pointer for dialog expiration timer - CExpiryTimer* iExpiryTimer; - - }; - -#endif // __QOSDIALOG_H__ - - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/ReconnectDialog.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/ReconnectDialog.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CReconnectDialog. -* -*/ - - -#ifndef __RECONNECTDIALOG_H__ -#define __RECONNECTDIALOG_H__ - -// INCLUDES -#include -#include -#include "ExpiryTimerCallback.h" - -// FORWARD DECLARATIONS -class CConnDlgReconnectPlugin; -class CExpiryTimer; - -// CLASS DECLARATIONS - -/** - * Class implementing Reconnect dialog - */ -NONSHARABLE_CLASS( CReconnectDialog ) : public CAknQueryDialog, public MExpiryTimerCallback - { - public: - /** - * Constructor of the CReconnetDialog class - * @param aPlugin plugin pointer - * @param aBool reconnect to the IAP - * @return - - */ - CReconnectDialog( CConnDlgReconnectPlugin* aPlugin, TBool& aBool ); - - /** - * Exit function the CReconnectDialog - * @param aButtonId plugin pointer - * @param aBool reconnect to the IAP - * @return TBool exit or no - */ - virtual TBool OkToExitL( TInt aButtonId ); - - /** - * Dialog expiration timeout callback - */ - void HandleTimedOut(); - - - /** - * Destructor - */ - virtual ~CReconnectDialog(); - - - private: - /** - * PreLayoutDynInitL - * @param - - */ - virtual void PreLayoutDynInitL(); - - - private: - // Pointer to the plugin - CConnDlgReconnectPlugin* iPlugin; - - // Specifies way of closing of the dialog. ETrue when 'Yes' or 'Done' - // softkeys pressed. - TBool& iBool; - - // Pointer for dialog expiration timer - CExpiryTimer* iExpiryTimer; - }; - -#endif // __RECONNECTDIALOG_H__ - - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/SelectConnectionDialog.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/SelectConnectionDialog.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,181 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of class CSelectConnectionDialog. -* -*/ - - -#ifndef __SELECTCONNECTIONDIALOG_H__ -#define __SELECTCONNECTIONDIALOG_H__ - - -// INCLUDES -#include -#include -#include "ExpiryTimerCallback.h" - - -// FORWARD DECLARATION -class CConnDlgSelectConnectionPlugin; -class CConnectionInfoArray; -class MEikSrvNotifierBase2; -class CActiveSelectExplicit; -class CExpiryTimer; - -// CLASS DECLARATION -/** - * Class implementing SelectConnection dialog - */ -NONSHARABLE_CLASS( CSelectConnectionDialog ) : public CAknListQueryDialog, public MExpiryTimerCallback - { - private: - /** - * CSelectConnectionDialog constructor - * @param aPlugin plugin pointer - */ - CSelectConnectionDialog( MEikSrvNotifierBase2* aPlugin, - TInt aRefreshInterval, - TUint32 aBearerSet, - TBool aIsWLANFeatureSupported, - TUint aDefaultCMId ); - - /** - * Symbian default constructor. - */ - void ConstructL(); - - - public: - /** - * NewL function - * @param aPlugin plugin pointer - * return CSelectConnectionDialog* - */ - static CSelectConnectionDialog* NewL( MEikSrvNotifierBase2* aPlugin, - TInt aRefreshInterval, - TUint32 aBearerSet, - TBool aIsWLANFeatureSupported, - TUint aDefaultCMId ); - - /** - * ~CSelectConnectionDialog destructor - */ - ~CSelectConnectionDialog(); - - /** - * Exit function OF the CSelectConnectionDialog - * @param aButtonId button exit id - * @return TBool exit or no - */ - virtual TBool OkToExitL( TInt aButtonId ); - - void PrepareAndRunLD( CConnectionInfoArray* aIAP, - CArrayPtr< CGulIcon >* aIcons, - TBool aIsReallyRefreshing, - const TInt aHighlightedItem ); - - /** - * Dialog refreshing - */ - void RefreshDialogL( CConnectionInfoArray* aIAP, - CArrayPtr< CGulIcon >* aIcons, - TBool aIsReallyRefreshing, - const TInt aHighlightedItem ); - - /** - * - * @return The value of iFromOkToExit. - */ - inline TBool GetOkToExit(); - - /** - * Dialog expiration timeout callback - */ - void HandleTimedOut(); - - /** - * From CCoeControl Handle key events. When a key event occurs, - * CONE calls this function for each control on the control stack, - * until one of them returns EKeyWasConsumed to indicate that it processed the key event. - * @param aKeyEvent The key event. - * @param aType The type of the event: EEventKey, EEventKeyUp or EEventKeyDown. - * @return Indicates whether or not the key event was used by this control. - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ); - - TInt RunLD(); - - void SetElementIDL( TUint32 aIAPId ); - - void CompleteL( TInt aStatus ); - - void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); - - void HandlePointerEventL(const TPointerEvent& aPointerEvent); - - private: - /** - * PreLayoutDynInitL - * @param - - */ - virtual void PreLayoutDynInitL(); - - /** - * Initialize menu pane. - * @param aResourceId Menu pane resource id. - * @param CEikMenuPane Menu pane. - */ - void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); - - void ProcessCommandL( TInt aCommand ); - - - private: // Data - - // Pointer to the plugin, not owned - CConnDlgSelectConnectionPlugin* iPlugin; - - RArray iIapIDs; - RArray iDestIDs; - - // For base class, unused. - TInt iDummy; - - TBool iFromOkToExit; ///< closed the dialof from OkToExitL or not - - CArrayPtr< CGulIcon >* iIcons; - - // pointer to active object - CActiveSelectExplicit* iActiveSelectExplicit; - TInt iRefreshInterval; - - // Selected preferences - TUint32 iBearerSet; - - TBool iIsWLANFeatureSupported; - - TUint iDefaultCMId; - - // Pointer for dialog expiration timer - CExpiryTimer* iExpiryTimer; - }; - - -#include "SelectConnectionDialog.inl" - -#endif - - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/SelectConnectionDialog.inl --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/SelectConnectionDialog.inl Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Inline method definitions of the class SelectConnectionDIALOG. -* -* -*/ - - - -#ifndef __SELECTCONNECTIONDIALOG_H__INL -#define __SELECTCONNECTIONDIALOG_H__INL - - -// ================= MEMBER FUNCTIONS ======================= -// ---------------------------------------------------------------------------- -// void CSelectConnectionDialog::GetOkToExit -// ---------------------------------------------------------------------------- -// -TBool CSelectConnectionDialog::GetOkToExit() - { - return iFromOkToExit; - } - - - -#endif // __SELECTCONNECTIONDIALOG_H__INL - -// End of File \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/SelectExplicitDialog.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/SelectExplicitDialog.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of class CSelectExplicitDialog. -* -*/ - - -#ifndef __SELECTEXPLICITDIALOG_H__ -#define __SELECTEXPLICITDIALOG_H__ - - -// INCLUDES -#include -#include -#include "ExpiryTimerCallback.h" - -// FORWARD DECLARATION -class CConnectionInfoArray; -class CSelectConnectionDialog; -class CExpiryTimer; - -// CLASS DECLARATION -/** - * Class implementing SelectExplicit dialog - */ -NONSHARABLE_CLASS( CSelectExplicitDialog ) : public CAknListQueryDialog, public MExpiryTimerCallback - { - private: - /** - * CSelectExplicitDialog constructor - * @param aPlugin plugin pointer - */ - CSelectExplicitDialog( CSelectConnectionDialog* aCallerDialog ); - - - /** - * Symbian default constructor. - */ - void ConstructL(); - - - public: - /** - * NewL function - * @param aPlugin plugin pointer - * return CSelectExplicitDialog* - */ - static CSelectExplicitDialog* NewL( - CSelectConnectionDialog* aCallerDialog ); - - - /** - * ~CSelectExplicitDialog destructor - */ - ~CSelectExplicitDialog(); - - /** - * Exit function OF the CSelectExplicitDialog - * @param aButtonId button exit id - * @return TBool exit or no - */ - virtual TBool OkToExitL( TInt aButtonId ); - - void PrepareAndRunLD( CConnectionInfoArray* aIAP, - CArrayPtr< CGulIcon >* aIcons, - TBool aIsReallyRefreshing ); - - /** - * Dialog refreshing - */ - void RefreshDialogL( CConnectionInfoArray* aIAP, - CArrayPtr< CGulIcon >* aIcons, - TBool aIsReallyRefreshing ); - - /** - * - * @return The value of iFromOkToExit. - */ - inline TBool GetOkToExit(); - - /** - * from CCoeControl - * @param aKeyEvent Event to handled. - * @param aType Type of the key event. - * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType); - - /** - * Dialog expiration timeout callback - */ - void HandleTimedOut(); - private: - /** - * PreLayoutDynInitL - * @param - - */ - virtual void PreLayoutDynInitL(); - - - private: // Data - - // Pointer to the plugin, not owned - CSelectConnectionDialog* iCallerDialog; - - RArray iIAPIds; - - TBool iFromOkToExit; ///< closed the dialof from OkToExitL or not - - TInt iDummy; - - CArrayPtr< CGulIcon >* iIcons; - - // Pointer for dialog expiration timer - CExpiryTimer* iExpiryTimer; - - }; - - -#include "SelectExplicitDialog.inl" - -#endif - - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/SelectExplicitDialog.inl --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/SelectExplicitDialog.inl Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Inline method definitions of the class SelectExplicitDialog. -* -* -*/ - - - -#ifndef __SELECTEXPLICITDIALOG__INL -#define __SELECTEXPLICITDIALOG__INL - - -// ================= MEMBER FUNCTIONS ======================= -// ---------------------------------------------------------------------------- -// void CSelectExplicitDialog::GetOkToExit -// ---------------------------------------------------------------------------- -// -TBool CSelectExplicitDialog::GetOkToExit() - { - return iFromOkToExit; - } - - -#endif // __SELECTEXPLICITDIALOG__INL - -// End of File \ No newline at end of file diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/inc/sortsnaputils.h --- a/connectionutilities/ConnectionDialogs/cconndlg/inc/sortsnaputils.h Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of TSortSnapUtils -* -*/ - - - -#ifndef __SORTSNAPUTILS_H__ -#define __SORTSNAPUTILS_H__ - - -// INCLUDES -#include -#include -#include - - -// CLASS DECLARATION - -/** - * TSortSnapUtils class, - * utility class to use P&S mechanism to - * avoid circular reference with MPM - */ -class TSortSnapUtils - { - public: - enum TSortSnapUtilsState - { - EUninitialised = 0, - EUseMPM, - EUsePubSub - } ; - - /** - * Constructor - */ - TSortSnapUtils( RMPM& aMPM ); - - /** - * Destructor - */ - ~TSortSnapUtils(); - - void GetDestIdArrayL( RCmManagerExt& aCmManagerExt, RArray& aDestArray ); - - /** - * GetSortSNAPDataL - * Gets snap data - * Reads P&S values first, then uses MPM if - * unsuccessful. This is needed to avoid a deadlock situation - * with MPM. - * @param aSnapData - iSnap attribute of TMpmSnapPubSubFormat is the - * input parameter, iSortedIaps attribute holds the iap ids if - * returned with KErrNone - */ - TInt GetSortSnapData( TUint32 aSnapId, TMpmSnapBuffer& aSnapBuffer ); - - private: - void InitDestIdArray(); - - private: - TUint32 iSnapIdArray[KMPMSortSnapMaxKey]; - TInt iSnapCount; - TSortSnapUtilsState iSSUState; - RMPM& iMPM; - }; - - -#endif - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/src/ActiveBase.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/src/ActiveBase.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,195 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of base CActive class with a timer -* -*/ - - -// INCLUDE FILES -#include "ActiveBase.h" -#include "ConnectionDialogsLogger.h" - -/*#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -*/ - - - -/////////////////////////////////////////////////////////////////////////////// - -// --------------------------------------------------------- -// CActiveBase::CActiveBase() -// --------------------------------------------------------- -// -CActiveBase::CActiveBase() -: CActive( EPriorityUserInput ) - { - } - - -// --------------------------------------------------------- -// CActiveBase* CActiveBase::NewL() -// --------------------------------------------------------- -// -CActiveBase* CActiveBase::NewL() - { - CLOG_ENTERFN( "CActiveBase::NewL " ); - - CActiveBase* self = new ( ELeave ) CActiveBase(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - CLOG_LEAVEFN( "CActiveBase::NewL " ); - - return self; - } - - -// --------------------------------------------------------- -// CActiveBase::ConstructL() -// --------------------------------------------------------- -// -void CActiveBase::ConstructL() - { - CActiveScheduler::Add( this ); - iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); - } - - -// --------------------------------------------------------- -// CActiveBase::~CActiveBase() -// --------------------------------------------------------- -// -CActiveBase::~CActiveBase() - { - Cancel(); - } - - -// --------------------------------------------------------- -// CActiveBase::Cancel() -// --------------------------------------------------------- -// -void CActiveBase::Cancel() - { - StopTimer(); - CActive::Cancel(); - } - - -// --------------------------------------------------------- -// CActiveBase::DoCancel() -// --------------------------------------------------------- -// -void CActiveBase::DoCancel() - { - } - - -// --------------------------------------------------------- -// CActiveBase::RunL() -// --------------------------------------------------------- -// -void CActiveBase::RunL() - { - } - - -// --------------------------------------------------------- -// CActiveBase::StartTimerL -// --------------------------------------------------------- -// -void CActiveBase::StartTimerL( TInt aTickInterval ) - { - CLOG_ENTERFN( "CActiveBase::StartTimerL " ); - - if( !iPeriodic ) - { - iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); - } - - iPeriodic->Start( aTickInterval, aTickInterval, TCallBack( Tick, this ) ); - - CLOG_LEAVEFN( "CActiveBase::StartTimerL " ); - } - - -// --------------------------------------------------------- -// CActiveBase::StopTimer -// --------------------------------------------------------- -// -void CActiveBase::StopTimer() - { - CLOG_ENTERFN( "CActiveBase::StopTimer " ); - - if( iPeriodic ) - { - CLOG_WRITE( "iPeriodic" ); - iPeriodic->Cancel(); - CLOG_WRITE( "Cancel" ); - - delete iPeriodic; - CLOG_WRITE( "delete" ); - - iPeriodic = NULL; - } - - CLOG_LEAVEFN( "CActiveBase::StopTimer " ); - } - - -// --------------------------------------------------------- -// CActiveBase::Tick -// --------------------------------------------------------- -// -TInt CActiveBase::Tick( TAny* aObject ) - { - CLOG_ENTERFN( "CActiveBase::Tick " ); - - CActiveBase* myself = static_cast( aObject ); - - if ( myself->iStatus == KErrCancel ) - { - CLOG_WRITE( "iStatus == KErrCancel" ); - myself->StopTimer(); - } - else - { - CLOG_WRITE( "iStatus != KErrCancel" ); - - myself->SetActive(); - myself->iClientStatus = &( myself->iStatus ); - *( myself->iClientStatus ) = KRequestPending; - - User::RequestComplete( myself->iClientStatus, KErrNone ); - } - - CLOG_LEAVEFN( "CActiveBase::Tick " ); - - return 1; - } - - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/src/ActiveIapPlugin.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/src/ActiveIapPlugin.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,230 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of plugins (base & all derived). -* -*/ - - -// INCLUDE FILES -#include "ActiveIapPlugin.h" -#include "IAPDialog.h" -#include "ConnectionInfo.h" -#include "ConnectionInfoArray.h" -#include "CConnDlgPrivateCRKeys.h" -#include "ConnectionDialogsLogger.h" - -#include -#include -#include -#ifndef __WINS__ -#include -#endif -#include - -#include - - -/////////////////////////////////////////////////////////////////////////////// - -// --------------------------------------------------------- -// CActiveCConnDlgIapPlugin::CActiveCConnDlgIapPlugin() -// --------------------------------------------------------- -// -CActiveCConnDlgIapPlugin::CActiveCConnDlgIapPlugin( - CConnDlgIapPlugin* aPlugin, - const TConnectionPrefs& aPrefs ) -: CActiveIAPListing( aPrefs ), - iPlugin( aPlugin ), - isDialogDeleting( EFalse ) - { - } - - -// --------------------------------------------------------- -// CActiveCConnDlgIapPlugin* CActiveCConnDlgIapPlugin::NewL() -// --------------------------------------------------------- -// -CActiveCConnDlgIapPlugin* CActiveCConnDlgIapPlugin::NewL( - CConnDlgIapPlugin* aPlugin, - const TConnectionPrefs& aPrefs ) - { - CLOG_ENTERFN( "CActiveCConnDlgIapPlugin::NewL " ); - - CActiveCConnDlgIapPlugin* self = - new ( ELeave ) CActiveCConnDlgIapPlugin( aPlugin, - aPrefs ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - CLOG_LEAVEFN( "CActiveCConnDlgIapPlugin::NewL " ); - - return self; - } - - -// --------------------------------------------------------- -// CActiveCConnDlgIapPlugin::ConstructL() -// --------------------------------------------------------- -// -void CActiveCConnDlgIapPlugin::ConstructL() - { - BaseConstructL(); - } - -// --------------------------------------------------------- -// CActiveCConnDlgIapPlugin::~CActiveCConnDlgIapPlugin() -// --------------------------------------------------------- -// -CActiveCConnDlgIapPlugin::~CActiveCConnDlgIapPlugin() - { - CLOG_ENTERFN( "CActiveCConnDlgIapPlugin::~CActiveCConnDlgIapPlugin" ); - - Cancel(); - - CLOG_LEAVEFN( "CActiveCConnDlgIapPlugin::~CActiveCConnDlgIapPlugin" ); - } - - -// --------------------------------------------------------- -// CActiveCConnDlgIapPlugin::Cancel() -// --------------------------------------------------------- -// -void CActiveCConnDlgIapPlugin::Cancel() - { - CLOG_ENTERFN( "CActiveCConnDlgIapPlugin::Cancel" ); - - CActiveIAPListing::Cancel(); - - CLOG_WRITE( "Returned from CActiveIAPListing::Cancel" ); - - if( iDialog && !( iDialog->GetOkToExit() ) ) - { - CLOG_WRITEF( _L( "iDialog->GetOkToExit() : %b" ), iDialog->GetOkToExit() ); - delete iDialog; - iDialog = NULL; - } - - CLOG_LEAVEFN( "CActiveCConnDlgIapPlugin::Cancel" ); - } - - -// --------------------------------------------------------- -// CActiveCConnDlgIapPlugin::DoCancel() -// --------------------------------------------------------- -// -void CActiveCConnDlgIapPlugin::DoCancel() - { - CLOG_ENTERFN( "CActiveCConnDlgIapPlugin::DoCancel " ); - - if( isDialogDeleting ) - { - CLOG_WRITE( "isDialogDeleting" ); - - delete iDialog; - iDialog = NULL; - - isDialogDeleting = EFalse; - } - - CLOG_LEAVEFN( "CActiveCConnDlgIapPlugin::DoCancel " ); - } - - -// --------------------------------------------------------- -// CActiveCConnDlgIapPlugin::RunL() -// --------------------------------------------------------- -// -void CActiveCConnDlgIapPlugin::RunL() - { - CLOG_ENTERFN( "CActiveCConnDlgIapPlugin::RunL " ); - - CLOG_WRITEF( _L( "iStatus.Int() : %d" ), iStatus.Int() ); - CLOG_WRITEF( _L( "&iStatus : %d" ), &iStatus ); - - if( iStatus == KErrNone ) - { - - if( iIAPs ) // if iIAPs has been created - { - // merge arrays and sort - MergeArraysL( R_WLAN_SEARCH_FOR_NETWORKS ); - - if ( iDialog ) // if dialog has been created - { - iDialog->RefreshDialogL( iActIAPs, ETrue ); - } - else - { - TInt interval = 0; - if ( iIsWLANFeatureSupported ) - { - interval = GetRefreshInterval(); - CLOG_WRITEF( _L( "interval : %d" ), interval ); - - if ( iWaitDialog ) - { - iWaitDialog->ProcessFinishedL(); - delete iWaitDialog; - iWaitDialog = NULL; - } - } - - iDialog = CIapDialog::NewL( iPlugin ); - iDialog->PrepareLC( R_LIST_QUERY ); - iDialog->RefreshDialogL( iActIAPs, EFalse ); - iDialog->RunLD(); - - if ( iIsWLANFeatureSupported ) - { - if( interval ) - { - StartTimerL( interval ); - } - } - } // else - } // if iIAPs - else - { - CreateArraysL( R_WLAN_SEARCH_FOR_NETWORKS, EFalse, 0 ); - } - } - - CLOG_LEAVEFN( "CActiveCConnDlgIapPlugin::RunL " ); - - } - - -// --------------------------------------------------------- -// CActiveCConnDlgIapPlugin::StartSearchIAPsL() -// --------------------------------------------------------- -// -void CActiveCConnDlgIapPlugin::StartSearchIAPsL() - { - CActiveIAPListing::BaseStartSearchIAPsL( R_SEARCHING_WAIT_NOTE ); - } - - -// --------------------------------------------------------- -// CActiveCConnDlgIapPlugin::GetRefreshInterval() -// --------------------------------------------------------- -// -TInt CActiveCConnDlgIapPlugin::GetRefreshInterval() - { - return CActiveIAPListing::GetRefreshInterval( KCRUidCConnDlg, - KCConnDlgScanInterval ); - } - - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/src/ActiveSelectConnectionPlugin.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/src/ActiveSelectConnectionPlugin.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,819 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of plugins (base & all derived). -* -*/ - - -// INCLUDE FILES -#include "ActiveSelectConnectionPlugin.h" -#include "SelectConnectionDialog.h" -#include "ConnectionDialogsLogger.h" -#include "ConnectionInfo.h" -#include "ConnectionInfoArray.h" -#include "sortsnaputils.h" -#include "cdbcols.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#else -#include -#include -#endif - -#include -#include - -// CONSTANTS - -// Category for all panics in this module -_LIT( KASCPCategory, "Select Connection Plugin" ); - -LOCAL_D const TInt KIconsGranularity = 4; -LOCAL_D const TInt KArrayGranularity = 4; -LOCAL_D const TInt KMaxEntryLength = CommsDat::KMaxTextLength*2 + 20; -/** -* For iPeriodic Timer, 60 seconds -*/ -LOCAL_C const TInt KTickDefaultInterval = 60000000; -LOCAL_C const TInt KMicrosecondsToSecondsMultiplier = 1000000; - -// background scan automatic scanning value -static const TUint KWlanBgScanIntervalAuto = 0xffffffff; - -using namespace CMManager; - - -/////////////////////////////////////////////////////////////////////////////// - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::CActiveSelectConnectionPlugin() -// --------------------------------------------------------- -// -CActiveSelectConnectionPlugin::CActiveSelectConnectionPlugin( - MEikSrvNotifierBase2* aPlugin, - const TUint32 aElementId, - TUint32 aBearerSet ) -: iBearerSet( aBearerSet ), - iReqBearerSet( aBearerSet ), - iElementId( aElementId ), - iPlugin( aPlugin ), - iDialogConn( NULL ), - iIsWLANFeatureSupported( EFalse ), - iRefreshInterval( KTickDefaultInterval ), - iHighlightedItem( -1 ), - iDefaultDestId( 0 ), - iDefaultCMId( 0 ) - { - } - - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin* CActiveSelectConnectionPlugin::NewL() -// --------------------------------------------------------- -// -CActiveSelectConnectionPlugin* CActiveSelectConnectionPlugin::NewL( - MEikSrvNotifierBase2* aPlugin, - const TUint32 aElementId, - TUint32 aBearerSet ) - { - CLOG_ENTERFN( "CActiveSelectConnectionPlugin::NewL " ); - - CActiveSelectConnectionPlugin* self = new ( ELeave ) - CActiveSelectConnectionPlugin( aPlugin, aElementId, - aBearerSet ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - CLOG_LEAVEFN( "CActiveSelectConnectionPlugin::NewL " ); - - return self; - } - - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::ConstructL() -// --------------------------------------------------------- -// -void CActiveSelectConnectionPlugin::ConstructL() - { - CLOG_ENTERFN( "CActiveSelectConnectionPlugin::ConstructL " ); - - CActiveBase::ConstructL(); - - FeatureManager::InitializeLibL(); - - iIsWLANFeatureSupported = FeatureManager::FeatureSupported( - KFeatureIdProtocolWlan ); - - FeatureManager::UnInitializeLib(); - - iBearerSet |= ECommDbBearerVirtual; // To get also VPN APs - -#ifdef __WINS__ - iBearerSet |= ECommDbBearerLAN; // To add Ethernet AP -#endif // __WINS__ - - if ( iIsWLANFeatureSupported ) - { - CLOG_WRITE( "WLAN Supported!" ); - iBearerSet |= ECommDbBearerWLAN; // To add WLan AP - iRefreshInterval = GetRefreshIntervalL(); - } - - - - iItems = new( ELeave ) CConnectionInfoArray(); - iIcons = new( ELeave ) CAknIconArray( KIconsGranularity ); - - iCmManagerExt.OpenL(); - - TInt ret = iMPM.LaunchServer(); - if ( ret != KErrAlreadyExists ) - { - User::LeaveIfError( ret ); - } - CLOG_LEAVEFN( "CActiveSelectConnectionPlugin::ConstructL " ); - } - - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::~CActiveSelectConnectionPlugin() -// --------------------------------------------------------- -// -CActiveSelectConnectionPlugin::~CActiveSelectConnectionPlugin() - { - CLOG_ENTERFN( "~CActiveSelectConnectionPlugin" ); - Cancel(); - - if ( iItems ) - { - iItems->ResetAndDestroy(); - } - delete iItems; - iItems = NULL; - - iCmManagerExt.Close(); - iMPM.Close(); - - CLOG_LEAVEFN( "~CActiveSelectConnectionPlugin" ); - } - - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::Cancel() -// --------------------------------------------------------- -// -void CActiveSelectConnectionPlugin::Cancel() - { - StopTimer(); - CActive::Cancel(); - - if( iDialogConn && !( iDialogConn->GetOkToExit() ) ) - { - CLOG_WRITEF( _L( "iDialogConn->GetOkToExit() : %b" ), iDialogConn->GetOkToExit() ); - delete iDialogConn; - iDialogConn = NULL; - } - } - - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::DoCancel() -// --------------------------------------------------------- -// -void CActiveSelectConnectionPlugin::DoCancel() - { - } - - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::RunL() -// --------------------------------------------------------- -// -void CActiveSelectConnectionPlugin::RunL() - { - CLOG_ENTERFN( "CActiveSelectConnectionPlugin::RunL " ); - - if( iStatus == KErrNone ) - { - BuildConnectionListL(); - iDialogConn->RefreshDialogL( iItems, iIcons, ETrue, iHighlightedItem ); - } - - CLOG_LEAVEFN( "CActiveSelectConnectionPlugin::RunL " ); - } - - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::ShowSelectConnectionL() -// --------------------------------------------------------- -// -void CActiveSelectConnectionPlugin::ShowSelectConnectionL() - { - CLOG_ENTERFN( "CActiveSelectConnectionPlugin::ShowSelectConnectionL" ); - - BuildConnectionListL(); - - iDialogConn = CSelectConnectionDialog::NewL( iPlugin, iRefreshInterval, - iBearerSet, - iIsWLANFeatureSupported, - iDefaultCMId ); - - iDialogConn->PrepareAndRunLD( iItems, iIcons, EFalse, iHighlightedItem ); - - if( iRefreshInterval ) - { - StartTimerL( iRefreshInterval ); - } - - CLOG_LEAVEFN( "CActiveSelectConnectionPlugin::ShowSelectConnectionL" ); - } - - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::BuildConnectionListL() -// --------------------------------------------------------- -// -void CActiveSelectConnectionPlugin::BuildConnectionListL() - { - CLOG_ENTERFN( "CActiveSelectConnectionPlugin::BuildConnectionListL " ); - - // iItems and iIcons are allocated at construction and deallocated at - // destruction. Unless memory allocation has failed, they cannot be NULL. - __ASSERT_ALWAYS( iItems, User::Panic( KASCPCategory, KErrGeneral ) ); - __ASSERT_ALWAYS( iIcons, User::Panic( KASCPCategory, KErrGeneral ) ); - - iItems->ResetAndDestroy(); - iIcons->ResetAndDestroy(); - - _LIT( KDriveZ, "z:" ); // ROM folder - // Name of the MBM file containing icons - _LIT( KManagerIconFilename, "cmmanager.mbm" ); - - TFileName iconsFileName; - - iconsFileName.Append( KDriveZ ); - iconsFileName.Append( KDC_APP_BITMAP_DIR ); - iconsFileName.Append( KManagerIconFilename ); - -// iIcons->AppendL( AknsUtils::CreateGulIconL( AknsUtils::SkinInstance(), -// KAknsIIDQgnIndiCbHotAdd, -// iconsFileName, -// EMbmCmmanagerQgn_indi_cb_hot_add, -// EMbmCmmanagerQgn_indi_cb_hot_add_mask ) ); - - // Create color icon for marking the default connection - // - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - CGulIcon* icon = CGulIcon::NewLC(); - - AknsUtils::CreateColorIconL( AknsUtils::SkinInstance(), - KAknsIIDQgnIndiCbHotAdd, - KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13, - bitmap, - mask, - iconsFileName, - EMbmCmmanagerQgn_indi_cb_hot_add, - EMbmCmmanagerQgn_indi_cb_hot_add_mask, - KRgbBlack ); - - icon->SetBitmap( bitmap ); - icon->SetMask( mask ); - iIcons->AppendL( icon ); - - CleanupStack::Pop( icon ); - - TCmDefConnValue defaultConnSetting; - - iCmManagerExt.ReadDefConnL( defaultConnSetting ); - if ( defaultConnSetting.iType == ECmDefConnDestination ) - { - iDefaultDestId = defaultConnSetting.iId; - } - else if ( defaultConnSetting.iType == ECmDefConnConnectionMethod ) - { - iDefaultCMId = defaultConnSetting.iId; - } - - if ( iIsWLANFeatureSupported && (iReqBearerSet & ECommDbBearerWLAN) ) - { - AddSearchForWLanItemL(); - } - - AddDestinationItemsL(); - - CLOG_WRITEF( _L( "iItems count: %d" ), iItems->Count() ); - CLOG_LEAVEFN( "CActiveSelectConnectionPlugin::BuildConnectionListL " ); - } - - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::AddSearchForWLanItemL -// --------------------------------------------------------- -// -void CActiveSelectConnectionPlugin::AddSearchForWLanItemL() - { - TUint32 easyWlanId = iCmManagerExt.EasyWlanIdL(); - if ( easyWlanId ) - { - CLOG_WRITEF( _L( "easyWlanId %d" ), easyWlanId ); - - RCmConnectionMethodExt cmConnMethodExt; - TRAPD( err, cmConnMethodExt = iCmManagerExt.ConnectionMethodL( - easyWlanId ) ); - if ( err == KErrNone ) - { - CleanupClosePushL( cmConnMethodExt ); - - CGulIcon* wlanIcon = ( CGulIcon* ) - cmConnMethodExt.GetIntAttributeL( ECmBearerIcon ); - CleanupStack::PopAndDestroy(); // cmConnMethodExt - - if ( wlanIcon ) - { - CleanupStack::PushL( wlanIcon ); - iIcons->AppendL( wlanIcon ); - - // icon array took over ownership - CleanupStack::Pop( wlanIcon ); - - // +1 because it "Zero terminates" the string - TBuf nameSearch; - _LIT( KIconIdNameEmpty, "%d\t%s\t" ); - - HBufC *msg = StringLoader::LoadL( R_WLAN_EASY_WLAN ); - nameSearch = *msg; - nameSearch.ZeroTerminate(); - delete msg; - - TBuf temp; - temp.FillZ( KMaxEntryLength ); - temp.Format( KIconIdNameEmpty, iIcons->Count()-1, - nameSearch.Ptr() ); - - CConnectionInfo* conIn = CConnectionInfo::NewL( easyWlanId, - 0, temp ); - CleanupStack::PushL( conIn ); - iItems->AppendL( conIn ); - CleanupStack::Pop( conIn ); - iHighlightedItem = 0; - } - } - } - } - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::AddDestinationItemsL -// --------------------------------------------------------- -// -void CActiveSelectConnectionPlugin::AddDestinationItemsL() - { - /* TInt errConnect = iMPM.Connect(); - CLOG_WRITEF( _L( "errConnect = %d" ), errConnect ); - if ( errConnect == KErrNone ) - {*/ - TSortSnapUtils sortSnapUtils( iMPM ); - RArray destIdArray( KArrayGranularity ); - TRAPD( err, sortSnapUtils.GetDestIdArrayL( iCmManagerExt, destIdArray ) ); - //TRAPD( err, iCmManagerExt.AllDestinationsL( destIdArray ) ); - // Append the destinations to the list - CLOG_WRITEF( _L( "GetDestIdArrayL returned with %d" ), err ); - if ( err == KErrNone ) - { - CleanupClosePushL( destIdArray ); - - CLOG_WRITEF( _L( "destIdArray.Count() = %d" ), destIdArray.Count() ); - for ( TInt i = 0; i < destIdArray.Count(); i++ ) - { - RCmDestinationExt cmDestExt = iCmManagerExt.DestinationL( - destIdArray[i] ); - CleanupClosePushL( cmDestExt ); - if ( /*cmDestExt.ElementId() != iElementId &&*/ - !cmDestExt.MetadataL( ESnapMetadataHiddenAgent ) ) - { - CLOG_WRITEF( _L( "Destination id %d, Total number of methods %d" ), - destIdArray[i], cmDestExt.ConnectionMethodCount() ); - -#ifdef _DEBUG - for ( TInt j = 0; - j < cmDestExt.ConnectionMethodCount(); j++ ) - { - RCmConnectionMethodExt cmConnMethodExt; - TRAP( err, cmConnMethodExt = - cmDestExt.ConnectionMethodL( j ) ); - if ( err == KErrNone ) - { - CleanupClosePushL( cmConnMethodExt ); - HBufC* bufMethod = - cmConnMethodExt.GetStringAttributeL( ECmName ); - CleanupStack::PushL( bufMethod ); - TBuf nameMethod; - nameMethod = *bufMethod; - nameMethod.ZeroTerminate(); - - /*CLOG_WRITEF( _L( "ConnMethod id %d, Method name %s" ), - cmConnMethodExt.GetIntAttributeL( ECmIapId ), - nameMethod.Ptr() );*/ - - CleanupStack::PopAndDestroy( bufMethod ); - CleanupStack::PopAndDestroy(); // cmConnMethodExt - } - } -#endif - - AddDestinationItemL( cmDestExt, destIdArray[i], i == 0, - destIdArray[i] == iDefaultDestId, - sortSnapUtils ); - } - CleanupStack::PopAndDestroy(); // cmDestExt - } - CleanupStack::PopAndDestroy(); // destIdArray - } - AddUncategorizedItemL( sortSnapUtils ); -/* }*/ - } - - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::AddDestinationItemL -// --------------------------------------------------------- -// -void CActiveSelectConnectionPlugin::AddDestinationItemL( - RCmDestinationExt aDestination, - TUint32 aDestId, - TBool aFirstItem, - TBool aDefaultDest, - TSortSnapUtils& aSortSnapUtils ) - { - TMpmSnapBuffer list; - - TInt errMPM = aSortSnapUtils.GetSortSnapData( aDestId, list ); - CLOG_WRITEF( _L( "errMPM = %d. list.Count() = %d" ), errMPM, list.Count() ); - - if ( errMPM == KErrNone ) - { - for ( TInt numCM = 0; numCM < list.Count(); numCM++ ) - { - RCmConnectionMethodExt cmConnMethodExt; - TRAPD( err, cmConnMethodExt = iCmManagerExt.ConnectionMethodL( - list.iIapId[numCM] ) ); - - CLOG_WRITEF( _L( "Trapped err = %d" ), err ); - - if ( err == KErrNone ) - { - CleanupClosePushL( cmConnMethodExt ); - if ( iBearerSet & cmConnMethodExt.GetIntAttributeL( - ECmCommsDBBearerType ) ) - { - HBufC* bufBest = cmConnMethodExt.GetStringAttributeL( - ECmName ); - - CleanupStack::PopAndDestroy(); // cmConnMethodExt - CleanupStack::PushL( bufBest ); - - _LIT( KIconIdNameBest, "%d\t%s\t\"%s\"" ); - _LIT( KIconIdNameBestDefaultConn, "%d\t%s\t\"%s\"\t0" ); - - TBuf nameBest; - nameBest = *bufBest; - nameBest.ZeroTerminate(); - CleanupStack::PopAndDestroy( bufBest ); - - TBuf nameDest; - HBufC* name = aDestination.NameLC(); - nameDest = *name; - nameDest.ZeroTerminate(); - CleanupStack::PopAndDestroy( name ); - - CGulIcon* destIcon = aDestination.IconL(); - if ( destIcon ) - { - CleanupStack::PushL( destIcon ); - iIcons->AppendL( destIcon ); - - // icon array took over ownership - CleanupStack::Pop( destIcon ); - - TBuf temp; - temp.FillZ( KMaxEntryLength ); - if ( aDefaultDest ) - { - temp.Format( KIconIdNameBestDefaultConn, - iIcons->Count()-1, - nameDest.Ptr(), nameBest.Ptr() ); - } - else - { - temp.Format( KIconIdNameBest, - iIcons->Count()-1, - nameDest.Ptr(), nameBest.Ptr() ); - } - - CConnectionInfo* conIn = - CConnectionInfo::NewL( 0, aDestId, temp ); - CleanupStack::PushL( conIn ); - iItems->AppendL( conIn ); - CleanupStack::Pop( conIn ); - - if ( aFirstItem || - aDestination.MetadataL( ESnapMetadataHighlight ) ) - { // It sets the highlight to the - // first Destination (Internet), - // but if it finds another with - // the bit set, then it changes - iHighlightedItem = iItems->Count()-1; - } - } - - numCM = list.Count(); // break; - } - else - { - CleanupStack::PopAndDestroy(); // cmConnMethodExt - } - } - } - } - } - - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::AddUncategorizedItemL -// --------------------------------------------------------- -// -void CActiveSelectConnectionPlugin::AddUncategorizedItemL(TSortSnapUtils& aSortSnapUtils ) - { - TMpmSnapBuffer list; - - TInt errMPM = aSortSnapUtils.GetSortSnapData( 0, list ); - CLOG_WRITEF( _L( "Uncategorized: errMPM = %d. list.Count() = %d" ), errMPM, list.Count() ); - - if ( errMPM == KErrNone ) - { - TUint numOfUncatToBeListed = 0; - - for ( TInt numCM = 0; numCM < list.Count(); numCM++ ) - { - RCmConnectionMethodExt cmConnMethodExt; - TRAPD( err, cmConnMethodExt = iCmManagerExt.ConnectionMethodL( - list.iIapId[numCM] ) ); - if ( err == KErrNone ) - { - CleanupClosePushL( cmConnMethodExt ); - if ( iBearerSet & cmConnMethodExt.GetIntAttributeL( - ECmCommsDBBearerType ) ) - { - numOfUncatToBeListed++; - } - CleanupStack::PopAndDestroy(); // cmConnMethodExt - } - } - - if ( ( iBearerSet & ECommDbBearerWLAN ) && iIsWLANFeatureSupported ) - { - numOfUncatToBeListed += CountAdhocWlanIapsL(); - } - - if ( numOfUncatToBeListed > 0 ) - { - CGulIcon* uncatIcon = - ( CGulIcon* )iCmManagerExt.UncategorizedIconL(); - if ( uncatIcon ) - { - CleanupStack::PushL( uncatIcon ); - iIcons->AppendL( uncatIcon ); - CleanupStack::Pop( uncatIcon ); // icon array took over ownership - - // +1 because it "Zero terminates" the string - TBuf nameUncat; - TBuf numUncat; - - HBufC *bufUncat = StringLoader::LoadL( R_LIST_UNCATEGORIZED ); - nameUncat = *bufUncat; - nameUncat.ZeroTerminate(); - delete bufUncat; - - HBufC *bufNumOfUncat; - if ( numOfUncatToBeListed == 1 ) - { - bufNumOfUncat = StringLoader::LoadL( R_CONN_METHODS_ONE ); - } - else - { - bufNumOfUncat = StringLoader::LoadL( R_CONN_METHODS_MANY, - numOfUncatToBeListed ); - } - - numUncat = *bufNumOfUncat; - numUncat.ZeroTerminate(); - delete bufNumOfUncat; - - TBuf temp; - _LIT( KIconIdNameNumber, "%d\t%s\t%s" ); - - temp.FillZ( KMaxEntryLength ); - temp.Format( KIconIdNameNumber, iIcons->Count()-1, nameUncat.Ptr(), - numUncat.Ptr() ); - - CConnectionInfo* conIn = CConnectionInfo::NewL( 0, 0, temp ); - CleanupStack::PushL( conIn ); - iItems->AppendL( conIn ); - CleanupStack::Pop( conIn ); - if ( iHighlightedItem < 0 ) - { - iHighlightedItem = 0; - } - } - } - } - } - - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::GetElementIDL -// --------------------------------------------------------- -// -TUint32 CActiveSelectConnectionPlugin::GetElementIDL( TUint32 aIAPId, - TUint32 aDestinationId ) - { - TUint32 retval = 0; - TInt err; - - if ( aDestinationId ) - { - RCmDestinationExt cmDestExt; - TRAP( err, cmDestExt = iCmManagerExt.DestinationL( aDestinationId ) ); - if ( err == KErrNone ) - { - retval = cmDestExt.ElementId(); - cmDestExt.Close(); - } - } - else if ( aIAPId ) - { - RCmConnectionMethodExt cmConnMethodExt; - TRAP( err, cmConnMethodExt = iCmManagerExt.ConnectionMethodL( - aIAPId ) ); - if ( err == KErrNone ) - { - CleanupClosePushL( cmConnMethodExt ); - retval = cmConnMethodExt.GetIntAttributeL( ECmElementID ); - CleanupStack::PopAndDestroy(); // cmConnMethodExt - } - } - - return retval; - } - - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::GetRefreshIntervalL() -// --------------------------------------------------------- -// -TInt CActiveSelectConnectionPlugin::GetRefreshIntervalL( ) - { - CLOG_ENTERFN( "CActiveSelectConnectionPlugin::GetRefreshInterval" ); - - TInt variant( KTickDefaultInterval ); - - - CMDBSession* session = CMDBSession::NewL(KCDLatestVersion); - CleanupStack::PushL( session ); - - //session->OpenTransactionL(); - TMDBElementId tableId = 0; - - tableId = CCDWlanDeviceSettingsRecord::TableIdL( *session); - - CCDWlanDeviceSettingsRecord* record = new(ELeave) - CCDWlanDeviceSettingsRecord(tableId); - CleanupStack::PushL(record); - - record->iWlanDeviceSettingsType = KWlanUserSettings; - - if(record->FindL( *session )) - { - record->LoadL( *session ); - - // In case iBgScanInterval is -1 (= automatic) then just use - // KTickDefaultInterval as refresh interval - if ( record->iBgScanInterval != KWlanBgScanIntervalAuto - && record->iBgScanInterval > 0 ) - { - variant = record->iBgScanInterval; - variant = variant * KMicrosecondsToSecondsMultiplier; - } - } - CleanupStack::PopAndDestroy( record ); - - //session->CommitTransactionL(); - - CleanupStack::PopAndDestroy( session ); - - TUint32 variantToLog = variant; - - CLOG_WRITEF( _L( "Refresh interval (microseconds) : %d" ), variantToLog ); - - CLOG_LEAVEFN( "CActiveSelectConnectionPlugin::GetRefreshInterval" ); - - return variant; - } - -// --------------------------------------------------------- -// CActiveSelectConnectionPlugin::CountAdhocWlanIapsL() -// --------------------------------------------------------- -// -TInt CActiveSelectConnectionPlugin::CountAdhocWlanIapsL() - { - CLOG_ENTERFN( "CActiveSelectExplicit::CountAdhocWlanIapsL " ); - - // Creating a session with the latest version - CMDBSession* db = CMDBSession::NewLC( CMDBSession::LatestVersion() ); - db->SetAttributeMask( ECDProtectedWrite ); - - // Create wlan service record set (RArray (or RPtrArray?)) - CMDBRecordSet* wlanSet = - new (ELeave)CMDBRecordSet( CCDWlanServiceRecord::TableIdL( *db ) ); - CleanupStack::PushL( wlanSet ); - - // Create wlan service record - CCDWlanServiceRecord* wlanRecord = - new (ELeave)CCDWlanServiceRecord( CCDWlanServiceRecord::TableIdL( *db ) ); - - CleanupStack::PushL( wlanRecord ); - - // Set ConnectionMode field in wlan service record (see wlancontainer.h) - // This works with EWlanOperatingModeAdhoc, fails with EWlanConnectionModeAdhoc - wlanRecord->iWlanConnMode.SetL( EWlanOperatingModeAdhoc ); - - // Append wlan service record to wlan service record set (currently empty) - wlanSet->iRecords.AppendL( wlanRecord ); - CleanupStack::Pop( wlanRecord ); // ownership moved to RPointerArray - - TInt wlanRecordCount( 0 ); - - // Find matcing wlan service records - if( wlanSet->FindL( *db ) ) - { - wlanRecordCount = wlanSet->iRecords.Count(); - - for ( TInt i = 0; i < wlanRecordCount; i++ ) - { - // Load the current record again to be sure all fields are up to date - wlanRecord->SetElementId( wlanSet->iRecords[i]->ElementId() ); - - // Load will only look at ElementId and updates the rest of the fields - wlanRecord->LoadL( *db ); - - if ( wlanRecord->iWLanSSID.IsNull() ) - { - // Count active Easy WLAN using adhoc out - wlanRecordCount--; - break; - } - } - - CLOG_WRITEF( _L("wlanSet record count = %d"), wlanRecordCount ); - } - else - { - CLOG_WRITEF( _L("no matcing wlan records found." )); - } - - CleanupStack::PopAndDestroy( wlanSet ); - CleanupStack::PopAndDestroy( db ); - - CLOG_LEAVEFN( "CActiveSelectExplicit::CountAdhocWlanIapsL" ); - - return ( wlanRecordCount ); - } - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/src/ActiveSelectExplicit.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/src/ActiveSelectExplicit.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,519 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of plugins (base & all derived). -* -*/ - - -// INCLUDE FILES -#include "ActiveSelectExplicit.h" -#include "SelectExplicitDialog.h" -#include "ConnectionInfo.h" -#include "ConnectionInfoArray.h" -#include "CConnDlgPrivateCRKeys.h" -#include "ConnectionDialogsLogger.h" -#include "sortsnaputils.h" - -#include -#include -#include -#include -#include -#ifndef __WINS__ -#include -#endif -#include -#include -#include - -#include -#include -#include -#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#else -#include -#include -#endif -#include - - -// CONSTANTS - -LOCAL_D const TInt KMaxEntryLength = CommsDat::KMaxTextLength*2 + 20; -LOCAL_D const TInt KIconsGranularity = 4; - -using namespace CMManager; - - -/////////////////////////////////////////////////////////////////////////////// - -// --------------------------------------------------------- -// CActiveSelectExplicit::CActiveSelectExplicit() -// --------------------------------------------------------- -// -CActiveSelectExplicit::CActiveSelectExplicit( - CSelectConnectionDialog* aCallerDialog, - TUint aDestId, - TInt aRefreshInterval, - TUint32 aBearerSet, - TBool aIsWLANFeatureSupported, - TUint aDefaultCMId ) -: iCallerDialog( aCallerDialog ), - iDestId( aDestId ), -// isDialogDeleting( EFalse ), - iRefreshInterval( aRefreshInterval ), - iBearerSet( aBearerSet ), - iIsWLANFeatureSupported( aIsWLANFeatureSupported ), - iDefaultCMId( aDefaultCMId ) - { - } - - -// --------------------------------------------------------- -// CActiveSelectExplicit* CActiveSelectExplicit::NewL() -// --------------------------------------------------------- -// -CActiveSelectExplicit* CActiveSelectExplicit::NewL( - CSelectConnectionDialog* aCallerDialog, - TUint aDestId, - TInt aRefreshInterval, - TUint32 aBearerSet, - TBool aIsWLANFeatureSupported, - TUint aDefaultCMId ) - { - CLOG_ENTERFN( "CActiveSelectExplicit::NewL " ); - - CActiveSelectExplicit* self = new ( ELeave ) CActiveSelectExplicit( - aCallerDialog, aDestId, aRefreshInterval, - aBearerSet, aIsWLANFeatureSupported, - aDefaultCMId ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - CLOG_LEAVEFN( "CActiveSelectExplicit::NewL " ); - - return self; - } - - -// --------------------------------------------------------- -// CActiveSelectExplicit::ConstructL() -// --------------------------------------------------------- -// -void CActiveSelectExplicit::ConstructL() - { - CActiveBase::ConstructL(); - - iItems = new( ELeave ) CConnectionInfoArray(); - iIcons = new( ELeave ) CAknIconArray( KIconsGranularity ); - - iCmManagerExt.OpenL(); - } - -// --------------------------------------------------------- -// CActiveSelectExplicit::~CActiveSelectExplicit() -// --------------------------------------------------------- -// -CActiveSelectExplicit::~CActiveSelectExplicit() - { - Cancel(); - - if ( iItems ) - { - iItems->ResetAndDestroy(); - } - delete iItems; - iItems = NULL; - - iCmManagerExt.Close(); - } - - -// --------------------------------------------------------- -// CActiveSelectExplicit::Cancel() -// --------------------------------------------------------- -// -void CActiveSelectExplicit::Cancel() - { - StopTimer(); - CActive::Cancel(); - - if( iDialog && !( iDialog->GetOkToExit() ) ) - { - CLOG_WRITEF( _L( "iDialog->GetOkToExit() : %b" ), iDialog->GetOkToExit() ); - delete iDialog; - iDialog = NULL; - } - } - - -// --------------------------------------------------------- -// CActiveSelectExplicit::DoCancel() -// --------------------------------------------------------- -// -void CActiveSelectExplicit::DoCancel() - { - CLOG_ENTERFN( "CActiveSelectExplicit::DoCancel " ); - -/* if( isDialogDeleting ) - { - CLOG_WRITE( "isDialogDeleting" ); - - delete iDialog; - iDialog = NULL; - - isDialogDeleting = EFalse; - } - */ - CLOG_LEAVEFN( "CActiveSelectExplicit::DoCancel " ); - } - - -// --------------------------------------------------------- -// CActiveSelectExplicit::RunL() -// --------------------------------------------------------- -// -void CActiveSelectExplicit::RunL() - { - CLOG_ENTERFN( "CActiveSelectExplicit::RunL " ); - - if( iStatus == KErrNone ) - { - BuildConnectionListL(); - iDialog->RefreshDialogL( iItems, iIcons, ETrue ); - } - - CLOG_LEAVEFN( "CActiveSelectExplicit::RunL " ); - - } - - -// --------------------------------------------------------- -// CActiveSelectExplicit::StartSearchIAPsL() -// --------------------------------------------------------- -// -void CActiveSelectExplicit::ShowSelectExplicitL() - { - BuildConnectionListL(); - - iDialog = CSelectExplicitDialog::NewL( iCallerDialog ); - iDialog->PrepareAndRunLD( iItems, iIcons, EFalse ); - - if( iRefreshInterval ) - { - StartTimerL( iRefreshInterval ); - } - } - - -// --------------------------------------------------------- -// CActiveSelectExplicit::BuildConnectionListL() -// --------------------------------------------------------- -// -void CActiveSelectExplicit::BuildConnectionListL() - { - CLOG_ENTERFN( "CActiveSelectExplicit::BuildConnectionListL " ); - - if ( iItems ) - { - iItems->ResetAndDestroy(); - } - - if ( iIcons ) - { - iIcons->ResetAndDestroy(); - } - - if ( iDefaultCMId != 0 ) - { // It automatically means also that the feature is supported - _LIT( KDriveZ, "z:" ); // ROM folder - // Name of the MBM file containing icons - _LIT( KManagerIconFilename, "cmmanager.mbm" ); - - TFileName iconsFileName; - - iconsFileName.Append( KDriveZ ); - iconsFileName.Append( KDC_APP_BITMAP_DIR ); - iconsFileName.Append( KManagerIconFilename ); - - iIcons->AppendL( AknsUtils::CreateGulIconL( AknsUtils::SkinInstance(), - KAknsIIDQgnIndiCbHotAdd, - iconsFileName, - EMbmCmmanagerQgn_indi_cb_hot_add, - EMbmCmmanagerQgn_indi_cb_hot_add_mask ) ); - } - - TBool easyWlanIsInDb = EFalse; - -#ifdef _DEBUG - if ( iDestId ) - { // Real destination, not for uncategorized - RCmDestinationExt cmDestExt = iCmManagerExt.DestinationL( iDestId ); - CleanupClosePushL( cmDestExt ); - CLOG_WRITEF( _L( "Destination id %d, Total number of methods %d" ), - iDestId, cmDestExt.ConnectionMethodCount() ); - - for ( TInt j = 0; j < cmDestExt.ConnectionMethodCount(); j++ ) - { - RCmConnectionMethodExt cmConnMethodExt; - TRAPD( err, cmConnMethodExt = cmDestExt.ConnectionMethodL( j ) ); - if ( err == KErrNone ) - { - CleanupClosePushL( cmConnMethodExt ); - HBufC* bufMethod = cmConnMethodExt.GetStringAttributeL( - ECmName ); - CleanupStack::PushL( bufMethod ); - TBuf nameMethod; - nameMethod = *bufMethod; - nameMethod.ZeroTerminate(); - - CLOG_WRITEF( _L( "ConnMethod id %d, Method name %s" ), - cmConnMethodExt.GetIntAttributeL( ECmIapId ), nameMethod.Ptr() ); - - CleanupStack::PopAndDestroy( 2 ); // bufMethod, cmConnMethodExt - } - } - CleanupStack::PopAndDestroy(); // cmDestExt - } -#endif - TSortSnapUtils sortSnapUtils( iMPM ); - TMpmSnapBuffer snapBuffer; - TInt err = sortSnapUtils.GetSortSnapData( iDestId, snapBuffer ); - CLOG_WRITEF( _L( "GetSortSNAPDataL returned = %d. list.Count() = %d" ), err, snapBuffer.Count() ); - - if ( err == KErrNone ) - { - RCmConnectionMethodExt cmConnMethodExt; - CleanupClosePushL( cmConnMethodExt ); - for ( TInt numCM = 0; numCM < snapBuffer.Count(); numCM++ ) - { - AddConnectionMethodItemL( snapBuffer.iIapId[numCM], - iDestId == 0, - easyWlanIsInDb, - snapBuffer.iIapId[numCM] == iDefaultCMId ); - } - CleanupStack::PopAndDestroy(); // cmConnMethodExt - } - - // Add any ad-hoc WLAN iaps to the list - if ( ( iBearerSet & ECommDbBearerWLAN ) && ( iDestId == 0 ) && iIsWLANFeatureSupported ) - { - AddAdhocWlanIapsL(); - } - - CLOG_LEAVEFN( "CActiveSelectExplicit::BuildConnectionListL " ); - } - - -// --------------------------------------------------------- -// CActiveSelectExplicit::AddConnectionMethodItemL() -// --------------------------------------------------------- -// -void CActiveSelectExplicit::AddConnectionMethodItemL( TUint32 aId, - TBool aCheckForEasyWlan, - TBool& aEasyWlanIsInDb, - TBool aDefaultCM ) - { - CLOG_ENTERFN( "CActiveSelectExplicit::AddConnectionMethodItemL" ); - - CConnectionInfo* conIn; - - RCmConnectionMethodExt cmConnMethodExt; - CLOG_WRITEF( _L( "Uncat dest id %d" ), aId ); - - TRAPD( err, cmConnMethodExt = iCmManagerExt.ConnectionMethodL( aId ) ); - CLOG_WRITEF( _L( "err %d" ), err ); - - if ( err == KErrNone ) - { - CleanupClosePushL( cmConnMethodExt ); - - TUint32 bearer = cmConnMethodExt.GetIntAttributeL( - ECmCommsDBBearerType ); - CLOG_WRITEF( _L( "bearer %d" ), bearer ); - - if ( bearer & iBearerSet ) - { - CLOG_WRITE( "To be listed!" ); - - TBool isCMEasyWlan = EFalse; - - HBufC* bufName = cmConnMethodExt.GetStringAttributeL( - ECmName ); - - TBuf nameCM; - nameCM = *bufName; - nameCM.ZeroTerminate(); - delete bufName; - - CLOG_WRITEF( _L( "Method name %s. Bearer = %d" ), nameCM.Ptr(), bearer ); - - if ( aCheckForEasyWlan && bearer == KCommDbBearerWLAN && - iIsWLANFeatureSupported ) - { - if ( !aEasyWlanIsInDb ) - { - HBufC* bufSSID = cmConnMethodExt.GetStringAttributeL( - EWlanSSID ); - if ( !bufSSID || bufSSID->Des().Length() == 0 ) - { - isCMEasyWlan = ETrue; - aEasyWlanIsInDb = ETrue; - } - delete bufSSID; - } - } - - if ( !isCMEasyWlan ) - { - CGulIcon* iconCM = ( CGulIcon* ) - cmConnMethodExt.GetIntAttributeL( - ECmBearerIcon ); - if ( iconCM ) - { - CLOG_WRITEF( _L( "iconCM found" ) ); - CleanupStack::PushL( iconCM ); - iIcons->AppendL( iconCM ); - - // icon array took over ownership - CleanupStack::Pop( iconCM ); - } - else - { - CLOG_WRITEF( _L( "iconCM not found" ) ); - } - - TBuf temp; - _LIT( KIconIdName, "%d\t%s" ); - _LIT( KIconIdNameDefaultConn, "%d\t%s\t0" ); - - if ( aDefaultCM ) - { - temp.Format( KIconIdNameDefaultConn, iIcons->Count()-1, - nameCM.Ptr() ); - } - else - { - temp.Format( KIconIdName, iIcons->Count()-1, - nameCM.Ptr() ); - } - - conIn = CConnectionInfo::NewL( aId, 0, temp ); - CleanupStack::PushL( conIn ); - iItems->AppendL( conIn ); - CleanupStack::Pop( conIn ); - } - } - CleanupStack::PopAndDestroy(); // cmConnMethodExt - } - - CLOG_LEAVEFN( "CActiveSelectExplicit::AddConnectionMethodItemL" ); - } - -// --------------------------------------------------------- -// CActiveSelectExplicit::AddAdhocWlanIapsL() -// --------------------------------------------------------- -// -void CActiveSelectExplicit::AddAdhocWlanIapsL() - { - CLOG_ENTERFN( "CActiveSelectExplicit::AddAdhocWlanIapsL " ); - - // Creating a session with the latest version - CMDBSession* db = CMDBSession::NewLC( CMDBSession::LatestVersion() ); - db->SetAttributeMask( ECDProtectedWrite ); - - // Create wlan service record set (RArray (or RPtrArray?)) - CMDBRecordSet* wlanSet = - new (ELeave)CMDBRecordSet( CCDWlanServiceRecord::TableIdL( *db ) ); - CleanupStack::PushL( wlanSet ); - - // Create wlan service record - CCDWlanServiceRecord* wlanRecord = - new (ELeave)CCDWlanServiceRecord( CCDWlanServiceRecord::TableIdL( *db ) ); - - CleanupStack::PushL( wlanRecord ); - - // Set ConnectionMode field in wlan service record (see wlancontainer.h) - // This works with EWlanOperatingModeAdhoc, fails with EWlanConnectionModeAdhoc - wlanRecord->iWlanConnMode.SetL( EWlanOperatingModeAdhoc ); - - // Append wlan service record to wlan service record set (currently empty) - wlanSet->iRecords.AppendL( wlanRecord ); - CleanupStack::Pop( wlanRecord ); // ownership moved to RPointerArray - - // Find matcing wlan service records - if( wlanSet->FindL( *db ) ) - { - TInt wlanRecordCount( wlanSet->iRecords.Count() ); - CLOG_WRITEF( _L("wlanSet record count = %d"), wlanRecordCount ); - - TBool easyWlanIsInDb = EFalse; - - // loop for each record found - for ( TInt i = 0; i < wlanRecordCount; i++ ) - { - // Seems we need to specifically load the current record again to be sure all fields are up to date - wlanRecord->SetElementId( wlanSet->iRecords[i]->ElementId() ); - // Load will only look at ElementId and updates the rest of the fields - wlanRecord->LoadL( *db ); - - if ( !( wlanRecord->iWLanSSID.IsNull() ) ) - { - // Don't include Easy WLAN - // lets print some stuff to log - CLOG_WRITEF( _L("New ad-hoc WLAN IAP:" )); - CLOG_WRITEF( _L(" iWlanServiceId = %d"), static_cast( wlanRecord->iWlanServiceId ) ); - CLOG_WRITEF( _L(" iWlanConnMode = %d"), static_cast( wlanRecord->iWlanConnMode ) ); - CLOG_WRITEF( _L(" iWLanSSID = %S"), &(static_cast( wlanRecord->iWLanSSID ) ) ); - - // Create an iap record - CCDIAPRecord* iapRecord = static_cast ( - CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); - CleanupStack::PushL( iapRecord ); - - iapRecord->iServiceType.SetL( TPtrC( KCDTypeNameLANService ) ); - // Set the service field to the same value as in the wlan service record we are currently looking - iapRecord->iService = wlanRecord->iWlanServiceId; - // Find the matching iap record - if( iapRecord->FindL( *db ) ) - { - TUint iapId( 0 ); - - // read the iap id - iapId = iapRecord->RecordId(); - CLOG_WRITEF( _L(" iapId = %d"), iapId ); - - AddConnectionMethodItemL( iapId, - iDestId == 0, - easyWlanIsInDb, - iapId == iDefaultCMId ); - } - CleanupStack::PopAndDestroy( iapRecord ); - } - } - } - else - { - CLOG_WRITEF( _L("no matcing wlan records found." )); - } - - CleanupStack::PopAndDestroy( wlanSet ); - CleanupStack::PopAndDestroy( db ); - - CLOG_LEAVEFN( "CActiveSelectExplicit::AddAdhocWlanIapsL" ); - } - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/src/AuthenticationDialog.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/src/AuthenticationDialog.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CAuthenticationDialog. -* -*/ - - -// INCLUDE FILES -#include "AuthenticationDialog.h" -#include "ConnDlgPlugin.h" -#include "ExpiryTimer.h" - -#include - - -// --------------------------------------------------------- -// CAuthenticationDialog::CAuthenticationDialog -// --------------------------------------------------------- -// -CAuthenticationDialog::CAuthenticationDialog( - CConnDlgAuthenticationPlugin* aPlugin ) -: CAknMultiLineDataQueryDialog( CAknQueryDialog::ENoTone ), - iPlugin( aPlugin ) - { - } - - -// --------------------------------------------------------- -// CAuthenticationDialog::~CAuthenticationDialog -// --------------------------------------------------------- -// -CAuthenticationDialog::~CAuthenticationDialog() - { - - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse ); - delete iExpiryTimer; - - } - - -// --------------------------------------------------------- -// CAuthenticationDialog::NewL -// --------------------------------------------------------- -// -CAuthenticationDialog* CAuthenticationDialog::NewL( - CConnDlgAuthenticationPlugin* aPlugin, - TDes& aUsername, TDes& aPassword ) - { - CAuthenticationDialog* dialog = new( ELeave ) - CAuthenticationDialog( aPlugin ); - CleanupStack::PushL( dialog ); - - dialog->SetDataL( aUsername, aPassword ); - - CleanupStack::Pop( dialog ); - - return dialog; - } - - -// --------------------------------------------------------- -// CAuthenticationDialog::PreLayoutDynInitL() -// --------------------------------------------------------- -// -void CAuthenticationDialog::PreLayoutDynInitL() - { - CAknMultiLineDataQueryDialog::PreLayoutDynInitL(); - - if( FirstData( TPtr( 0, 0 ) ).Length() > 0 ) - { - MakeLeftSoftkeyVisible( ETrue ); - } - - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue ); - - iExpiryTimer = CExpiryTimer::NewL( *this ); - iExpiryTimer->Start(); - } - - -// --------------------------------------------------------- -// CAuthenticationDialog::SetInitialCurrentLine() -// --------------------------------------------------------- -// -void CAuthenticationDialog::SetInitialCurrentLine() - { - CAknMultiLineDataQueryDialog::SetInitialCurrentLine(); - - iFirstEmpty = FirstData( TPtr( 0,0 ) ).Length() == 0; - iSecondEmpty = SecondData( TPtr( 0,0 ) ).Length() == 0; - if( !iFirstEmpty || !iSecondEmpty ) - { - MakeLeftSoftkeyVisible( ETrue ); - } - } - - -// --------------------------------------------------------- -// CAuthenticationDialog::OkToExitL -// --------------------------------------------------------- -// -TBool CAuthenticationDialog::OkToExitL( TInt aButtonId ) - { - if ( CAknMultiLineDataQueryDialog::OkToExitL( aButtonId ) ) - { - if ( aButtonId == EAknSoftkeySelect || - aButtonId == EAknSoftkeyOk || - aButtonId == EAknSoftkeyDone ) - { - iPlugin->CompleteL( KErrNone ); - } - else if ( aButtonId== EAknSoftkeyCancel ) - { - iPlugin->CompleteL( KErrCancel ); - } - - return( ETrue ); - } - - return( EFalse ); - } - - -// --------------------------------------------------------- -// CAuthenticationDialog::HandleQueryEditorStateEventL -// -// This code is based on AknQueryDialog.cpp -// --------------------------------------------------------- -// -TBool CAuthenticationDialog::HandleQueryEditorStateEventL( - CAknQueryControl* aQueryControl, - TQueryControlEvent /*aEventType*/, - TQueryValidationStatus aStatus ) - { - if( STATIC_CAST( CAknMultilineQueryControl*, aQueryControl )->IsFirst() ) - { - iFirstEmpty = ( aStatus == EEditorEmpty ); - } - - if( STATIC_CAST( CAknMultilineQueryControl*, aQueryControl)->IsSecond() ) - { - iSecondEmpty = ( aStatus == EEditorEmpty ); - } - - MakeLeftSoftkeyVisible( ( !iFirstEmpty ) || ( !iSecondEmpty ) ); - - return EFalse; - } - -void CAuthenticationDialog::HandleTimedOut() - { - TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) ); - } - - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/src/ConnDlgPlugin.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/src/ConnDlgPlugin.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/cconndlg/src/ConnDlgPlugin.cpp Mon May 03 12:53:07 2010 +0300 @@ -17,14 +17,7 @@ // INCLUDE FILES #include "ConnDlgPlugin.h" -#include "AuthenticationDialog.h" -#include "ReconnectDialog.h" -#include "QosDialog.h" -#include "NewIapDialog.h" -#include "ActiveIapPlugin.h" -#include "ActiveSelectConnectionPlugin.h" -#include "CConnDlgPrivateCRKeys.h" #include #include "ConnectionDialogsUidDefs.h" @@ -34,27 +27,23 @@ #include #include #include +#include +#include +#include -#include #include + +// NOTE that the functionality this file is DEPRECATED +// None on the methods have UI functionality, the plugins complete the requests +// immediately when they are started + using namespace CommsDat; // CONSTANTS -// RSC file name. -_LIT( KResourceFileName, "CConnDlgPlugin.rsc" ); - -// Panic string -_LIT( KConnDlgPluginPanic, "CConnDlgPlugin" ); - LOCAL_D const TInt KPluginGranularity = 4; -#if defined(_DEBUG) -_LIT( KErrActiveObjectNull, "iActivePlugin not NULL" ); -#endif - - LOCAL_C void CreateNotifiersL( CArrayPtrFlat* aNotifiers ); @@ -160,55 +149,61 @@ void CConnDlgIapPlugin::StartL( const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage ) { - iPrefs.Copy( (TPtrC8) aBuffer ); iCancelled = EFalse; iReplySlot = aReplySlot; iMessage = aMessage; - // Check if there is a suitable active connection - TInt iap( 0 ); - TInt bearer( ECommDbBearerWLAN ); // User conn. is always WLAN in 9.1 - - // Is there active User connection - TInt err = GetUserConnection( iap ); + // The UI is deprectad, complete the request and return the best available iap + RCmManager cmManager; + cmManager.OpenL(); + CleanupClosePushL( cmManager ); + + RArray destinationArray; + cmManager.AllDestinationsL( destinationArray ); + CleanupClosePushL(destinationArray); + TInt error = KErrNotFound; - if ( err != KErrNone || iap == 0 ) - { - // Is there any active connection - err = GetActiveConnection( iap, bearer ); + // loop the destinations and find the internet snap + for (TInt i = 0; i < destinationArray.Count(); ++i) + { + RCmDestination destination = cmManager.DestinationL( destinationArray[i] ); + CleanupClosePushL(destination); + TUint32 purposeMetaData = destination.MetadataL( CMManager::ESnapMetadataPurpose ); + + // If the internet snap was found, check out the IAPs + if ( CMManager::ESnapPurposeInternet == purposeMetaData ) + { + RMPM mpm; + User::LeaveIfError(mpm.Connect()); + TMpmSnapBuffer buffer; + buffer.Reset(); + User::LeaveIfError( mpm.SortSNAP( destination.Id(), buffer )); + mpm.Close(); + // if there are iaps in the list, return the first + // if there are none, return an error + if ( buffer.Count() > 0 ) + { + iIAP = buffer.iIapId[0]; + error = KErrNone; + } + CleanupStack::PopAndDestroy(); //destination + break; + } + CleanupStack::PopAndDestroy(); //destination } - - if ( ( err == KErrNone ) && - ( iap != 0 ) && - ( iPrefs().iBearerSet & bearer ) ) - { - // a suitable connection is already active - iIAP = iap; - CompleteL( KErrNone ); - } - else - { - // display a dialog - __ASSERT_DEBUG( !iActivePlugin, - User::Panic( KErrActiveObjectNull, KErrNone ) ); + CleanupStack::PopAndDestroy(); //destinationArray + CleanupStack::PopAndDestroy(); //cmManager - iActivePlugin = CActiveCConnDlgIapPlugin::NewL( this, iPrefs() ); - iActivePlugin->StartSearchIAPsL(); - } + CompleteL( error ); } - - // --------------------------------------------------------- // void CConnDlgIapPlugin::Cancel() // --------------------------------------------------------- // void CConnDlgIapPlugin::Cancel() - { - delete iActivePlugin; - iActivePlugin = NULL; - + { if ( !iCancelled ) { iCancelled = ETrue; @@ -251,79 +246,11 @@ // --------------------------------------------------------- // CConnDlgIapPlugin* CConnDlgIapPlugin::NewL( - const TBool aResourceFileResponsible ) + const TBool /*aResourceFileResponsible*/ ) { CConnDlgIapPlugin* self = new (ELeave) CConnDlgIapPlugin(); - CleanupStack::PushL( self ); - self->ConstructL( KResourceFileName, aResourceFileResponsible ); - CleanupStack::Pop(); - return self; } - -// --------------------------------------------------------- -// CConnDlgIapPlugin::SetPreferredIapIdL -// --------------------------------------------------------- -// -void CConnDlgIapPlugin::SetPreferredIapIdL( TUint32 aIAPId ) - { - CLOG_ENTERFN( "CConnDlgIapPlugin::SetPreferredIapIdL " ); - - iIAP = aIAPId; - - CLOG_LEAVEFN( "CConnDlgIapPlugin::SetPreferredIapIdL " ); - } - - -// --------------------------------------------------------- -// CConnDlgIapPlugin::GetActiveConnection -// --------------------------------------------------------- -// -TInt CConnDlgIapPlugin::GetActiveConnection( TInt& aIapId, - TInt& aBearer ) - { - aIapId = 0; - aBearer = 0; - - TInt err = RProperty::Get( KMPMActiveConnectionCategory, - KMPMPSKeyActiveConnectionIap, - aIapId ); - - CLOG_WRITEF( _L( "KMPMPSKeyActiveConnectionIap : %d" ), aIapId ); - CLOG_WRITEF( _L( "err : %d" ), err ); - - if ( err == KErrNone ) - { - err = RProperty::Get( KMPMActiveConnectionCategory, - KMPMPSKeyActiveConnectionBearer, - aBearer ); - } - - CLOG_WRITEF( _L( "KMPMPSKeyActiveConnectionBearer : %d" ), aBearer ); - CLOG_WRITEF( _L( "err : %d" ), err ); - CLOG_WRITEF( _L( "iPrefs().iBearerSet : %d" ), iPrefs().iBearerSet ); - - return err; - } - - -// --------------------------------------------------------- -// CConnDlgIapPlugin::GetUserConnection -// --------------------------------------------------------- -// -TInt CConnDlgIapPlugin::GetUserConnection( TInt& aIapId ) - { - aIapId = 0; - - TInt err = RProperty::Get( KMPMUserConnectionCategory, - KMPMPSKeyUserConnectionIap, - aIapId ); - - CLOG_WRITEF( _L( "KMPMPSKeyUserConnectionIap : %d" ), aIapId ); - CLOG_WRITEF( _L( "err : %d" ), err ); - - return err; - } // --------------------------------------------------------- @@ -353,19 +280,12 @@ { CLOG_ENTERFN( "CConnDlgAuthenticationPlugin::StartL" ); - if ( aBuffer.Length() > iAuthPairBuff.Length() ) - { - CLOG_WRITE( "User::Panic, EConnDlgIllegalRequest" ); - User::Panic( KConnDlgPluginPanic, EConnDlgIllegalRequest ); - } - - iAuthPairBuff.Copy( aBuffer ); - iReplySlot = aReplySlot; iMessage = aMessage; iCancelled = EFalse; - GetAuthenticationL(); + // The UI is deprecated, just complete the request + CompleteL(KErrNotSupported); CLOG_LEAVEFN( "CConnDlgAuthenticationPlugin::StartL" ); } @@ -387,8 +307,6 @@ { iMessage.Complete( KErrCancel ); } - delete iDialog; - iDialog = NULL; } CLOG_LEAVEFN( "CConnDlgAuthenticationPlugin::Cancel" ); @@ -396,24 +314,6 @@ // --------------------------------------------------------- -// void CConnDlgAuthenticationPlugin::GetAuthenticationL() -// --------------------------------------------------------- -// -void CConnDlgAuthenticationPlugin::GetAuthenticationL() - { - CLOG_ENTERFN( "CConnDlgAuthenticationPlugin::GetAuthenticationL" ); - - iDialog = CAuthenticationDialog::NewL( this, iAuthPairBuff().iUsername, - iAuthPairBuff().iPassword ); - - - iDialog->ExecuteLD( R_CONNDLG_AUTHENTICATION ); - - CLOG_LEAVEFN( "CConnDlgAuthenticationPlugin::GetAuthenticationL" ); - } - - -// --------------------------------------------------------- // void CConnDlgAuthenticationPlugin::CompleteL( TInt aStatus ) // --------------------------------------------------------- // @@ -424,11 +324,6 @@ iCancelled = ETrue; if ( !iMessage.IsNull() ) { - if ( aStatus == KErrNone ) - { - iMessage.WriteL( iReplySlot, iAuthPairBuff ); - } - iMessage.Complete( aStatus ); } Cancel(); @@ -442,14 +337,10 @@ // --------------------------------------------------------- // CConnDlgAuthenticationPlugin* CConnDlgAuthenticationPlugin::NewL( - const TBool aResourceFileResponsible ) + const TBool /*aResourceFileResponsible*/ ) { CConnDlgAuthenticationPlugin* self = new (ELeave) CConnDlgAuthenticationPlugin(); - CleanupStack::PushL( self ); - self->ConstructL( KResourceFileName, aResourceFileResponsible ); - CleanupStack::Pop(); - return self; } @@ -459,7 +350,6 @@ // --------------------------------------------------------- // CConnDlgAuthenticationPlugin::CConnDlgAuthenticationPlugin() -: iAuthPair( TAuthenticationPair() ) { } @@ -489,7 +379,7 @@ iMessage = aMessage; iCancelled = EFalse; - GetReconnectL(); + CompleteL(KErrNotSupported); } @@ -506,24 +396,11 @@ { iMessage.Complete( KErrCancel ); } - delete iDialog; - iDialog = NULL; } } // --------------------------------------------------------- -// void CConnDlgQosPlugin::GetReconnectL() -// --------------------------------------------------------- -// -void CConnDlgQosPlugin::GetReconnectL() - { - iDialog = new (ELeave) CQosDialog( this, iBool ); - iDialog->ExecuteLD( R_CONNDLG_QOS ); - } - - -// --------------------------------------------------------- // void CConnDlgQosPlugin::CompleteL( TInt aStatus ) // --------------------------------------------------------- // @@ -532,11 +409,6 @@ iCancelled = ETrue; if ( !iMessage.IsNull() ) { - if ( aStatus == KErrNone ) - { - TRAP_IGNORE( iMessage.WriteL( iReplySlot, TPckg( iBool ) ) ); - } - iMessage.Complete( aStatus ); } Cancel(); @@ -548,13 +420,9 @@ // --------------------------------------------------------- // CConnDlgQosPlugin* CConnDlgQosPlugin::NewL( - const TBool aResourceFileResponsible ) + const TBool /*aResourceFileResponsible*/ ) { CConnDlgQosPlugin* self = new (ELeave) CConnDlgQosPlugin(); - CleanupStack::PushL( self ); - self->ConstructL( KResourceFileName, aResourceFileResponsible ); - CleanupStack::Pop(); - return self; } @@ -585,7 +453,8 @@ iMessage = aMessage; iCancelled = EFalse; - GetReconnectL(); + // The UI is deprecated, just complete the request + CompleteL(KErrNotSupported); } @@ -602,24 +471,11 @@ { iMessage.Complete( KErrCancel ); } - delete iDialog; - iDialog = NULL; } } // --------------------------------------------------------- -// void CConnDlgReconnectPlugin::GetReconnectL() -// --------------------------------------------------------- -// -void CConnDlgReconnectPlugin::GetReconnectL() - { - iDialog = new (ELeave) CReconnectDialog( this, iBool ); - iDialog->ExecuteLD( R_CONNDLG_RECONNECT ); - } - - -// --------------------------------------------------------- // void CConnDlgReconnectPlugin::CompleteL( TInt aStatus ) // --------------------------------------------------------- // @@ -628,11 +484,6 @@ iCancelled = ETrue; if ( !iMessage.IsNull() ) { - if ( aStatus == KErrNone ) - { - iMessage.WriteL( iReplySlot, TPckg( iBool ) ); - } - iMessage.Complete( aStatus ); } Cancel(); @@ -645,13 +496,9 @@ // --------------------------------------------------------- // CConnDlgReconnectPlugin* CConnDlgReconnectPlugin::NewL( - const TBool aResourceFileResponsible ) + const TBool /*aResourceFileResponsible*/ ) { CConnDlgReconnectPlugin* self = new (ELeave) CConnDlgReconnectPlugin(); - CleanupStack::PushL( self ); - self->ConstructL( KResourceFileName, aResourceFileResponsible ); - CleanupStack::Pop(); - return self; } @@ -678,17 +525,12 @@ void CConnDlgNewIapPlugin::StartL( const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage ) { - if ( aBuffer.Length() > iPrefs.Length() ) - { - User::Panic( KConnDlgPluginPanic, EConnDlgIllegalRequest ); - } - - iPrefs.Copy( aBuffer ); iReplySlot = aReplySlot; iMessage = aMessage; iCancelled = EFalse; - GetNewIapL(); + // This api has been deprecated, just Complete the request + CompleteL(KErrNotSupported); } @@ -705,24 +547,11 @@ { iMessage.Complete( KErrCancel ); } - delete iDialog; - iDialog = NULL; } } // --------------------------------------------------------- -// void CConnDlgNewIapPlugin::GetNewIapL() -// --------------------------------------------------------- -// -void CConnDlgNewIapPlugin::GetNewIapL() - { - iDialog = new (ELeave) CNewIapDialog( this, iConnect, iPrefs() ); - iDialog->ExecuteLD( R_CONNDLG_NEW_IAP ); - } - - -// --------------------------------------------------------- // void CConnDlgNewIapPlugin::CompleteL( TInt aStatus ) // --------------------------------------------------------- // @@ -731,11 +560,6 @@ iCancelled = ETrue; if ( !iMessage.IsNull() ) { - if ( aStatus == KErrNone ) - { - iMessage.WriteL( iReplySlot, TPckg( iConnect ) ); - } - iMessage.Complete( aStatus ); } Cancel(); @@ -747,13 +571,9 @@ // --------------------------------------------------------- // CConnDlgNewIapPlugin* CConnDlgNewIapPlugin::NewL( - const TBool aResourceFileResponsible ) + const TBool /*aResourceFileResponsible*/ ) { CConnDlgNewIapPlugin* self = new (ELeave) CConnDlgNewIapPlugin(); - CleanupStack::PushL( self ); - self->ConstructL( KResourceFileName, aResourceFileResponsible ); - CleanupStack::Pop(); - return self; } @@ -779,74 +599,59 @@ // --------------------------------------------------------- // -void CConnDlgSelectConnectionPlugin::StartL( const TDesC8& aBuffer, +void CConnDlgSelectConnectionPlugin::StartL( const TDesC8& /*aBuffer*/, TInt aReplySlot, const RMessagePtr2& aMessage ) { - if ( iActivePlugin ) - { - aMessage.Complete( KErrServerBusy ); - return; - } - iPrefs.Copy( ( TPtrC8 ) aBuffer ); - - iCancelled = ETrue; // This method could leave before displaying the dialog. iReplySlot = aReplySlot; iMessage = aMessage; - __ASSERT_DEBUG( !iActivePlugin, - User::Panic( KErrActiveObjectNull, KErrNone ) ); + // because the connection dialog is deprecated and removed functionality, + // return the Internet SNAP and complete + RCmManager cmManager; + cmManager.OpenL(); + CleanupClosePushL( cmManager ); + + RArray destinationArray; + cmManager.AllDestinationsL( destinationArray ); + CleanupClosePushL(destinationArray); + bool found = false; - iElementID = iPrefs().iRank; - iActivePlugin = CActiveSelectConnectionPlugin::NewL( this, - iElementID, - iPrefs().iBearerSet ); - // Check if there is a suitable active connection - TInt snap( 0 ); - TInt iap( 0 ); - TInt bearer( ECommDbBearerWLAN ); // User conn. is always WLAN in 9.1 + // loop the destinations and find the internet snap + for (TInt i = 0; i < destinationArray.Count() && !found; ++i) + { + RCmDestination destination = cmManager.DestinationL( destinationArray[i] ); + CleanupClosePushL(destination); + + TUint32 purposeMetaData = destination.MetadataL( CMManager::ESnapMetadataPurpose ); + if ( CMManager::ESnapPurposeInternet == purposeMetaData ) + { + iElementID = destination.ElementId(); + found = true; + } + CleanupStack::PopAndDestroy(); //destination + } + CleanupStack::PopAndDestroy(); //destinationArray + CleanupStack::PopAndDestroy(); //cmManager - // Is there active User connection - TInt err = GetUserConnection( iap, snap ); - - if ( ( err != KErrNone ) || ( iap == 0 && snap == 0 ) ) + if (found) { - // Is there any active connection - err = GetActiveConnection( iap, snap, bearer ); - } - - if ( ( err == KErrNone ) && - ( iap != 0 || snap != 0 ) && - ( iPrefs().iBearerSet & bearer ) && - ( iPrefs().iDirection == 0 ) ) // JavaVM sets iDirection to "1" + CompleteL(KErrNone); + } + else { - // a suitable connection is already active - SetElementIDL( iap, snap ); - CompleteL( KErrNone ); - } - else - { - // display dialog - iActivePlugin->ShowSelectConnectionL(); - iCancelled = EFalse; // Dialog is now up and running + CompleteL(KErrNotFound); } } - - // --------------------------------------------------------- // void CConnDlgSelectConnectionPlugin::Cancel() // --------------------------------------------------------- // void CConnDlgSelectConnectionPlugin::Cancel() { - CLOG_ENTERFN( "CConnDlgSelectConnectionPlugin::Cancel" ); - - delete iActivePlugin; - CLOG_WRITE( "iActivePlugin deleted" ); - iActivePlugin = NULL; - CLOG_WRITE( "iActivePlugin NULLed" ); + CLOG_ENTERFN( "CConnDlgSelectConnectionPlugin::Cancel" ); if ( !iCancelled ) { @@ -895,97 +700,12 @@ // --------------------------------------------------------- // CConnDlgSelectConnectionPlugin* CConnDlgSelectConnectionPlugin::NewL( - const TBool aResourceFileResponsible ) + const TBool /*aResourceFileResponsible*/ ) { CConnDlgSelectConnectionPlugin* self = new (ELeave) CConnDlgSelectConnectionPlugin(); - CleanupStack::PushL( self ); - self->ConstructL( KResourceFileName, aResourceFileResponsible ); - CleanupStack::Pop(); - return self; } - - -// --------------------------------------------------------- -// CConnDlgSelectConnectionPlugin::SetSelectedIDsL -// --------------------------------------------------------- -// -void CConnDlgSelectConnectionPlugin::SetElementIDL( TUint32 aIAPId, - TUint32 aDestinationId ) - { - iElementID = iActivePlugin->GetElementIDL( aIAPId, aDestinationId ); - } - -// --------------------------------------------------------- -// CConnDlgSelectConnectionPlugin::GetUserConnection -// --------------------------------------------------------- -// -TInt CConnDlgSelectConnectionPlugin::GetUserConnection( TInt& aIapId, - TInt& aSnapId ) - { - aIapId = 0; - aSnapId = 0; - - TInt err = RProperty::Get( KMPMUserConnectionCategory, - KMPMPSKeyUserConnectionSnap, - aSnapId ); - - if ( err != KErrNone || aSnapId == 0 ) - { - err = RProperty::Get( KMPMUserConnectionCategory, - KMPMPSKeyUserConnectionIap, - aIapId ); - } - - CLOG_WRITEF( _L( "KMPMPSKeyUserConnectionSnap : %d" ), aSnapId ); - CLOG_WRITEF( _L( "KMPMPSKeyUserConnectionIap : %d" ), aIapId ); - CLOG_WRITEF( _L( "err : %d" ), err ); - - return err; - } - - -// --------------------------------------------------------- -// CConnDlgSelectConnectionPlugin::GetActiveConnection -// --------------------------------------------------------- -// -TInt CConnDlgSelectConnectionPlugin::GetActiveConnection( TInt& aIapId, - TInt& aSnapId, - TInt& aBearer ) - { - aIapId = 0; - aSnapId = 0; - aBearer = 0; - - TInt err = RProperty::Get( KMPMActiveConnectionCategory, - KMPMPSKeyActiveConnectionSnap, - aSnapId ); - - if ( err != KErrNone || aSnapId == 0 ) - { - err = RProperty::Get( KMPMActiveConnectionCategory, - KMPMPSKeyActiveConnectionIap, - aIapId ); - } - - CLOG_WRITEF( _L( "KMPMPSKeyActiveConnectionSnap : %d" ), aSnapId ); - CLOG_WRITEF( _L( "KMPMPSKeyActiveConnectionIap : %d" ), aIapId ); - CLOG_WRITEF( _L( "err : %d" ), err ); - - if ( err == KErrNone ) - { - err = RProperty::Get( KMPMActiveConnectionCategory, - KMPMPSKeyActiveConnectionBearer, - aBearer ); - } - - CLOG_WRITEF( _L( "KMPMPSKeyActiveConnectionBearer : %d" ), aBearer ); - CLOG_WRITEF( _L( "iPrefs().iBearerSet : %d" ), iPrefs().iBearerSet ); - CLOG_WRITEF( _L( "err : %d" ), err ); - - return err; - } // End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/src/IAPDialog.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/src/IAPDialog.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,286 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CIapDialog. -* -*/ - - -// INCLUDE FILES -#include "IAPDialog.h" -#include "ConnectionInfo.h" -#include "ConnectionInfoArray.h" -#include "ConnDlgPlugin.h" -#include "ConnectionDialogsLogger.h" -#include "ExpiryTimer.h" - -#include -#include -#include - -#include -#include - - -// CONST DECLARATIONS - -// ROM folder -_LIT( KDriveZ, "z:" ); - - -// Name of the MBM file containing icons -_LIT( KApsettingsMBMFile, "ApSettings.mbm" ); - -#if defined(_DEBUG) -_LIT( KErrNullPointer, "NULL pointer" ); -#endif - -// CONSTANTS - -LOCAL_D const TInt KIconsGranularity = 4; - - -// ================= MEMBER FUNCTIONS ======================= -// -// --------------------------------------------------------- -// CIapDialog::CIapDialog -// --------------------------------------------------------- -// -CIapDialog::CIapDialog( CConnDlgIapPlugin* aPlugin ) -: CAknListQueryDialog( &iDummy ), - iPlugin( aPlugin ), - iFromOkToExit( EFalse ) - { - } - - -// --------------------------------------------------------- -// CIapDialog::NewL -// --------------------------------------------------------- -// -CIapDialog* CIapDialog::NewL( CConnDlgIapPlugin* aPlugin ) - { - CIapDialog* self = new( ELeave ) CIapDialog( aPlugin ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - - -// --------------------------------------------------------- -// CIapDialog::ConstructL() -// --------------------------------------------------------- -// -void CIapDialog::ConstructL() - { - } - - -// --------------------------------------------------------- -// CIapDialog::~CIapDialog() -// --------------------------------------------------------- -// -CIapDialog::~CIapDialog() - { - CLOG_ENTERFN( "CIapDialog::~CIapDialog " ); - iIAPIds.Close(); - delete iExpiryTimer; - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse ); - CLOG_LEAVEFN( "CIapDialog::~CIapDialog " ); - } - - -// --------------------------------------------------------- -// CIapDialog::PreLayoutDynInitL() -// --------------------------------------------------------- -// -void CIapDialog::PreLayoutDynInitL() - { - CLOG_ENTERFN( "CIapDialog::PreLayoutDynInitL " ); - - CAknListQueryDialog::PreLayoutDynInitL(); - - SetOwnershipType( ELbmDoesNotOwnItemArray ); - SetIconsL(); - - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue ); - - iExpiryTimer = CExpiryTimer::NewL( *this ); - iExpiryTimer->Start(); - - CLOG_LEAVEFN( "CIapDialog::PreLayoutDynInitL " ); - } - - -// --------------------------------------------------------- -// CIapDialog::SetIconsL() -// --------------------------------------------------------- -// -void CIapDialog::SetIconsL() - { - CLOG_ENTERFN( "CIapDialog::SetIconsL " ); - - CArrayPtr< CGulIcon >* icons = new( ELeave ) CAknIconArray( - KIconsGranularity ); - CleanupStack::PushL( icons ); - - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - - TFileName iconsFileName; - - iconsFileName.Append( KDriveZ ); - iconsFileName.Append( KDC_APP_BITMAP_DIR ); - iconsFileName.Append( KApsettingsMBMFile ); - - icons->AppendL( AknsUtils::CreateGulIconL( skinInstance, - KAknsIIDQgnPropWmlGprs, - iconsFileName, - EMbmApsettingsQgn_prop_wml_gprs, - EMbmApsettingsQgn_prop_wml_gprs_mask ) ); - - icons->AppendL( AknsUtils::CreateGulIconL( skinInstance, - KAknsIIDQgnPropWmlCsd, - iconsFileName, - EMbmApsettingsQgn_prop_wml_csd, - EMbmApsettingsQgn_prop_wml_csd_mask ) ); - - icons->AppendL( AknsUtils::CreateGulIconL( skinInstance, - KAknsIIDQgnPropWmlHscsd, - iconsFileName, - EMbmApsettingsQgn_prop_wml_hscsd, - EMbmApsettingsQgn_prop_wml_hscsd_mask ) ); - - icons->AppendL( AknsUtils::CreateGulIconL( skinInstance, - KAknsIIDQgnPropWlanEasy, - iconsFileName, - EMbmApsettingsQgn_prop_wlan_easy, - EMbmApsettingsQgn_prop_wlan_easy_mask ) ); - - icons->AppendL( AknsUtils::CreateGulIconL( skinInstance, - KAknsIIDQgnPropWlanBearer, - iconsFileName, - EMbmApsettingsQgn_prop_wlan_bearer, - EMbmApsettingsQgn_prop_wlan_bearer_mask ) ); - - SetIconArrayL( icons ); - - CleanupStack::Pop( icons ); - CLOG_LEAVEFN( "CIapDialog::SetIconsL " ); - } - - -// --------------------------------------------------------- -// CIapDialog::OkToExitL -// --------------------------------------------------------- -// -TBool CIapDialog::OkToExitL( TInt aButtonId ) - { - CLOG_ENTERFN( "CIapDialog::OkToExitL " ); - - TBool result( EFalse ); - TInt completeCode( KErrNone ); - - if ( aButtonId == EAknSoftkeySelect || aButtonId == EAknSoftkeyOk || - aButtonId == EAknSoftkeyDone ) - { - iPlugin->SetPreferredIapIdL( iIAPIds[ListBox()->CurrentItemIndex()] ); - result = ETrue; - } - else if ( aButtonId == EAknSoftkeyCancel ) - { - completeCode = KErrCancel; - result = ETrue; - } - - if ( result ) - { - iFromOkToExit = ETrue; - - __ASSERT_DEBUG( iPlugin, User::Panic( KErrNullPointer, KErrNone ) ); - iPlugin->CompleteL( completeCode ); - } - - CLOG_LEAVEFN( "CIapDialog::OkToExitL " ); - - return result; - } - - -// --------------------------------------------------------- -// CIapDialog::RefreshDialogL -// --------------------------------------------------------- -// -void CIapDialog::RefreshDialogL( CConnectionInfoArray* aIAP, - TBool aIsReallyRefreshing ) - { - CLOG_ENTERFN( "CIapDialog::RefreshDialogL " ); - - SetItemTextArray( aIAP ); - - iIAPIds.Reset(); - - TInt numAPs = aIAP->Count(); - for( TInt ii = 0; ii < numAPs; ii++ ) - { - TUint32 id = aIAP->At( ii )->Id(); - iIAPIds.AppendL( id ); - } - - ListBox()->SetCurrentItemIndex( 0 ); - - ListBox()->HandleItemAdditionL(); - - if ( aIsReallyRefreshing ) - { // If we are really making a refresh, we need to recalculate the - // layout, because the number of items could be different and the - // dialog should be resized accordingly - Layout(); - SizeChanged(); - DrawNow(); - } - - CLOG_LEAVEFN( "CIapDialog::RefreshDialogL " ); - } - -// --------------------------------------------------------- -// CIapDialog::OfferKeyEventL -// --------------------------------------------------------- -// -TKeyResponse CIapDialog::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType) - { - if( aType == EEventKey && aKeyEvent.iCode == EKeyPhoneSend ) - { - // Let's not obscure the Dialer in the background - if ( iExpiryTimer ) - { - iExpiryTimer->Cancel(); - iExpiryTimer->StartShort(); - } - } - - return CAknListQueryDialog::OfferKeyEventL( aKeyEvent,aType ); - } - -void CIapDialog::HandleTimedOut() - { - TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) ); - } - - - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/src/NewIapDialog.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/src/NewIapDialog.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CNewIapDialog. -* -*/ - - - -// INCLUDE FILES -#include "NewIapDialog.h" -#include "ConnDlgPlugin.h" -#include "ExpiryTimer.h" - -#include -#include - -#include - - -// CONST DECLARATIONS - -#if defined(_DEBUG) -_LIT( KErrNullPointer, "NULL pointer" ); -#endif - - -// ================= MEMBER FUNCTIONS ======================= -// -// --------------------------------------------------------- -// CNewIapDialog::CNewIapDialog -// --------------------------------------------------------- -// -CNewIapDialog::CNewIapDialog( CConnDlgNewIapPlugin* aPlugin, TBool& aConnect, - const TNewIapConnectionPrefs& aPrefs ) -: iPlugin( aPlugin ), - iConnect( aConnect ), - iPrefs( aPrefs ) - { - } - - -// --------------------------------------------------------- -// CNewIapDialog::~CNewIapDialog -// --------------------------------------------------------- -// -CNewIapDialog::~CNewIapDialog() - { - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse ); - delete iExpiryTimer; - } - -// --------------------------------------------------------- -// CNewIapDialog::PreLayoutDynInitL -// --------------------------------------------------------- -// -void CNewIapDialog::PreLayoutDynInitL() - { - CAknQueryDialog::PreLayoutDynInitL(); - - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue ); - - // New connection name - HBufC *msg = StringLoader::LoadL( R_CONNDLG_NEW_CONNECTION_ATTEMPT, - iPrefs.iName ); - CleanupStack::PushL( msg ); - SetPromptL( msg->Des() ); - CleanupStack::PopAndDestroy( msg ); - - iExpiryTimer = CExpiryTimer::NewL( *this ); - iExpiryTimer->Start(); - } - - -// --------------------------------------------------------- -// CNewIapDialog::OkToExitL -// --------------------------------------------------------- -// -TBool CNewIapDialog::OkToExitL( TInt aButtonId ) - { - iConnect = EFalse; - if ( aButtonId == EAknSoftkeyYes || aButtonId == EAknSoftkeyDone || - aButtonId == EAknSoftkeyOk ) - { - iConnect = ETrue; - } - - __ASSERT_DEBUG( iPlugin, User::Panic( KErrNullPointer, KErrNone ) ); - iPlugin->CompleteL( KErrNone ); - - return( ETrue ); - } - -void CNewIapDialog::HandleTimedOut() - { - TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) ); - } - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/src/QosDialog.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/src/QosDialog.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CQosDialog. -* -*/ - - -// INCLUDE FILES -#include "QosDialog.h" -#include "ConnDlgPlugin.h" -#include "ExpiryTimer.h" - -#include - - -// CONSTANTS -#if defined(_DEBUG) -_LIT( KErrNullPointer, "NULL pointer" ); -#endif - - -// ================= MEMBER FUNCTIONS ======================= -// -// --------------------------------------------------------- -// CQosDialog::CQosDialog -// --------------------------------------------------------- -// -CQosDialog::CQosDialog( CConnDlgQosPlugin* aPlugin, TBool& aBool ) -: iPlugin( aPlugin ), - iBool( aBool ) - { - } - - -// --------------------------------------------------------- -// CQosDialog::~CQosDialog -// --------------------------------------------------------- -// -CQosDialog::~CQosDialog() - { - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse ); - delete iExpiryTimer; - } - - -// --------------------------------------------------------- -// CQosDialog::PreLayoutDynInitL() -// --------------------------------------------------------- -// -void CQosDialog::PreLayoutDynInitL() - { - CAknQueryDialog::PreLayoutDynInitL(); - - iExpiryTimer = CExpiryTimer::NewL( *this ); - iExpiryTimer->Start(); - - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue ); - } - - -// --------------------------------------------------------- -// CQosDialog::OkToExitL -// --------------------------------------------------------- -// -TBool CQosDialog::OkToExitL( TInt aButtonId ) - { - iBool = EFalse; - if ( aButtonId == EAknSoftkeyYes || aButtonId == EAknSoftkeyDone || - aButtonId == EAknSoftkeyOk ) - { - iBool = ETrue; - } - - - __ASSERT_DEBUG( iPlugin, User::Panic( KErrNullPointer, KErrNone ) ); - iPlugin->CompleteL( KErrNone ); - - return ETrue; - } - -void CQosDialog::HandleTimedOut() - { - TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) ); - } - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/src/ReconnectDialog.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/src/ReconnectDialog.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CReconnectDialog. -* -*/ - - -// INCLUDE FILES -#include "ReconnectDialog.h" -#include "ConnDlgPlugin.h" -#include "ExpiryTimer.h" - -#include - - -// CONSTANTS -#if defined(_DEBUG) -_LIT( KErrNullPointer, "NULL pointer" ); -#endif - - -// ================= MEMBER FUNCTIONS ======================= -// -// --------------------------------------------------------- -// CReconnectDialog::CReconnectDialog -// --------------------------------------------------------- -// -CReconnectDialog::CReconnectDialog( CConnDlgReconnectPlugin* aPlugin, - TBool& aBool ) -: iPlugin( aPlugin ), - iBool( aBool ) - { - } - - -// --------------------------------------------------------- -// CReconnectDialog::~CReconnectDialog -// --------------------------------------------------------- -// -CReconnectDialog::~CReconnectDialog() - { - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse ); - delete iExpiryTimer; - } - -// --------------------------------------------------------- -// CReconnectDialog::PreLayoutDynInitL() -// --------------------------------------------------------- -// -void CReconnectDialog::PreLayoutDynInitL() - { - CAknQueryDialog::PreLayoutDynInitL(); - - iExpiryTimer = CExpiryTimer::NewL( *this ); - iExpiryTimer->Start(); - - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue ); - } - - -// --------------------------------------------------------- -// CReconnectDialog::OkToExitL -// --------------------------------------------------------- -// -TBool CReconnectDialog::OkToExitL( TInt aButtonId ) - { - iBool = EFalse; - if ( aButtonId == EAknSoftkeyYes || aButtonId == EAknSoftkeyDone || - aButtonId == EAknSoftkeyOk ) - { - iBool = ETrue; - } - - - __ASSERT_DEBUG( iPlugin, User::Panic( KErrNullPointer, KErrNone ) ); - iPlugin->CompleteL( KErrNone ); - - return ETrue; - } - -void CReconnectDialog::HandleTimedOut() - { - TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) ); - } - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/src/SelectConnectionDialog.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/src/SelectConnectionDialog.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,570 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CSelectConnectionDialog. -* -*/ - - -// INCLUDE FILES -#include "SelectConnectionDialog.h" -#include "ConnectionInfo.h" -#include "ConnectionInfoArray.h" -#include "ConnectionDialogsLogger.h" -#include "ActiveSelectExplicit.h" -#include "ExpiryTimer.h" -#include "ConnectionDialogs.hrh" - - -#include "ConnDlgPlugin.h" -#include - -#include - -#include -#include -#include -#include -#include -#include - -// CONST DECLARATIONS - -#if defined(_DEBUG) -_LIT( KErrNullPointer, "NULL pointer" ); -#endif - - - -// ================= MEMBER FUNCTIONS ======================= -// -// --------------------------------------------------------- -// CSelectConnectionDialog::CSelectConnectionDialog -// --------------------------------------------------------- -// -CSelectConnectionDialog::CSelectConnectionDialog( - MEikSrvNotifierBase2* aPlugin, - TInt aRefreshInterval, - TUint32 aBearerSet, - TBool aIsWLANFeatureSupported, - TUint aDefaultCMId ) -: CAknListQueryDialog( &iDummy ), - iPlugin( ( CConnDlgSelectConnectionPlugin* )aPlugin ), - iFromOkToExit( EFalse ), - iActiveSelectExplicit( NULL ), - iRefreshInterval( aRefreshInterval ), - iBearerSet( aBearerSet ), - iIsWLANFeatureSupported( aIsWLANFeatureSupported ), - iDefaultCMId( aDefaultCMId ) - { - } - - -// --------------------------------------------------------- -// CSelectConnectionDialog::NewL -// --------------------------------------------------------- -// -CSelectConnectionDialog* CSelectConnectionDialog::NewL( - MEikSrvNotifierBase2* aPlugin, - TInt aRefreshInterval, - TUint32 aBearerSet, - TBool aIsWLANFeatureSupported, - TUint aDefaultCMId ) - { - CSelectConnectionDialog* self = new( ELeave ) CSelectConnectionDialog( - aPlugin, - aRefreshInterval, - aBearerSet, - aIsWLANFeatureSupported, - aDefaultCMId ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - - -// --------------------------------------------------------- -// CSelectConnectionDialog::ConstructL() -// --------------------------------------------------------- -// -void CSelectConnectionDialog::ConstructL() - { - } - - -// --------------------------------------------------------- -// CSelectConnectionDialog::~CSelectConnectionDialog() -// --------------------------------------------------------- -// -CSelectConnectionDialog::~CSelectConnectionDialog() - { - CLOG_ENTERFN( "CSelectConnectionDialog::~CSelectConnectionDialog " ); - iIapIDs.Close(); - iDestIDs.Close(); - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse ); - delete iExpiryTimer; - CLOG_LEAVEFN( "CSelectConnectionDialog::~CSelectConnectionDialog " ); - } - - -// --------------------------------------------------------- -// CSelectConnectionDialog::PreLayoutDynInitL() -// --------------------------------------------------------- -// -void CSelectConnectionDialog::PreLayoutDynInitL() - { - CLOG_ENTERFN( "CSelectConnectionDialog::PreLayoutDynInitL " ); - - CAknListQueryDialog::PreLayoutDynInitL(); - - SetOwnershipType( ELbmDoesNotOwnItemArray ); - SetIconArrayL( iIcons ); - - STATIC_CAST( CEikServAppUi*, - CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue ); - - iExpiryTimer = CExpiryTimer::NewL( *this ); - iExpiryTimer->Start(); - - CLOG_LEAVEFN( "CSelectConnectionDialog::PreLayoutDynInitL " ); - } - - -// --------------------------------------------------------- -// CSelectConnectionDialog::OkToExitL -// --------------------------------------------------------- -// -TBool CSelectConnectionDialog::OkToExitL( TInt aButtonId ) - { - CLOG_ENTERFN( "CSelectConnectionDialog::OkToExitL " ); - - TBool result( EFalse ); - TInt completeCode( KErrNone ); - - if ( aButtonId == EAknSoftkeySelect || aButtonId == EAknSoftkeyOk || - aButtonId == EAknSoftkeyDone ) - { - CLOG_WRITE( "OkToExitL Ok-ed" ); - TInt index = ListBox()->CurrentItemIndex(); - if ( iIapIDs[index] == 0 && iDestIDs[index] == 0 ) - { // Uncategorized - ProcessCommandL( ESelectConnectionCmdChooseMethod ); - } - else - { - iPlugin->SetElementIDL( iIapIDs[index], iDestIDs[index] ); - result = ETrue; - } - } - else if ( aButtonId == EAknSoftkeyCancel ) - { - CLOG_WRITE( "OkToExitL Cancel" ); - completeCode = KErrCancel; - result = ETrue; - } - else if ( aButtonId == EAknSoftkeyOptions ) - { - if ( !( ListBox()->View()->ItemDrawer()->Flags() - & CListItemDrawer::EDisableHighlight ) ) - { - DisplayMenuL(); - } - else - { - ListBox()->View()->ItemDrawer()->ClearFlags( - CListItemDrawer::EDisableHighlight ); - DrawNow(); - } - } - - if ( result ) - { - iFromOkToExit = ETrue; - - __ASSERT_DEBUG( iPlugin, User::Panic( KErrNullPointer, KErrNone ) ); - CLOG_WRITE( "OkToExitL Going to CompleteL" ); - iPlugin->CompleteL( completeCode ); - CLOG_WRITE( "OkToExitL Returned from CompleteL" ); - } - - CLOG_LEAVEFN( "CSelectConnectionDialog::OkToExitL " ); - - return result; - } - - -// --------------------------------------------------------- -// CSelectConnectionDialog::PrepareAndRunLD -// --------------------------------------------------------- -// -void CSelectConnectionDialog::PrepareAndRunLD( CConnectionInfoArray* aIAP, - CArrayPtr< CGulIcon >* aIcons, - TBool aIsReallyRefreshing, - const TInt aHighlightedItem ) - { - PrepareLC( R_SELECT_CONNECTION_QUERY ); - RefreshDialogL( aIAP, aIcons, aIsReallyRefreshing, aHighlightedItem ); - RunLD(); - } - - -// --------------------------------------------------------- -// CSelectConnectionDialog::RefreshDialogL -// --------------------------------------------------------- -// -void CSelectConnectionDialog::RefreshDialogL( CConnectionInfoArray* aIAP, - CArrayPtr< CGulIcon >* aIcons, - TBool aIsReallyRefreshing, - const TInt aHighlightedItem ) - { - CLOG_ENTERFN( "CSelectConnectionDialog::RefreshDialogL " ); - - if ( aIAP->Count() == 0 ) - { - ListBox()->Reset(); - } - else - { - SetItemTextArray( aIAP ); - } - - iIcons = aIcons; - - iIapIDs.Reset(); - iDestIDs.Reset(); - - // Determine the preferred IAP - TInt numAPs = aIAP->Count(); - for( TInt ii = 0; ii < numAPs; ii++ ) - { - iIapIDs.AppendL( aIAP->At( ii )->Id() ); - iDestIDs.AppendL( aIAP->At( ii )->DestinationId() ); - } - - if ( aHighlightedItem >= 0 && aHighlightedItem < numAPs ) - { - ListBox()->SetCurrentItemIndex( aHighlightedItem ); - if ( aHighlightedItem == 1 ) - { - // To have the Search for Wlan also visible. But this is valid only - // if the highlighted item can be the first or the second, - // otherwise we risk to hide the highlighted item! - ListBox()->ScrollToMakeItemVisible( 0 ); - } - } - - ListBox()->HandleItemAdditionL(); - - if ( aHighlightedItem >= 0 && aHighlightedItem < numAPs ) - { - CEikButtonGroupContainer& cba = ButtonGroupContainer(); - HBufC* label; - - if ( iIapIDs[aHighlightedItem] != 0 ) - { // Easy Wlan - label = StringLoader::LoadL( R_QTN_MSK_SELECT ); - } - else if ( iDestIDs[aHighlightedItem] != 0 ) - { // Destination - label = StringLoader::LoadL( R_QTN_MSK_CONNECT ); - } - else // if ( iIapIDs[aHighlightedItem] == 0 && iDestIDs[aHighlightedItem] == 0 ) - { // Uncategorized - label = StringLoader::LoadL( R_QTN_MSK_OPEN ); - } - - CleanupStack::PushL( label ); - cba.SetCommandL( EAknSoftkeyDone, label->Des() ); - CleanupStack::PopAndDestroy(); // label - } - - if ( aIsReallyRefreshing ) - { // If we are really making a refresh, we need to recalculate the - // layout, because the number of items could be different and the - // dialog should be resized accordingly - Layout(); - SizeChanged(); - DrawDeferred(); - } - - CLOG_LEAVEFN( "CSelectConnectionDialog::RefreshDialogL " ); - } - - -// ---------------------------------------------------------------------------- -// CSelectConnectionDialog::DynInitMenuPaneL -// ---------------------------------------------------------------------------- -// -void CSelectConnectionDialog::DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - CAknListQueryDialog::DynInitMenuPaneL( aResourceId, aMenuPane ); - - if ( aResourceId == R_SELECT_CONNECTION_MENU_PANE ) - { - if ( aMenuPane ) - { - TInt index = ListBox()->CurrentItemIndex(); - - if ( iIapIDs[index] != 0 ) - { // Easy Wlan - aMenuPane->DeleteMenuItem( ESelectConnectionCmdChooseMethod ); - aMenuPane->DeleteMenuItem( ESelectConnectionCmdConnect ); - } - else if ( iDestIDs[index] != 0 ) - { // Destination - aMenuPane->DeleteMenuItem( ESelectConnectionCmdSelect ); - } - else // if ( iIapIDs[index] == 0 && iDestIDs[index] == 0 ) - { // Uncategorized - aMenuPane->DeleteMenuItem( ESelectConnectionCmdSelect ); - aMenuPane->DeleteMenuItem( ESelectConnectionCmdConnect ); - } - } - } - } - - -// ---------------------------------------------------------------------------- -// CSelectConnectionDialog::ProcessCommandL -// ---------------------------------------------------------------------------- -// -void CSelectConnectionDialog::ProcessCommandL( TInt aCommand ) - { - CLOG_ENTERFN( "CSelectConnectionDialog::ProcessCommandL" ); - if ( MenuShowing() ) - { - HideMenu(); - } - - switch( aCommand ) - { - case ESelectConnectionCmdSelect: - case ESelectConnectionCmdConnect: - { - TryExitL( EAknSoftkeySelect ); - break; - } - - case ESelectConnectionCmdChooseMethod: - { - if ( !iActiveSelectExplicit ) - { - iActiveSelectExplicit = CActiveSelectExplicit::NewL( this, - iDestIDs[ListBox()->CurrentItemIndex()], - iRefreshInterval, - iBearerSet, - iIsWLANFeatureSupported, - iDefaultCMId ); - iActiveSelectExplicit->ShowSelectExplicitL(); - } - break; - } - - default: - { - break; - } - } - CLOG_LEAVEFN( "CSelectConnectionDialog::ProcessCommandL" ); - } - - -// --------------------------------------------------------- -// CNetworksViewContainer::OfferKeyEventL -// --------------------------------------------------------- -// -TKeyResponse CSelectConnectionDialog::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - CLOG_ENTERFN( "CSelectConnectionDialog::OfferKeyEventL" ); - - if( aType == EEventKey && aKeyEvent.iCode == EKeyPhoneSend ) - { - // Let's not obscure the Dialer in the background - if ( iExpiryTimer && !iActiveSelectExplicit ) - { - iExpiryTimer->Cancel(); - iExpiryTimer->StartShort(); - } - } - - TKeyResponse result( EKeyWasNotConsumed ); - TInt indexBefore = -1; - TInt indexAfter = -1; - - if ( aKeyEvent.iScanCode == EStdKeyDownArrow || - aKeyEvent.iScanCode == EStdKeyUpArrow ) - { - CLOG_WRITE( "Arrow pressed" ); - indexBefore = ListBox()->CurrentItemIndex(); - } - - result = CAknListQueryDialog::OfferKeyEventL( aKeyEvent, aType ); - - CLOG_WRITEF( _L ( "Returned from CAknListQueryDialog::OfferKeyEventL: %d" ), result ); - - if ( aKeyEvent.iScanCode == EStdKeyDownArrow || - aKeyEvent.iScanCode == EStdKeyUpArrow ) - { - indexAfter = ListBox()->CurrentItemIndex(); - } - - if ( indexBefore != indexAfter ) - { - CLOG_WRITEF( _L ( "IndexBefore = %d, IndexAfter = %d" ), indexBefore, indexAfter ); - CEikButtonGroupContainer& cba = ButtonGroupContainer(); - HBufC* label; - if ( iIapIDs[indexAfter] != 0 ) - { // Easy Wlan - label = StringLoader::LoadL( R_QTN_MSK_SELECT ); - } - else if ( iDestIDs[indexAfter] != 0 ) - { // Destination - label = StringLoader::LoadL( R_QTN_MSK_CONNECT ); - } - else // if ( iIapIDs[indexAfter] == 0 && iDestIDs[indexAfter] == 0 ) - { // Uncategorized - label = StringLoader::LoadL( R_QTN_MSK_OPEN ); - } - CleanupStack::PushL( label ); - cba.SetCommandL( EAknSoftkeyDone, label->Des() ); - CleanupStack::PopAndDestroy(); // label - cba.DrawDeferred(); - } - - CLOG_LEAVEFN( "CSelectConnectionDialog::OfferKeyEventL" ); - - return result; - } - - -// ---------------------------------------------------------------------------- -// CSelectConnectionDialog::RunLD -// ---------------------------------------------------------------------------- -// -TInt CSelectConnectionDialog::RunLD() - { - CLOG_ENTERFN( "CSelectConnectionDialog::RunLD" ); - CAknDialog::ConstructL( R_SELECT_CONNECTION_MENUBAR ); - User::ResetInactivityTime(); - - CAknKeySoundSystem* soundSystem = NULL; - if ( iSoundSystem ) - { - iSoundSystem->PushContextL( R_AVKON_DEFAULT_SKEY_LIST ); - // Need to store local copy of iSoundSystem, since it will have been - // destroyed when RunLD returns - soundSystem = iSoundSystem; - } - - CAknsFrameBackgroundControlContext* cc = - ( CAknsFrameBackgroundControlContext* )AknsDrawUtils::ControlContext( - this ); - cc->SetCenter( KAknsIIDQsnFrPopupCenterQuery ); - - TInt ret = CAknDialog::RunLD(); - if ( soundSystem ) - { - soundSystem->PopContext(); - } - CLOG_LEAVEFN( "CSelectConnectionDialog::RunLD" ); - return ret; - } - - -// --------------------------------------------------------- -// CSelectConnectionDialog::SetElementIDL -// --------------------------------------------------------- -// -void CSelectConnectionDialog::SetElementIDL( TUint32 aIAPId ) - { - iPlugin->SetElementIDL( aIAPId, 0 ); - } - - -// --------------------------------------------------------- -// void CSelectConnectionDialog::CompleteL -// --------------------------------------------------------- -// -void CSelectConnectionDialog::CompleteL( TInt aStatus ) - { - CLOG_ENTERFN( "CSelectConnectionDialog::CompleteL" ); - delete iActiveSelectExplicit; - iActiveSelectExplicit = NULL; - iPlugin->CompleteL( aStatus ); - CLOG_LEAVEFN( "CSelectConnectionDialog::CompleteL" ); - } - -void CSelectConnectionDialog::HandleTimedOut() - { - TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) ); - } - -// --------------------------------------------------------- -// void CSelectConnectionDialog::HandleListBoxEventL -// --------------------------------------------------------- -// -void CSelectConnectionDialog::HandleListBoxEventL(CEikListBox* aListBox, - TListBoxEvent aEventType) - { - if( aEventType == EEventItemClicked ) - { - // Do not forward to the base class. - // The first click must only select the item. - return; - } - else if( aEventType == EEventItemDoubleClicked ) - { - // Forward as EEventItemClicked to open the item on the second click. - CAknListQueryDialog::HandleListBoxEventL( aListBox, EEventItemClicked ); - } - else - { - // normal forward - CAknListQueryDialog::HandleListBoxEventL( aListBox, aEventType ); - } - } - -// --------------------------------------------------------- -// void CSelectConnectionDialog::HandlePointerEventL -// --------------------------------------------------------- -// -void CSelectConnectionDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) - { - if( ListBox()->Rect().Contains( aPointerEvent.iPosition ) ) - { - if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - TInt index; - TInt oldIndex = ListBox()->CurrentItemIndex(); - if ( ListBox()->View()->XYPosToItemIndex( aPointerEvent.iPosition, index ) && - ( index == oldIndex ) ) - { - // Pressed Down Effect - ListBox()->View()->ItemDrawer()->SetFlags( CListItemDrawer::EPressedDownState ); - } - } - CAknControl::HandlePointerEventL(aPointerEvent); - } - else - { - CAknListQueryDialog::HandlePointerEventL( aPointerEvent ); - } - } - -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/src/SelectExplicitDialog.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/src/SelectExplicitDialog.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CSelectExplicitDialog. -* -*/ - - -// INCLUDE FILES -#include "SelectExplicitDialog.h" -#include "ConnectionInfo.h" -#include "ConnectionInfoArray.h" -#include "ConnDlgPlugin.h" -#include "ConnectionDialogsLogger.h" -#include "SelectConnectionDialog.h" -#include "ExpiryTimer.h" - -#include -#include -#include - -#include -#include - -#include - - -// ================= MEMBER FUNCTIONS ======================= -// -// --------------------------------------------------------- -// CSelectExplicitDialog::CSelectExplicitDialog -// --------------------------------------------------------- -// -CSelectExplicitDialog::CSelectExplicitDialog( - CSelectConnectionDialog* aCallerDialog ) -: CAknListQueryDialog( &iDummy ), - iCallerDialog( aCallerDialog ), - iFromOkToExit( EFalse ) - { - } - - -// --------------------------------------------------------- -// CSelectExplicitDialog::NewL -// --------------------------------------------------------- -// -CSelectExplicitDialog* CSelectExplicitDialog::NewL( - CSelectConnectionDialog* aCallerDialog ) - { - CSelectExplicitDialog* self = new( ELeave ) - CSelectExplicitDialog( aCallerDialog ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - - -// --------------------------------------------------------- -// CSelectExplicitDialog::ConstructL() -// --------------------------------------------------------- -// -void CSelectExplicitDialog::ConstructL() - { - } - - -// --------------------------------------------------------- -// CSelectExplicitDialog::~CSelectExplicitDialog() -// --------------------------------------------------------- -// -CSelectExplicitDialog::~CSelectExplicitDialog() - { - CLOG_ENTERFN( "CSelectExplicitDialog::~CSelectExplicitDialog " ); - iIAPIds.Close(); - delete iExpiryTimer; - CLOG_LEAVEFN( "CSelectExplicitDialog::~CSelectExplicitDialog " ); - } - - -// --------------------------------------------------------- -// CSelectExplicitDialog::PreLayoutDynInitL() -// --------------------------------------------------------- -// -void CSelectExplicitDialog::PreLayoutDynInitL() - { - CLOG_ENTERFN( "CSelectExplicitDialog::PreLayoutDynInitL " ); - - CAknListQueryDialog::PreLayoutDynInitL(); - - SetOwnershipType( ELbmDoesNotOwnItemArray ); - SetIconArrayL( iIcons ); - - iExpiryTimer = CExpiryTimer::NewL( *this ); - iExpiryTimer->Start(); - - CLOG_LEAVEFN( "CSelectExplicitDialog::PreLayoutDynInitL " ); - } - - -// --------------------------------------------------------- -// CSelectExplicitDialog::OkToExitL -// --------------------------------------------------------- -// -TBool CSelectExplicitDialog::OkToExitL( TInt aButtonId ) - { - CLOG_ENTERFN( "CSelectExplicitDialog::OkToExitL " ); - - TBool result( EFalse ); - TInt completeCode( KErrNone ); - - if ( aButtonId == EAknSoftkeySelect || aButtonId == EAknSoftkeyOk || - aButtonId == EAknSoftkeyDone ) - { - iCallerDialog->SetElementIDL( iIAPIds[ListBox()->CurrentItemIndex()] ); - result = ETrue; - } - else if ( aButtonId == EAknSoftkeyCancel ) - { - completeCode = KErrCancel; - result = ETrue; - } - - if ( result ) - { - iFromOkToExit = ETrue; - - iCallerDialog->CompleteL( completeCode ); - } - - CLOG_LEAVEFN( "CSelectExplicitDialog::OkToExitL " ); - - return result; - } - - -// --------------------------------------------------------- -// CSelectExplicitDialog::PrepareAndRunLD -// --------------------------------------------------------- -// -void CSelectExplicitDialog::PrepareAndRunLD( CConnectionInfoArray* aIAP, - CArrayPtr< CGulIcon >* aIcons, - TBool aIsReallyRefreshing ) - { - PrepareLC( R_LIST_EXPLICIT_QUERY ); - RefreshDialogL( aIAP, aIcons, aIsReallyRefreshing ); - RunLD(); - } - - -// --------------------------------------------------------- -// CSelectExplicitDialog::RefreshDialogL -// --------------------------------------------------------- -// -void CSelectExplicitDialog::RefreshDialogL( CConnectionInfoArray* aIAP, - CArrayPtr< CGulIcon >* aIcons, - TBool aIsReallyRefreshing ) - { - CLOG_ENTERFN( "CSelectExplicitDialog::RefreshDialogL " ); - - SetItemTextArray( aIAP ); - iIcons = aIcons; - - iIAPIds.Reset(); - - // Determine the preferred IAP - TInt numAPs = aIAP->Count(); - for( TInt ii = 0; ii < numAPs; ii++ ) - { - iIAPIds.AppendL( aIAP->At( ii )->Id() ); - } - - if ( numAPs ) - { - ListBox()->SetCurrentItemIndex( 0 ); - } - ListBox()->HandleItemAdditionL(); - - if ( aIsReallyRefreshing ) - { // If we are really making a refresh, we need to recalculate the - // layout, because the number of items could be different and the - // dialog should be resized accordingly - Layout(); - SizeChanged(); - DrawNow(); - } - - CLOG_LEAVEFN( "CSelectExplicitDialog::RefreshDialogL " ); - } - -// --------------------------------------------------------- -// CSelectExplicitDialog::OfferKeyEventL -// --------------------------------------------------------- -// -TKeyResponse CSelectExplicitDialog::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType) - { - if( aType == EEventKey && aKeyEvent.iCode == EKeyPhoneSend ) - { - // Let's not obscure the Dialer in the background - if ( iExpiryTimer ) - { - iExpiryTimer->Cancel(); - iExpiryTimer->StartShort(); - } - } - - return CAknListQueryDialog::OfferKeyEventL( aKeyEvent,aType ); - } - -void CSelectExplicitDialog::HandleTimedOut() - { - TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) ); - } -// End of File diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/cconndlg/src/sortsnaputils.cpp --- a/connectionutilities/ConnectionDialogs/cconndlg/src/sortsnaputils.cpp Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,229 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class TSortSnapUtils. -* -*/ - - -// INCLUDE FILES -#include "sortsnaputils.h" -#include "ConnectionDialogsLogger.h" - -// ================= MEMBER FUNCTIONS ======================= -// -// --------------------------------------------------------- -// TSortSnapUtils::TSortSnapUtils -// --------------------------------------------------------- -// -TSortSnapUtils::TSortSnapUtils( RMPM& aMPM ): -iSnapCount( 0 ), -iSSUState( EUninitialised ), -iMPM( aMPM ) - { - CLOG_ENTERFN( "TSortSnapUtils::TSortSnapUtils" ); - CLOG_LEAVEFN( "TSortSnapUtils::TSortSnapUtils" ); - } - - -// --------------------------------------------------------- -// TSortSnapUtils::~TSortSnapUtils -// --------------------------------------------------------- -// -TSortSnapUtils::~TSortSnapUtils() - { - CLOG_ENTERFN( "TSortSnapUtils::~TSortSnapUtils" ); - CLOG_LEAVEFN( "TSortSnapUtils::~TSortSnapUtils" ); - } - -// --------------------------------------------------------- -// TSortSnapUtils::InitDestIdArray -// --------------------------------------------------------- -// -void TSortSnapUtils::InitDestIdArray() - { - CLOG_ENTERFN( "TSortSnapUtils::InitDestIdArray" ); - switch (iSSUState) - { - case EUseMPM: - { - // we already know that MPM is used - CLOG_WRITE( "using MPM, no need to re-read from P&S " ); - break; - } - case EUninitialised: - case EUsePubSub: - default: - { - iSnapCount = 0; - TMpmSnapPubSubFormat snapData; - TPtr8 e( reinterpret_cast< TUint8* >( &snapData ), - sizeof( snapData ) ); - for (TInt i = 0 ; i < KMPMSortSnapMaxKey; i++ ) - { - TInt err = RProperty::Get( KMPMSortSnapCategory, - i, - e ); - CLOG_WRITEF( _L( "RProperty::Get returned: %d" ), err ); - CLOG_WRITEF( _L( "Snap Id: %d" ), snapData.iSnap ); - CLOG_WRITEF( _L( "Snap Number: %d" ), iSnapCount ); - - if (err == KErrNone) - { - iSnapIdArray[iSnapCount] = snapData.iSnap; - iSnapCount++; - } - } - //determine what method to use: - // we always have at least one snap element - // in P&S - // if we are called from MPM - if (iSnapCount) - { - CLOG_WRITE( "iSSUState = EUsePubSub " ); - iSSUState = EUsePubSub; - } - else - { - CLOG_WRITE( "iSSUState = EUseMPM " ); - iSSUState = EUseMPM; - } - } - } - CLOG_LEAVEFN( "TSortSnapUtils::InitDestIdArray" ); - } - -// --------------------------------------------------------- -// TSortSnapUtils::GetDestIdArrayL -// --------------------------------------------------------- -// -void TSortSnapUtils::GetDestIdArrayL( RCmManagerExt& aCmManagerExt, RArray& aDestArray ) - { - CLOG_ENTERFN( "TSortSnapUtils::GetDestIdArrayL" ); - aDestArray.Reset(); - InitDestIdArray(); // re-read the values, set iSSUState - switch (iSSUState) - { - case EUsePubSub: - { - CLOG_WRITE( "Using P&S " ); - // append from 1, do not append uncategorised destination! - for ( TInt i = 1 ; i < iSnapCount; i++ ) - { - aDestArray.Append( iSnapIdArray[i] ); - CLOG_WRITEF( _L( "Appending to array: Snap Id: %d" ), iSnapIdArray[i] ); - } - break; - } - case EUseMPM: - { - CLOG_WRITE( "Using MPM " ); - aCmManagerExt.AllDestinationsL( aDestArray ); - break; - } - case EUninitialised: - default: - { - //should not ever happen, as we initialise at the beginning of the - // function - User::Leave( KErrNotReady ); - } - } - CLOG_LEAVEFN( "TSortSnapUtils::GetDestIdArrayL" ); - } - -// --------------------------------------------------------- -// TSortSnapUtils::GetSortSnapDataL() -// --------------------------------------------------------- -// -TInt TSortSnapUtils::GetSortSnapData( TUint32 aSnapId, TMpmSnapBuffer& aSnapBuffer ) - { - CLOG_ENTERFN( "TSortSnapUtils::GetSortSnapDataL" ); - - if (iSSUState == EUninitialised) - { - InitDestIdArray(); - } - - switch (iSSUState) - { - case EUsePubSub: - { - CLOG_WRITE( "Using P&S " ); - TMpmSnapPubSubFormat snapData; - TPtr8 e( reinterpret_cast< TUint8* >( &snapData ), - sizeof( snapData ) ); - // initialize snap to invalid value - snapData.iSnap = (TUint32) KErrNotFound; - for ( TInt i = 0 ; i < iSnapCount; i++ ) - { - if ( aSnapId == iSnapIdArray[i] ) - { - - TInt err = RProperty::Get( KMPMSortSnapCategory, - i, - e ); - CLOG_WRITEF( _L( "RProperty::Get returned: %d" ), err ); - - if (err == KErrNone) - { - if ( aSnapId == snapData.iSnap ) - { - aSnapBuffer = snapData.iSortedIaps; - - CLOG_WRITEF( _L( "Found: Snap id: %d" ), snapData.iSnap ); - CLOG_WRITEF( _L( "Iap count: %d" ), snapData.iSortedIaps.iCount ); - - CLOG_LEAVEFN( "TSortSnapUtils::GetSortSnapDataL" ); - return KErrNone; - } - } - else - { - CLOG_LEAVEFN( "TSortSnapUtils::GetSortSnapDataL" ); - return err; - } - } - } - break; - } - case EUseMPM: - { - CLOG_WRITE( "Using MPM " ); - TInt errConnect = iMPM.Connect(); - CLOG_WRITEF( _L( "errConnect = %d" ), errConnect ); - if ( errConnect == KErrNone ) - { - TInt err = iMPM.SortSNAP( aSnapId, aSnapBuffer ); - iMPM.Close(); - CLOG_LEAVEFN( "TSortSnapUtils::GetSortSnapDataL" ); - return err; - } - else - { - CLOG_LEAVEFN( "TSortSnapUtils::GetSortSnapDataL" ); - return errConnect; - } - } - case EUninitialised: - default: - { - //should not ever happen, as we initialise at the beginning of the - // function - CLOG_LEAVEFN( "TSortSnapUtils::GetSortSnapDataL" ); - return KErrNotReady; - } - } - return KErrNone; - } - diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/ecomsrc/connectiondialogswrapper.cpp --- a/connectionutilities/ConnectionDialogs/ecomsrc/connectiondialogswrapper.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/ecomsrc/connectiondialogswrapper.cpp Mon May 03 12:53:07 2010 +0300 @@ -183,21 +183,6 @@ KUidEasyWapiDlg, KMyPriority ) ); - subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master, - KUidNoWLANNetworksAvailableNote, - KUidNoWLANNetworksAvailableNote, - KMyPriority ) ); - - subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master, - KUidConnectingViaDiscreetPopup, - KUidConnectingViaDiscreetPopup, - KMyPriority ) ); - - subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master, - KUidConnectionErrorDiscreetPopup, - KUidConnectionErrorDiscreetPopup, - KMyPriority ) ); - CleanupStack::Pop(); // array cleanup return( subjects ); } diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/group/CConnDlgClient.mmp --- a/connectionutilities/ConnectionDialogs/group/CConnDlgClient.mmp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/group/CConnDlgClient.mmp Mon May 03 12:53:07 2010 +0300 @@ -31,7 +31,6 @@ SOURCEPATH ../cconndlg/clientsrc SOURCE GenConAgentDialogServer.cpp -SOURCE ActiveLogin.cpp USERINCLUDE ../cconndlg/inc ../cconndlg/clientinc diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/group/CConnDlgPlugin.mmp --- a/connectionutilities/ConnectionDialogs/group/CConnDlgPlugin.mmp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/group/CConnDlgPlugin.mmp Mon May 03 12:53:07 2010 +0300 @@ -44,23 +44,8 @@ SYSTEMINCLUDE /epoc32/include/uikon -START RESOURCE ../cconndlg/data/CConnDlgPlugin.rss -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END // RESOURCE - - SOURCEPATH ../cconndlg/src -SOURCE ConnDlgPlugin.cpp IAPDialog.cpp AuthenticationDialog.cpp -SOURCE ReconnectDialog.cpp NewIapDialog.cpp QosDialog.cpp -SOURCE ActiveIapPlugin.cpp -SOURCE ActiveBase.cpp -SOURCE SelectConnectionDialog.cpp -SOURCE ActiveSelectConnectionPlugin.cpp -SOURCE SelectExplicitDialog.cpp -SOURCE ActiveSelectExplicit.cpp -SOURCE sortsnaputils.cpp +SOURCE ConnDlgPlugin.cpp SOURCEPATH ../src SOURCE ConnectionInfo.cpp ConnectionInfoKey.cpp ConnectionInfoArray.cpp ExpiryTimer.cpp @@ -89,9 +74,10 @@ #ifdef WINSCW - DEFFILE ../cconndlg/BWinsCw/CConnDlgPlugin.DEF +DEFFILE ../cconndlg/BWinsCw/CConnDlgPlugin.DEF #else - DEFFILE ../cconndlg/EABI/CCONNDLGPLUGIN.DEF +DEFFILE ../cconndlg/EABI/CCONNDLGPLUGIN.DEF #endif // End of File + diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/group/ConnUiUtilsNotif.mmp --- a/connectionutilities/ConnectionDialogs/group/ConnUiUtilsNotif.mmp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/group/ConnUiUtilsNotif.mmp Mon May 03 12:53:07 2010 +0300 @@ -65,18 +65,10 @@ SOURCE WLANNetworkUnavailableNoteNotif.cpp SOURCE ActiveWLANNetworkUnavailableNote.cpp -SOURCE ActiveConnectViaNote.cpp -SOURCE ConnectViaNoteNotif.cpp SOURCE NoteDlgSuppressingSwitch.cpp SOURCE wlanpowersavetest.cpp SOURCE wlanpowersavetestnotif.cpp SOURCE easywapidlgnotif.cpp -SOURCE nowlannetworksavailablenotif.cpp -SOURCE connectingviadiscreetpopup.cpp -SOURCE connectingviadiscreetpopupnotif.cpp -SOURCE connectionerrordiscreetpopup.cpp -SOURCE connectionerrordiscreetpopupnotif.cpp -SOURCE nowlansdiscreetpopup.cpp SOURCE cellulardataconfirmation.cpp SOURCE devicedialogobserver.cpp @@ -99,10 +91,13 @@ SYSTEMINCLUDE /epoc32/include/libc SYSTEMINCLUDE /epoc32/include/uikon +SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore +SYSTEMINCLUDE /epoc32/include/mw/hb/hbwidgets + LIBRARY euser.lib eikdlg.lib eiksrv.lib cone.lib eikcore.lib eikcoctl.lib LIBRARY bafl.lib avkon.lib AknSkins.lib Ecom.lib -LIBRARY eiksrvui.lib +LIBRARY eiksrvui.lib LIBRARY commonengine.lib LIBRARY AKNNOTIFY.LIB LIBRARY AknIcon.lib @@ -114,13 +109,13 @@ LIBRARY charconv.lib LIBRARY commdb.lib -LIBRARY cmmanager.lib +LIBRARY cmmanager.lib LIBRARY etel3rdparty.lib LIBRARY HbCore.lib LIBRARY HbWidgets.lib #if defined(ARMCC) - DEFFILE ../ConnectionUiUtilities/EABI/ConnUiUtilsNotif.DEF +DEFFILE ../ConnectionUiUtilities/EABI/ConnUiUtilsNotif.DEF #elif defined( WINSCW ) DEFFILE ../ConnectionUiUtilities/BWinsCw/ConnUiUtilsNotif.DEF #endif diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/group/ConnectionUiUtilities.mmp --- a/connectionutilities/ConnectionDialogs/group/ConnectionUiUtilities.mmp Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/group/ConnectionUiUtilities.mmp Mon May 03 12:53:07 2010 +0300 @@ -43,7 +43,7 @@ SOURCE ChangeConnectionDlg.cpp SOURCE ActiveCChangeConnectionDlg.cpp SOURCE ActiveWrapper.cpp - +SOURCE connectionstatuspopup.cpp SOURCEPATH ../src SOURCE ConnectionInfo.cpp @@ -52,11 +52,11 @@ SOURCE ActiveIAPListing.cpp SOURCE ExpiryTimer.cpp - USERINCLUDE ../ConnectionUiUtilities/inc // Component specific internal headers USERINCLUDE ../inc +USERINCLUDE ../traces // ADO specific internal headers SYSTEMINCLUDE ../../../inc @@ -64,23 +64,31 @@ //Macro to /epoc32 headers MW_LAYER_SYSTEMINCLUDE +// Hb orbit headers +SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore +SYSTEMINCLUDE /epoc32/include/mw/hb/hbwidgets + LIBRARY euser.lib cone.lib eikcore.lib eikcoctl.lib avkon.lib eikdlg.lib LIBRARY bafl.lib commonengine.lib commdb.lib AknSkins.lib FeatMgr.lib LIBRARY AknNotify.lib LIBRARY Ecom.lib LIBRARY centralrepository.lib LIBRARY aknlayout.lib +LIBRARY hbcore.lib +LIBRARY hbwidgets.lib +LIBRARY cmmanager.lib +LIBRARY efsrv.lib DEBUGLIBRARY flogger.lib #if defined( ARMCC ) - DEFFILE ../ConnectionUiUtilities/EABI/ConnectionUiUtilities_PROT.def +DEFFILE ../ConnectionUiUtilities/EABI/ConnectionUiUtilities_PROT.def #elif defined( WINSCW ) - DEFFILE ../ConnectionUiUtilities/BWinsCw/ConnectionUiUtilities_PROT.def +DEFFILE ../ConnectionUiUtilities/BWinsCw/ConnectionUiUtilities_PROT.def #endif diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/inc/ConnectionDialogsUidDefs.h --- a/connectionutilities/ConnectionDialogs/inc/ConnectionDialogsUidDefs.h Fri Apr 16 15:21:37 2010 +0300 +++ b/connectionutilities/ConnectionDialogs/inc/ConnectionDialogsUidDefs.h Mon May 03 12:53:07 2010 +0300 @@ -58,10 +58,12 @@ const TUid KUidDisconnectDlg = { 0x101F85F1 }; // ID of Connecting via discreet popup -const TUid KUidConnectingViaDiscreetPopup = { 0x20026FC5 }; +// Deprecated. Left here for documentation purpose. +// const TUid KUidConnectingViaDiscreetPopup = { 0x20026FC5 }; // ID of Connection error discreet popup -const TUid KUidConnectionErrorDiscreetPopup = { 0x20026FEF }; +// Deprecated. Left here for documentation purpose. +// const TUid KUidConnectionErrorDiscreetPopup = { 0x20026FEF }; // WLAN uids @@ -97,7 +99,8 @@ const TUid KUidEasyWapiDlg = { 0x101F6D51 }; // ID of No WLAN networks are available at the moment -note -const TUid KUidNoWLANNetworksAvailableNote = { 0x20016A83 }; +// Deprecated. Left here for documentation purpose. +// const TUid KUidNoWLANNetworksAvailableNote = { 0x20016A83 }; #endif // __CONNECTIONDIALOGSUIDDEFS_H__ diff -r fcbbe021d614 -r 9c97ad6591ae connectionutilities/ConnectionDialogs/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectionutilities/ConnectionDialogs/traces/OstTraceDefinitions.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,21 @@ +/* +* 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 __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +#include +#endif diff -r fcbbe021d614 -r 9c97ad6591ae dbcreator/commsdatcreator/Inc/cdcprocessorglobal.h --- a/dbcreator/commsdatcreator/Inc/cdcprocessorglobal.h Fri Apr 16 15:21:37 2010 +0300 +++ b/dbcreator/commsdatcreator/Inc/cdcprocessorglobal.h Mon May 03 12:53:07 2010 +0300 @@ -66,7 +66,7 @@ RPointerArray< HBufC >& aDefCon ); // Stores the default connection values - void SetDefaultConnectionL(); + // void SetDefaultConnectionL(); /** * Destructor. diff -r fcbbe021d614 -r 9c97ad6591ae dbcreator/commsdatcreator/Src/cdccommsdatcreator.cpp --- a/dbcreator/commsdatcreator/Src/cdccommsdatcreator.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/dbcreator/commsdatcreator/Src/cdccommsdatcreator.cpp Mon May 03 12:53:07 2010 +0300 @@ -350,8 +350,8 @@ SetLingerSettingsL( iLingerSettings ); // Sets the default connection - SetDefaultConnectionL( iDefCon ); - +// SetDefaultConnectionL( iDefCon ); + // Logs IAPs in UDEB mode #ifdef _DEBUG LogIapIdsL(); @@ -587,7 +587,7 @@ // CCdcCommsDatCreator::ProcessDNL // --------------------------------------------------------- // -void CCdcCommsDatCreator::SetDefaultConnectionL( RPointerArray< HBufC >& aDefCon ) +/*void CCdcCommsDatCreator::SetDefaultConnectionL( RPointerArray< HBufC >& aDefCon ) { // Sets the default connection if( aDefCon.Count() > 0 ) @@ -605,12 +605,12 @@ CleanupStack::PushL( glb ); glb->SetDefaultConnectionL(); - + CleanupStack::PopAndDestroy( glb ); CLOG_WRITE( "--------------------------------------\n" ) } - } + }*/ // --------------------------------------------------------- // CCdcCommsDatCreator::SetUnderlyingIapL diff -r fcbbe021d614 -r 9c97ad6591ae dbcreator/commsdatcreator/Src/cdcprocessordn.cpp --- a/dbcreator/commsdatcreator/Src/cdcprocessordn.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/dbcreator/commsdatcreator/Src/cdcprocessordn.cpp Mon May 03 12:53:07 2010 +0300 @@ -187,17 +187,18 @@ } } break; - case EDN_Icon: - { - TPtrC16 iconPtr = ptrTag->Right( ptrTag->Length() ); - TLex16 lex( iconPtr ); - TUint32 icon( 0 ); - if ( lex.Val( icon, EDecimal ) == KErrNone ) - { - iDestination.SetIconL( icon ); - } - } - break; + // SetIconL API removed from new cmmgr implementation + //case EDN_Icon: + // { + // TPtrC16 iconPtr = ptrTag->Right( ptrTag->Length() ); + // TLex16 lex( iconPtr ); + // TUint32 icon( 0 ); + // if ( lex.Val( icon, EDecimal ) == KErrNone ) + // { + // iDestination.SetIconL( icon ); + // } + // } + //break; case EDN_Metadata: { if( !ptrTag->Compare( KPurposeUnknown ) ) diff -r fcbbe021d614 -r 9c97ad6591ae dbcreator/commsdatcreator/Src/cdcprocessorglobal.cpp --- a/dbcreator/commsdatcreator/Src/cdcprocessorglobal.cpp Fri Apr 16 15:21:37 2010 +0300 +++ b/dbcreator/commsdatcreator/Src/cdcprocessorglobal.cpp Mon May 03 12:53:07 2010 +0300 @@ -614,7 +614,7 @@ // CProcessorGlobal::SetDefaultConnectionL // --------------------------------------------------------- // -void CProcessorGlobal::SetDefaultConnectionL() +/*void CProcessorGlobal::SetDefaultConnectionL() { if( iDefCon->Count() > 0 ) { @@ -624,7 +624,7 @@ { SetDefaultConnectionNameL( (*iDefCon)[1] ); } - } + }*/ // --------------------------------------------------------- // CProcessorGlobal::SetDefaultConnectionTypeL @@ -759,14 +759,14 @@ // CProcessorGlobal::SetDefConnRecordL() //----------------------------------------------------------------------------- // -void CProcessorGlobal::SetDefConnRecordL( const TInt aId ) +void CProcessorGlobal::SetDefConnRecordL( const TInt /*aId*/ ) { - TCmDefConnValue value; +/* TCmDefConnValue value; value.iType = iDefaultConnectionType; - value.iId = aId; + value.iId = aId;*/ - iCmManager->WriteDefConnL( value ); +// iCmManager->WriteDefConnL( value ); // It gets true if the defconn was set correctly iDefaultConnectionSet = ETrue; diff -r fcbbe021d614 -r 9c97ad6591ae dbcreator/inc/cdccommsdatcreator.h --- a/dbcreator/inc/cdccommsdatcreator.h Fri Apr 16 15:21:37 2010 +0300 +++ b/dbcreator/inc/cdccommsdatcreator.h Mon May 03 12:53:07 2010 +0300 @@ -96,7 +96,7 @@ void SetUnderlyingIapL( RPointerArray< HBufC >& aUnderLying ); - void SetDefaultConnectionL( RPointerArray< HBufC >& aDefCon ); +// void SetDefaultConnectionL( RPointerArray< HBufC >& aDefCon ); void SetWlanSecurityL( RPointerArray< HBufC >& aWlanSecurity ); diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/bearer_settings_plugin_api/group/bld.inf --- a/ipcm_plat/bearer_settings_plugin_api/group/bld.inf Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_plat/bearer_settings_plugin_api/group/bld.inf Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -11,8 +11,8 @@ * * Contributors: * -* Description: File that exports the files belonging to -: Bearer Settings Plugin API +* Description: +* File that exports the files belonging to Bearer Settings Plugin API. * */ @@ -24,13 +24,13 @@ PRJ_EXPORTS -../inc/cmpbasesettingsdlgip.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpbasesettingsdlgip.h) -../inc/cmpluginlanbase.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpluginlanbase.h) -../inc/cmpbasesettingsdlgadv.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpbasesettingsdlgadv.h) -../inc/cmpluginlandef.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpluginlandef.h) -../inc/cmcommonconstants.h MW_LAYER_PLATFORM_EXPORT_PATH(cmcommonconstants.h) -../inc/cmpluginbaseeng.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpluginbaseeng.h) -../inc/cmpluginbase.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpluginbase.h) +../inc/cmpbasesettingsdlgip.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpbasesettingsdlgip.h) +../inc/cmpluginlanbase.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpluginlanbase.h) +../inc/cmpbasesettingsdlgadv.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpbasesettingsdlgadv.h) +../inc/cmpluginlandef.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpluginlandef.h) +../inc/cmcommonconstants.h MW_LAYER_PLATFORM_EXPORT_PATH(cmcommonconstants.h) +../inc/cmpluginbaseeng.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpluginbaseeng.h) +../inc/cmpluginbase.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpluginbase.h) ../inc/cmpluginlanbasedef.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpluginlanbasedef.h) ../inc/cmpbasesettingsdlg.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpbasesettingsdlg.h) -../inc/mcmdexec.h MW_LAYER_PLATFORM_EXPORT_PATH(mcmdexec.h) +../inc/mcmdexec.h MW_LAYER_PLATFORM_EXPORT_PATH(mcmdexec.h) diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/bearer_settings_plugin_api/inc/cmpluginbase.h --- a/ipcm_plat/bearer_settings_plugin_api/inc/cmpluginbase.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_plat/bearer_settings_plugin_api/inc/cmpluginbase.h Mon May 03 12:53:07 2010 +0300 @@ -241,30 +241,7 @@ IMPORT_C CommsDat::CMDBSession& Session() const; - /** - * Launches the settings dialog of the plugin - * - * @since S60 3.2 - * @return soft key selection - */ - TInt RunSettingsL(); - - /** - * Called on a newly created connection method to initialize it properly - * with user interaction (e.g. APN setting for a packet data-, WEP-key - * setting for a WLAN connection method, etc.). - * Note: each plug-in should set its name (i.e. ECmName) in this - * function call. - * - * @since S60 3.2 - * @param aManuallyConfigure let's the plugin know if a plugin should - * be configured manually or automatically - * @return ETrue if initialization was successful and wasn't cancelled. - * EFalse, if initialization process was cancelled (i.e. user pressed - * Cancel button). - */ - TBool InitializeWithUiL( TBool aManuallyConfigure ); - + /** * Checks if the plug-in can handle the given AP. * @param aIapId IAPId of the AP to be checked diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/bearer_settings_plugin_api/inc/cmpluginbaseeng.h --- a/ipcm_plat/bearer_settings_plugin_api/inc/cmpluginbaseeng.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_plat/bearer_settings_plugin_api/inc/cmpluginbaseeng.h Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -11,7 +11,8 @@ * * Contributors: * -* Description: IF implementation class for connection method plugins. +* Description: +* IF implementation class for connection method plugins. * */ @@ -23,14 +24,28 @@ #include #include -#include // For REComSession +#include #include -#include +#include +#include + +/** + * Macro for getting element id from Iap Id. + * @param iapRecId Record id of an Iap. + */ #define IAP_ELEMENT_ID( iapRecId ) (KCDTIdIAPRecord | \ KCDMaskShowFieldType | \ (iapRecId << 8)) +/** + * Macros for getting/setting diffrerent type of values from/to the records(CommsDat) + * @param record Pointer to the record which has the field requested/to be set. + * @param fieldId Id of the field to get/set the value. + * @param ***Val Value to be set. + * @return Returns the requested value in get operation. + */ + #define QUERY_HBUFC_FIELD( record, fieldId ) *STATIC_CAST(CommsDat::CMDBField*, record->GetFieldByIdL( fieldId )) #define QUERY_UINT32_FIELD( record, fieldId ) *STATIC_CAST(CommsDat::CMDBField*, record->GetFieldByIdL( fieldId )) #define QUERY_INT_FIELD( record, fieldId ) *STATIC_CAST(CommsDat::CMDBField*, record->GetFieldByIdL( fieldId )) @@ -41,11 +56,23 @@ // CONSTANTS const TInt32 KExtensionBaseLevel = 1; -const TUint32 KDefAttrsArrayGranSize = 32; -const TUint32 KMaxProxyServerNameLength = 1000; +const TUint32 KMaxProxyServerNameLength = 1024; const TUint32 KDummyBearerType = 1; +/** + * Record indexes for generic iap records in the Client instance table. + */ +const TInt KIapRecordIndex = 0; +const TInt KServiceRecordIndex = 1; +const TInt KNetworkRecordIndex = 2; +const TInt KWAPAPRecordIndex = 3; +const TInt KWAPBearerRecordIndex = 4; +const TInt KMetaDataRecordIndex = 5; +const TInt KLocationRecordIndex = 6; +const TInt KProxyRecordIndex = 7; + + // DATA TYPES typedef enum { @@ -76,734 +103,664 @@ */ }; -class CCmPluginBaseEng; -class CCmPluginBase; - /** -* Validation function called before data is stored. -* @param aThis 'this' pointer of the plugin instance -* @param aAttribute attribute to be set -* @param aValue value to be checked -* @return ETrue if value is stored. -*/ -typedef TBool (*TValidationFunctionL)( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ); - -/** -* Structure of conversion table between CM attributes and -* CommsDat ids. The first element must indicate the -* range of the conversion table. iAttribId is the lowest Id, -* iCommsDatId is the highest one. The last element is a -* terminator. e.g. Proxy table: -* static const TCmAttribConvTable SProxyConvTbl[] = -* { - { ECMProxyUsageEnabled, ECMProxyRangeMax, NULL } - { ECMProxyUseProxyServer, KCDTIdUseProxyServer, NULL }, - { ECmProxyPortNumber, KCDTIdPortNumber, &CheckPortNumberValidityL }, - ... - { 0, 0 } - } -*/ -typedef struct - { - TInt iAttribId; - TInt iCommsDatId; - TValidationFunctionL iValidFuncL; - TInt iTitleId; - TInt iMaxLength; - TUint32 iAttribFlags; // see TCmConvAttribFlags - TInt iDefSettingResId; - TInt iEditorResId; - TInt iDefValueResId; - TAny* iNotUsed1; - TAny* iNotUsed2; - }TCmAttribConvTable; - -enum TCmConvAttribFlags - { - EConvNoZeroLength = 0x00000001, // Zero length NOT acceptable - EConvCompulsory = 0x00000002, - EConv8Bits = 0x00000004, - EConvReadOnly = 0x00000008, - EConvNumber = 0x00000010, - EConvIPv4 = 0x00000020, - EConvIPv6 = 0x00000040, - EConvPassword = 0x00000080, - }; - -typedef struct - { - CommsDat::CCDRecordBase* *iRecord; - TBool* iEnabled; - const TCmAttribConvTable* iConvTable; - }TCmAttrConvArrayItem; - -typedef struct - { - TInt iAttribId; - TInt iCommonAttribId; - }TCmCommonAttrConvArrayItem; - + * Flags for Iap metadata to indicate: + * EMetaHighlight: If it's set it indicates that a connection method is + * highlighted in Agent dialog. Only one connection + * method can have this flag set. + * EMetaHiddenAgent: If it's set it indicates that an connection method is + * hidden connection method in Agent dialog. + */ enum TCmMetaDataFields { EMetaHighlight = 0x00000001, EMetaHiddenAgent = 0x00000002 }; - -// FUNCTION PROTOTYPES - -/** -* TValidationFunctionL functions. -*/ - -/** -* Function should be called if client tries to set attribute that is read-only -* @param aThis 'this' pointer of the plugin instance -* @param aAttribute not used -* @param aValue not used -* @leave KErrNotSupported in every cases -*/ -IMPORT_C TBool ReadOnlyAttributeL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ); - -/** -* Function to check if the passed IPv4 address is valid. -* @param aThis 'this' pointer of the plugin instance -* @param aAttribute attribute client wants to set -* @param aValue TDesC* IPv4 address buffer to be checked -*/ -IMPORT_C TBool CheckIPv4ValidityL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ); - -/** -* Function to check if the passed IPv6 address is valid. -* @param aThis 'this' pointer of the plugin instance -* @param aAttribute attribute client wants to set -* @param aValue TDesC* IPv6 address buffer to be checked -*/ -IMPORT_C TBool CheckIPv6ValidityL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ); - -/** -* Function to check if the passed port number is valid. -* @param aThis 'this' pointer of the plugin instance -* @param aAttribute attribute client wants to set -* @param aValue TUint32 the port number to be check -*/ -IMPORT_C TBool CheckPortNumberValidityL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ); - -/** -* Function to check if the passed record is valid. -* @param aThis 'this' pointer of the plugin instance -* @param aAttribute attribute client wants to set -* @param aValue TUint32 the record id to be checked -*/ -IMPORT_C TBool CheckRecordIdValidityL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ); - -/** -* Function to check if the passed WAPWspOption is valid. -* @param aThis 'this' pointer of the plugin instance -* @param aAttribute attribute client wants to set -* @param TUint32 the WPSOption to be checked -*/ -IMPORT_C TBool CheckWAPWspOptionValidityL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ); - -/** -* @param aThis 'this' pointer of the plugin instance -* @param aAttribute attribute client wants to set -* @param TUint32 the WPSOption to be checked -*/ -IMPORT_C TBool SetProxyServerNameL( CCmPluginBaseEng* aThis, - TUint32 aAttribute, - const TAny* aValue ); - -/** -* Miscellaneous utility functions. -*/ - -/** -* Check if the passed IP address is '0.0.0.0' or empty string -* @param aIpAddress IP address to be checked -*/ -IMPORT_C TBool IsUnspecifiedIPv4Address( const TDesC& aIpv4Address ); - -/** -* Check if the passed IP address is one of these: -* - empty string - -* - '0:0:0:0:0:0:0:0' -* - 'fec0:000:0000:ffff::1' -* - 'fec0:000:0000:ffff::2' -* @param aIpAddress IP address to be checked -*/ -IMPORT_C CMManager::TIPv6Types ClassifyIPv6Address( const TDesC& aIpv6Address ); // FORWARD DECLARATIONS -class CCmDestinationImpl; -class CCmManagerImpl; +class CCmPluginBaseEng; class CCDIAPMetadataRecord; -class CCmTransactionHandler; -class CCmPluginBasePrivate; // CLASS DECLARATION +/** + * Initialisation instance for plugin creation. Used in plugin + * construction phase. + */ NONSHARABLE_CLASS(TCmPluginInitParam) { public: - - TCmPluginInitParam( CCmManagerImpl& aCmMgr ); + /** + * Constructor. + * @param aSessionRef Reference for open Session handle to CommsDat. + */ + IMPORT_C TCmPluginInitParam( CommsDat::CMDBSession& aSessionRef ); public: - - CCmManagerImpl& iCmMgr; - TUint32 iParentDest;// Parent destination + /** + * Reference to CommsDat session handle. + */ + CommsDat::CMDBSession& iSessionRef; + + /** + * Reserved for future. + */ TAny* iNotused1; TAny* iNotused2; }; +// CLASS DECLARATION /** - * CCmPluginBaseEng is base class for every connection method plugin + * This defines the data object used for moving data between + * cmm server and plugins. + */ +NONSHARABLE_CLASS( CCmClientPluginInstance ): public CBase + { + public: + /** + * Two-phase constructor. Returns pointer to the new + * CCmClientPluginInstance object. + */ + IMPORT_C static CCmClientPluginInstance* NewL(); + + /** + * Two-phase constructor. Returns pointer to the new + * CCmClientPluginInstance object. + */ + IMPORT_C static CCmClientPluginInstance* NewLC(); + + /** + * Destructor + */ + IMPORT_C ~CCmClientPluginInstance(); + + private: + /** + * Default constructor. + */ + CCmClientPluginInstance(); + + /** + * Second phase constructor. + */ + void ConstructL(); + + public: + /** + * Pointer array for generic record pointers. Those are copies + * from CommsDat versions for the client usage. + */ + RPointerArray iGenRecordArray; + + /** + * Pointer array for bearer specific record pointers. Those are copies + * from CommsDat versions for the client usage. These are asked from + * the different plugins. + */ + RPointerArray iBearerSpecRecordArray; + + /** Naming way of the CM. e.g. ENamingUnique */ + CMManager::TNamingMethod iNamingMethod; + + /** Boolean to keep the information if location is enabled */ + TBool iLocationEnabled; + + /** Iap Record id of this Connection Method */ + TUint32 iIapId; + }; + +/** + * CCmPluginBaseEng is base class for every connection method plugin. + * It handles all the generic iap informations e.g. record handling + * and attribute reaquests to generic records. * - * @lib cmmanager.lib - * @since S60 v3.2 + * @lib cmmpluginbase.lib + * @since S60 v5.2 */ class CCmPluginBaseEng : public CBase { public: - - /** Destructor. */ - IMPORT_C virtual ~CCmPluginBaseEng(); + /** + * Destructor. + */ + IMPORT_C virtual ~CCmPluginBaseEng(); /** - * Create a new instance of the given bearer type plugin. - * Used from framework to avoid using slow ECom framework. - * @param aInitParam initialization data - */ + * Create a new instance of the given bearer type plugin. + * Used from CMM server to avoid using slow ECom framework. + * @param aInitParam initialization data + * @return Returns CCmPluginBaseEng type pointer which represents pure + * bearer instance for the CMM server. + */ virtual CCmPluginBaseEng* CreateInstanceL( TCmPluginInitParam& aInitParam ) const = 0; - - public: // Attribute handlers - - /** - * Gets the value for a TInt attribute. - * @param aAttribute Identifies the attribute to be retrived. - * @return contains the requested TInt attribute. - */ - IMPORT_C virtual TUint32 - GetIntAttributeL( const TUint32 aAttribute ) const; /** - * Gets the value for a TBool attribute. - * @param aAttribute Identifies the attribute to be retrived. - * @return contains the requested TBool attribute. - */ - IMPORT_C virtual TBool - GetBoolAttributeL( const TUint32 aAttribute ) const; + * Following GetBearerInfoXXXL methods return the values of the + * requested attributes. These values are bearerspecific so they + * don't vary between CMs with same bearer type. + * @param aAttribute An attribute identifier. + * @return Returns the value requested. If not found leaves with + * KErrNotFound error code. + */ + IMPORT_C virtual TUint32 GetBearerInfoIntL( + TUint32 aAttribute ) const = 0; + + IMPORT_C virtual TBool GetBearerInfoBoolL( + TUint32 aAttribute ) const = 0; - /** - * Gets the value for a String16 attribute. - * @param aAttribute Identifies the attribute to be retrived. - * @return copy of the requested attribute. Ownership is passed. - */ - IMPORT_C virtual HBufC* - GetStringAttributeL( const TUint32 aAttribute ) const; + IMPORT_C virtual HBufC* GetBearerInfoStringL( + TUint32 aAttribute ) const = 0; - /** - * Gets the value for a String8 attribute. - * @param aAttribute Identifies the attribute to be retrived. - * @return copy of the requested attribute. Ownership is passed. - */ - IMPORT_C virtual HBufC8* - GetString8AttributeL( const TUint32 aAttribute ) const; + IMPORT_C virtual HBufC8* GetBearerInfoString8L( + TUint32 aAttribute ) const = 0; /** - * Sets the value for a TInt attribute. - * @param aAttribute Identifies the attribute to be set. - * @param aValue The value to be set. - * @return None. - */ - IMPORT_C virtual void SetIntAttributeL( - const TUint32 aAttribute, TUint32 aValue ); + * Checks if the plug-in can handle the Connection Method identified + * with parameter aIapId. + * @param aIapId IAPId of the AP to be checked + * @return ETrue if plug-in can handle the IAP, otherwise EFalse. + */ + virtual TBool CanHandleIapIdL( TUint32 aIapId ) const = 0; + + /** + * Checks if the plug-in can handle the given IAP record. + * @param aIapRecord IAP record to be checked + * @return ETrue if plug-in can handle the IAP, otherwise EFalse. + */ + virtual TBool CanHandleIapIdL( + CommsDat::CCDIAPRecord* aIapRecord ) const = 0; + + public: // Client interface + /** + * Loads all the records belonging to this Connection Method. + * @param aIapId Id of the IAP record. Identifies the CM + * related records to load. + */ + IMPORT_C void LoadL( TUint32 aIapId ); /** - * Sets the value for a TBool attribute. - * @param aAttribute Identifies the attribute to be set. - * @param aValue The value to be set. - * @return None. - */ - IMPORT_C virtual void SetBoolAttributeL( - const TUint32 aAttribute, TBool aValue ); + * Resets and loads all the records belonging to this Connection Method. + */ + IMPORT_C void ReLoadL(); /** - * Sets the value for a String16 attribute. - * @param aAttribute Identifies the attribute to be set. - * @param aValue The value to be set. - * @return None. - */ - IMPORT_C virtual void SetStringAttributeL( - const TUint32 aAttribute, const TDesC16& aValue ); + * Creates a new Connection Method in memory. Call UpdateL() to store + * it in CommsDat. No CommsDat transaction operation is needed for this. + * @param aCmId Predefined iapid to be used when saving to CommsDat. + * 0 means that CommsDat gives the id. + */ + IMPORT_C void CreateNewL( TUint32 aCmId ); + + /** + * Creates a copy of an existing Connection Method. + * @param aClientPluginInstance The source data to create the copy from. + * @return CCmPluginBaseEng type pointer to an object which represents + * the new plugin to the CMM server. + */ + IMPORT_C CCmPluginBaseEng* CreateCopyL( + CCmClientPluginInstance* aClientPluginInstance ); /** - * Sets the value for a String8 attribute. - * @param aAttribute Identifies the attribute to be set. - * @param aValue The value to be set. - * @return None. - */ - IMPORT_C virtual void SetString8AttributeL( - const TUint32 aAttribute, const TDesC8& aValue ); + * Updates all records to commsdat. Data is copied from the client's copy + * to the original data. + * This method does not open/rollback/commit transaction to CommsDat. + * Caller must handle transactions. + */ + IMPORT_C virtual void UpdateL( + CCmClientPluginInstance* aClientPluginInstance ); + + /* + * Deletes all the records of this CM from the database. + * All the preventing conditions must be checked before calling this. + * This method does not open/rollback/commit transaction to CommsDat. + * Caller must handle transactions. + */ + IMPORT_C virtual void DeleteL(); /** - * Restore the original value of the attribute from commsdat field. - * Base implementation can be used only with attributes - * stored directly in commsdat. - * @param aAttribute attribute to be restored - */ - IMPORT_C virtual void RestoreAttributeL( const TUint32 aAttribute ); - - /** - * Returns the CCmDestinationImpl* if this is an - * embedded destination CM. Otherwise returns NULL. - * @return embedded destination object or NULL - */ - IMPORT_C virtual CCmDestinationImpl* Destination() const; + * Creates a copy of all plugin data( most of them are CommsDat data ) for a client. + * @param aClientPluginInstance An object where to copy the data. + */ + IMPORT_C void GetPluginDataL( CCmClientPluginInstance* aClientPluginInstance ); /** - * Update or if this is a new CM, creates CM in CommsDat. - * - OpenTransactionLC() - * - PrepareToUpdateRecordsL() - * - UpdateChargeCardRecordL() - * - UpdateServiceRecordL() - * - UpdateIAPRecordL() - * - UpdateLocationRecordL() - * - BearerRecordIdLC() - * - UpdateNetworkRecordL() - * - UpdateWapRecordL() - * - UpdateProxyRecordL() - * - UpdateConnPrefSettingL() - * - UpdateAdditionalRecordsL() - * - CommitTransactionL() - * @return None. - */ - IMPORT_C virtual void UpdateL(); + * Following GetXXXXAttributeL methods return the values of the + * requested attributes. Attributes are returned from the client's + * copy of the data. These values are CM specific. + * @param aAttribute An attribute identifier. + * @param aClientPluginInstance Client's copy of the data where + * to get the return value. + * @return Returns the value requested. If not found leaves with + * KErrNotFound error code. + */ + IMPORT_C TUint32 GetIntAttributeL( + TUint32 aAttribute, + CCmClientPluginInstance* aClientPluginInstance ); - /* - * Delete from the database if this CM has no more reference - * from the DN_IAP table. - * - IsMultipleReferencedL() - * - OpenTransactionLC() - * - PrepareToDeleteL() - * - Delete records (in this order) - * - IAP - * - Proxy - * - Service - * - ChargeCard - * - Network - * - Location - * - WapAP - * - WapBearer - * - DeleteAdditionalRecordsL() - * - CommitTransactionL() - * @param aForced forced delete doesn't check referencies - * @param aOneRefsAllowed ETrue if one reference from a destination is - * acceptable to delete this connection method. - */ - IMPORT_C virtual TBool DeleteL( TBool aForced, - TBool aOneRefAllowed = ETrue ); + IMPORT_C TBool GetBoolAttributeL( + TUint32 aAttribute, + CCmClientPluginInstance* aClientPluginInstance ); + + IMPORT_C HBufC* GetStringAttributeL( + TUint32 aAttribute, + CCmClientPluginInstance* aClientPluginInstance ); + + IMPORT_C HBufC8* GetString8AttributeL( + TUint32 aAttribute, + CCmClientPluginInstance* aClientPluginInstance ); /** - * Performs the basic loading of records related - * to this connection method: - * - OpenTransactionLC(); - * - PrepareToLoadRecordsL() - * - LoadIAPRecordL(); - * - load IAP - * - load WAP (AP & IP Bearer) - * - load proxy - * - load charge card - * - load network - * - load location - * - LoadServiceSettingL(); - * - LoadAdditionalRecordsL(); - */ - IMPORT_C virtual void LoadL( TUint32 aIapId ); + * Following SetXXXXAttributeL methods set the given values + * identified with attributes. Attributes are set to the + * client's copy of the data. + * @param aAttribute An attribute identifier. + * @param aValue Value to set. + * @param aClientPluginInstance Client's copy of the data where + * to set the given value. + */ + IMPORT_C void SetIntAttributeL( TUint32 aAttribute, TUint32 aValue, + CCmClientPluginInstance* aClientPluginInstance ); + + IMPORT_C void SetBoolAttributeL( TUint32 aAttribute, TBool aValue, + CCmClientPluginInstance* aClientPluginInstance ); + + IMPORT_C void SetStringAttributeL( TUint32 aAttribute, const TDesC16& aValue, + CCmClientPluginInstance* aClientPluginInstance ); + + IMPORT_C void SetString8AttributeL( TUint32 aAttribute, const TDesC8& aValue, + CCmClientPluginInstance* aClientPluginInstance ); + + /** + * Requests CommsDat table ids to be observed for changes by the cmm + * server. This is only for generic iap related tables. + * @param aTableIdArray A reference to an array where iap related generic + * table ids are added. + */ + IMPORT_C void GetGenericTableIdsToBeObserved( RArray& aTableIdArray ) const; + + /** + * Requests CommsDat table ids to be observed for changes by the cmm + * server. If a table used is not mentioned to be modified a bearer + * shouldn't return this. Bearers do not reset the array before adding + * ids. + * @param aTableIdArray A reference to an array where plugin must add + * the ids of the tables it want's to be observed. + */ + IMPORT_C virtual void GetBearerTableIdsToBeObservedL( + RArray& aTableIdArray ) const = 0; + + public: // plugin interface + /** + * Creates a copy of all bearer specific CommsDat data for the client. + * Called as result of GetPluginDataL(). + * @param aRecordArray An array where the copy the records. Only + * the bearer specific implementation knows the amount and order + * of these records in the array. + */ + virtual void GetBearerSpecificRecordsL( + RPointerArray& aRecordArray ) = 0; /** - * Create a new connection method in memory. - * Call UpdateL() to store it in CommsDat. - * No transaction operation is performed. - * - Creates new WAP, IAP, Network records - * - CreateNewServiceRecordL() - * - CreateAdditionalRecordsL() - * - Loads default AP name from resource - * (R_CMMANAGERENG_DEFAULT_AP_NAME) - */ - IMPORT_C virtual void CreateNewL(); + * Following GetBearerXXXXAttribute methods get only the + * fields in records in pointer arrays(parameters). + * @param aAttribute Identifier of the requested value. + * @param aGenRecordArray An array containing pointers to generic + * records of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records of the Connection Method. aAttribute + * parameter should identify one field(integer, boolean string) + * in one of these records. + * @return Returns the requested value. In error case leaves with + * system-wide error code. + */ + + virtual TUint32 GetBearerIntAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) = 0; - /** - * Create a copy of the connection method: - * - CreateInstanceL() - * - CreateNewL() - * - PrepareToCopyDataL() - * - Copies data: - * - name - * - bearer type - * - records added to the convertion table - * - Calls CopyAdditionalDataL(). - */ - IMPORT_C virtual CCmPluginBaseEng* CreateCopyL() const; + virtual TBool GetBearerBoolAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) = 0; + + virtual HBufC* GetBearerStringAttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) = 0; - /* - * Returns true if the CM has more than one parent destination - */ - IMPORT_C virtual TInt NumOfConnMethodReferencesL(); - - public: - - /** - * Returns a pointer to the cmmanager - * @return a pointer to the cmmanager - */ - CCmManagerImpl& CmMgr() const { return iCmMgr; }; - - IMPORT_C CommsDat::CMDBSession& Session() const; - - /** - * Launches the settings dialog of the plugin - * - * @since S60 3.2 - * @return soft key selection - */ - virtual TInt RunSettingsL() = 0; + virtual HBufC8* GetBearerString8AttributeL( + TUint32 aAttribute, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) = 0; /** - * Called on a newly created connection method to initialize it properly - * with user interaction (e.g. APN setting for a packet data-, WEP-key - * setting for a WLAN connection method, etc.). - * Note: each plug-in should set its name (i.e. ECmName) in this - * function call. - * - * @since S60 3.2 - * @param aManuallyConfigure let's the plugin know if a plugin should - * be configured manually or automatically - * @return ETrue if initialization was successful and wasn't cancelled. - * EFalse, if initialization process was cancelled (i.e. user pressed - * Cancel button). - */ - virtual TBool InitializeWithUiL( TBool aManuallyConfigure ) = 0; + * Following SetBearerXXXXAttribute methods set only the + * fields in records in pointer arrays(parameters). They are not + * allowed to update the original records in plugins. + * @param aAttribute Identifier of the field to set. + * @param aValue The value to set. + * @param aGenRecordArray An array containing pointers to generic + * records of the Connection Method. + * @param aBearerSpecRecordArray An array containing pointers to bearer + * specific records of the Connection Method. aAttribute + * parameter should identify one field(integer, boolean string) + * in one of these records. + * @return None. + */ + + virtual void SetBearerIntAttributeL( + TUint32 aAttribute, + TUint32 aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) = 0; - /** - * Checks if the plug-in can handle the given AP. - * @param aIapId IAPId of the AP to be checked - * @return ETrue if plug-in can handle the IAP - */ - virtual TBool CanHandleIapIdL( TUint32 aIapId ) const = 0; - + virtual void SetBearerBoolAttributeL( + TUint32 aAttribute, + TBool aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) = 0; + + virtual void SetBearerStringAttributeL( + TUint32 aAttribute, + const TDesC16& aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) = 0; + + virtual void SetBearerString8AttributeL( + TUint32 aAttribute, + const TDesC8& aValue, + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) = 0; + /** - * Checks if the plug-in can handle the given AP. - * @param aIapRecord IAP record to be checked - * @return ETrue if plug-in can handle the IAP - */ - virtual TBool CanHandleIapIdL( CommsDat::CCDIAPRecord* aIapRecord ) const = 0; - - /** - * Return the parent destination of this connection method. - * @return parent destination of this connection method - */ - IMPORT_C CCmDestinationImpl* ParentDestination() const; - - /** - * Calls FeatureManager::FeatureSupported directly. - * @param aFeature feature ID - * @return feature support status - * @since 3.2 - */ - IMPORT_C static TBool FeatureSupported( TInt aFeature ); - - /** - * Function should be overriden by virtual bearer type plugins. - * Returns if the passed IAP id is linked to that connection method. - * @param aIapId IAP id to be checked - * @return ETrue if the passed IAP id is linked to that connection method. - */ - virtual TBool IsLinkedToIap( TUint32 /*aIapId*/ ){ return EFalse; } + * Inherited class can make some preraration before CCmPluginBaseEng + * would start loading bearer specific records. + */ + virtual void PreparePluginToLoadRecordsL() = 0; /** - * Function should be overriden by virtual bearer type plugins. - * Returns if the passed SNAP id is linked to that connection method. - * @param aSnapId SNAP id to be checked - * @return ETrue if the passed SNAP id is linked to that connection method. - */ - virtual TBool IsLinkedToSnap( TUint32 /*aSnapId*/ ){ return EFalse; } + * Gives the plugin a possibility to do some preparing operations + * if needed. + * @param aCopyInstance Client side data instance. + */ + virtual void PrepareToCopyDataL( CCmPluginBaseEng* aCopyInstance ) = 0; + + /** + * Inherited class can make some preraration before CCmPluginBaseEng + * would start to update all the records. + * @param aGenRecordArray Reference to generic records pointer array. + * @param aBearerSpecRecordArray Reference to bearer specific records + * pointer array. + */ + virtual void PreparePluginToUpdateRecordsL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) = 0; + + /** + * Plugin can prepare to delete the Connection Method with this + * function. Called from DeleteL() before any record would be + * deleted. No records are deleted here. + */ + virtual void PrepareToDeleteRecordsL(){}; /** - * Increments the reference counter. Used by the object pool. - */ - void IncrementRefCounter(); + * Loads the service record. Service record type is known and loaded by + * plugin(bearer specific) part of the implementation even if the record + * is saved to the generic side. Service record is linked to IAP record. + */ + virtual void LoadServiceRecordL() = 0; + + /** + * Creates the service records. + */ + virtual void CreateServiceRecordL() = 0; + /** - * Increments the reference counter. Used by the object pool. - */ - void DecrementRefCounter(); + * Update service record. + * @param aGenRecordArray Reference to generic records pointer array. + * @param aBearerSpecRecordArray Reference to bearer specific records + * pointer array. + */ + virtual void UpdateServiceRecordL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) = 0; + /** - * Returns the reference counter. Used by the object pool. - * @return TInt - */ - TInt GetRefCounter(); + * Copies the service record. Bearer specific part knows the type of it's + * service record. + * @return Returns the service record pointer. + */ + virtual CommsDat::CCDRecordBase* CopyServiceRecordL() = 0; + + /** + * Returns the service record id of the Connection Method. + * @return Returns the id of the service record id of the Connection Method. + */ + virtual TUint32 ServiceRecordId() const = 0; /** - * Appends uids of connection methods - which were also created during connection method - * creation - to the array given as parameter - * @param aIapIds the array the additonal cm uids are appended to - */ - IMPORT_C virtual void GetAdditionalUids( RArray& aIapIds ); + * Returns the service record name of the Connection Method. + * @param aServiceName Name of the service record the CM's iap record + * points to. + */ + virtual void ServiceRecordNameLC( HBufC* &aServiceName ) = 0; + + /** + * Inherited class loads all the bearer specific records after + * loading generic records. Called from LoadL(). + */ + virtual void LoadBearerRecordsL() = 0; + + /** + * Creates bearer specific records. + */ + virtual void CreateBearerRecordsL(){}; + + /** + * Update bearer specific records. + * @param aGenRecordArray Reference to generic records pointer array. + * @param aBearerSpecRecordArray Reference to bearer specific records + */ + virtual void UpdateBearerRecordsL( + RPointerArray& aGenRecordArray, + RPointerArray& aBearerSpecRecordArray ) = 0; + + /** + * Plugin(generic part) can delete bearer specific records + * with this function. Called from DeleteL(). + */ + virtual void DeleteBearerRecordsL() = 0; - protected: // Conversion table API - - IMPORT_C void AddConverstionTableL( - CommsDat::CCDRecordBase* *aRecord, - TBool* aEnabled, - const TCmAttribConvTable* aConvTable ); - - IMPORT_C void AddCommonConversionTableL( - const TCmCommonAttrConvArrayItem* aConvTable ); + /** + * Resets the bearer specific records. + */ + virtual void ResetBearerRecords() = 0; + + /** + * Copies the bearer specific records to copy instance given as + * parameter. + * @param aCopyInstance Pointer to instance where to copy. + */ + virtual void CopyBearerRecordsL( CCmPluginBaseEng* aCopyInstance ) = 0; + + /** + * Returns the bearer record id of the Connection Method. + * @param aRecordId Id of the bearer record this CM's iap record + * points to. + */ + virtual void BearerRecordIdL( TUint32& aRecordId ) = 0; + + /** + * Returns the bearer record name of the Connection Method. + * @param aBearerName Name of the bearer record this CM's iap record + * points to. + */ + virtual void BearerRecordNameLC( HBufC* &aBearerName ) = 0; + + protected: + /** + * Constructor + */ + IMPORT_C CCmPluginBaseEng( TCmPluginInitParam *aInitParam ); - IMPORT_C void RemoveConversionTable( - const TCmAttribConvTable* aConvTable ); - - IMPORT_C void RemoveCommonConversionTable( - const TCmCommonAttrConvArrayItem* aConvTable ); - - protected: // Resource handling - - /** - * Add file name to the resource file array. - * Open it and/or increment reference count. - * @param aName resource file name - */ - IMPORT_C void AddResourceFileL( const TDesC& aName ); + /** + * Second phase constructor + */ + IMPORT_C virtual void ConstructL(); /** - * Remove file name from the resource file name array. - * Close the resource file and/or decrement the reference count. - * @param aName resource file name - */ - IMPORT_C void RemoveResourceFile( const TDesC& aName ); - - /** - * Read string from resource file. Resource file has to be - * opened prior this by calling AddResourceFileL(). - */ - IMPORT_C HBufC* AllocReadL( TInt aResourceId ) const; - - - protected: - - /** Constructor */ - IMPORT_C CCmPluginBaseEng( TCmPluginInitParam *aInitParam ); - - /** Second phase constructor */ - IMPORT_C virtual void ConstructL(); - - /** Open transaction */ - void OpenTransactionLC(); - - /** - * Commit transaction. - * @param aError - error id - */ - void CommitTransactionL( TInt aError ); - - /** - * Rollback transaction. - */ - void RollbackTransaction(); - - /** Make a reset on this class. */ - IMPORT_C void Reset(); - - /** - * Plug-in implementation can make its on - * cleanup in this function. - * Always called from LoadL() and - * should be called from plugin's destructor. - */ - virtual void AdditionalReset() = 0; - - /** - * Check if there's connection established with - * this connection method (IAP id). - */ - IMPORT_C virtual TBool CheckIfAlreadyConnected() const; - - protected: // virtual loader function - - /** - * Inherited class can make some preraration - * before CCmPluginBaseEng would start loading - * records from tables. - */ - IMPORT_C virtual void PrepareToLoadRecordsL(); - - /** - * Inherited class can load any additional - * records after CCmPluginBaseEng finished. - */ - virtual void LoadAdditionalRecordsL(){}; + * Checks if the ECmName attribute was set since the last update. + * If so, name is updated in passed record + * @param aSrcRecord record to be checked against + * @param aDestRecord record to be checked against aSrcRecord + */ + IMPORT_C void CheckIfNameModifiedL( + CommsDat::CCDRecordBase* aSrcRecord, + CommsDat::CCDRecordBase* aDestRecord ) const; /** - * Load service record. Default implementation can - * create only factory supported record instances. - */ - IMPORT_C virtual void LoadServiceSettingL(); + * Plugins can check DNS setting with this function. + * Suggested to be called from PrepareToUpdateRecordsL(). + * It checked the DNS server addresses, moves secord into + * first if first is dynamic, and update DNSFromServer field + * according to address values. + * @param aIPv6 passed DNS server address are in IPv6 form + * @param aDNS1 first DNS server address + * @param aDNS1 secord DNS server address + * @param aDNSFromServer DNS address from server flag + */ + IMPORT_C void CheckDNSServerAddressL( + TBool aIPv6, + CommsDat::CMDBField& aDNS1, + CommsDat::CMDBField& aDNS2, + CommsDat::CMDBField& aDNSFromServer ); - protected: // virtual update functions - + private: /** - * Check if connection method data is valid, before - * it would be persisted to commsdat. - * If invalid data found, set its attribute id in - * iInvalidAttribute. - * Base class implementation must be called from - * overridden one. - */ - IMPORT_C virtual void PrepareToUpdateRecordsL(); - - /** - * Inherited class can update its additional - * records here. - */ - virtual void UpdateAdditionalRecordsL(){}; - - /** - * Update service record. - */ - IMPORT_C virtual void UpdateServiceRecordL(); + * Handles all the Connection Method data copying to instance given as + * parameter. This is called from CreateCopyL(). + * @ param aCopyInstance Pointer to plugin to copy the data. + */ + void CopyDataL( CCmPluginBaseEng* aCopyInstance ); /** - * Return the service table name and record id - * of this connection in the service table. - * @param - aServiceName name of the service table - * this connection method points to. - * @param - aRecordId record id in the service table. - */ - virtual void ServiceRecordIdLC( HBufC* &aServiceName, - TUint32& aRecordId ) = 0; + * Handles all the Connection Method related record copying. Called from + * CopyDataL(). + * @ param aCopyInstance Pointer to plugin to copy the data. + */ + void CopyRecordsL( CCmPluginBaseEng* aCopyInstance ); + + /** + * Copies the record identified by aRecordIdentifier to copy instance. + * @param aRecordIdentifier Identifies the record which is copied copy. + * @param aCopyInstance Pointer to plugin to copy the data. + */ + void CopyRecordDataL( TUint32 aRecordIdentifier, + CCmPluginBaseEng* aCopyInstance ); /** - * Return the bearer table name and record id - * of this connection in the bearer table. - * @param - aBearerName name of the bearer table - * this connection method points to. - * @param - aRecordId record id in the bearer table. - */ - virtual void BearerRecordIdLC( HBufC* &aBearerName, - TUint32& aRecordId ) = 0; + * Creates proxy record and sets the proxy settings enabled for this + * Connection Method. + */ + void EnableProxyL( TBool aEnable ); + + /** + * Creates location record and sets the location enabled for this + * Connection Method. + */ + void EnableLocationL( TBool aEnable ); - protected: // virtual delete function - /** - * Plugin can prepare to delete the connection method - * with this function. Called from DeleteL() before - * any record would be deleted. Do NOT delete any - * record here. - */ - virtual void PrepareToDeleteRecordsL(){}; + * Calls all the loading methods. + */ + void DoLoadL( TUint32 aIapId ); /** - * Plugin can delete additional, bearer specific record - * with this function. Called from DeleteL(). - */ - virtual void DeleteAdditionalRecordsL(){}; + * Loads IAP record. + * @param aIapId Identifies the IAP record to load. + */ + void LoadIAPRecordL( TUint32 aIapId ); - protected: // virtual create function - /** - * Plugin has to create and initialize its bearer specific object - * that points to the service record here. Pointer has to be stored in - * iServiceRecord data member. - * Do NOT store service record in CommsDat yet. - */ - virtual void CreateNewServiceRecordL() = 0; + * Loads proxy record related to this IAP. This is called as a result + * of calling LoadL(). + */ + void LoadProxyRecordL(); + + /** + * Loads network record related to this IAP. This is called as a result + * of calling LoadL(). + */ + void LoadNetworkRecordL(); /** - * Plugin can create and initialize its bearer specific record(s) here. - * Do NOT store them in CommsDat yet. - */ - virtual void CreateAdditionalRecordsL(){}; - - protected: + * Loads location record related to this IAP. This is called as a result + * of calling LoadL(). + */ + void LoadLocationRecordL(); + + /** + * Loads WAP AP and WAP IP records related to this IAP. This is called as a result + * of calling LoadL(). + */ + void LoadWapRecordL(); /** - * Called from CreateCopyL(). - * Plugin can prepare for copying every records - * added to the conversion tables. - * - * @param aDestInst copy attributes into this plugin instance - */ - virtual void PrepareToCopyDataL( CCmPluginBaseEng& /*aDestInst*/ ) const {}; - + * Loads iap metadata record related to this IAP. This is called as a result + * of calling LoadL(). + */ + void LoadMetadataRecordL(); + /** - * Copy data of the connection method that is not - * added to the conversion table. (e.g. bearer specific - * flags) - * - * @param aDestInst copy attributes into this plugin instance - */ - virtual void CopyAdditionalDataL( CCmPluginBaseEng& /*aDestInst*/ ) const {}; - - private: - - void EnableProxyL( TBool aEnable ); - void EnableChargeCardL( TBool aEnable ); - void EnableLocationL( TBool aEnable ); - - // Loader functions - void DoLoadL( TUint32 aIapId ); - void LoadIAPRecordL( TUint32 aIapId ); - void LoadChargeCardSettingL( TUint32 aChargeCardId ); - void LoadProxySettingL(); - void LoadNetworkSettingL(); - void LoadLocationSettingL(); - void LoadWapRecordL(); - void LoadSeamlessnessRecordL(); - - // Updater functions - void UpdateIAPRecordL(); - void UpdateProxyRecordL(); - void UpdateChargeCardRecordL(); + * Following methods are called as a result of calling method UpdateL(). + * Each method overwrites the original data in memory with the client copy + * of that data. Client data has all the possible changes set by client. + * After overwrite the data is written to CommsDat. + * @param aClientPluginInstance The client copy of the original data with the + * possible changes. + */ + void UpdateIAPRecordL( CCmClientPluginInstance* aClientPluginInstance ); + void UpdateProxyRecordL( CCmClientPluginInstance* aClientPluginInstance ); void UpdateConnPrefSettingL(); - void UpdateNetworkRecordL(); - void UpdateLocationRecordL(); - void UpdateWapRecordL(); - void UpdateSeamlessnessRecordL(); + void UpdateNetworkRecordL( CCmClientPluginInstance* aClientPluginInstance ); + void UpdateLocationRecordL( CCmClientPluginInstance* aClientPluginInstance ); + void UpdateWapRecordL( CCmClientPluginInstance* aClientPluginInstance ); + void UpdateMetadataRecordL( CCmClientPluginInstance* aClientPluginInstance ); + void UpdateServiceRecordL( CCmClientPluginInstance* aClientPluginInstance ); /** - * No WAP record found in load process, - * but client wants to set start page. + * Creates new wap records. */ void NewWapRecordL(); + + /** + * Searches the WAP records related to this iap. This is called as a + * result of LoadL(). + * @return Returns pointer to WAP IP record. If it's not found NULL is + * returned. + */ + CommsDat::CCDWAPIPBearerRecord* FindWAPRecordL(); + + /** + * Creates a new metadata record. + * @param aSetDef ETrue if setting default seamlessness value is needed + * @return Returns metadata record pointer. + */ + CCDIAPMetadataRecord* NewMetadataRecordL( TBool aSetDef ); /** - * Create a new metadata record. - * @param aSetDef ETrue if setting default seamlessness valud is needed - * @return create metadata record point - */ - CCDIAPMetadataRecord* NewSeamlessnessRecordL( TBool aSetDef ); - - CommsDat::CCDWAPIPBearerRecord* FindWAPRecordL(); - CCDIAPMetadataRecord* FindSeamlessnessRecordL(); + * Searches the metadata record belonging to this iap. This is called as a + * result of LoadL(). + * @return Returns pointer to WAP IP record. If it's not found NULL is + * returned. + */ + CCDIAPMetadataRecord* FindMetadataRecordL(); /** - * Set attribute flag on the given record - * @param aRecord record to be set - * @param aAttribute e.g. ECDHidden + * Set attribute flag on the given record. + * @param aRecord Record to be set. + * @param aAttribute Attribute to be set. * @param aSet ETrue to set, EFalse to clear */ void SetAttribute( CommsDat::CCDRecordBase* aRecord, @@ -818,221 +775,141 @@ void CopyAttributes( CommsDat::CCDRecordBase* aSrcRecord, CommsDat::CCDRecordBase* aDstRecord ); - /** - * Find field element associated with the passed attribute. - * @param aAttribute aatribute to find - * @aType type of the attribute (e.g. bool, int or string) - */ - TValidationFunctionL FindFieldL( TUint32 aAttribute, - TCMFieldTypes aType, - CommsDat::CMDBElement* &aElement ) const; - - - /** - * Return Location id - * @return location id - */ - TUint32 GetLocationIdL() const; - - /** - * Search for common attribute and convert it to plugin specific one. - * @param aAttribute common attribute id - * @return bearer specific attribute id - */ - TUint32 CheckForCommonAttribute( const TUint32 aAttribute ) const; /** - * Returns the common attribute for the bearer specific attribute. - * Panics if there is no matching common attribute. - * @param aAttribute bearer specific attribute - * @return common attribute + * Returns the default location record id. + * @return Returns the default location record id. */ - TUint32 CommonAttribute( const TUint32 aAttribute ) const; - - public: // Util functions + TUint32 GetLocationIdL() const; + + private: - IMPORT_C CommsDat::TMDBElementId IAPRecordElementId() const; - - IMPORT_C TBool IsProtected() const; - - TBool SetProxyServerNameL( const TDesC& aProxyServer ); + /** + * Gives a possibility to make some prerarations before + * starting to load bearer specific records. + */ + void PrepareToLoadRecordsL(); /** - * Return the coversion table item of the attribute - * @param aAttribute attribute of which conversion item is requested - * @return conversion table item - */ - IMPORT_C const TCmAttribConvTable* ConvTableItem( TUint32 aAttribute ); + * Gives a possibility to make some prerarations before + * starting to update bearer specific records. + */ + void PrepareToUpdateRecordsL( + CCmClientPluginInstance* aClientPluginInstance ); /** - * Function to set up DNS addresses and DNS address from server flag. - * Can be used with both IPv4 and IPv6 attribute. - * Passed bearer specific attributes must be defined in common conversion - * table. - * @param aSrv1Attr first DNS server address attribute - * @param aSrv1 DNS first DNS server address - * @param aSrv2Attr second DNS server address - * @param aSrv2 DNS second DNS server address attribute - * @param aAddrFromSrvAttr DNS address from server flag attribute - * @param aIPv6 ETrue if passed addresses are in IPv6 form - */ - IMPORT_C void SetDNSServerAddressL( TUint32 aSrv1Attr, - const TDesC& aSrv1, - TUint32 aSrv2Attr, - const TDesC& aSrv2, - TUint32 aAddrFromSrvAttr, - TBool aIPv6 ); + * Returns the element id of the iap record. + * @return Returns the element id of the iap record. + */ + CommsDat::TMDBElementId IAPRecordElementId() const; + + /** + * Checks the protection attribute of the IAP. + * @return Returns ETrue if the IAP is protected. Otherwise returns + * EFalse. + */ + TBool IsProtected() const; /** - * Plugins can check DNS setting with this function. - * Suggested to be called from PrepareToUpdateRecordsL(). - * It checked the DNS server addresses, moves secord into - * first if first is dynamic, and update DNSFromServer field - * according to address values. - * @param aIPv6 passed DNS server address are in IPv6 form - * @param aDNS1 first DNS server address - * @param aDNS1 secord DNS server address - * @param aDNSFromServer DNS address from server flag - */ - IMPORT_C void CheckDNSServerAddressL( TBool aIPv6, - CommsDat::CMDBField& aDNS1, - CommsDat::CMDBField& aDNS2, - CommsDat::CMDBField& aDNSFromServer ); + * Sets the name of the proxy server to proxy record. If name's + * length is 0, proxyport is set to 0 and proxyserver usage + * boolean is set to EFalse. If the name is longer than 0, + * boolean is set to ETrue. + * @param aProxyServer Address to be set. + * @param Record pointer where to set. + */ + void SetProxyServerNameL( const TDesC& aProxyServer, + CommsDat::CCDRecordBase* aProxyRecord ); - protected: - /** - * Checks if the ECmName attribute was set since the last update. - * If so, name is updated in passed record - * @param aRecord record to be checked against iIapRecord - */ - IMPORT_C void CheckIfNameModifiedL( CommsDat::CCDRecordBase* aRecord ) const; - + * Sets a name to IAP. + * @param aName Name to set. + * @param aClientPluginInstance Client copy of data where to set the + * name. UpdateL() updates the name to the CommsDat. + */ + void SetNameL( const TDesC& aName, + CommsDat::CCDRecordBase* aIapRecord, + const CMManager::TNamingMethod aNamingMethod ); + /** - * Returns the global priority of the passed bearer type - * @param aServiceType bearer type of which priority is requested - * @return global bearer priority - */ - IMPORT_C TInt GlobalBearerPriority( const TDesC& aServiceType ) const; - - /** - * Returns the global UI priority of the passed bearer type - * @param aServiceType bearer type of which priority is requested - * @return global UI bearer priority - */ - IMPORT_C TInt GlobalUiBearerPriority( const TDesC& aServiceType ) const; - - private: // Util functions - - HBufC* DoMakeValidNameL( const TDesC& aName ); + * Following methods are called as a result of SetNameL() to + * make a valid name of the given string. + */ + HBufC* DoMakeValidNameL( const TDesC& aName, + const TUint32& aIapId ); HBufC* EnsureMaxLengthLC( const TDesC& aName, TBool& aChanged ); - TPtrC GetPrefix( const TDesC& aName ); TInt GetPostfix( const TDesC& aName, const TDesC& aPrefix ); - - TBool IsValidNameL( const TDesC& aNameText ); + TBool IsValidNameL( const TDesC& aNameText, + const TUint32& aIapId ); HBufC* EscapeTextLC( const TDesC& aLiteral ); - - void SetNameL( const TDesC& aName ); - - TCmAttrConvArrayItem* ConversionTable( TUint32 aAttribute ) const; - CommsDat::CMDBElement& FieldByAttributeL( const TCmAttrConvArrayItem* aItem, - const TUint32 aAttribute, - TInt& aIndex ) const; - - /** - * Writes the passed text into the passed attribute. - * @param aAttribute The attribute to write into - * @param aValue The value to write - */ - void GenericStringWriterL( const TUint32 aAttribute, - const TDesC16& aValue ); - - /** - * Returns the common attribute for the bearer specific attribute, if - * it is mapped to any. Otherwise, it returns the original attribute. - * @param aAttribute bearer specific attribute - * @return common/original attribute - */ - TUint32 MappedCommonAttribute( const TUint32 aAttribute ) const; - public: + void SetDefaultNameL( const TDesC& aName ); /** - * Indicates if the Id is valid or if this is a new object which sitll - * haven't been updated. - * Used by the object pool. - * @return TBool + * Check if the passed IP address is '0.0.0.0' or empty string + * @param aIpAddress IP address to be checked */ - TBool IdIsValid(); + TBool IsUnspecifiedIPv4Address( const TDesC& aIpv4Address ); /** - * Sets iIdIsValid attribute - * Used by the object pool. - */ - void SetIdValidity(TBool validity); - - /** - * Scans aDests for destinations that may be valid parents - * for this plugin and removes those that may not. The function may be - * overriden by virtual bearer type plugins. - * @param aDests The array of destination IDs to be filtered. + * Check if the passed IP address is one of these: + * - empty string - + * - '0:0:0:0:0:0:0:0' + * - 'fec0:000:0000:ffff::1' + * - 'fec0:000:0000:ffff::2' + * @param aIpAddress IP address to be checked */ - virtual void FilterPossibleParentsL( RArray& /*aDests*/ ) {} - - /** - * Sets the predefined id for the plugin. This should only be - * used by cmmanager framework. - */ - IMPORT_C void SetPreDefinedId( const TUint32 aPreDefId ); - - public: - - /** - * Check if there is space to save record - * @return ETrue if space is available; otherwise leave with KLeaveWithoutAlert - */ - IMPORT_C TBool CheckSpaceBelowCriticalLevelL() const; + CMManager::TIPv6Types ClassifyIPv6Address( const TDesC& aIpv6Address ); public: // Data // Required attribute for the framework // (An identifier used during destruction) - TUid iDtor_ID_Key; - + TUid iDtor_ID_Key; + TUint32 iBearerType; + protected: + /** + * Reference to cmm's session handle. Initialised at the construction + * phase. + */ + CommsDat::CMDBSession& iSession; - CCmManagerImpl& iCmMgr; //< Not owned - TUint32 iParentDest; // id of the parent destinaton - - // IAP id of the CM. 0 means that this is a newly - // created one. - TUint32 iIapId; - TUint32 iBearerType; //< Should be set by plugin - //< constructor + /** + * Generic record pointers. + */ + CommsDat::CCDIAPRecord* iIapRecord; + CommsDat::CCDProxiesRecord* iProxyRecord; + CommsDat::CCDRecordBase* iServiceRecord; + CommsDat::CCDNetworkRecord* iNetworkRecord; + CommsDat::CCDLocationRecord* iLocationRecord; + CommsDat::CCDWAPAccessPointRecord* iWapAPRecord; + CommsDat::CCDWAPIPBearerRecord* iWapIPBearerRecord; + CCDIAPMetadataRecord* iMetaDataRecord; - CommsDat::CCDIAPRecord* iIapRecord; // created by base class - CommsDat::CCDProxiesRecord* iProxyRecord; // optional - CommsDat::CCDRecordBase* iServiceRecord; // created by plugin - CommsDat::CCDChargecardRecord* iChargeCardRecord; // optional - CommsDat::CCDNetworkRecord* iNetworkRecord; // created by base class - CommsDat::CCDLocationRecord* iLocationRecord; // optional - - TBool iChargeCardEnabled; - TBool iLocationEnabled; + private: + /** + * IAP record id of the CM. 0 means that this is not stored to CommsDat + * yet. If in UpdateL phase iap record has an id but iIapId == 0 --> + * predefined iap id + */ + TUint32 iIapId; - TUint32 iInvalidAttribute; - - private: // Data + /** + * Naming method of the CM. + */ + CMManager::TNamingMethod iNamingMethod; - CCmPluginBasePrivate* iPriv; - //Reference counter for the object pool - TInt iRefCounter; - //indicates if the Id is valid or not (for the object pool) - TBool iIdIsValid; - // Predefined connection method id(iap id) - TUint32 iPreDefIapId; - friend class CCmPluginBase; + /** + * Table id of the iap metadata table. + */ + CommsDat::TMDBElementId iMetadataTableId; + + /** + * Identifies if the location is enabled. + */ + TBool iLocationEnabled; }; #endif // CMPLUGINBASEENG_H diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/bearer_settings_plugin_api/inc/cmpluginlanbase.h --- a/ipcm_plat/bearer_settings_plugin_api/inc/cmpluginlanbase.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_plat/bearer_settings_plugin_api/inc/cmpluginlanbase.h Mon May 03 12:53:07 2010 +0300 @@ -23,7 +23,7 @@ #include #include #include -#include +#include #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS #include #endif @@ -79,20 +79,6 @@ */ IMPORT_C void PrepareToUpdateRecordsL(); - /** - * No UI for LanBase. - * Panics in debug mode, leaves with KErrNotSupported in - * release mode. - */ - IMPORT_C virtual TInt RunSettingsL(); - - /** - * No UI for LanBase. - * Panics in debug mode, leaves with KErrNotSupported in - * release mode. - */ - IMPORT_C virtual TBool InitializeWithUiL( TBool aManuallyConfigure ); - private: IMPORT_C CommsDat::CCDLANServiceRecord& ServiceRecord()const; diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/bearer_settings_plugin_api/inc/cmpluginlandef.h --- a/ipcm_plat/bearer_settings_plugin_api/inc/cmpluginlandef.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_plat/bearer_settings_plugin_api/inc/cmpluginlandef.h Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -11,7 +11,8 @@ * * Contributors: * -* Description: Resource headers for LAN Plug-in +* Description: +* Resource headers for LAN Plug-in. * */ @@ -21,6 +22,8 @@ #include +const TUint KUidLanBearerType = 0x1020737A; + namespace CMManager { /** LAN specific connection method attributes */ diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/bearer_settings_ui_plugin_api/bearer_settings_ui_plugin_api.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipcm_plat/bearer_settings_ui_plugin_api/bearer_settings_ui_plugin_api.pri Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,19 @@ +# +# 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: +# Bearer Settings UI Plugin API project include. +# + +PLATFORM_HEADERS += \ + bearer_settings_ui_plugin_api/inc/cpbearerapplugininterface.h diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/bearer_settings_ui_plugin_api/inc/cpbearerapplugininterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipcm_plat/bearer_settings_ui_plugin_api/inc/cpbearerapplugininterface.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Control Panel plugin interface for bearer specific AP settings plugins. +* +*/ + +#ifndef CPBEARERAPPLUGININTERFACE_H +#define CPBEARERAPPLUGININTERFACE_H + +// System includes +#include + +// User includes + +// Forward declarations +class CpBaseSettingView; + +// External data types + +// Constants + +// Class declaration + +/*! + \class CpBearerApPluginInterface + \brief This class is an interface for bearer specific AP settings plugins + which can be displayed in the Control Panel application. + + Plugin stubs must be located in + /resource/qt/plugins/controlpanel/bearerap directory. + */ + +class CpBearerApPluginInterface +{ +public: + /*! + Destructor. + */ + virtual ~CpBearerApPluginInterface() {} + + /*! + Getter for bearer type. Bearer types are defined in the Connection + Settings Shim API cmmanagerdefines_shim.h. + + \return Bearer type handled by the plugin. + */ + virtual uint bearerType() const = 0; + + /*! + Creates the settings view. Caller owns the object. + + \param connectionMethod Connection method ID. + \return Pointer to a settings view object. + */ + virtual CpBaseSettingView *createSettingView( + uint connectionMethod) = 0; + +signals: + +public slots: + +protected: + +protected slots: + +private: + +private slots: + +private: // data + +}; + +Q_DECLARE_INTERFACE( + CpBearerApPluginInterface, + "com.nokia.plugin.controlpanel.bearerap.platform.interface/1.0"); + +#endif // CPBEARERAPPLUGININTERFACE_H diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/connection_settings_shim_api/connection_settings_shim_api.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipcm_plat/connection_settings_shim_api/connection_settings_shim_api.pri Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,22 @@ +# +# 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: +# Connection Settings Shim API project include. +# + +PLATFORM_HEADERS += \ + connection_settings_shim_api/inc/cmconnectionmethod_shim.h \ + connection_settings_shim_api/inc/cmdestination_shim.h \ + connection_settings_shim_api/inc/cmmanager_shim.h \ + connection_settings_shim_api/inc/cmmanagerdefines_shim.h diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/connection_settings_shim_api/inc/cmconnectionmethod_shim.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipcm_plat/connection_settings_shim_api/inc/cmconnectionmethod_shim.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,189 @@ +/* + * 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: + * Wrapper for CM Manager Symbian interface. + */ + +#ifndef CMCONNECTIONMETHOD_SHIM_H +#define CMCONNECTIONMETHOD_SHIM_H + +// System includes + +#include +#include +#include +#include + +// User includes + +// Forward declarations + +class CmConnectionMethodShimPrivate; + +// External data types + +// Constants + +// Class declaration + +/*! + \class CmConnectionMethodShim + \brief Implementation class for CM Manager Connection Method Shim. + + Wrapper for CM Manager Symbian interface. + + NOTE! This shim is supposed to be used only in middleware code. Usage + must be agreed with ipconnmgmt package owner. Applications should use + the Qt Bearer Management API instead. +*/ + +class CONNECTIONSETTINGSSHIMDLL_EXPORT CmConnectionMethodShim +{ + +public: + + // Data types + + /*! + * Constructor. + * + * @param[in] cm CM Manager connection method object. + */ + CmConnectionMethodShim(RCmConnectionMethod &cm); + + /*! + * Destructor. + */ + ~CmConnectionMethodShim(); + + /*! + * Gets the value for a uint attribute. + * Note: even though the name suggests int attribute, return value is + * actually uint. This is how the function is specified in public + * RCmConnectionMethod class as well. + * + * @param attribute Identifies the attribute to be retrived. + * @return Contains the requested uint attribute. + */ + uint getIntAttribute( + CMManagerShim::ConnectionMethodAttribute attribute) const; + + /*! + * Gets the value for a bool attribute. + * + * @param attribute Identifies the attribute to be retrived. + * @return Contains the requested bool attribute. + */ + bool getBoolAttribute( + CMManagerShim::ConnectionMethodAttribute attribute) const; + + /*! + * Gets the value for a 16 bit QString attribute. + * + * @param attribute Identifies the attribute to be retrived. + * @return Contains the requested QString attribute. + */ + QString getStringAttribute( + CMManagerShim::ConnectionMethodAttribute attribute) const; + + /*! + * Gets the value for an 8 bit QString attribute. + * + * @param attribute Identifies the attribute to be retrived. + * @return Contains the requested QString attribute. + */ + QString getString8Attribute( + CMManagerShim::ConnectionMethodAttribute attribute) const; + + /*! + * Sets the value for an uint attribute. + * Note: even though the name suggests int attribute, parameter is + * actually uint. This is how the function is specified in public + * RCmConnectionMethod class as well. + * + * @param attribute Identifies the attribute to be set. + * @param value The value to be set. + */ + void setIntAttribute( + CMManagerShim::ConnectionMethodAttribute attribute, + uint value); + + /*! + * Sets the value for a bool attribute. + * + * @param attribute Identifies the attribute to be set. + * @param value The value to be set. + */ + void setBoolAttribute( + CMManagerShim::ConnectionMethodAttribute attribute, + bool value); + + /*! + * Sets the value for a 16 bit QString attribute. + * + * @param attribute Identifies the attribute to be set. + * @param value The value to be set. + */ + void setStringAttribute( + CMManagerShim::ConnectionMethodAttribute attribute, + QString value); + + /*! + * Sets the value for an 8 bit QString attribute. + * + * @param attribute Identifies the attribute to be set. + * @param value The value to be set. + */ + void setString8Attribute( + CMManagerShim::ConnectionMethodAttribute attribute, + QString value); + + /*! + * Try to delete the connection method. If it is referenced from + * any destination, then the references are removed and the connection + * method is deleted. + * + * @return True if connection method deleted. + */ + bool deleteConnectionMethod(); + + /*! + * Update in the database. + */ + void update(); + + /*! + * Reload the contents of the connection method from database. + * Any current changes made to the connection method are lost. + */ + void refresh(); + +protected: + +private: + +private: // data + + CmConnectionMethodShimPrivate *d_ptr; //!< Private implementation + + // Friend classes + + /* + * CmDestinationShimPrivate::AddConnectionMethodL needs direct access + * to Connection Methods it is adding to the Destination. + */ + friend class CmDestinationShimPrivate; +}; + +#endif /* CMCONNECTIONMETHOD_SHIM_H */ diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/connection_settings_shim_api/inc/cmdestination_shim.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipcm_plat/connection_settings_shim_api/inc/cmdestination_shim.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,214 @@ +/* + * 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: + * Wrapper for CM Manager Symbian interface. + */ + +#ifndef CMDESTINATION_SHIM_H +#define CMDESTINATION_SHIM_H + +// System includes + +#include +#include +#include + +// User includes + +// Forward declarations + +class CmDestinationShim; +class CmDestinationShimPrivate; +class CmConnectionMethodShim; + +// External data types + +// Constants + +// Class declaration + +/*! + \class CmDestinationShim + \brief Implementation class for CM Manager Destination Shim. + + Wrapper for CM Manager Symbian interface. + + NOTE! This shim is supposed to be used only in middleware code. Usage + must be agreed with ipconnmgmt package owner. Applications should use + the Qt Bearer Management API instead. +*/ + +class CONNECTIONSETTINGSSHIMDLL_EXPORT CmDestinationShim +{ + +public: + + // Data types + + /*! + * Constructor. + * + * @param[in] destination CM Manager destination object. + */ + CmDestinationShim(RCmDestination &destination); + + /*! + * Destructor. + */ + ~CmDestinationShim(); + + /*! + * Return the number of connection methods in the destination. + * + * @return Number of the connection methods in this destination. + */ + int connectionMethodCount() const; + + /*! + * Return a reference to the connection method. The index must be less + * than the return value of connectionMethodCount(). + * + * @param[in] index Index of the connection method to be returned. + * @return Connection method. + */ + CmConnectionMethodShim *connectionMethod(int index) const; + + /*! + * Returns the connection method with the given ID. + * + * @param cmId Unique id of the requested connection method. + * @return Connection method. + */ + CmConnectionMethodShim *connectionMethodByID(uint cmId) const; + + // Getting attributes + + /*! + * Return the priority of the passed connection method. + * + * @param cmItem Connection method. + * @return Priority of the queried connection method. + */ + uint priority(CmConnectionMethodShim *cmItem) const; + + /*! + * Return the name of the destination. + * + * @return Name of the destination, empty string in error cases. + */ + QString name() const; + + /*! + * Return the destination's Id attribute. + * + * @return Id of the destination. + */ + uint id() const; + + /*! + * Returns the Metadata. + * + * @param metadataField The meta data field to query. + * @return The value of the requested field. + */ + uint metadata(CMManagerShim::SnapMetadataField metadataField) const; + + /*! + * Return the protection level of the destination. + * + * @return Protection level. + */ + CMManagerShim::CmmProtectionLevel protectionLevel() const; + + /*! + * Return whether the destination is hidden or not. + * + * @return True if the destination is hidden. + */ + bool isHidden() const; + + /*! + * Adds an existing connection method to a destination. + * + * @param cm Connection method to be added. + * @return Index in the Connection Method list. + */ + int addConnectionMethod(CmConnectionMethodShim *cm); + + /*! + * Remove a connection method from a destination and delete it + * on update. + * Exception: connection method is not deleted, if it's referenced + * from any other destination. + * + * @param cm The connection method to be deleted. + */ + void deleteConnectionMethod(CmConnectionMethodShim *cm); + + /*! + * Remove connection method from the destination. + * + * @param cm Connection method to be removed. + */ + void removeConnectionMethod(CmConnectionMethodShim *cm); + + /*! + * Set the connection method's priority based on the passed + * index. Indexing starts from zero(the highest priority). + * + * @param cm The connection method item + * @param index The new priority of the connection method in the + * destination. + */ + void modifyPriority(CmConnectionMethodShim *cm, int index); + + /*! + * Set the destination's name. + * + * @param name New name of the destination. + */ + void setName(QString name); + + /*! + * Update all values of the destination and its connection methods to + * CommsDat. Nothing is stored, if update leaves due to any reason. + */ + void update(); + + /*! + * Reload the contents of the destination from database. + * Any current changes made to the destination are lost. + */ + void refresh(); + + /*! + * Delete destination and its connection methods from CommsDat. + * Connection methods that belong also to some other destination are + * not deleted. + */ + void deleteDestination(); + +protected: + +private: + +private: // data + + CmDestinationShimPrivate *d_ptr; //!< Private implementation + + // Friend classes + +}; + +#endif /* CMDESTINATION_SHIM_H */ diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/connection_settings_shim_api/inc/cmmanager_shim.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipcm_plat/connection_settings_shim_api/inc/cmmanager_shim.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,131 @@ +/* + * 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: + * Wrapper for CM Manager Symbian interface. + */ + +#ifndef CMMANAGER_SHIM_H +#define CMMANAGER_SHIM_H + +// System includes + +#include +#include +#include + +// User includes + +// Forward declarations + +class CmDestinationShim; +class CmManagerShimPrivate; +class CmConnectionMethodShim; + +// External data types + +// Constants + +// Class declaration + +/*! + \class CmManagerShim + \brief Implementation class for CM Manager Shim. + + Wrapper for CM Manager Symbian interface. + + NOTE! This shim is supposed to be used only in middleware code. Usage + must be agreed with ipconnmgmt package owner. Applications should use + the Qt Bearer Management API instead. +*/ + +class CONNECTIONSETTINGSSHIMDLL_EXPORT CmManagerShim +{ + +public: + + // Data types + + /*! + * Constructor. + */ + CmManagerShim(); + + /*! + * Destructor. + */ + ~CmManagerShim(); + + /*! + * Creates a Destination with the passed name. + * + * @param[in] name The name of the new destination. + * @return New destination. Ownership is passed to the caller. + */ + CmDestinationShim *createDestination(QString name); + + /*! + * Creates a connection method that does not belong to any destination. + * + * @param[in] bearerType Bearer type of the new connection method. Types + * are defined in cmmanagerdefines_shim.h. + * @return New connection method. Ownership is passed to the caller. + */ + CmConnectionMethodShim *createConnectionMethod(uint bearerType); + + /*! + * Returns the connection method queried by its ID. + * + * @param[in] connectionMethodId Id of the connection method. + * @return Found connection method instance. + */ + CmConnectionMethodShim *connectionMethod(uint connectionMethodId) const; + + /*! + * Returns the list of connection methods that do not belong to any + * destination. + * + * @param[out] cmArray On return it is the array of connection method ids. + * @param[in] legacyOnly When set to true only Legacy connection method + * ids (connection methods which do not belong to + * any destination) will be returned + */ + void connectionMethod( + QList &cmArray, + bool legacyOnly = true) const; + + /*! + * Returns the destination queried by its ID. + * + * @param[in] destinationId Id of the destination. + * @return Found network destination. + */ + CmDestinationShim *destination(uint destinationId) const; + + /*! + * Returns an array of all destination id's. + * + * @param[out] destArray Array of all available network destinations. + */ + void allDestinations(QList &destArray) const; + +protected: + +private: + +private: // data + + CmManagerShimPrivate *d_ptr; //!< Private implementation +}; + +#endif /* CMMANAGER_SHIM_H */ diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/connection_settings_shim_api/inc/cmmanagerdefines_shim.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipcm_plat/connection_settings_shim_api/inc/cmmanagerdefines_shim.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,246 @@ +/* + * 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: + * Defines for data types and attributes used in CmManagerShim interface. + */ + +#ifndef CMMANAGERDEFINES_SHIM_H +#define CMMANAGERDEFINES_SHIM_H + +// System includes + +#include +#include +#include +#include + +// User includes + +// Macro for exporting Shim classes +#ifdef BUILD_CONNECTIONSETTINGSSHIMDLL_DLL +#define CONNECTIONSETTINGSSHIMDLL_EXPORT Q_DECL_EXPORT +#else +#define CONNECTIONSETTINGSSHIMDLL_EXPORT Q_DECL_IMPORT +#endif + +/*! + * Constants and data types used in CmManagerShim, CmDestinationShim, + * and CmConnectionMethodShim interfaces. + */ +namespace CMManagerShim +{ + //! Wlan bearer type + const uint BearerTypeWlan = KUidWlanBearerType; + //! Packet data bearer type + const uint BearerTypePacketData = KUidPacketDataBearerType; + + /*! + * Constants for maximum string lengths. + */ + //! Connection name length + const uint CmNameLength = 30; + //! Homepage address length + const uint CmStartPageLength = 1024; + //! IPv6 DNS address length + const uint CmIP6NameServerLength = 50; + //! Proxy server address length + const uint CmProxyServerNameLength = 1024; + //! Proxy server port number length + const uint CmProxyPortNumberLength = 5; + //! Packet data AP name length + const uint PacketDataAPNameLength = 100; + //! Packet data AP user name length + const uint PacketDataIFAuthNameLength = 50; + //! Packet data AP password length + const uint PacketDataIFAuthPassLength = 50; + //! WLAN SSID length + const uint WlanSSIDLength = 32; + + /*! + * Enumerations for connection method attributes. + */ + enum ConnectionMethodAttribute { + // Common attributes + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmBearerType = CMManager::ECmBearerType, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmName = CMManager::ECmName, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmIapId = CMManager::ECmIapId, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmHidden = CMManager::ECmHidden, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmProtected = CMManager::ECmProtected, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmNetworkId = CMManager::ECmNetworkId, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmId = CMManager::ECmId, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmStartPage = CMManager::ECmStartPage, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmIPv6Supported = CMManager::ECmIPv6Supported, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmIPDNSAddrFromServer = CMManager::ECmIPDNSAddrFromServer, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmIPAddress = CMManager::ECmIPAddress, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmIPNameServer1 = CMManager::ECmIPNameServer1, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmIPNameServer2 = CMManager::ECmIPNameServer2, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmIP6DNSAddrFromServer = CMManager::ECmIP6DNSAddrFromServer, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmIP6NameServer1 = CMManager::ECmIP6NameServer1, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmIP6NameServer2 = CMManager::ECmIP6NameServer2, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmProxyUsageEnabled = CMManager::ECmProxyUsageEnabled, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmProxyProtocolName = CMManager::ECmProxyProtocolName, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmProxyServerName = CMManager::ECmProxyServerName, + //! From TConnectionMethodCommonAttributes in cmconnectionmethoddef.h + CmProxyPortNumber = CMManager::ECmProxyPortNumber, + + // Packet data specific attributes + /*! + * From TConnectionMethodPacketDataSpecificAttributes in + * cmpluginpacketdatadef.h + */ + PacketDataAPName = CMManager::EPacketDataAPName, + /*! + * From TConnectionMethodPacketDataSpecificAttributes in + * cmpluginpacketdatadef.h + */ + PacketDataIFPromptForAuth = CMManager::EPacketDataIFPromptForAuth, + /*! + * From TConnectionMethodPacketDataSpecificAttributes in + * cmpluginpacketdatadef.h + */ + PacketDataIFAuthName = CMManager::EPacketDataIFAuthName, + /*! + * From TConnectionMethodPacketDataSpecificAttributes in + * cmpluginpacketdatadef.h + */ + PacketDataIFAuthPass = CMManager::EPacketDataIFAuthPass, + /*! + * From TConnectionMethodPacketDataSpecificAttributes in + * cmpluginpacketdatadef.h + */ + PacketDataDisablePlainTextAuth = CMManager::EPacketDataDisablePlainTextAuth, + + // WLAN specific attributes + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanConnectionMode = CMManager::EWlanConnectionMode, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanSSID = CMManager::EWlanSSID, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanSecurityMode = CMManager::EWlanSecurityMode, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanScanSSID = CMManager::EWlanScanSSID, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanWepKey1InHex = CMManager::EWlanWepKey1InHex, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanWepKey2InHex = CMManager::EWlanWepKey2InHex, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanWepKey3InHex = CMManager::EWlanWepKey3InHex, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanWepKey4InHex = CMManager::EWlanWepKey4InHex, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanWepKey1InAscii = CMManager::EWlanWepKey1InAscii, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanWepKey2InAscii = CMManager::EWlanWepKey2InAscii, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanWepKey3InAscii = CMManager::EWlanWepKey3InAscii, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanWepKey4InAscii = CMManager::EWlanWepKey4InAscii, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanWepKeyIndex = CMManager::EWlanWepKeyIndex, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanEnableWpaPsk = CMManager::EWlanEnableWpaPsk, + //! From TConnectionMethodWlanSpecificAttributes in cmpluginwlandef.h + WlanWpaPreSharedKey = CMManager::EWlanWpaPreSharedKey + }; + + /*! + * Enumerations for Wlan connection modes. Values come from + * TWlanNetMode in cmpluginwlandef.h + */ + enum WlanConnMode { + Adhoc = CMManager::EAdhoc, + Infra = CMManager::EInfra + }; + + /*! + * Enumerations for Wlan security modes. Values come from + * TWlanSecMode in cmpluginwlandef.h + */ + enum WlanSecMode { + WlanSecModeOpen = CMManager::EWlanSecModeOpen, + WlanSecModeWep = CMManager::EWlanSecModeWep, + WlanSecMode802_1x = CMManager::EWlanSecMode802_1x, + WlanSecModeWpa = CMManager::EWlanSecModeWpa, + WlanSecModeWpa2 = CMManager::EWlanSecModeWpa2, + WlanSecModeWapi = CMManager::EWlanSecModeWAPI + }; + + /*! + * Enumerations for Wlan WEP key index. Values come from + * TWepKeyIndex in cmpluginwlandef.h + */ + enum WlanWepKeyIndex { + WepKeyIndex1 = CMManager::EWepKeyIndex1, + WepKeyIndex2 = CMManager::EWepKeyIndex2, + WepKeyIndex3 = CMManager::EWepKeyIndex3, + WepKeyIndex4 = CMManager::EWepKeyIndex4 + }; + + /*! + * Enumerations for SNAP metadata items. Values come from + * TSnapMetadataField in cmmanagerdef.h + */ + enum SnapMetadataField { + SnapMetadataInternet = CMManager::ESnapMetadataInternet, + SnapMetadataHighlight = CMManager::ESnapMetadataHighlight, + SnapMetadataHiddenAgent = CMManager::ESnapMetadataHiddenAgent, + SnapMetadataDestinationIsLocalised = CMManager::ESnapMetadataDestinationIsLocalised, + SnapMetadataPurpose = CMManager::ESnapMetadataPurpose + }; + + /*! + * Enumerations for SnapMetadataPurpose. Values come from + * TSnapPurpose in cmmanagerdef.h + */ + enum SnapPurpose + { + SnapPurposeUnknown = CMManager::ESnapPurposeUnknown, + SnapPurposeInternet = CMManager::ESnapPurposeInternet, + SnapPurposeOperator = CMManager::ESnapPurposeOperator, + SnapPurposeMMS = CMManager::ESnapPurposeMMS, + SnapPurposeIntranet = CMManager::ESnapPurposeIntranet + }; + + /*! + * Enumerations for CM Manager protection levels. Values come from + * TProtectionLevel in cmmanagerdef.h + */ + enum CmmProtectionLevel { + ProtLevel0 = CMManager::EProtLevel0, + ProtLevel1 = CMManager::EProtLevel1, + ProtLevel2 = CMManager::EProtLevel2, + ProtLevel3 = CMManager::EProtLevel3 + }; +} + +#endif // CMMANAGERDEFINES_SHIM_H diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/connection_settings_ui_api/connection_settings_ui_api.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipcm_plat/connection_settings_ui_api/connection_settings_ui_api.pri Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,18 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +PLATFORM_HEADERS += \ + connection_settings_ui_api/inc/cmapplsettingsui.h diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/connection_settings_ui_api/inc/cmapplsettingsui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipcm_plat/connection_settings_ui_api/inc/cmapplsettingsui.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,240 @@ +/* +* 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: +* CM Manager Application Settings UI interface. +* +*/ + +#ifndef CMAPPLSETTINGSUI_H +#define CMAPPLSETTINGSUI_H + +// System includes + +#include +#include +#include + +// User includes + +// Forward declarations + +class CmApplSettingsUiPrivate; +class TestCmApplSettingsUi; + +// External data types + +// Constants + +#ifdef BUILD_CMAPPLSETTINGSUI_DLL +#define CMAPPLSETTINGSUIDLL_EXPORT Q_DECL_EXPORT +#else +#define CMAPPLSETTINGSUIDLL_EXPORT Q_DECL_IMPORT +#endif + +// Class declaration + +/*! + \class CmApplSettingsUi + \brief Class for launching the Application Settings UI. + + Displays a radio button list dialog for an application that can be used + to select a destination or connection method. + +*/ + +class CMAPPLSETTINGSUIDLL_EXPORT CmApplSettingsUi : public QObject +{ + Q_OBJECT + +public: + + // Data types + + /*! + The selection type of a list item in application settings UI + */ + enum SelectionType + { + //! The user selected a destination + SelectionTypeDestination, + //! The user selected a connection method + SelectionTypeConnectionMethod + }; + + /*! + These flags control what items the selection UI can contain. + Flags that are not listed in the enum are reserved for future usage + and they are disabled by default. So extending these flags later on + does not cause a BC break. These flags are used as bit fields. + + The following enumerations control how destinations and + Connection Methods are presented in the selection UI. + + ShowDestinations is set and ShowConnectionMethods is set: + Destination list is shown in selection UI and alternatively + the user can select a Connection Method. + ShowDestinations is set and ShowConnectionMethods is not set: + Destination list is shown in selection UI and no specific + Connection Method can be selected. + ShowDestinations is not set and ShowConnectionMethods is set: + Connection Method list is shown in selection UI. Destinations + can not be selected. + ShowDestinations is not set and ShowConnectionMethods is not set: + The selection UI will not contain any Destination or + Connection Method. If no extension(s) are implemented (later + on), no dialog is shown, and the execution is cancelled + (ApplSettingsErrorNoContent). + */ + enum SelectionDialogItems + { + //! Support destination selection + ShowDestinations = 0x01, + //! Support connection method selection + ShowConnectionMethods = 0x02 + }; + + /*! + Error codes for the dialog. + */ + enum ApplSettingsError { + //! No error. Dialog succeeded. + ApplSettingsErrorNone = 0, + //! Selection was canceled. + ApplSettingsErrorCancel, + //! No items to show (e.g. too strict filters). + ApplSettingsErrorNoContent, + //! Settings reading failed. + ApplSettingsErrorSettingsRead + }; + + /*! + Details of a setting selection. Used both for configuring and + selection result. + */ + struct SettingSelection + { + /*! + Selection type, refers to the type of the list item which + is selected. + */ + SelectionType result; + + /*! + Id of the selected destination or connection method. + */ + uint id; + }; + + /*! + Typedef for the bearer filter parameter. + This type is used to filter Connection Methods by bearer type. + + The Bearer types are defined in CM Manager's Connection Settings + Shim (cmmanagerdefines_shim.h). + */ + typedef uint BearerTypeFilter; + + /*! + Constructor. + + @param parent Parent object. + */ + explicit CmApplSettingsUi(QObject *parent = 0); + + /*! + Destructor. + */ + virtual ~CmApplSettingsUi(); + + /*! + Set dialog options. If this function is not called before running the + dialog, the default options are used: + -listItems: ShowDestinations | ShowConnectionMethods + -bearerFilter: empty + + @param[in] listItems Dialog list items configuration. + @param[in] bearerFilter Dialog Connection Method bearer type filter. + If empty, all bearers are supported. + */ + void setOptions( + const QFlags &listItems, + const QSet &bearerFilter); + + /*! + Dialog selection setter. Sets the current selection in the dialog. + If not selected, or if the selection is invalid, the default + selection is used (the first item in the dialog items list). + + @param[in] selection Dialog selection to set. + */ + void setSelection(const SettingSelection &selection); + + /*! + Dialog selection getter. Returns the current selection. + + @return Current dialog selection. + */ + SettingSelection selection() const; + + /*! + Launches the Application Settings UI provided for applications + for selecting Destinations and/or Connection Methods. + + If a list of Destinations is displayed, and the selection is set to + a Connection Method, the destination list highlight is set to + "Dedicated access point". + + This function runs the dialog asynchronously. After the dialog + has been closed (or cancelled), the signal finished() is emmitted. + If the dialog succeeded, the client can then check the new + selection with selection() getter. + */ + void open(); + +signals: + + /*! + Signal used for informing that the dialog has finished. + + @param[in] status Dialog run status code (ApplSettingsError*). + */ + void finished(uint status); + +public slots: + +protected: + +protected slots: + +private: + + Q_DISABLE_COPY(CmApplSettingsUi) + +private slots: + +private: // data + + CmApplSettingsUiPrivate *d_ptr; //!< Private implementation + + // Friend classes + + // This is defined as a friend class in order to be able to emit + // signals directly from private implementation code. + friend class CmApplSettingsUiPrivate; + + // Test class needs direct access + friend class TestCmApplSettingsUi; +}; + +#endif // CMAPPLSETTINGSUI_H diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/connection_ui_utilities_api/inc/ConnectionUiUtilities.h --- a/ipcm_plat/connection_ui_utilities_api/inc/ConnectionUiUtilities.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_plat/connection_ui_utilities_api/inc/ConnectionUiUtilities.h Mon May 03 12:53:07 2010 +0300 @@ -108,18 +108,35 @@ /** * Pops up discreet popup indicating that connection is being + * established to not yet known access point. The access point details + * can be later provided with ConnectingViaDiscreetPopup( aIAPId, + * aConnectionAlreadyActive) method. + * This method should only be used from the MPM in order to provide + * a consistent popup behavior across the platform. + */ + IMPORT_C void ConnectingViaDiscreetPopup( ); + + /** + * Pops up discreet popup indicating that connection is being * established to the given access point. * This method should only be used from the MPM in order to provide * a consistent popup behavior across the platform. * @param aIAPId The id of the access point. - * @param aConnectionActive is connection already active. + * @param aConnectionActive ETrue connection already active. */ - IMPORT_C void ConnectingViaDiscreetPopup( const TUint32& aIAPId, TBool aConnectionAlreadyActive ); + IMPORT_C void ConnectingViaDiscreetPopup( const TUint32& aIAPId, + TBool aConnectionAlreadyActive ); + + /** + * Cancels (hides) connecting via discreet popup. + * This method should only be used from the MPM in order to provide + * a consistent popup behavior across the platform. + */ + IMPORT_C void CancelConnectingViaDiscreetPopup( ); /** * Pops up a discreet popup indicating a connection error. - * Only appropriate error codes show the popup, otherwise - * (such as with general errors) the popup is not shown. + * Only appropriate error codes show the popup. * This method should only be used from the MPM in order to provide * a consistent popup behavior across the platform. * @param aErrCode Symbian error code. diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/extended_connection_settings_api/group/bld.inf --- a/ipcm_plat/extended_connection_settings_api/group/bld.inf Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_plat/extended_connection_settings_api/group/bld.inf Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -11,8 +11,8 @@ * * Contributors: * -* Description: File that exports the files belonging to -: Extended Connection Settings API +* Description: +* File that exports the files belonging to Extended Connection Settings API. * */ @@ -24,10 +24,10 @@ PRJ_EXPORTS -../inc/cmdestinationext.h MW_LAYER_PLATFORM_EXPORT_PATH(cmdestinationext.h) -../inc/cmconnectionmethodext.h MW_LAYER_PLATFORM_EXPORT_PATH(cmconnectionmethodext.h) -../inc/cmpsettingsconsts.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpsettingsconsts.h) -../inc/cmsettingsui.h MW_LAYER_PLATFORM_EXPORT_PATH(cmsettingsui.h) -../inc/cmcommonui.h MW_LAYER_PLATFORM_EXPORT_PATH(cmcommonui.h) -../inc/cmmanagerext.h MW_LAYER_PLATFORM_EXPORT_PATH(cmmanagerext.h) -../inc/cmmanagerkeys.h MW_LAYER_PLATFORM_EXPORT_PATH(cmmanagerkeys.h) +../inc/cmdestinationext.h MW_LAYER_PLATFORM_EXPORT_PATH(cmdestinationext.h) +../inc/cmconnectionmethodext.h MW_LAYER_PLATFORM_EXPORT_PATH(cmconnectionmethodext.h) +../inc/cmpsettingsconsts.h MW_LAYER_PLATFORM_EXPORT_PATH(cmpsettingsconsts.h) +../inc/cmsettingsui.h MW_LAYER_PLATFORM_EXPORT_PATH(cmsettingsui.h) +../inc/cmcommonui.h MW_LAYER_PLATFORM_EXPORT_PATH(cmcommonui.h) +../inc/cmmanagerext.h MW_LAYER_PLATFORM_EXPORT_PATH(cmmanagerext.h) +../inc/cmmanagerkeys.h MW_LAYER_PLATFORM_EXPORT_PATH(cmmanagerkeys.h) diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/extended_connection_settings_api/inc/cmconnectionmethodext.h --- a/ipcm_plat/extended_connection_settings_api/inc/cmconnectionmethodext.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_plat/extended_connection_settings_api/inc/cmconnectionmethodext.h Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -11,20 +11,22 @@ * * Contributors: * -* Description: Connection method extended interface class. +* Description: +* Connection method extended interface class. * */ + #ifndef CMCONNECTIONMETHODEXT_H #define CMCONNECTIONMETHODEXT_H -// INCLUDES #include #include -// CLASS DECLARATION -class CCmPluginBaseEng; +// Forward declarations class RCmDestinationExt; +class CCmConnectionMethodWrapper; + /** * RCmConnectionMethodExt is for getting/setting values of a connection method. @@ -34,44 +36,36 @@ */ NONSHARABLE_CLASS( RCmConnectionMethodExt ) { - //===================================================================== - // Constructors/Destructors - // public: - /** - * Default constructor. + * Default constructor. */ IMPORT_C RCmConnectionMethodExt(); + /** + * Copy constructor. + */ + IMPORT_C RCmConnectionMethodExt( + const RCmConnectionMethodExt& aConnMethod ); /** - * Copy constructor. - */ - IMPORT_C RCmConnectionMethodExt(const RCmConnectionMethodExt& aItem); - - - /** - * Destructor. + * Destructor. */ IMPORT_C ~RCmConnectionMethodExt(); - //===================================================================== - // API functions public: - /** * Close the session. */ IMPORT_C void Close(); - + /** - * Creates a copy of this connection method. UpdateL() has to be called + * Creates a copy of this connection method. UpdateL() has to be called * to store new connection method in database. Copy is put to * the Uncategorized destination. The ownership is passed. */ IMPORT_C RCmConnectionMethodExt CreateCopyL(); - + /** * Gets the value for a TInt attribute. * @param aAttribute Identifies the attribute to be retrived. @@ -93,7 +87,7 @@ * @return copy of the requested attribute. Ownership is passed. */ IMPORT_C HBufC* GetStringAttributeL( TUint32 aAttribute ) const; - + /** * Gets the value for a String8 attribute. * HBuf ownership is passed to the caller @@ -124,18 +118,20 @@ * @param aValue The value to be set. * @return None. */ - IMPORT_C void SetStringAttributeL( TUint32 aAttribute, - const TDesC16& aValue ); - + IMPORT_C void SetStringAttributeL( + TUint32 aAttribute, + const TDesC16& aValue ); + /** * Sets the value for a String8 attribute. * @param aAttribute Identifies the attribute to be set. * @param aValue The value to be set. * @return None. */ - IMPORT_C void SetString8AttributeL( TUint32 aAttribute, - const TDesC8& aValue ); - + IMPORT_C void SetString8AttributeL( + TUint32 aAttribute, + const TDesC8& aValue ); + /** * Call this function only if this CM is an embedded destination! * @return embedded destination @@ -143,8 +139,8 @@ IMPORT_C RCmDestinationExt DestinationL() const; /** - * Try to delete the connection method. If it is referenced from - * any destination, then the references are removed and the + * Try to delete the connection method. If it is referenced from + * any destination, then the references are removed and the * connection method is deleted. * Do NOT call this function if you got this * connection method from a destination. Call destination's @@ -152,51 +148,49 @@ * @return ETrue if connection method deleted. */ IMPORT_C TBool DeleteL(); - + /** * Update in the database. * @return None. - */ + */ IMPORT_C void UpdateL(); - + /** - * checks if connection methods are the same - * + * checks if connection methods are the same + * * @since S60 3.2 * @param aConnMethod the connection method being compared * @return ETrue if the destinations are the same */ IMPORT_C TBool operator==( RCmConnectionMethodExt& aConnMethod ) const; - + /** - * checks if connection methods are not the same - * + * checks if connection methods are not the same + * * @since S60 3.2 * @param aConnMethod the connection method being compared * @return ETrue if the destinations are different */ IMPORT_C TBool operator!=( RCmConnectionMethodExt& aConnMethod ) const; - + /** - * assignment operator - * + * assignment operator + * * @since S60 3.2 * @return RCmConnectionMethod */ - IMPORT_C RCmConnectionMethodExt& operator=(const RCmConnectionMethodExt& - aConnMethod); + IMPORT_C RCmConnectionMethodExt& operator=( + const RCmConnectionMethodExt& aConnMethod ); private: - friend class RCmManagerExt; friend class RCmDestinationExt; - + private: - - CCmPluginBaseEng* iImplementation; + CCmConnectionMethodWrapper* iCmConnectionMethodWrapper; }; -#endif // CMCONNECTIONMETHODEXT_H - -// End of File \ No newline at end of file +#endif // CMCONNECTIONMETHODEXT_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/extended_connection_settings_api/inc/cmdestinationext.h --- a/ipcm_plat/extended_connection_settings_api/inc/cmdestinationext.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_plat/extended_connection_settings_api/inc/cmdestinationext.h Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -11,45 +11,36 @@ * * Contributors: * -* Description: Destination extended interface class. +* Description: +* Destination extended interface class. * */ -#ifndef DESTINATIONEXT_H -#define DESTINATIONEXT_H -// System includes -#include +#ifndef CMDESTINATIONEXT_H +#define CMDESTINATIONEXT_H + #include #include #include -// FORWARD DECLARATIONS -class CCmDestinationData; -class CCmManagerImpl; +// Forward declarations class RCmConnectionMethodExt; -class RCmDestinationExt; -class CGulIcon; +class CCmDestinationWrapper; + /** * RCmDestination is for getting/setting values of a network destination. * @lib cmmanager.lib * @since S60 v3.2 */ -NONSHARABLE_CLASS(RCmDestinationExt) +NONSHARABLE_CLASS( RCmDestinationExt ) { - //===================================================================== - // Constructors/Destructors - // public: - /** Default constructor. */ IMPORT_C RCmDestinationExt(); - //===================================================================== - // API functions public: - /** * Close the session. */ @@ -57,180 +48,164 @@ IMPORT_C ~RCmDestinationExt(); - IMPORT_C RCmDestinationExt(const RCmDestinationExt& aCmDestination); - - //===================================================================== - // Conn method handling - + IMPORT_C RCmDestinationExt( const RCmDestinationExt& aDestination ); + /** * Return the number of connection methods in the destination * @param None * @return number of the connection method in this destination - */ + */ IMPORT_C TInt ConnectionMethodCount(); - + /** - * Return a reference to the connection method. - * The index must be less than the return value of + * Return a reference to the connection method. + * The index must be less than the return value of * ConnectionMethodCount() * @param anIndex index of the connection method to be returned * @return connection method - */ - IMPORT_C RCmConnectionMethodExt ConnectionMethodL( TInt anIndex ); - + */ + IMPORT_C RCmConnectionMethodExt ConnectionMethodL( TInt aIndex ); + /** * Returns the connection method with the ECmId. * Leaves with KErrNotFound if not found. * @param aCmId unique id of the requested connection method. * @return connection method */ - IMPORT_C RCmConnectionMethodExt ConnectionMethodByIDL( - TInt aCmId ); - - //Getting attributes + IMPORT_C RCmConnectionMethodExt ConnectionMethodByIDL( + TInt aConnMethodId ); /** * Return the priority of the passed connection method * @param aCCMItem connection method - * @return the priority of the queried connection method + * @return the priority of the queried connection method */ - IMPORT_C TUint PriorityL(const RCmConnectionMethodExt& aCCMItem ); - + IMPORT_C TUint PriorityL( + const RCmConnectionMethodExt& aConnectionMethod ); + /** * Return the name of the destination. Ownership is passed. * HBuf ownership is passed to the caller * @return name of the destination. - */ - IMPORT_C HBufC* NameLC(); - + */ + IMPORT_C HBufC* NameLC(); + /** * Return the destination's Id attribute * @return id of the destination - */ + */ IMPORT_C TUint32 Id(); /** * Return the destination's ElementId attribute - * @return TUint32 - */ + * @return TUint32 + */ IMPORT_C TUint32 ElementId(); - - /** - * Return the Icon pointer. Ownership is passed. - * This fucton leaves if the client does not have a valid UI context - * @return icon of the destination - */ - IMPORT_C CGulIcon* IconL(); - + /** * Return the Metadata - * @return TUint32 - */ - IMPORT_C TUint32 MetadataL( CMManager::TSnapMetadataField aMetaField ) const; - + * @return TUint32 + */ + IMPORT_C TUint32 MetadataL( + CMManager::TSnapMetadataField aMetadataField ) const; + /** * Return the protection level of the destination. * @return protection level */ IMPORT_C CMManager::TProtectionLevel ProtectionLevel(); - + /** * Return that the destination is hidden or not. * @return ETrue if the destination is hidden */ - IMPORT_C TBool IsHidden(); - + IMPORT_C TBool IsHidden(); + /** * Create a connection method that belongs to this destination. - * @param aImplementationUid - implementation uid (bearer type) of the + * @param aImplementationUid - implementation uid (bearer type) of the * connection method to be created * @return newly created connection method */ - IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( - TUint32 aBearerType ); - + IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( + TUint32 aBearerType ); + /* * Adds an existing connection method to a destination * @param aConnectionMethod Connection method to be added * @return index in the Connection Method list */ - IMPORT_C TInt AddConnectionMethodL( - RCmConnectionMethodExt aConnectionMethod ); - + IMPORT_C TInt AddConnectionMethodL( + RCmConnectionMethodExt aConnectionMethod ); + /* * Embeds an existing destination into this destination. * @param RCmDestinationExt - Destination to be embedded * @return TInt - index in the Connection Method list */ IMPORT_C TInt AddEmbeddedDestinationL( - const RCmDestinationExt& aDestination ); - + const RCmDestinationExt& aDestination ); + /** * Remove a connection method from a destination and delete it - * on update. - * Exception: conenction method is not deleted if it's referenced + * on update. + * Exception: conenction method is not deleted if it's referenced * from any other destination. * @param aConnectionMethod the connection method to be deleted. */ - IMPORT_C void DeleteConnectionMethodL( - RCmConnectionMethodExt& aConnectionMethod ); - + IMPORT_C void DeleteConnectionMethodL( + RCmConnectionMethodExt& aConnectionMethod ); + /** * Remove connection method from the destination * @param aConnectionMethod connection method to be removed */ - IMPORT_C void RemoveConnectionMethodL( - RCmConnectionMethodExt aConnectionMethod ); - - + IMPORT_C void RemoveConnectionMethodL( + RCmConnectionMethodExt aConnectionMethod ); + /** * Set the connection method's priority based on the passed * index. Indexing starts from zero(the highest priority). * @param aCCMItem the connection method item - * @param aIndex the new priority of the connection method in the + * @param aIndex the new priority of the connection method in the * destination */ - IMPORT_C void ModifyPriorityL( RCmConnectionMethodExt& aCCMItem, - TUint aIndex ); - + IMPORT_C void ModifyPriorityL( + RCmConnectionMethodExt& aConnectionMethod, + TUint aIndex ); + /** * Set the destination's name * @param aDestinationName new name of the destination */ IMPORT_C void SetNameL( const TDesC& aName ); - - /** - * Set the destination's icon index. - * This fucton leaves if the client does not have a valid UI context - * @param aIconIndex new icon index of the destination - */ - IMPORT_C void SetIconL( TUint32 anIndex ); - + /** * Set the Metadata * @param aMetaField field to be modified * @param aValue value to be set - */ - IMPORT_C void SetMetadataL( CMManager::TSnapMetadataField aMetaField, - TUint32 aValue ); - + */ + IMPORT_C void SetMetadataL( + CMManager::TSnapMetadataField aMetadataField, + TUint32 aValue ); + /** * Set the protection level of the destination. - * @param aProtLevel new protection level + * @param aProtLevel new protection level */ IMPORT_C void SetProtectionL( CMManager::TProtectionLevel aProtLevel ); - + /** * Set if the destination is hidden or not. * @param aHidden - ETrue if destination is hidden */ - IMPORT_C void SetHiddenL( TBool aHidden ); - + IMPORT_C void SetHiddenL( TBool aHidden ); + /** * Update all values of the destination and its connection method. * Nothing if stored, if update leaves due to any reason. */ - IMPORT_C void UpdateL(); + IMPORT_C void UpdateL(); /** * Delete destination and its connection methods from CommsDat. @@ -238,7 +213,7 @@ * not deleted. */ IMPORT_C void DeleteLD(); - + /** * Returns if there's connection created with any of the destination's * connection method. @@ -246,50 +221,53 @@ * connection method. */ IMPORT_C TBool IsConnectedL() const; - + /** * Compares whether two objects content is the same. * @return ETrue if the content is same. */ - IMPORT_C TBool operator==(const RCmDestinationExt& aDestination) const; + IMPORT_C TBool operator==( + const RCmDestinationExt& aDestination ) const; /** * Compares whether two objects content is different. * @return ETrue if the content is different. */ - IMPORT_C TBool operator!=(const RCmDestinationExt& aDestination) const; + IMPORT_C TBool operator!=( + const RCmDestinationExt& aDestination ) const; /** - * assignment operator - * + * assignment operator + * * @since S60 3.2 * @param aDestination the destination being compared * @return RCmDestination */ - IMPORT_C RCmDestinationExt& operator=(const RCmDestinationExt& - aCmDestination); + IMPORT_C RCmDestinationExt& operator=( + const RCmDestinationExt& aDestination ); /** - * Create a connection method with given id that belongs to this destination. - * @param aImplementationUid - implementation uid (bearer type) of the + * Create a connection method with given id that belongs to this + * destination. + * @param aImplementationUid - implementation uid (bearer type) of the * connection method to be created * @param aConnMethdId Predefined id for the connection method * (id range is from 1 to max IAP record amount in CommsDat). * @return newly created connection method or leaves with * KErrAlreadyExists if there exists CM with the same Id. */ - IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( - TUint32 aBearerType, - TUint32 aConnMethId ); - - private: // Data - - CCmDestinationData* iDestinatonData; + IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( + TUint32 aBearerType, + TUint32 aConnMethodId ); private: - friend class RCmManagerExt; friend class RCmConnectionMethodExt; + + private: + CCmDestinationWrapper* iCmDestinationWrapper; }; - -#endif // DESTINATIONEXT_H + +#endif // CMDESTINATIONEXT_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/extended_connection_settings_api/inc/cmmanagerext.h --- a/ipcm_plat/extended_connection_settings_api/inc/cmmanagerext.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_plat/extended_connection_settings_api/inc/cmmanagerext.h Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -11,27 +11,25 @@ * * Contributors: * -* Description: Connection manager IF class. +* Description: +* Connection manager IF class. * */ + #ifndef CMMANAGEREXT_H #define CMMANAGEREXT_H -// System includes -#include #include -#include #include -#include #include #include #include -// FORWARD DECLARATIONS +// Forward declarations class RCmDestinationExt; -class CCmManagerImpl; -class CGulIcon; +class RCmManagerApi; + /** * RCmManager is used to query and modify network destinations and connection @@ -40,208 +38,197 @@ * @lib cmmanager.lib * @since S60 v3.2 */ -NONSHARABLE_CLASS(RCmManagerExt) +NONSHARABLE_CLASS( RCmManagerExt ) { - //===================================================================== - // Constructors/Destructors - // public: - /** Inline constructor */ inline RCmManagerExt(); - //===================================================================== - // API functions public: - /** Open session */ - IMPORT_C void OpenL(); + IMPORT_C void OpenL(); - /** Open session and create tables if they don't exist*/ - IMPORT_C void CreateTablesAndOpenL(); - + /** Open session and create tables if they don't exist */ + IMPORT_C void CreateTablesAndOpenL(); + /** * Symbian constructor * Pushes the object on the cleanup stack * * @since S60 3.2 */ - IMPORT_C void OpenLC(); - + IMPORT_C void OpenLC(); + /** Close session */ IMPORT_C void Close(); - + /** - * GetBearerInfoXXX function can be used to query - * bearer informantion that doesn't belong - * to a specific connection method, such as + * GetBearerInfoXXX function can be used to query bearer informantion + * that doesn't belong to a specific connection method, such as * ECmCoverage or ECmDefaultPriority etc. - * NULL pointer, returned from string functions, means - * attribute exists but has no value. + * NULL pointer, returned from string functions, means attribute exists + * but has no value. + * HBuf ownership is passed to the caller. + */ + IMPORT_C TUint32 GetBearerInfoIntL( + TUint32 aBearerType, + TUint32 aAttribute ) const; + IMPORT_C TBool GetBearerInfoBoolL( + TUint32 aBearerType, + TUint32 aAttribute ) const; + IMPORT_C HBufC* GetBearerInfoStringL( + TUint32 aBearerType, + TUint32 aAttribute ) const; + IMPORT_C HBufC8* GetBearerInfoString8L( + TUint32 aBearerType, + TUint32 aAttribute ) const; + + /** + * GetConnectionMethodInfoXXX function can be used to query any, + * non-bearer specific information about a given connection method. This + * can be e.g. ECmBearerType, ECmName, ECmStartPage etc. + * NULL pointer, returned from string functions, means attribute exists + * but has no value. * HBuf ownership is passed to the caller */ - IMPORT_C TUint32 GetBearerInfoIntL( TUint32 aBearerType, - TUint32 aAttribute ) const; - IMPORT_C TBool GetBearerInfoBoolL( TUint32 aBearerType, - TUint32 aAttribute ) const; - IMPORT_C HBufC* GetBearerInfoStringL( TUint32 aBearerType, - TUint32 aAttribute ) const; - IMPORT_C HBufC8* GetBearerInfoString8L( TUint32 aBearerType, - TUint32 aAttribute ) const; + IMPORT_C TUint32 GetConnectionMethodInfoIntL( + TUint32 aIapId, + TUint32 aAttribute ) const; + IMPORT_C TBool GetConnectionMethodInfoBoolL( + TUint32 aIapId, + TUint32 aAttribute ) const; + IMPORT_C HBufC* GetConnectionMethodInfoStringL( + TUint32 aIapId, + TUint32 aAttribute ) const; + IMPORT_C HBufC8* GetConnectionMethodInfoString8L( + TUint32 aIapId, + TUint32 aAttribute ) const; /** - * GetConnectionMethodInfoXXX function can be used to - * query any, non-bearer specific information about - * a given connection method. This can be e.g. ECmBearerType, - * ECmName, ECmStartPage etc. - * NULL pointer, returned from string functions, means - * attribute exists but has no value. - * HBuf ownership is passed to the caller - */ - IMPORT_C TUint32 GetConnectionMethodInfoIntL( TUint32 aIapId, - TUint32 aAttribute ) const; - IMPORT_C TBool GetConnectionMethodInfoBoolL( TUint32 aIapId, - TUint32 aAttribute ) const; - IMPORT_C HBufC* GetConnectionMethodInfoStringL( TUint32 aIapId, - TUint32 aAttribute ) const; - IMPORT_C HBufC8* GetConnectionMethodInfoString8L( TUint32 aIapId, - TUint32 aAttribute ) const; - - /** - * Creates a Destination with the passed name. + * Creates a Destination with the passed name. * @param aName the name of the new destination. - * @return RCmDestinationExt new destination. ownership is passed to the + * @return RCmDestinationExt new destination. ownership is passed to the * caller */ IMPORT_C RCmDestinationExt CreateDestinationL( const TDesC& aName ); - + /** * Creates a connection method does not belong to any destination * @param aImplementationUid - bearer type of the new connection method * @return RCmConnectionMethodExt newly created connection method. */ - IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( - TUint32 aBearerType ); - + IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( + TUint32 aBearerType ); + /** - * Copies a connection method belonging to one destination to - * another. The connection method becomes shared. - * Calls UpdateL on the destination + * Copies a connection method belonging to one destination to another. + * The connection method becomes shared. Calls UpdateL on the + * destination. * @param aTargetDestination * @param aConnectionMethodId * @return TInt - index in the Connection Method list */ - IMPORT_C TInt CopyConnectionMethodL( - RCmDestinationExt& aTargetDestination, - RCmConnectionMethodExt& aConnectionMethod ); - + IMPORT_C TInt CopyConnectionMethodL( + RCmDestinationExt& aTargetDestination, + RCmConnectionMethodExt& aConnectionMethod ); + /** - * Moves a connection method belonging to one destination to - * another. The connection method is removed from the source destination + * Moves a connection method belonging to one destination to another. The + * connection method is removed from the source destination. * @param aSourceDestination * @param aTargetDestination * @param aConnectionMethod * @return TInt - index in the Connection Method list */ - IMPORT_C TInt MoveConnectionMethodL( - RCmDestinationExt& aSourceDestination, - RCmDestinationExt& aTargetDestination, - RCmConnectionMethodExt& aConnectionMethod ); - + IMPORT_C TInt MoveConnectionMethodL( + RCmDestinationExt& aSourceDestination, + RCmDestinationExt& aTargetDestination, + RCmConnectionMethodExt& aConnectionMethod ); + /** * Remove connection method from the destination * @param aDestination destination the connection method is attached to * @param aConnectionMethod connection method to be removed */ - IMPORT_C void RemoveConnectionMethodL( - RCmDestinationExt& aDestination, - RCmConnectionMethodExt& aConnectionMethod ); - + IMPORT_C void RemoveConnectionMethodL( + RCmDestinationExt& aDestination, + RCmConnectionMethodExt& aConnectionMethod ); + /** - * Removes connection method from every destination and make it + * Removes connection method from every destination and make it * uncategorized. * @param aConnectionMethod connection method to be removed */ - IMPORT_C void RemoveAllReferencesL( - RCmConnectionMethodExt& aConnectionMethod ); + IMPORT_C void RemoveAllReferencesL( + RCmConnectionMethodExt& aConnectionMethod ); - //========================================================================= - // API functions - Getter-Setter public: - /** * Returns the connection method queried by its ID. * @param aId if of the connection method * @return RCmConnectionMethodExt connection method instance */ - IMPORT_C RCmConnectionMethodExt ConnectionMethodL( - TUint32 aConnectionMethodId ); - + IMPORT_C RCmConnectionMethodExt ConnectionMethodL( + TUint32 aConnectionMethodId ); + /** - * Returns the list of connection methods that do not belong to any - * destination + * Returns the list of connection methods that do not belong to any + * destination. * @param aCMArray on return it is the array of IAP ids. - * @param aCheckBearerType If ETrue only connection methods with - * supported bearer types are returned - * @param aLegacyOnly when set to ETrue only Legacy IAP ids will - * be returned - * @param aEasyWlan when set to ETrue EasyWlan id is returned, too + * @param aCheckBearerType If ETrue only connection methods with + * supported bearer types are returned. + * @param aLegacyOnly when set to ETrue only Legacy IAP ids will be + * returned. + * @param aEasyWlan when set to ETrue EasyWlan id is returned, too. */ - IMPORT_C void ConnectionMethodL( RArray& aCMArray, - TBool aCheckBearerType = ETrue, - TBool aLegacyOnly = ETrue, - TBool aEasyWlan = EFalse ); - + IMPORT_C void ConnectionMethodL( + RArray& aCmArray, + TBool aCheckBearerType = ETrue, + TBool aLegacyOnly = ETrue, + TBool aEasyWlan = EFalse ); + /** - * Returns the destination to which a specified - * connection method belongs, search is by destination ID + * Returns the destination to which a specified connection method + * belongs, search is by destination ID. * @param aDestinationId id of the destination * @return RCmDestinationExt network destination */ IMPORT_C RCmDestinationExt DestinationL( TUint32 aDestinationId ); - + /** * Returns an array of all destination id's * @param aDestArray array of all available network destination - */ + */ IMPORT_C void AllDestinationsL( RArray& aDestArray ); - + /** * Returns the copy of the bearer priority array. Ownership is passed. * @param aArray bearer priority array - */ - IMPORT_C void BearerPriorityArrayL( RArray& aArray ) const; - + */ + IMPORT_C void BearerPriorityArrayL( + RArray& aArray ) const; + /** * Update bearer priority array * @param aArray array with new global bearer priority - */ - IMPORT_C void UpdateBearerPriorityArrayL( - const RArray& aArray ); - + */ + IMPORT_C void UpdateBearerPriorityArrayL( + const RArray& aArray ); /** * Clean up passed global bearer priority array. Delete * the elements and calls Reset and Close on the array. * @param aArray array to be cleaned up */ - IMPORT_C void CleanupGlobalPriorityArray( - RArray& aArray ) const; - + IMPORT_C void CleanupGlobalPriorityArray( + RArray& aArray ) const; + /** * Query all of the supported bearer types. * @param aArray list of all supported bearer types. - */ + */ IMPORT_C void SupportedBearersL( RArray& aArray ) const; - - /** - * Returns "Uncategorized" icon. - * This fucton leaves if the client does not have a valid UI context - * @return CGulIcon* Icon of uncategorized connection methods. Ownership - * is passed. - */ - IMPORT_C CGulIcon* UncategorizedIconL() const; - + /** * Returns the id of the EasyWlan connection method. * @@ -255,25 +242,27 @@ * * @since S60 3.2 */ - IMPORT_C void ReadDefConnL( TCmDefConnValue& aDCSetting ); + IMPORT_C void ReadDefConnL( TCmDefConnValue& aDefConnSetting ); + /** * Stores the default connection method/SNAP. * * @since S60 3.2 */ - IMPORT_C void WriteDefConnL( const TCmDefConnValue& aDCSetting ); + IMPORT_C void WriteDefConnL( const TCmDefConnValue& aDefConnSetting ); /** - * Creates a Destination with the passed name and id. + * Creates a Destination with the passed name and id. * @param aName the name of the new destination. * @param aDestId Predefined id of the destination. * @return RCmDestinationExt newly created destination or leaves with * KErrAlreadyExists if there exists CM with the same Id. * Ownership is passed to the caller. */ - IMPORT_C RCmDestinationExt CreateDestinationL( const TDesC& aName, - TUint32 aDestId ); - + IMPORT_C RCmDestinationExt CreateDestinationL( + const TDesC& aName, + TUint32 aDestId ); + /** * Creates a connection method does not belong to any destination * @param aImplementationUid - bearer type of the new connection @@ -284,35 +273,38 @@ * method or leaves with KErrAlreadyExists if there exists CM * with the same Id. */ - IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( TUint32 aImplementationUid, - TUint32 aConnMethodId ); + IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( + TUint32 aBearerType, + TUint32 aConnMethodId ); private: /** * This is a private copy constructor without iplemetation. - * The sole purpose of this declaration is to forbid the copying of + * The sole purpose of this declaration is to forbid the copying of * the objects of this class. - */ - RCmManagerExt(RCmManagerExt& ); + */ + RCmManagerExt( RCmManagerExt& ); + /** * This is a private copy constructor without iplemetation. - * The sole purpose of this declaration is to forbid the copying of + * The sole purpose of this declaration is to forbid the copying of * the objects of this class. - */ + */ RCmManagerExt& operator=( RCmManagerExt& ); - friend class CCmManagerImpl; - //========================================================================= - // Member data - + private: + friend class CCmManagerImpl; + private: - - CCmManagerImpl* iImplementation; + RCmManagerApi* iCmManagerApi; }; - -inline RCmManagerExt::RCmManagerExt() - : iImplementation(NULL) + + +inline RCmManagerExt::RCmManagerExt() : iCmManagerApi( NULL ) { } - + + #endif // CMMANAGEREXT_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/extended_connection_settings_api/inc/cmsettingsui.h --- a/ipcm_plat/extended_connection_settings_api/inc/cmsettingsui.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_plat/extended_connection_settings_api/inc/cmsettingsui.h Mon May 03 12:53:07 2010 +0300 @@ -18,7 +18,7 @@ #ifndef C_CMSETTINGSUI_H #define C_CMSETTINGSUI_H -#include +#include #include class CCmSettingsUiImpl; diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/group/bld.inf --- a/ipcm_plat/group/bld.inf Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_plat/group/bld.inf Mon May 03 12:53:07 2010 +0300 @@ -27,4 +27,3 @@ #include "../pdpcontextmanager2_reset_factory_settings_api/group/bld.inf" #include "../pdpcontextmanager2_settings_api/group/bld.inf" #include "../mpm_connect_screen_api/group/bld.inf" - diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/ipcm_plat.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipcm_plat/ipcm_plat.pro Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,28 @@ +# +# 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 ipcm_plat. +# + +TEMPLATE = subdirs +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " + +include(connection_settings_shim_api/connection_settings_shim_api.pri) +include(connection_settings_ui_api/connection_settings_ui_api.pri) +include(bearer_settings_ui_plugin_api/bearer_settings_ui_plugin_api.pri) +include(wlan_security_settings_ui_plugin_api/wlan_security_settings_ui_plugin_api.pri) + +for(filename,PLATFORM_HEADERS){ + BLD_INF_RULES.prj_exports *= "$$filename MW_LAYER_PLATFORM_EXPORT_PATH($$basename(filename))" + } diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/wlan_security_settings_ui_plugin_api/inc/cpwlansecurityplugininterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipcm_plat/wlan_security_settings_ui_plugin_api/inc/cpwlansecurityplugininterface.h Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Control Panel plugin interface for WLAN security settings plugins. +* +*/ + +#ifndef CPWLANSECURITYPLUGININTERFACE_H +#define CPWLANSECURITYPLUGININTERFACE_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class CmConnectionMethodShim; +class CpSettingFormItemData; +class CpItemDataHelper; + +// External data types + +// Constants + +// Class declaration + +/*! + \class CpWlanSecurityPluginInterface + \brief This class is an interface for WLAN security settings plugins + which can be displayed in Control Panel application. + + Plugin stubs must be located in + /resource/qt/plugins/controlpanel/wlansecurity directory. + */ + +class CpWlanSecurityPluginInterface +{ +public: + /*! + Destructor. + */ + virtual ~CpWlanSecurityPluginInterface() {} + + /*! + Getter for security mode. Security modes are defined in Connection + Settings Shim WlanSecMode enum, e.g. WlanSecModeWep. + + \return Security mode identifier. + */ + virtual CMManagerShim::WlanSecMode securityMode() const = 0; + + /*! + Getter for localization text identifier for the security mode, + e.g. "txt_occ_setlabel_wlan_security_mode_val_wep". This localized + text will be shown in the UI. + + \return Localization text ID. + */ + virtual QString securityModeTextId() const = 0; + + /*! + Sets the database reference. Plugin can either use Connection + Settings Shim to access the settings or some other way using the + provided connection method ID. + + \param cmConnectionMethod Pointer to CmConnectionMethodShim instance + which can be used for reading and writing of the settings. Not + owned by the plugin. + \param id Connection method ID. + */ + virtual void setReference( + CmConnectionMethodShim *cmConnectionMethod, + uint id) = 0; + + /*! + Getter for order number. This order number is used to put the + security modes in correct order in the security mode list. Security + mode with the lowest order number will be first and so on. + + E.g. WEP = 10, 802.1X = 20, WPA = 30, WPA2 = 40, WAPI = 50 + + \return Order number. + */ + virtual int orderNumber() const = 0; + + /*! + Creates an UI instance ("Security settings" group with all settings + for the security mode). Caller owns the object. The security plugin + doesn't need to handle deletion of the UI instance, it will be + handled by the caller and Control Panel framework. Every call shall + create a new UI instance. + + \param dataHelper Item data helper. + \return Pointer to an UI object. + */ + virtual CpSettingFormItemData* uiInstance( + CpItemDataHelper &dataHelper) = 0; + +signals: + +public slots: + +protected: + +protected slots: + +private: + +private slots: + +private: // data + +}; + +Q_DECLARE_INTERFACE( + CpWlanSecurityPluginInterface, + "com.nokia.plugin.controlpanel.wlansecurity.platform.interface/1.0"); + +#endif // CPWLANSECURITYPLUGININTERFACE_H diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_plat/wlan_security_settings_ui_plugin_api/wlan_security_settings_ui_plugin_api.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipcm_plat/wlan_security_settings_ui_plugin_api/wlan_security_settings_ui_plugin_api.pri Mon May 03 12:53:07 2010 +0300 @@ -0,0 +1,19 @@ +# +# 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: +# WLAN Security Settings UI Plugin API project include. +# + +PLATFORM_HEADERS += \ + wlan_security_settings_ui_plugin_api/inc/cpwlansecurityplugininterface.h diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_pub/connection_monitor_server_api/inc/rconnmon.h --- a/ipcm_pub/connection_monitor_server_api/inc/rconnmon.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_pub/connection_monitor_server_api/inc/rconnmon.h Mon May 03 12:53:07 2010 +0300 @@ -48,7 +48,8 @@ /** WLAN mode, defined in TConnMonNetworkMode. */ const TUint KNetworkMode = 7; -/** WLAN connection security mode, defined in TConnMonSecurityMode. +/** Old WLAN connection security mode, defined in TConnMonSecurityMode. +It is recommended to use the more detailed KSecurityMode_v2 instead. */ const TUint KSecurityMode = 8; /** Bearer information, defined in TConnMonBearerInfo. @@ -62,6 +63,10 @@ /** Network registration values defined in TConnMonNetworkRegistration_v2. */ const TUint KNetworkRegistration_v2 = 11; +/** WLAN connection security mode, defined in TConnMonSecurityModeV2. +Replaces the previously used KSecurityMode attribute. +*/ +const TUint KSecurityMode_v2 = 12; /** QoS - Not supported. */ @@ -509,6 +514,24 @@ }; /** +* WLAN connection security modes in more detail. +* New values will be added to the end of the enumeration. +*/ +enum TConnMonSecurityModeV2 + { + EConnMonSecurityV2Open = 100, + EConnMonSecurityV2WepOpen = 101, + EConnMonSecurityV2WepShared = 102, + EConnMonSecurityV2802d1x = 103, + EConnMonSecurityV2Wpa = 104, + EConnMonSecurityV2WpaPsk = 105, + EConnMonSecurityV2Wpa2 = 106, + EConnMonSecurityV2Wpa2Psk = 107, + EConnMonSecurityV2Wapi = 108, + EConnMonSecurityV2WapiPsk = 109 + }; + +/** * Network Modes. */ enum TConnMonMobilePhoneNetworkMode @@ -850,7 +873,7 @@ static const TUint KWlanBssId = 6; /** Reserved for future use. */ - static const TUint KExtraCount = 10; + static const TUint KExtraCount = 8; /** * Constructor. @@ -874,6 +897,29 @@ /** * Constructor. * + * @param aName Name (SSID) of the network. + * @param aConnectionMode Mode of the network. + * @param aSignalStrength Signal strength of the network. + * @param aSecurityMode Security mode of the network. + * @param aSecurityModeV2 More detailed security mode of the network. + * @param aProtectedSetupSupport Wi-Fi Protected Setup support. + * @param aBssId Mac address (BSSID) of the base station. + * @param aVendorData Not in use. + * @return Pointer to the created CConnMonWlanNetwork object. + */ + IMPORT_C static CConnMonWlanNetwork* NewL( + const TBuf& aName, + TUint aConnectionMode, + TUint aSignalStrength, + TUint aSecurityMode, + TUint aSecurityModeV2, + TUint aProtectedSetupSupport, + const TBuf8& aBssId, + const TDesC& aVendorData ); + + /** + * Constructor. + * * @return Pointer to the created empty CConnMonWlanNetwork object. */ IMPORT_C static CConnMonWlanNetwork* NewL(); @@ -944,6 +990,8 @@ /** * Obtains the security mode of the network. + * This method is offered for backward compatibility + * reasons, SecurityModeV2() should be used instead. * * @return Security mode (defined in TConnMonSecurityMode). */ @@ -953,6 +1001,20 @@ } /** + * Obtains the more detailed security mode of the network. + * + * @return Security mode (defined in TConnMonSecurityModeV2). + */ + IMPORT_C TUint SecurityModeV2(); + + /** + * Finds whether Wi-Fi Protected Setup is supported. + * + * @return ETrue if AP supports Wi-Fi Protected Setup, EFalse if not. + */ + IMPORT_C TBool IsProtectedSetupSupported(); + + /** * Obtains the mac address (BSSID) of the base station. * * @return Mac address (BSSID). @@ -1020,6 +1082,28 @@ const TDesC& aVendorData ); /** + * Constructor. + * + * @param aName Name (SSID) of the network. + * @param aConnectionMode Mode of the network. + * @param aSignalStrength Signal strength of the network. + * @param aSecurityMode Security mode of the network. + * @param aSecurityModeV2 More detailed security mode of the network. + * @param aProtectedSetupSupport Wi-Fi Protected Setup support. + * @param aBssId Mac address (BSSID) of the base station. + * @param aVendorData Not in use. + */ + CConnMonWlanNetwork( + const TBuf& aName, + TUint aConnectionMode, + TUint aSignalStrength, + TUint aSecurityMode, + TUint aSecurityModeV2, + TUint aProtectedSetupSupport, + const TBuf8& aBssId, + const TDesC& aVendorData ); + + /** * Second-phase constructor. */ void ConstructL(); @@ -1031,6 +1115,8 @@ TUint iSecurityMode; // See TConnMonSecurityMode TBuf8 iWlanBssId; // BSSID HBufC* iVendorData; // For vendor specific data + TUint iSecurityModeV2; // See TConnMonSecurityModeV2 + TUint iProtectedSetupSupport; // Wi-Fi Protected Setup support, 0 if not supported TUint iExtraBuf[KExtraCount]; // Reserved for future }; diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_pub/connection_settings_api/group/bld.inf --- a/ipcm_pub/connection_settings_api/group/bld.inf Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_pub/connection_settings_api/group/bld.inf Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -11,8 +11,8 @@ * * Contributors: * -* Description: File that exports the files belonging to -: Connection Settings API +* Description: +* File that exports the files belonging to Connection Settings API. * */ @@ -24,20 +24,18 @@ PRJ_EXPORTS -../inc/cmconnectionmethod.inl MW_LAYER_PUBLIC_EXPORT_PATH(cmconnectionmethod.inl) ../inc/cmplugindialcommondefs.h MW_LAYER_PUBLIC_EXPORT_PATH(cmplugindialcommondefs.h) -../inc/cmdefconnvalues.h MW_LAYER_PUBLIC_EXPORT_PATH(cmdefconnvalues.h) -../inc/cmpluginpacketdatadef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmpluginpacketdatadef.h) -../inc/cmmanager.inl MW_LAYER_PUBLIC_EXPORT_PATH(cmmanager.inl) -../inc/cmconnectionmethod.h MW_LAYER_PUBLIC_EXPORT_PATH(cmconnectionmethod.h) -../inc/cmconnectionmethoddef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmconnectionmethoddef.h) -../inc/cmdestination.h MW_LAYER_PUBLIC_EXPORT_PATH(cmdestination.h) -../inc/cmpluginembdestinationdef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmpluginembdestinationdef.h) -../inc/cmplugincsddef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmplugincsddef.h) -../inc/cmmanagerdef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmmanagerdef.h) -../inc/cmpluginwlandef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmpluginwlandef.h) -../inc/cmpluginvpndef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmpluginvpndef.h) -../inc/cmpluginhscsddef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmpluginhscsddef.h) -../inc/cmmanager.h MW_LAYER_PUBLIC_EXPORT_PATH(cmmanager.h) -../inc/cmsettingsui.h MW_LAYER_PUBLIC_EXPORT_PATH(cmsettingsui.h) -../inc/cmgenconnsettings.h MW_LAYER_PUBLIC_EXPORT_PATH(cmgenconnsettings.h) +../inc/cmdefconnvalues.h MW_LAYER_PUBLIC_EXPORT_PATH(cmdefconnvalues.h) +../inc/cmpluginpacketdatadef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmpluginpacketdatadef.h) +../inc/cmconnectionmethod.h MW_LAYER_PUBLIC_EXPORT_PATH(cmconnectionmethod.h) +../inc/cmconnectionmethoddef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmconnectionmethoddef.h) +../inc/cmdestination.h MW_LAYER_PUBLIC_EXPORT_PATH(cmdestination.h) +../inc/cmpluginembdestinationdef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmpluginembdestinationdef.h) +../inc/cmplugincsddef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmplugincsddef.h) +../inc/cmmanagerdef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmmanagerdef.h) +../inc/cmpluginwlandef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmpluginwlandef.h) +../inc/cmpluginvpndef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmpluginvpndef.h) +../inc/cmpluginhscsddef.h MW_LAYER_PUBLIC_EXPORT_PATH(cmpluginhscsddef.h) +../inc/cmmanager.h MW_LAYER_PUBLIC_EXPORT_PATH(cmmanager.h) +../inc/cmsettingsui.h MW_LAYER_PUBLIC_EXPORT_PATH(cmsettingsui.h) +../inc/cmgenconnsettings.h MW_LAYER_PUBLIC_EXPORT_PATH(cmgenconnsettings.h) diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_pub/connection_settings_api/inc/cmconnectionmethod.h --- a/ipcm_pub/connection_settings_api/inc/cmconnectionmethod.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_pub/connection_settings_api/inc/cmconnectionmethod.h Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -11,20 +11,22 @@ * * Contributors: * -* Description: Connection Method interface class. +* Description: +* Connection Method interface class. * */ + #ifndef CMCONNECTIONMETHOD_H #define CMCONNECTIONMETHOD_H -// INCLUDES #include #include -// CLASS DECLARATION -class CCmPluginBaseEng; +// Forward declarations class RCmDestination; +class CCmConnectionMethodWrapper; + /** * RCmConnectionMethod is for getting/setting values of a connection method. @@ -33,39 +35,30 @@ */ NONSHARABLE_CLASS( RCmConnectionMethod ) { - //===================================================================== - // Constructors/Destructors - // public: - /** - * Default constructor. + * Default constructor. */ IMPORT_C RCmConnectionMethod(); + /** + * Copy constructor. + */ + IMPORT_C RCmConnectionMethod( const RCmConnectionMethod& aConnMethod ); /** - * Copy constructor. - */ - IMPORT_C RCmConnectionMethod(const RCmConnectionMethod& aItem); - - - /** - * Destructor. + * Destructor. */ IMPORT_C ~RCmConnectionMethod(); - //===================================================================== - // API functions public: - /** * Close the session * * @since S60 3.2 */ IMPORT_C void Close(); - + /** * Gets the value for a TInt attribute. * @@ -93,7 +86,7 @@ * @return copy of the requested attribute. Ownership is passed. */ IMPORT_C HBufC* GetStringAttributeL( TUint32 aAttribute ) const; - + /** * Gets the value for a String8 attribute. * HBuf ownership is passed to the caller @@ -102,8 +95,8 @@ * @param aAttribute Identifies the attribute to be retrieved. * @return copy of the requested attribute. Ownership is passed. */ - IMPORT_C HBufC8* GetString8AttributeL( - const TUint32 aAttribute ) const; + IMPORT_C HBufC8* GetString8AttributeL( + const TUint32 aAttribute ) const; /** * Call this function only if this CM is an embedded destination! @@ -113,42 +106,42 @@ */ IMPORT_C RCmDestination DestinationL() const; - + /** - * checks if connection methods are the same - * + * checks if connection methods are the same + * * @since S60 3.2 * @param aConnMethod the connection method being compared * @return ETrue if the destinations are the same */ IMPORT_C TBool operator==( RCmConnectionMethod& aConnMethod ) const; - + /** - * checks if connection methods are not the same - * + * checks if connection methods are not the same + * * @since S60 3.2 * @param aConnMethod the connection method being compared * @return ETrue if the destinations are different */ IMPORT_C TBool operator!=( RCmConnectionMethod& aConnMethod ) const; - + /** - * assignment operator - * + * assignment operator + * * @since S60 3.2 * @return RCmConnectionMethod */ - IMPORT_C RCmConnectionMethod& operator=(const RCmConnectionMethod& - aConnMethod); + IMPORT_C RCmConnectionMethod& operator=( + const RCmConnectionMethod& aConnMethod ); /** - * Creates a copy of this connection method. UpdateL() has to be called + * Creates a copy of this connection method. UpdateL() has to be called * to store new connection method in database. Ownership is passed. */ IMPORT_C RCmConnectionMethod CreateCopyL(); - /** + /** * Sets the value for a TInt attribute. * @param aAttribute Identifies the attribute to be set. * @param aValue The value to be set. @@ -170,8 +163,9 @@ * @param aValue The value to be set. * @return None. */ - IMPORT_C void SetStringAttributeL( TUint32 aAttribute, - const TDesC16& aValue ); + IMPORT_C void SetStringAttributeL( + TUint32 aAttribute, + const TDesC16& aValue ); /** * Sets the value for a String8 attribute. @@ -179,12 +173,13 @@ * @param aValue The value to be set. * @return None. */ - IMPORT_C void SetString8AttributeL( TUint32 aAttribute, - const TDesC8& aValue ); + IMPORT_C void SetString8AttributeL( + TUint32 aAttribute, + const TDesC8& aValue ); /** - * Try to delete the connection method. If it is referenced from - * any destination, then the references are removed and the + * Try to delete the connection method. If it is referenced from + * any destination, then the references are removed and the * connection method is deleted. * Do NOT call this function if you got this * connection method from a destination. Call destination's @@ -196,22 +191,40 @@ /** * Update in the database. * @return None. - */ + */ IMPORT_C void UpdateL(); + /** + * Gets the icon identifier(name) of the connection method. It can + * contain path information. HBufC* ownership is passed to the caller. + * @return Returns pointer to a buffer which identifies the requested + * icon. + */ + IMPORT_C HBufC* GetIconL() const; + + /** + * Sets the icon identifier(name) of the connection method. It can + * contain path information. + * @param aIcon Identifier of the connection method icon. + */ + IMPORT_C void SetIconL( const TDesC& aIcon ); + + /** + * Reload the contents of the connection method from database. + * Any current changes made to the connection method are lost. + * @return None. + */ + IMPORT_C void RefreshL(); + + private: - friend class RCmDestination; friend class RCmManager; - + private: - - /** - * the implementation class - */ - CCmPluginBaseEng* iImplementation; + CCmConnectionMethodWrapper* iCmConnectionMethodWrapper; }; -#include - -#endif // CMCONNECTIONMETHOD_H +#endif // CMCONNECTIONMETHOD_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_pub/connection_settings_api/inc/cmconnectionmethod.inl --- a/ipcm_pub/connection_settings_api/inc/cmconnectionmethod.inl Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: implementation of cmconnectionmethod.h inline functions -* -*/ - - diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_pub/connection_settings_api/inc/cmconnectionmethoddef.h --- a/ipcm_pub/connection_settings_api/inc/cmconnectionmethoddef.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_pub/connection_settings_api/inc/cmconnectionmethoddef.h Mon May 03 12:53:07 2010 +0300 @@ -135,50 +135,14 @@ */ ECmBearerIcon = 100, /**< - * Return the bearer specific icon. Assumes that - * there's an existing EEikEnv in the client. - * Type cast return value from TUint32 to - * CGuiIcon*. - * Return value 0 means bearer has no icon. - * (TUint32 - default: none - read only) + * Sets/Gets the Connection Method specific icon name(may + * contain the path too). + * Used with Get/SetStringAttribute(). + * Returns NULL if not found. + * (String - default: None ) */ - - ECmBearerAvailableIcon, /**< - * Return the bearer available specific icon. - * Assumes that there's an existing EEikEnv - * in the client. Type cast return value from - * TUint32 to CGuiIcon*. - * Return value 0 means bearer has no icon. - * (TUint32 - default: none - read only) - */ - - ECmBearerAvailableName = 200, /**< - * Name of the bearer. Can be used in - * layout - * list_double_large_graphic_popup_menu_pane. - * (String - default: none - read only) - */ - - ECmBearerSupportedName, /**< - * Name of the bearer. Can be used in - * layout list_single_popup_menu_pane_1. - * (String - default: none - read only) - */ - - ECmBearerAvailableText, /**< - * Localized text 'Available'. Can be used in - * layout - * list_double_large_graphic_popup_menu_pane. - * (String - default: none - read only) - */ - - ECmBearerNamePopupNote, /**< - * Localized text of the bearer type name. - * Can be used in layout popup note. - * (String - default: none - read only) - */ - - ECmCommsDBBearerType, /**< + + ECmCommsDBBearerType = 204, /**< * For backward compatibility, connection method * can return its CommsDB specific bearer type. * (TUint32 - default: none - read only) @@ -186,13 +150,7 @@ * type exists in CommsDat. */ - ECmBearerSettingName, /**< - * Name of the data bearer used when - * accessing external network. - * (String - default: none - read only) - */ - - ECmVirtual, /**< + ECmVirtual = 206, /**< * Is the given connection method virtual? * (TBool - default: none - read only) */ @@ -206,13 +164,7 @@ * (TUint32 - default: none - read only) */ - ECmAddToAvailableList, /**< - * Bearer type has to be added to the avaialable - * bearer type list. - * (TBool - default: EFalse - read only) - */ - - ECmLoadResult, /**< + ECmLoadResult = 402, /**< * Result of the load process. KErrNone if there * was no error. Otherwise a system wide * error code. diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_pub/connection_settings_api/inc/cmdestination.h --- a/ipcm_pub/connection_settings_api/inc/cmdestination.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_pub/connection_settings_api/inc/cmdestination.h Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -11,24 +11,24 @@ * * Contributors: * -* Description: Destination interface class. +* Description: +* Destination interface class. * */ + #ifndef DESTINATION_H #define DESTINATION_H -// System includes #include #include -#include #include #include -// FORWARD DECLARATIONS -class CCmManagerImpl; -class CCmDestinationData; -class CGulIcon; +// Forward declarations +class RCmConnectionMethod; +class CCmDestinationWrapper; + /** * RCmDestination is for setting/getting values of a network destination. @@ -36,49 +36,42 @@ * @lib cmmanager.lib * @since S60 v3.2 */ -NONSHARABLE_CLASS(RCmDestination) +NONSHARABLE_CLASS( RCmDestination ) { - //===================================================================== - // Constructors/Destructors - // public: - /** Default constructor. */ IMPORT_C RCmDestination(); IMPORT_C ~RCmDestination(); - IMPORT_C RCmDestination(const RCmDestination& aCmDestination); - - //===================================================================== - // API functions + IMPORT_C RCmDestination( const RCmDestination& aDestination ); + public: - /** * Close the session. * * @since S60 3.2 */ IMPORT_C void Close(); - + /** * Returns the number of connection methods of the destination * * @since 3.2 - * @return the number of connection methods belonging to a destination - */ + * @return the number of connection methods belonging to a destination + */ IMPORT_C TInt ConnectionMethodCount() const; - + /** - * Returns a reference to the connection method. - * The index must be less than the return value of + * Returns a reference to the connection method. + * The index must be less than the return value of * ConnectionMethodCount(). * * @since 3.2 * @param anIndex * @return a connection method - */ - IMPORT_C RCmConnectionMethod ConnectionMethodL( TInt anIndex ) const; + */ + IMPORT_C RCmConnectionMethod ConnectionMethodL( TInt aIndex ) const; /** * Returns the connection method with the ECmId. @@ -86,19 +79,18 @@ * @param aCmId unique id of the requested connection method. * @return connection method */ - IMPORT_C RCmConnectionMethod ConnectionMethodByIDL( - TInt aCmId ) const; + IMPORT_C RCmConnectionMethod ConnectionMethodByIDL( + TInt aConnMethodId ) const; /** * Return the priority of the passed connection method * * @since 3.2 * @param aCCMItem connection method - * @return the priority of the queried connection method + * @return the priority of the queried connection method */ - IMPORT_C TUint PriorityL(const RCmConnectionMethod& aCCMItem ) const; - - //Getting attributes + IMPORT_C TUint PriorityL( + const RCmConnectionMethod& aConnectionMethod ) const; /** * Returns the destination's Name attribute @@ -106,47 +98,39 @@ * * @since 3.2 * @return HBufC* Passes returned value's ownership to the caller - */ - IMPORT_C HBufC* NameLC() const; - + */ + IMPORT_C HBufC* NameLC() const; + /** * Returns the destination's Id attribute * * @since 3.2 * @return the destination's id - */ + */ IMPORT_C TUint32 Id() const; - + /** * Returns the destination's ElementId attribute * * @since 3.2 - * @return the destination's element id - */ - IMPORT_C TUint32 ElementId() const; - - /** - * Returns the Icon pointer - * This function leaves if the client does not have a valid UI context - * - * @since 3.2 - * @return the destination icon - */ - IMPORT_C CGulIcon* IconL() const; + * @return the destination's element id + */ + IMPORT_C TUint32 ElementId() const; /** * Returns the Metadata * * @since 3.2 * @param aMetaField the meta data field to query - * @return the value of the requested field - */ - IMPORT_C TUint32 MetadataL( CMManager::TSnapMetadataField aMetaField ) const; - + * @return the value of the requested field + */ + IMPORT_C TUint32 MetadataL( + CMManager::TSnapMetadataField aMetadataField ) const; + /** * Return the protection level of the destination. * - * @since 3.2 + * @since 3.2 * @return protection level of the destination */ IMPORT_C CMManager::TProtectionLevel ProtectionLevel() const; @@ -155,12 +139,12 @@ * Returns if there's a connection created with any of the destination's * connection method. * - * @since 3.2 + * @since 3.2 * @return ETrue if there's a connection with any of the destination's * connection method. */ IMPORT_C TBool IsConnectedL() const; - + /** * Returns whether the destination is hidden or not. * @@ -170,79 +154,85 @@ IMPORT_C TBool IsHidden() const; /** - * checks if destinations are the same - * + * checks if destinations are the same + * * @since S60 3.2 * @param aDestination the destination being compared * @return ETrue if the destinations are the same */ - IMPORT_C TBool operator==(const RCmDestination& aDestination ) const; - + IMPORT_C TBool operator==( const RCmDestination& aDestination ) const; + /** - * checks if destinations are not the same - * + * checks if destinations are not the same + * * @since S60 3.2 * @param aDestination the destination being compared * @return ETrue if the destinations are different */ - IMPORT_C TBool operator!=(const RCmDestination& aDestination ) const; + IMPORT_C TBool operator!=( const RCmDestination& aDestination ) const; /** - * assignment operator - * + * assignment operator + * * @since S60 3.2 * @param aDestination the destination being compared * @return RCmDestination */ - IMPORT_C RCmDestination& operator=(const RCmDestination& - aCmDestination); + IMPORT_C RCmDestination& operator=( + const RCmDestination& + aDestination ); - /** + /** * Create a connection method that belongs to this destination. - * @param aImplementationUid - implementation uid (bearer type) of the + * @param aImplementationUid - implementation uid (bearer type) of the * connection method to be created * @return newly created connection method */ - IMPORT_C RCmConnectionMethod CreateConnectionMethodL( TUint32 aBearerType ); + IMPORT_C RCmConnectionMethod CreateConnectionMethodL( + TUint32 aBearerType ); - /* + /** * Adds an existing connection method to a destination * @param aConnectionMethod Connection method to be added * @return index in the Connection Method list */ - IMPORT_C TInt AddConnectionMethodL( RCmConnectionMethod aConnectionMethod ); + IMPORT_C TInt AddConnectionMethodL( + RCmConnectionMethod aConnectionMethod ); - /* + /** * Embeds an existing destination into this destination. * @param RCmDestination - Destination to be embedded * @return TInt - index in the Connection Method list */ - IMPORT_C TInt AddEmbeddedDestinationL( const RCmDestination& aDestination ); + IMPORT_C TInt AddEmbeddedDestinationL( + const RCmDestination& aDestination ); /** * Remove a connection method from a destination and delete it - * on update. - * Exception: conenction method is not deleted if it's referenced + * on update. + * Exception: connection method is not deleted if it's referenced * from any other destination. * @param aConnectionMethod the connection method to be deleted. */ - IMPORT_C void DeleteConnectionMethodL( RCmConnectionMethod& aConnectionMethod ); + IMPORT_C void DeleteConnectionMethodL( + RCmConnectionMethod& aConnectionMethod ); /** * Remove connection method from the destination * @param aConnectionMethod connection method to be removed */ - IMPORT_C void RemoveConnectionMethodL( RCmConnectionMethod aConnectionMethod ); - + IMPORT_C void RemoveConnectionMethodL( + RCmConnectionMethod aConnectionMethod ); /** * Set the connection method's priority based on the passed index. * @param aCCMItem the connection method item - * @param aIndex the new priority of the connection method in the + * @param aIndex the new priority of the connection method in the * destination */ - IMPORT_C void ModifyPriorityL( RCmConnectionMethod& aCCMItem, - TUint aIndex ); + IMPORT_C void ModifyPriorityL( + RCmConnectionMethod& aConnectionMethod, + TUint aIndex ); /** * Set the destination's name @@ -251,23 +241,17 @@ IMPORT_C void SetNameL( const TDesC& aName ); /** - * Set the destination's icon index. - * This fucton leaves if the client does not have a valid UI context - * @param aIconIndex new icon index of the destination - */ - IMPORT_C void SetIconL( TUint32 anIndex ); - - /** * Set the Metadata * @param aMetaField field to be modified * @param aValue value to be set - */ - IMPORT_C void SetMetadataL( CMManager::TSnapMetadataField aMetaField, - TUint32 aValue ); + */ + IMPORT_C void SetMetadataL( + CMManager::TSnapMetadataField aMetadataField, + TUint32 aValue ); /** * Set the protection level of the destination. - * @param aProtLevel new protection level + * @param aProtLevel new protection level */ IMPORT_C void SetProtectionL( CMManager::TProtectionLevel aProtLevel ); @@ -275,13 +259,13 @@ * Set if the destination is hidden or not. * @param aHidden - ETrue if destination is hidden */ - IMPORT_C void SetHiddenL( TBool aHidden ); + IMPORT_C void SetHiddenL( TBool aHidden ); /** * Update all values of the destination and its connection method. * Nothing if stored, if update leaves due to any reason. */ - IMPORT_C void UpdateL(); + IMPORT_C void UpdateL(); /** * Delete destination and its connection methods from CommsDat. @@ -291,31 +275,48 @@ IMPORT_C void DeleteLD(); /** - * Create a connection method with given id that belongs to this destination. - * @param aImplementationUid - implementation uid (bearer type) of the + * Create a connection method with given id that belongs to this + * destination. + * @param aImplementationUid - implementation uid (bearer type) of the * connection method to be created * @return newly created connection method or leaves with * KErrAlreadyExists if there exists CM with the same Id. */ - IMPORT_C RCmConnectionMethod CreateConnectionMethodL( TUint32 aBearerType, - TUint32 aConnMethId ); + IMPORT_C RCmConnectionMethod CreateConnectionMethodL( + TUint32 aBearerType, + TUint32 aConnMethodId ); + + /** + * Gets the icon identifier(name) of the destination. It can + * contain path information. HBufC* ownership is passed to the caller. + * @return Returns pointer to a buffer which identifies the requested + * icon. + */ + IMPORT_C HBufC* GetIconL() const; + + /** + * Sets the icon identifier(name) of the destination. It can + * contain path information. + * @param aIcon Identifier of the destination icon. + */ + IMPORT_C void SetIconL( const TDesC& aIcon ); + + /** + * Reload the contents of the destination from database. + * Any current changes made to the destination are lost. + * @return None. + */ + IMPORT_C void RefreshL(); - //======================================================================= - // Member variables - // - private: - - /** - * the implementation class - */ - CCmDestinationData* iDestinatonData; + private: + friend class RCmManager; + friend class RCmConnectionMethod; private: - - friend class RCmManager; - friend class RCmConnectionMethod; + CCmDestinationWrapper* iCmDestinationWrapper; }; - #endif // DESTINATION_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_pub/connection_settings_api/inc/cmmanager.h --- a/ipcm_pub/connection_settings_api/inc/cmmanager.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_pub/connection_settings_api/inc/cmmanager.h Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -11,26 +11,25 @@ * * Contributors: * -* Description: Connection manager IF class. +* Description: +* Connection method manager IF class. * */ + #ifndef CMMANAGER_H #define CMMANAGER_H -// System Includes -#include #include -#include #include #include -// Forward Declarations +// Forward declarations class RCmConnectionMethod; class RCmDestination; -class CCmManagerImpl; class TBearerPriority; -class CGulIcon; +class RCmManagerApi; + /** * RCmManager gives access to network destinations and connection methods. @@ -38,51 +37,40 @@ * @lib cmmanager.lib * @since S60 v3.2 */ -NONSHARABLE_CLASS(RCmManager) - { - //===================================================================== - // Constructors/Destructors - // +NONSHARABLE_CLASS( RCmManager ) + { public: - /** - * Default constructor. + * Default constructor. */ inline RCmManager(); - //===================================================================== - // API functions - public: - /** * Symbian constructor * * @since S60 3.2 */ - IMPORT_C void OpenL(); - + IMPORT_C void OpenL(); + /** * Symbian constructor * Pushes the object on the cleanup stack * * @since S60 3.2 */ - IMPORT_C void OpenLC(); - + IMPORT_C void OpenLC(); + /** * Secondary destructor * * @since S60 3.2 */ IMPORT_C void Close(); - - //======================================================================= - // Getter API - public: - + + public: /** * Used to query bearer information that doesn't belong - * to a specific connection method, such as + * to a specific connection method, such as * ECmCoverage or ECmDefaultPriority etc. * * @since S60 3.2 @@ -90,13 +78,13 @@ * @param aAttribute the setting value * @return the setting value */ - IMPORT_C TUint32 GetBearerInfoIntL( TUint32 aBearerType, - TUint32 aAttribute ) const; - - + IMPORT_C TUint32 GetBearerInfoIntL( + TUint32 aBearerType, + TUint32 aAttribute ) const; + /** * Used to query bearer information that doesn't belong - * to a specific connection method, such as + * to a specific connection method, such as * ECmCoverage or ECmDefaultPriority etc. * * @since S60 3.2 @@ -104,11 +92,13 @@ * @param aAttribute the setting value * @return the setting value */ - IMPORT_C TBool GetBearerInfoBoolL( TUint32 aBearerType, - TUint32 aAttribute ) const; + IMPORT_C TBool GetBearerInfoBoolL( + TUint32 aBearerType, + TUint32 aAttribute ) const; + /** * Used to query bearer information that doesn't belong - * to a specific connection method, such as + * to a specific connection method, such as * ECmCoverage or ECmDefaultPriority etc. * HBuf ownership is passed to the caller * @@ -116,12 +106,14 @@ * @param aBearerType the bearer * @param aAttribute the setting value * @return the setting value - */ - IMPORT_C HBufC* GetBearerInfoStringL( TUint32 aBearerType, - TUint32 aAttribute ) const; + */ + IMPORT_C HBufC* GetBearerInfoStringL( + TUint32 aBearerType, + TUint32 aAttribute ) const; + /** * Used to query bearer information that does not belong - * to a specific connection method, such as + * to a specific connection method, such as * ECmCoverage or ECmDefaultPriority, etc. * HBuf ownership is passed to the caller * @@ -130,9 +122,10 @@ * @param aAttribute the setting value * @return the setting value */ - IMPORT_C HBufC8* GetBearerInfoString8L( TUint32 aBearerType, - TUint32 aAttribute ) const; - + IMPORT_C HBufC8* GetBearerInfoString8L( + TUint32 aBearerType, + TUint32 aAttribute ) const; + /** * Used to query any non-bearer specific information about * a given connection method. This can be e.g. ECmBearerType, @@ -143,9 +136,10 @@ * @param aAttribute the setting value * @return the setting value */ - IMPORT_C TUint32 GetConnectionMethodInfoIntL( TUint32 aIapId, - TUint32 aAttribute ) const; - + IMPORT_C TUint32 GetConnectionMethodInfoIntL( + TUint32 aIapId, + TUint32 aAttribute ) const; + /** * Used to query any, non-bearer specific information about * a given connection method. This can be e.g. ECmBearerType, @@ -156,8 +150,9 @@ * @param aAttribute the setting value * @return the setting value */ - IMPORT_C TBool GetConnectionMethodInfoBoolL( TUint32 aIapId, - TUint32 aAttribute ) const; + IMPORT_C TBool GetConnectionMethodInfoBoolL( + TUint32 aIapId, + TUint32 aAttribute ) const; /** * Used to query any non-bearer specific information about @@ -170,8 +165,9 @@ * @param aAttribute the setting value * @return the setting value */ - IMPORT_C HBufC* GetConnectionMethodInfoStringL( TUint32 aIapId, - TUint32 aAttribute ) const; + IMPORT_C HBufC* GetConnectionMethodInfoStringL( + TUint32 aIapId, + TUint32 aAttribute ) const; /** * Used to query any non-bearer specific information about @@ -184,9 +180,10 @@ * @param aAttribute the setting value * @return the setting value */ - IMPORT_C HBufC8* GetConnectionMethodInfoString8L( TUint32 aIapId, - TUint32 aAttribute ) const; - + IMPORT_C HBufC8* GetConnectionMethodInfoString8L( + TUint32 aIapId, + TUint32 aAttribute ) const; + /** * Returns the connection method queried by its ID * @@ -194,53 +191,54 @@ * @param aConnectionMethodId id of the connection method * @return RCmConnectionMethod connection method */ - IMPORT_C RCmConnectionMethod ConnectionMethodL( - TUint32 aConnectionMethodId ) const; - + IMPORT_C RCmConnectionMethod ConnectionMethodL( + TUint32 aConnectionMethodId ) const; + /** - * Returns the list of connection methods. Connection Methods are + * Returns the list of connection methods. Connection Methods are * filtered by the switch parameters e.g. aLegacyOnly. * * @since S60 3.2 * @param aCMArray on return it is the array of IAP ids. - * @param aCheckBearerType If ETrue only connection methods with + * @param aCheckBearerType If ETrue only connection methods with * supported bearer type are returned * @param aLegacyOnly when set to ETrue only Legacy IAP ids will * be returned * @param aEasyWlan when set to ETrue EasyWlan id is returned, too */ - IMPORT_C void ConnectionMethodL( RArray& aCMArray, - TBool aCheckBearerType = ETrue, - TBool aLegacyOnly = ETrue, - TBool aEasyWlan = EFalse ) const; - + IMPORT_C void ConnectionMethodL( + RArray& aCmArray, + TBool aCheckBearerType = ETrue, + TBool aLegacyOnly = ETrue, + TBool aEasyWlan = EFalse ) const; + /** * Returns an array of all destination id's * * @since S60 3.2 * @param aDestArray list all available destinations' id - */ + */ IMPORT_C void AllDestinationsL( RArray& aDestArray ) const; /** - * Returns the destination to which a specified + * Returns the destination to which a specified * connection method belongs, search is by destination ID * * @since S60 3.2 * @param aDestinationId id of destination - * @return RCmDestination network destination + * @return RCmDestination network destination */ IMPORT_C RCmDestination DestinationL( TUint32 aDestinationId ) const; - + /** * Returns the copy of the bearer priority array. Ownership is passed. * * @since S60 3.2 * @param aArray bearer priority array - */ - IMPORT_C void BearerPriorityArrayL( - RArray& aArray ) const; - + */ + IMPORT_C void BearerPriorityArrayL( + RArray& aArray ) const; + /** * Clean up passed global bearer priority array. Delete * the elements and calls Reset and Close on the array. @@ -248,9 +246,9 @@ * @since S60 3.2 * @param aArray array to be cleaned up */ - IMPORT_C void CleanupGlobalPriorityArray( - RArray& aArray ) const; - + IMPORT_C void CleanupGlobalPriorityArray( + RArray& aArray ) const; + /** * Returns the id of the EasyWlan connection method. * @@ -258,20 +256,20 @@ * @return id of the EasyWLan connection method. 0 if not found. */ IMPORT_C TUint32 EasyWlanIdL() const; - + /** * Returns the default connection method/SNAP. * * @since S60 3.2 */ - IMPORT_C void ReadDefConnL( TCmDefConnValue& aDCSetting ); + IMPORT_C void ReadDefConnL( TCmDefConnValue& aDefConnSetting ); /** * Stores the default connection method/SNAP. * * @since S60 3.2 */ - IMPORT_C void WriteDefConnL( const TCmDefConnValue& aDCSetting ); + IMPORT_C void WriteDefConnL( const TCmDefConnValue& aDefConnSetting ); /** @@ -287,15 +285,15 @@ * @since S60 9.2 */ IMPORT_C void WriteGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings ); - - + + /** Open session and create tables if they don't exist*/ - IMPORT_C void CreateTablesAndOpenL(); + IMPORT_C void CreateTablesAndOpenL(); /** - * Creates a Destination with the passed name. + * Creates a Destination with the passed name. * @param aName the name of the new destination. - * @return RCmDestination new destination. ownership is passed to the + * @return RCmDestination new destination. ownership is passed to the * caller */ IMPORT_C RCmDestination CreateDestinationL( const TDesC& aName ); @@ -305,62 +303,69 @@ * @param aImplementationUid - bearer type of the new connection method * @return RCmConnectionMethod newly created connection method. */ - IMPORT_C RCmConnectionMethod CreateConnectionMethodL( TUint32 aBearerType ); + IMPORT_C RCmConnectionMethod CreateConnectionMethodL( + TUint32 aBearerType ); /** - * Copies a connection method belonging to one destination to + * Copies a connection method belonging to one destination to * another. The connection method becomes shared. * Calls UpdateL on the destination * @param aTargetDestination * @param aConnectionMethodId * @return TInt - index in the Connection Method list */ - IMPORT_C TInt CopyConnectionMethodL( RCmDestination& aTargetDestination, - RCmConnectionMethod& aConnectionMethod ); + IMPORT_C TInt CopyConnectionMethodL( + RCmDestination& aTargetDestination, + RCmConnectionMethod& aConnectionMethod ); /** - * Moves a connection method belonging to one destination to + * Moves a connection method belonging to one destination to * another. The connection method is removed from the source destination * @param aSourceDestination * @param aTargetDestination * @param aConnectionMethod * @return TInt - index in the Connection Method list */ - IMPORT_C TInt MoveConnectionMethodL( RCmDestination& aSourceDestination, - RCmDestination& aTargetDestination, - RCmConnectionMethod& aConnectionMethod ); + IMPORT_C TInt MoveConnectionMethodL( + RCmDestination& aSourceDestination, + RCmDestination& aTargetDestination, + RCmConnectionMethod& aConnectionMethod ); /** * Remove connection method from the destination * @param aDestination destination the connection method is attached to * @param aConnectionMethod connection method to be removed */ - IMPORT_C void RemoveConnectionMethodL( RCmDestination& aDestination, - RCmConnectionMethod& aConnectionMethod ); + IMPORT_C void RemoveConnectionMethodL( + RCmDestination& aDestination, + RCmConnectionMethod& aConnectionMethod ); /** - * Removes connection method from every destination and make it + * Removes connection method from every destination and make it * uncategorized. * @param aConnectionMethod connection method to be removed */ - IMPORT_C void RemoveAllReferencesL( RCmConnectionMethod& aConnectionMethod ); + IMPORT_C void RemoveAllReferencesL( + RCmConnectionMethod& aConnectionMethod ); /** * Update bearer priority array * @param aArray array with new global bearer priority - */ - IMPORT_C void UpdateBearerPriorityArrayL( const RArray& aArray ); + */ + IMPORT_C void UpdateBearerPriorityArrayL( + const RArray& aArray ); /** - * Creates a Destination with the passed name and id. + * Creates a Destination with the passed name and id. * @param aName the name of the new destination. * @param aDestId Predefined id of the destination. * @return RCmDestination newly created destination or leaves with * KErrAlreadyExists if there exists CM with the same Id. * Ownership is passed to the caller. */ - IMPORT_C RCmDestination CreateDestinationL( const TDesC& aName, - TUint32 aDestId ); + IMPORT_C RCmDestination CreateDestinationL( + const TDesC& aName, + TUint32 aDestId ); /** * Creates a connection method does not belong to any destination @@ -371,47 +376,50 @@ * method or leaves with KErrAlreadyExists if there exists CM * with the same Id. */ - IMPORT_C RCmConnectionMethod CreateConnectionMethodL( TUint32 aImplementationUid, - TUint32 aConnMethodId ); + IMPORT_C RCmConnectionMethod CreateConnectionMethodL( + TUint32 aBearerType, + TUint32 aConnMethodId ); /** * Query all of the supported bearer types. * @param aArray list of all supported bearer types. - */ + */ IMPORT_C void SupportedBearersL( RArray& aArray ) const; /** - * Returns "Uncategorized" icon. - * This fucton leaves if the client does not have a valid UI context - * @return CGulIcon* Icon of uncategorized connection methods. Ownership - * is passed. - */ - IMPORT_C CGulIcon* UncategorizedIconL() const; - + * Gets the "Uncategorized" icon identifier(name). It can + * contain path information. HBufC* ownership is passed to the caller. + * @return Returns pointer to a buffer which identifies the requested + * icon. + */ + IMPORT_C HBufC* GetUncategorizedIconL() const; + + private: /** * This is a private copy constructor without implementation. - * The sole purpose of this declaration is to forbid the copying of + * The sole purpose of this declaration is to forbid the copying of * the objects of this class. - */ - RCmManager(RCmManager& ); + */ + RCmManager( RCmManager& ); + /** * This is a private copy constructor without implementation. - * The sole purpose of this declaration is to forbid the copying of + * The sole purpose of this declaration is to forbid the copying of * the objects of this class. - */ + */ RCmManager& operator=( RCmManager& ); - //========================================================================= - // Member data - + private: - - /** - * the implementation class - */ - CCmManagerImpl* iImplementation; + RCmManagerApi* iCmManagerApi; }; -#include "cmmanager.inl" - + +inline RCmManager::RCmManager() : iCmManagerApi( NULL ) + { + } + + #endif // CMMANAGER_H + +// End of file diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_pub/connection_settings_api/inc/cmmanager.inl --- a/ipcm_pub/connection_settings_api/inc/cmmanager.inl Fri Apr 16 15:21:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: implementation of cmmanager.h inline functions -* -*/ - - -// ----------------------------------------------------------------------------- -// RCmManager::RCmManager -// ----------------------------------------------------------------------------- -// -inline RCmManager::RCmManager() - : iImplementation(NULL) - { - } diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_pub/connection_settings_api/inc/cmmanagerdef.h --- a/ipcm_pub/connection_settings_api/inc/cmmanagerdef.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_pub/connection_settings_api/inc/cmmanagerdef.h Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,17 +11,19 @@ * * Contributors: * -* Description: Definition module for Connection Method Manager +* Description: +* Definition module for Connection Method Manager. * */ + #ifndef CMMANAGERDEF_H #define CMMANAGERDEF_H -// System includes -#include +#include #include - + + namespace CMManager { /** @@ -159,22 +161,22 @@ NONSHARABLE_CLASS( TBearerPriority ) { public: - + HBufC* iServiceType; /**< * Name of the service table to identify - * type of bearer + * type of bearer */ - + TUint32 iPriority; /**< - * Priority of the bearer. - * Values must be unique within the table + * Priority of the bearer. + * Values must be unique within the table */ - + TUint32 iUIPriority; /**< * Priority of this bearer type when shown - * in UI for configuring a new IAP. - * Values must be unique within the table + * in UI for configuring a new IAP. + * Values must be unique within the table */ - }; - + }; + #endif // CMMANAGERDEF_H diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_pub/connection_settings_api/inc/cmpluginpacketdatadef.h --- a/ipcm_pub/connection_settings_api/inc/cmpluginpacketdatadef.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_pub/connection_settings_api/inc/cmpluginpacketdatadef.h Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,8 @@ * * Contributors: * -* Description: packet data specific enums +* Description: +* Packet data specific enums. * */ @@ -274,13 +275,13 @@ * ( TBool - default: None) */ - EGPRSReqTrafficClass = 10200, /**< + EGPRSReqTrafficClass = 10200, /**< * Requested traffic class * Defined in etelqos.h in RPacketQoS::TTrafficClass. * (TUint32 - default: ETrafficClassUnspecified) */ - - EGPRSMinTrafficClass, /**< + + EGPRSMinTrafficClass, /**< * Minimum acceptable traffic class. * Defined in etelqos.h in RPacketQoS::TTrafficClass. * (TUint32 - default: ETrafficClassUnspecified) diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_pub/connection_settings_api/inc/cmpluginwlandef.h --- a/ipcm_pub/connection_settings_api/inc/cmpluginwlandef.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_pub/connection_settings_api/inc/cmpluginwlandef.h Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-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" @@ -11,7 +11,8 @@ * * Contributors: * -* Description: ?description +* Description: +* WLAN specific enums. * */ @@ -25,15 +26,15 @@ namespace CMManager { - /** enumerations for WLAN network modes */ + /** Enumerations for WLAN network modes. */ enum TWlanNetMode { EAdhoc = 0, ///< Ad-Hoc mode EInfra = 1 ///< Infrastructure mode }; - - /** enumerations for WLAN security modes - ** It's possible to extend this enumeration */ + + /** Enumerations for WLAN security modes. + ** It's possible to extend this enumeration. */ enum TWlanSecMode { EWlanSecModeOpen = 1, ///< Open security mode @@ -44,7 +45,33 @@ EWlanSecModeWAPI = 32 ///< WAPI security mode }; - /** Wlan specific connection method attributes */ + /** Enumerations for WLAN authentication modes. + ** It's possible to extend this enumeration. */ + enum TWlanAuthMode + { + EWlanAuthModeOpen = 0, + EWlanAuthModeShared = 1 + }; + + /** Enumerations for WAPI pre-shared key format (ascii, hex). + ** It's possible to extend this enumeration. */ + enum TWlanWapiPskFormat + { + EWlanWapiPskFormatAscii = 0, + EWlanWapiPskFormatHex + }; + + /** Enumerations for the WEP key indexes. + ** It's possible to extend this enumeration. */ + enum TWepKeyIndex + { + EWepKeyIndex1 = 0, // Key number 1 + EWepKeyIndex2, // Key number 2 + EWepKeyIndex3, // Key number 3 + EWepKeyIndex4 // Key number 4 + }; + + /** WLAN specific connection method attributes. */ enum TConnectionMethodWlanSpecificAttributes { /** @@ -56,27 +83,27 @@ /** * IP net mask of interface. * ( String - default: None) - */ + */ EWlanIpNetMask, - + /** - * IP address of gateway + * IP address of gateway. * ( String - default: None) */ EWlanIpGateway, - + /** * Get IP addresses (for EPOC) from server? * ( TBool - default: None) */ EWlanIpAddrFromServer, - + /** * IP address of EPOC. * ( String - default: None) */ EWlanIpAddr, - + /** * Get DNS addresses from server? * ( TBool - default: None) @@ -88,149 +115,204 @@ * ( String - default: None) */ EWlanIpNameServer1, - + /** * IP Address of secondary name server. * ( String - default: None) */ EWlanIpNameServer2, - + /** * Get IP6 DNS addresses from server? * ( TBool - default: None) */ EWlanIp6DNSAddrFromServer, - + /** * IP6 Address of primary name server. * ( String - default: None) */ EWlanIp6NameServer1, - + /** * IP6 Address of secondary name server. * ( String - default: None) */ EWlanIp6NameServer2, - + /** - * IP address valid from this time, used to store + * IP address valid from this time, used to store * dynamically assigned address lease info. * ( String - default: None) */ EWlanIpAddrLeaseValidFrom, - + /** * IP address valid for use until this time, used to store * dynamically assigned address lease info. * ( String - default: None) */ EWlanIpAddrLeaseValidTo, - + /** - * Name of the ECOM configuration daemon manager component. - * This component interfaces with the server identified in - * ISP_CONFIG_DAEMON_NAME. If specified, ISP_CONFIG_DAEMON_NAME - * should also be specified. + * Name of the ECOM configuration daemon manager component. + * This component interfaces with the server identified in + * ISP_CONFIG_DAEMON_NAME. If specified, ISP_CONFIG_DAEMON_NAME + * should also be specified. * ( String - default: None) */ EWlanConfigDaemonManagerName, - + /** - * Name of the configuration daemon server. - * This server is used to provide further configuration for - * a connection, e.g. dynamic IP address assignment. - * If specified, ISP_CONFIG_DAEMON_MANAGER_NAME should also + * Name of the configuration daemon server. + * This server is used to provide further configuration for + * a connection, e.g. dynamic IP address assignment. + * If specified, ISP_CONFIG_DAEMON_MANAGER_NAME should also * be specified. * ( String - default: None) */ EWlanConfigDaemonName, - + /** * Name of the WLAN Service Extension table. * ( String - default: None) */ EWlanServiceExtensionTableName, - + /** * The record ID of the linked WLAN Service Extension record in the * WLAN Service Extension table. * ( TUint32 - default: None) */ EWlanServiceExtensionTableRecordId, - + /** * Marks the beginning of WLAN specific attributes. */ EWlanSpecificAttributes = 30000, - + /** * The record ID to which IAP record these settings belong to. * ( TUint32 - default: None) */ EWlanServiceId = 30100, - + /** * The connection mode. This can be either Ad-hoc or infrastructure. * TWlanNetMode enum is to be used. * ( TUint32 - default: EInfra ) */ EWlanConnectionMode, - + /** * The SSID of this WLAN connection. * ( String - default: None) */ EWlanSSID, - + /** * Used SSID. * ( String - default: None) */ EWlanUsedSSID, - + /** * The security mode of this WLAN connection. It is a TWlanSecMode enum. * ( TUint32 - default: EWlanSecModeOpen ) */ EWlanSecurityMode, - + /** - * Authentication type: none, wep, wpa, wpapresharedkey - * ( TUint32 - default: None ) + * Authentication mode: Defined in TWlanAuthMode. + * ( TUint32 - default: EWlanAuthModeOpen ) */ EWlanAuthenticationMode, - + /** * Gives whether it should scan for the SSID. * (TBool - default: EFalse ) */ EWlanScanSSID, - + /** * This is the channel ID in ad-hoc network mode * ( TUint32 - default: EAdhocAutomatic, if set to EAdhocUserDefined default = 7 ) */ EWlanChannelID, - + /** * Gives whether it is allowed to roam inside one SSID or not. * (TBool - default: determined through variation ) */ EWlanAllowSSIDRoaming, - - - // The following attributes before EWlanRangeMax are for internal use only + + /** + * WEP key data. + * Key data is in hex-format (0-9, A-F, length 10 or 26). + * String (8-bit) + */ + EWlanWepKey1InHex = 31000, + EWlanWepKey2InHex, + EWlanWepKey3InHex, + EWlanWepKey4InHex, + + /** + * WEP key data. + * Key data is in ascii-format (length 5 or 13). + * String (8-bit) + */ + EWlanWepKey1InAscii, + EWlanWepKey2InAscii, + EWlanWepKey3InAscii, + EWlanWepKey4InAscii, + + /** + * Used WEP key. + * TWepKeyIndex + */ + EWlanWepKeyIndex, + + /** + * Is unencrypted mode allowed in 802.1x. + * TBool + */ + EWlan802_1xAllowUnencrypted = 31050, + + /** + * WPA pre-shared key usage. + * TBool + */ + EWlanEnableWpaPsk = 31100, + + /** + * WPA pre-shared key. + * String (8-bit) + */ + EWlanWpaPreSharedKey, + + /** + * WAPI pre-shared key data. + * String (8-bit) + */ + EWlanWapiPsk = 31150, + + /** + * The format of the WAPI key (ascii, hex) + * TWlanWapiKeyFormat + */ + EWlanWapiPskFormat, + + // The following attributes before EWlanRangeMax are for internal use only. /** * Internal limiter */ EWlanRangeInternal = 35000, - + /** * Internal, used for the security settings. */ EWlanSecuritySettings, - + /** * Marks the end of WLAN attributes. */ diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_pub/connection_settings_ui_api/inc/cmapplicationsettingsui.h --- a/ipcm_pub/connection_settings_ui_api/inc/cmapplicationsettingsui.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_pub/connection_settings_ui_api/inc/cmapplicationsettingsui.h Mon May 03 12:53:07 2010 +0300 @@ -18,7 +18,10 @@ #ifndef C_CMAPPLICATIONSETTINGSUI_H #define C_CMAPPLICATIONSETTINGSUI_H -#include +// Deprecation warning +#warning This header file is deprecated and will be fully removed in Symbian^4. See Polonium CRs #533 and #532 for details. + +#include #include class CCmConnSettingsUiImpl; diff -r fcbbe021d614 -r 9c97ad6591ae ipcm_pub/extendedconnpref_api/inc/extendedconnpref.h --- a/ipcm_pub/extendedconnpref_api/inc/extendedconnpref.h Fri Apr 16 15:21:37 2010 +0300 +++ b/ipcm_pub/extendedconnpref_api/inc/extendedconnpref.h Mon May 03 12:53:07 2010 +0300 @@ -259,8 +259,11 @@ IMPORT_C TBool DisconnectDialog() const; /** - * Enables or disables Connection selection dialog. Only the SNAPs/IAPs - * matching with BearerSet are shown in the dialog. + * DEPRECATED + * + * Enables or disables Connection selection dialog, but since the + * Connection selection dialog is deprecated functionality, this + * method gets the Internet SNAP chosen if set as enabled. * By default, Connection selection dialog is disabled. * * If Connection selection dialog is enabled, SNAP id shall be zero. @@ -271,14 +274,20 @@ * selection dialog shall be enabled. * * @param aConnSelectionDialog Indicates whether Connection selection - * dialog is enabled or disabled. + * dialog is enabled or disabled. + * @deprecated since Symbian^4 */ IMPORT_C void SetConnSelectionDialog( TBool aConnSelectionDialog ); /** - * Indicates whether Connection selection dialog is enabled. + * DEPRECATED + * + * Indicates whether Connection selection dialog is enabled. This + * function holds no value since the usage of the Connection selection + * dialog is deprecated, thus this function is deprecated also. * * @return Indicates whether Connection selection dialog is enabled. + * @deprecated since Symbian^4 */ IMPORT_C TBool ConnSelectionDialog() const; diff -r fcbbe021d614 -r 9c97ad6591ae ipconnmgmt.pro --- a/ipconnmgmt.pro Fri Apr 16 15:21:37 2010 +0300 +++ b/ipconnmgmt.pro Mon May 03 12:53:07 2010 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# 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" @@ -16,9 +16,11 @@ TEMPLATE = subdirs -SUBDIRS += \ - connectionutilities \ - connectionmonitoring +SUBDIRS += \ + ipcm_plat \ + connectionutilities \ + cmmanager \ + connectionmonitoring CONFIG += ordered