--- a/bluetoothengine/btaudioman/src/basrvmain.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btaudioman/src/basrvmain.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -30,8 +30,8 @@
GLDEF_C TInt E32Main()
{
TRACE_STATIC_FUNC
-
- __UHEAP_MARK;
+ //TODO uncomment UHEAP macros after orbit & Qt memory leaks are resolved till then it should be commented.
+// __UHEAP_MARK;
CTrapCleanup* cleanup=CTrapCleanup::New();
TInt r=KErrNoMemory;
if (cleanup)
@@ -40,7 +40,7 @@
delete cleanup;
}
//
- __UHEAP_MARKEND;
+// __UHEAP_MARKEND;
return r;
}
--- a/bluetoothengine/bteng/btbearer/inc/btpluginnotifier.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/bteng/btbearer/inc/btpluginnotifier.h Tue Jul 06 14:27:09 2010 +0300
@@ -25,6 +25,7 @@
#include <locodbearerpluginparams.h>
#include <centralrepository.h>
#include <locodbearer.h>
+#include <hbindicatorsymbian.h>
/**
@@ -149,6 +150,8 @@
* Own.
*/
CRepository* iSession;
+
+ CHbIndicatorSymbian* iBTIndicator;
};
--- a/bluetoothengine/bteng/btbearer/src/btpluginnotifier.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/bteng/btbearer/src/btpluginnotifier.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -24,6 +24,8 @@
#include "debug.h"
#include <btfeaturescfg.h>
#include <btnotifclient.h>
+#include "btindicatorconstants.h"
+#include <hbsymbianvariant.h>
// ======== MEMBER FUNCTIONS ========
@@ -60,6 +62,7 @@
delete repository;
CBTEngSettings* settings = CBTEngSettings::NewL();
+ iBTIndicator = CHbIndicatorSymbian::NewL();
BluetoothFeatures::TEnterpriseEnablementMode mode = BluetoothFeatures::EnterpriseEnablementL();
TRACE_INFO( ( _L( "mode = %d" ), mode) )
@@ -78,6 +81,14 @@
{
TRACE_INFO( ( _L( "Turning BT off" ) ) )
(void) settings->SetPowerState( EBTPowerOff ); // Result is not important here
+ TInt state = EBTIndicatorOff;
+ CHbSymbianVariant* parameters = CHbSymbianVariant::NewL(&state,CHbSymbianVariant::EInt );
+ TBool success = iBTIndicator->Activate(KIndicatorType(),parameters);
+ delete parameters;
+ if(!success)
+ {
+ User::Leave(iBTIndicator->Error());
+ }
}
delete settings;
if ( mode != BluetoothFeatures::EDisabled ) // only subscribe if there's any point (NB changing Enterprise Disabling mode requires a reboot)
@@ -112,6 +123,7 @@
TRACE_FUNC_ENTRY
Cancel();
delete iSession;
+ delete iBTIndicator;
}
--- a/bluetoothengine/bteng/group/btbearer.mmp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/bteng/group/btbearer.mmp Tue Jul 06 14:27:09 2010 +0300
@@ -43,6 +43,7 @@
MW_LAYER_SYSTEMINCLUDE
SYSTEMINCLUDE /epoc32/include/ecom
SYSTEMINCLUDE ../../../inc
+SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore
LIBRARY euser.lib
LIBRARY ecom.lib
@@ -50,4 +51,5 @@
LIBRARY btengsettings.lib
LIBRARY btfeatures.lib
LIBRARY btnotifclient.lib
+LIBRARY hbcore.lib
DEBUGLIBRARY flogger.lib // File logging services
--- a/bluetoothengine/bteng/group/bteng.mmp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/bteng/group/bteng.mmp Tue Jul 06 14:27:09 2010 +0300
@@ -43,6 +43,7 @@
USERINCLUDE ../inc
SYSTEMINCLUDE ../../inc
+SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore
MW_LAYER_SYSTEMINCLUDE
LIBRARY euser.lib
@@ -59,6 +60,7 @@
LIBRARY featmgr.lib
LIBRARY aknnotify.lib
LIBRARY btfeatures.lib
+LIBRARY hbcore.lib
LIBRARY btpowercontrol.lib
#ifndef __WINS__
--- a/bluetoothengine/bteng/inc/btengsrvsettingsmgr.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengsrvsettingsmgr.h Tue Jul 06 14:27:09 2010 +0300
@@ -29,6 +29,7 @@
#include "btengactive.h"
class CBTEngServer;
+class CHbIndicatorSymbian;
/**
@@ -130,12 +131,11 @@
/**
* ?description
- *
- * @since S60 v3.2
- * @param ?arg1 ?description
+ *
+ * @param aState Current State of the Bluetooth
*/
- void SetIndicatorStateL( const TInt aIndicator, const TInt aState );
-
+ void SetIndicatorStateL( const TInt aState );
+
/**
* Update the Bluetooth visibility mode.
*
@@ -305,6 +305,15 @@
*/
RMessage2 iMessage;
+ /**
+ * Orbit Indicator to display Bluetooth Status
+ */
+ CHbIndicatorSymbian* iBTIndicator;
+
+ /*
+ * Indicator State
+ */
+ TInt iIndicatorState;
};
--- a/bluetoothengine/bteng/src/btengserver.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/bteng/src/btengserver.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -600,7 +600,8 @@
//
GLDEF_C TInt E32Main()
{
- __UHEAP_MARK;
+ //TODO uncomment UHEAP macros after orbit memory leaks are resolved till then it should be commented.
+// __UHEAP_MARK;
TRACE_FUNC_ENTRY
CTrapCleanup* cleanup = CTrapCleanup::New();
TInt err = KErrNoMemory;
@@ -609,6 +610,6 @@
TRAP( err, RunServerL() );
delete cleanup;
}
- __UHEAP_MARKEND;
+// __UHEAP_MARKEND;
return err;
}
--- a/bluetoothengine/bteng/src/btengsrvsettingsmgr.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvsettingsmgr.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -22,13 +22,14 @@
#include <btengdomainpskeys.h>
#include <centralrepository.h>
#include <featmgr.h>
-#include <AknSmallIndicator.h>
-//#include <avkon.hrh>
#include "btengserver.h"
#include "btengsrvpluginmgr.h"
#include "btengsrvbbconnectionmgr.h"
#include "btengsrvstate.h"
#include "debug.h"
+#include <btindicatorconstants.h>
+#include <hbindicatorsymbian.h>
+#include <hbsymbianvariant.h>
/** ID of active object helper */
const TInt KBTEngSettingsActive = 30;
@@ -48,7 +49,7 @@
// ---------------------------------------------------------------------------
//
CBTEngSrvSettingsMgr::CBTEngSrvSettingsMgr( CBTEngServer* aServer )
-: iServer( aServer )
+: iServer( aServer ),iIndicatorState(-1)
{
}
@@ -61,6 +62,7 @@
{
TRACE_FUNC_ENTRY
iActive = CBTEngActive::NewL( *this, KBTEngSettingsActive );
+ iBTIndicator = CHbIndicatorSymbian::NewL();
LoadBTPowerManagerL();
iEnterpriseEnablementMode = BluetoothFeatures::EnterpriseEnablementL();
TRACE_INFO( ( _L( "iEnterpriseEnablementMode = %d" ), iEnterpriseEnablementMode) )
@@ -93,6 +95,7 @@
CBTEngSrvSettingsMgr::~CBTEngSrvSettingsMgr()
{
delete iActive;
+ delete iBTIndicator;
iPowerMgr.Close();
}
@@ -726,7 +729,7 @@
TBTVisibilityMode visibilityMode = EBTVisibilityModeHidden;
CRepository* cenrep = NULL;
TInt phys = 0;
- TInt connecting = 0;
+ // TInt connecting = 0;
cenrep = CRepository::NewLC( KCRUidBluetoothPowerState );
User::LeaveIfError( cenrep->Get( KBTPowerState, (TInt&) powerState ) );
@@ -734,17 +737,13 @@
if( powerState == EBTPowerOff )
{
- // To be migrated
- //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
- //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
- //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
- //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
+ SetIndicatorStateL(EBTIndicatorOff);
}
else
{
// Power is on.
RProperty::Get( KPropertyUidBluetoothCategory, KPropertyKeyBluetoothPHYCount, phys );
- RProperty::Get( KPropertyUidBluetoothCategory, KPropertyKeyBluetoothConnecting, connecting );
+ // RProperty::Get( KPropertyUidBluetoothCategory, KPropertyKeyBluetoothConnecting, connecting );
cenrep = CRepository::NewLC( KCRUidBTEngPrivateSettings );
User::LeaveIfError( cenrep->Get( KBTDiscoverable, (TInt&) visibilityMode ) );
@@ -752,61 +751,44 @@
if( visibilityMode == EBTVisibilityModeHidden )
{
- if ( connecting ) // BT connecting and hidden
+ if ( phys > 0 ) // BT connection active and hidden
{
- // To be migrated to QT
- //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
- //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateAnimate );
- }
- else if ( phys > 0 ) // BT connection active and hidden
- {
- //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
- //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOn );
+ SetIndicatorStateL(EBTIndicatorHiddenConnected);
}
else // BT connection not active and hidden
{
- //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOn );
- //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
+ SetIndicatorStateL(EBTIndicatorOnHidden);
}
- //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
- //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
}
else if( visibilityMode == EBTVisibilityModeGeneral || visibilityMode == EBTVisibilityModeTemporary )
{
- if ( connecting ) // BT connecting and visible
+ if ( phys > 0 ) // BT connection active and visible
{
- //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
- //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateAnimate );
- }
- else if ( phys > 0 ) // BT connection active and visible
- {
- //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
- //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOn );
+ SetIndicatorStateL(EBTIndicatorVisibleConnected);
}
else // BT connection not active and visible
{
- //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOn );
- //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
+ SetIndicatorStateL(EBTIndicatorOnVisible);
}
- //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
- //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
}
}
TRACE_FUNC_EXIT
}
-// ---------------------------------------------------------------------------
-// ?implementation_description
-// ---------------------------------------------------------------------------
-//
-void CBTEngSrvSettingsMgr::SetIndicatorStateL( const TInt aIndicator, const TInt aState )
+void CBTEngSrvSettingsMgr::SetIndicatorStateL( const TInt aState )
{
- // To be migrated to QT
- (void) aIndicator;
- (void) aState;
- //CAknSmallIndicator* indicator = CAknSmallIndicator::NewLC( TUid::Uid( aIndicator ) );
- //indicator->SetIndicatorStateL( aState );
- //CleanupStack::PopAndDestroy( indicator ); //indicator
+ TBool success = EFalse;
+ if(iIndicatorState != aState)
+ {
+ CHbSymbianVariant* parameters = CHbSymbianVariant::NewL(&aState,CHbSymbianVariant::EInt );
+ success = iBTIndicator->Activate(KIndicatorType(),parameters);
+ delete parameters;
+ if(!success)
+ {
+ User::Leave(iBTIndicator->Error());
+ }
+ iIndicatorState = aState;
+ }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btindicator/btindicator.pro Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,45 @@
+#
+# 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 = btindicator
+CONFIG += hb plugin
+
+HEADERS += inc/btindicatorplugin.h \
+ inc/btindicator.h \
+ inc/btindicatorconstants.h
+
+SOURCES += src/btindicatorplugin.cpp \
+ src/btindicator.cpp
+
+MOC_DIR = moc
+OBJECTS_DIR = obj
+
+LIBS += -lxqservice -lcpframework
+symbian {
+ TARGET.EPOCALLOWDLLDATA = 1
+ TARGET.CAPABILITY = CAP_GENERAL_DLL
+ TARGET.UID3 = 0x200315E9
+ pluginstub.sources = $${TARGET}.dll
+ pluginstub.path = /resource/plugins/indicators
+ DEPLOYMENT += pluginstub
+
+BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
+ "qmakepluginstubs/$${TARGET}.qtplugin /epoc32/data/z/pluginstub/$${TARGET}.qtplugin" \
+ "rom/btindicator.iby CORE_MW_LAYER_IBY_EXPORT_PATH(btindicator.iby)" \
+ "inc/btindicatorconstants.h |../inc/btindicatorconstants.h"
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btindicator/inc/btindicator.h Tue Jul 06 14:27:09 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: Bluetooth Indicator class
+ *
+ */
+
+#ifndef BTINDICATOR_H
+#define BTINDICATOR_H
+
+
+#include <hbindicatorinterface.h>
+//#include <xqappmgr.h>
+/**
+ * Bluetooth indicator class.
+ * Handles client request and showing the indications.
+ */
+class BTIndicator : public HbIndicatorInterface
+{
+public:
+ /**
+ * Constructor
+ */
+ BTIndicator(const QString &indicatorType);
+
+ /**
+ * Destructor
+ */
+ ~BTIndicator();
+
+ /**
+ * @see HbIndicatorInterface
+ */
+ bool handleInteraction(InteractionType type);
+
+ /**
+ * @see HbIndicatorInterface
+ */
+ QVariant indicatorData(int role) const;
+
+protected:
+ /**
+ * @see HbIndicatorInterface
+ */
+ bool handleClientRequest(RequestType type, const QVariant ¶meter);
+
+private:
+// void launchBTCpSettingView();
+
+/*private slots:
+ void handleReturnValue(const QVariant &returnValue);
+ void handleError(int errorCode,const QString &errorMessage);*/
+
+private:
+
+ QString mSecDisplayName;
+// XQApplicationManager mAppMgr;
+ int mIndicatorStatus;
+
+private:
+
+};
+
+#endif /* BTINDICATOR_H */
+
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btindicator/inc/btindicatorconstants.h Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Bluetooth Indicator constants
+ *
+ */
+
+#ifndef BTINDCONSTANTS_H
+#define BTINDCONSTANTS_H
+
+
+
+/**
+ * Bluetooth indicator constants
+ *
+ */
+
+_LIT(KIndicatorType, "com.nokia.bluetooth.indicatorplugin/1.0");
+
+enum TBTDisplayStatus
+ {
+ EBTIndicatorOff,
+ EBTIndicatorOnVisible,
+ EBTIndicatorOnHidden,
+ EBTIndicatorVisibleConnected,
+ EBTIndicatorHiddenConnected
+ };
+
+#endif /* BTINDCONSTANTS_H */
+
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btindicator/inc/btindicatorplugin.h Tue Jul 06 14:27:09 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: Bluetooth Indicator Plugin Class
+ *
+ */
+
+#ifndef BTINDICATORPLUGIN_H
+#define BTINDICATORPLUGIN_H
+
+
+#include <hbindicatorplugininterface.h>
+#include <hbindicatorinterface.h>
+
+class HbTranslator;
+
+/**
+ * Bluetooth indicator plugin class.
+ * Main class of bluetooth indicator plugin.
+ */
+class BTIndicatorPlugin : public QObject, public HbIndicatorPluginInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(HbIndicatorPluginInterface)
+
+public:
+ /**
+ * Constructor
+ */
+ BTIndicatorPlugin();
+
+ /**
+ * Destructor
+ */
+ ~BTIndicatorPlugin();
+
+ /**
+ * @see HbIndicatorPluginInterface
+ */
+ QStringList indicatorTypes() const;
+
+ /**
+ * @see HbIndicatorPluginInterface
+ */
+ bool accessAllowed(const QString &indicatorType,
+ const QVariantMap &securityInfo) const;
+ /**
+ * @see HbIndicatorPluginInterface
+ */
+ HbIndicatorInterface* createIndicator(const QString &indicatorType);
+
+ /**
+ * @see HbIndicatorPluginInterface
+ */
+ int error() const;
+
+private:
+ Q_DISABLE_COPY(BTIndicatorPlugin)
+
+ /**
+ * Error value
+ */
+ int mError;
+
+ /**
+ * Indicator types
+ * supported indicator types.
+ */
+ QStringList mIndicatorTypes;
+
+ HbTranslator* mIndicatorTranslator;
+};
+
+
+#endif /* BTINDICATORPLUGIN_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btindicator/rom/btindicator.iby Tue Jul 06 14:27:09 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 __BTINDICATOR_IBY__
+#define __BTINDICATOR_IBY__
+
+REM DLL
+file=ABI_DIR\UREL\btindicator.dll SHARED_LIB_DIR\btindicator.dll
+data=\epoc32\data\z\pluginstub\btindicator.qtplugin \resource\plugins\indicators\btindicator.qtplugin
+#endif
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btindicator/src/btindicator.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,195 @@
+/*
+ * 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 "btindicator.h"
+#include <QVariant.h>
+//#include <hbmessagebox.h>
+//#include <xqaiwrequest.h>
+#include "btindicatorconstants.h"
+//#include <XQServiceRequest.h>
+//#include <cpbasesettingview.h>
+//#include <cppluginlauncher.h>
+#define LOC_BLUETOOTH hbTrId("txt_bt_dblist_bluetooth")
+#define LOC_BLUETOOTH_OFF hbTrId("txt_bt_dblist_bluetooth_val_off")
+#define LOC_BLUETOOTH_ON_VISIBLE hbTrId("txt_bt_dblist_bluetooth_val_on_and_visible")
+#define LOC_BLUETOOTH_VISIBLE_CONNECTED hbTrId("txt_bt_dblist_bluetooth_val_visible_and_connected")
+#define LOC_BLUETOOTH_ON_HIDDEN hbTrId("txt_bt_dblist_bluetooth_val_on_and_hidden")
+#define LOC_BLUETOOTH_HIDDEN_CONNECTED hbTrId("txt_bt_dblist_bluetooth_val_hidden_and_connected")
+
+struct BTIndicatorInfo
+ {
+ QString icon;
+ QString secondaryText;
+ };
+
+static const int BTIndicatorCount = 5;
+
+
+static const BTIndicatorInfo IndicatorInfo[BTIndicatorCount] = {
+ { "qtg_large_bluetooth_off", "LOC_BLUETOOTH_OFF" },
+ { "qtg_large_bluetooth", "LOC_BLUETOOTH_ON_VISIBLE" },
+ { "qtg_large_bluetooth_hide","LOC_BLUETOOTH_ON_HIDDEN" },
+ { "qtg_large_bluetooth_active_connection", "LOC_BT_VISIBLE_CONNECT" },
+ { "qtg_large_bluetooth_hide_connection","LOC_BT_HIDDEN_CONNECT" }
+ };
+
+
+// ----------------------------------------------------------------------------
+// BTIndicator::BTIndicator
+// ----------------------------------------------------------------------------
+BTIndicator::BTIndicator(const QString &indicatorType) :
+HbIndicatorInterface(indicatorType,
+ HbIndicatorInterface::SettingCategory ,
+ InteractionActivated)
+ {
+ mIndicatorStatus = 0;
+ }
+
+// ----------------------------------------------------------------------------
+// BTIndicator::~BTIndicator
+// ----------------------------------------------------------------------------
+BTIndicator::~BTIndicator()
+ {
+ }
+
+
+// ----------------------------------------------------------------------------
+// BTIndicator::handleInteraction
+// ----------------------------------------------------------------------------
+bool BTIndicator::handleInteraction(InteractionType type)
+ {
+ // bool handled = false;
+ if (type == InteractionActivated)
+ {
+ //@TODO need to code for launching the BT Control Panel Plugin is available
+
+ // launchBTCpSettingView();
+ }
+ return true;
+ }
+
+// ----------------------------------------------------------------------------
+// BTIndicator::indicatorData
+// returns the data and icon that needs to be displayed in the universal pop up and indicator menu
+// ----------------------------------------------------------------------------
+QVariant BTIndicator::indicatorData(int role) const
+{
+ switch(role)
+ {
+ case PrimaryTextRole:
+ {
+ QString text(LOC_BLUETOOTH);
+ return text;
+ }
+ case SecondaryTextRole:
+ {
+ return IndicatorInfo[mIndicatorStatus].secondaryText;//mSecDisplayName;
+ }
+ case DecorationNameRole:
+ {
+ //QString iconName("qtg_large_bluetooth");
+ return IndicatorInfo[mIndicatorStatus].icon;//iconName;
+ }
+ case MonoDecorationNameRole :
+ {
+ // QString iconName("qtg_large_bluetooth");
+ return IndicatorInfo[mIndicatorStatus].icon;//iconName;
+ }
+
+ default:
+ return QVariant();
+ }
+}
+
+// ----------------------------------------------------------------------------
+// BTIndicator::handleClientRequest
+// handles client's activate and deactivate request
+// ----------------------------------------------------------------------------
+bool BTIndicator::handleClientRequest( RequestType type,
+ const QVariant ¶meter)
+ {
+ bool handled(false);
+ switch (type) {
+ case RequestActivate:
+ {
+ mSecDisplayName.clear();
+/* if(parameter.toInt() == EBTIndicatorOff)
+ mSecDisplayName.append("LOC_BLUETOOTH_OFF");
+ else if(parameter.toInt() == EBTIndicatorOnVisible)
+ mSecDisplayName.append("LOC_BLUETOOTH_ON_VISIBLE");
+ else if(parameter.toInt() == EBTIndicatorOnHidden)
+ mSecDisplayName.append("LOC_BLUETOOTH_ON_HIDDEN");
+ else if(parameter.toInt() == EBTIndicatorVisibleConnected)
+ mSecDisplayName.append("LOC_BT_VISIBLE_CONNECT");
+ else if(parameter.toInt() == EBTIndicatorHiddenConnected)
+ mSecDisplayName.append("LOC_BT_HIDDEN_CONNECT");*/
+ mIndicatorStatus = parameter.toInt();
+ emit dataChanged();
+ handled = true;
+ }
+ break;
+ default:
+ {
+ mSecDisplayName.clear();
+ emit deactivate();
+ }
+ break;
+ }
+ return handled;
+ }
+
+
+/*void BTIndicator::launchBTCpSettingView()
+ {
+ XQAiwRequest *request = mAppMgr.create("obexhighway","com.nokia.symbian.IFileShare","send(QVariant)",true);
+
+ if (!request)
+ {
+ qDebug("BTIndicator request returned with NULL");
+ return;
+ }
+ else
+ {
+ connect(request, SIGNAL(requestOk(QVariant)), SLOT(handleReturnValue(QVariant)));
+ connect(request, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString)));
+ }
+ // Set arguments for request
+ QList<QVariant> args;
+ //c:\resource\qt\plugins\controlpanel\nfccpplugin.qtplugin
+ args << QVariant( "c:\\two.jpg" );//btcpplugin.dll
+// args << QVariant ( "c:\\two.jpg" );
+ request->setArguments(args);
+
+ // Make the request
+ if (!request->send())
+ {
+ //report error
+ qDebug("BTIndicator::launchBTCpSettingView request not sent");
+ }
+
+ delete request;
+
+ }*/
+
+
+/*void BTIndicator::handleReturnValue(const QVariant &returnValue)
+{
+}
+
+void BTIndicator::handleError(int errorCode,const QString &errorMessage)
+ {
+ Q_UNUSED(errorCode);
+ }*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btindicator/src/btindicatorplugin.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,88 @@
+/*
+ * 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 "btindicatorplugin.h"
+#include "btindicator.h"
+#include <hbtranslator.h>
+
+const char* BTINDICATOR_TRANSLATION = "btindimenu";
+
+Q_EXPORT_PLUGIN(BTIndicatorPlugin)
+
+// ----------------------------------------------------------------------------
+// BTIndicatorPlugin::BTIndicatorPlugin
+// ----------------------------------------------------------------------------
+BTIndicatorPlugin::BTIndicatorPlugin() : mError(0),mIndicatorTranslator(0)
+{
+}
+
+// ----------------------------------------------------------------------------
+// BTIndicatorPlugin::~BTIndicatorPlugin
+// ----------------------------------------------------------------------------
+BTIndicatorPlugin::~BTIndicatorPlugin()
+ {
+ delete mIndicatorTranslator;
+ }
+
+// ----------------------------------------------------------------------------
+// BTIndicatorPlugin::indicatorTypes
+// Return notification types this plugin implements
+// ----------------------------------------------------------------------------
+QStringList BTIndicatorPlugin::indicatorTypes() const
+{
+ QStringList types;
+ types << "com.nokia.bluetooth.indicatorplugin/1.0";
+ return types;
+}
+
+// ----------------------------------------------------------------------------
+// BTIndicatorPlugin::accessAllowed
+// ----------------------------------------------------------------------------
+bool BTIndicatorPlugin::accessAllowed(const QString &indicatorType,
+ const QVariantMap &securityInfo) const
+{
+ Q_UNUSED(indicatorType)
+ Q_UNUSED(securityInfo)
+
+ // This plugin doesn't perform operations that may compromise security.
+ // All clients are allowed to use.
+ return true;
+}
+
+
+// ----------------------------------------------------------------------------
+// BTIndicatorPlugin::createIndicator
+// Creates and returns the HbIndicatorInterface
+// ----------------------------------------------------------------------------
+HbIndicatorInterface* BTIndicatorPlugin::createIndicator(const QString &indicatorType)
+{
+ if(!mIndicatorTranslator)
+ {
+ mIndicatorTranslator = new HbTranslator(BTINDICATOR_TRANSLATION);
+ }
+ HbIndicatorInterface *indicator = new BTIndicator(indicatorType);
+ return indicator;
+}
+
+// ----------------------------------------------------------------------------
+// BTIndicatorPlugin::error
+// ----------------------------------------------------------------------------
+int BTIndicatorPlugin::error() const
+{
+ return mError;
+}
+
--- a/bluetoothengine/btnotif/btdevicedialogplugin/btdevicedialogplugin.pro Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/btdevicedialogplugin.pro Tue Jul 06 14:27:09 2010 +0300
@@ -61,7 +61,7 @@
hblib.sources = Hb.dll
hblib.path = \sys\bin
hblib.depends = "(0xEEF9EA38), 1, 0, 0, {\"Hb\"}"
- pluginstub.sources = btdevicedialogplugin.dll
+ pluginstub.sources = $${TARGET}.dll
pluginstub.path = /resource/plugins/devicedialogs
DEPLOYMENT += pluginstub
}
@@ -73,4 +73,4 @@
BLD_INF_RULES.prj_exports += \
"$${LITERAL_HASH}include <platform_paths.hrh>" \
"rom/btdevicedialogplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(btdevicedialogplugin.iby)" \
- "qmakepluginstubs/btdevicedialogplugin.qtplugin /epoc32/data/z/pluginstub/btdevicedialogplugin.qtplugin"
+ "qmakepluginstubs/$${TARGET}.qtplugin /epoc32/data/z/pluginstub/$${TARGET}.qtplugin"
--- a/bluetoothengine/btnotif/btdevicedialogplugin/btdevicedialogplugin.qrc Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/btdevicedialogplugin.qrc Tue Jul 06 14:27:09 2010 +0300
@@ -7,7 +7,5 @@
<file>icons/qtg_large_bluetooth.svg</file>
<file>docml/bt-receive-auth-dialog.docml</file>
<file>docml/bt-recv-progress-dialog.docml</file>
- <file>btdialogs_en_GB.qm</file>
- <file>btviews_en_GB.qm</file>
</qresource>
</RCC>
Binary file bluetoothengine/btnotif/btdevicedialogplugin/btdialogs_en_GB.qm has changed
Binary file bluetoothengine/btnotif/btdevicedialogplugin/btviews_en_GB.qm has changed
--- a/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogplugin.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogplugin.h Tue Jul 06 14:27:09 2010 +0300
@@ -26,7 +26,7 @@
// Forward declarations
class BtDeviceDialogPluginPrivate;
-class QTranslator;
+class HbTranslator;
/*!
\class BtDeviceDialogPlugin
@@ -68,8 +68,8 @@
private:
Q_DISABLE_COPY(BtDeviceDialogPlugin)
BtDeviceDialogPluginPrivate *d;
- QTranslator* mDialogTranslator;
- QTranslator* mViewTranslator;
+ HbTranslator* mDialogTranslator;
+ HbTranslator* mViewTranslator;
};
#endif // BTDEVICEDIALOGPLUGIN_P_H
--- a/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicesearchdialogwidget.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicesearchdialogwidget.h Tue Jul 06 14:27:09 2010 +0300
@@ -62,8 +62,8 @@
void viewByClicked();
void deviceSelected(const QModelIndex& modelIndex);
// void viewByItemSelected(int index);
- void selectionDialogClosed(HbAction*);
- void searchDialogClosed(HbAction* action);
+ void selectionDialogClosed(HbAction *action);
+ void searchDialogClosed();
private:
bool constructDialog(const QVariantMap ¶meters);
--- a/bluetoothengine/btnotif/btdevicedialogplugin/inc/btmoredevicesdialogwidget.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btmoredevicesdialogwidget.h Tue Jul 06 14:27:09 2010 +0300
@@ -16,8 +16,8 @@
*/
-#ifndef BTMOREDEVICESDIALOGWIDGET_H_
-#define BTMOREDEVICESDIALOGWIDGET_H_
+#ifndef BTMOREDEVICESDIALOGWIDGET_H
+#define BTMOREDEVICESDIALOGWIDGET_H
#include <QObject>
#include <QVariantMap>
@@ -76,4 +76,4 @@
Q_DISABLE_COPY(BTMoreDevicesDialogWidget)
};
-#endif /* BTMOREDEVICESDIALOGWIDGET_H_ */
+#endif /* BTMOREDEVICESDIALOGWIDGET_H */
--- a/bluetoothengine/btnotif/btdevicedialogplugin/inc/btsenddialogwidget.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btsenddialogwidget.h Tue Jul 06 14:27:09 2010 +0300
@@ -16,8 +16,8 @@
*/
-#ifndef BTSENDDIALOGWIDGET_H_
-#define BTSENDDIALOGWIDGET_H_
+#ifndef BTSENDDIALOGWIDGET_H
+#define BTSENDDIALOGWIDGET_H
#include <QObject>
#include <QVariantMap>
@@ -79,4 +79,4 @@
Q_DISABLE_COPY(BTSendDialogWidget)
};
-#endif /* BTSENDDIALOGWIDGET_H_ */
+#endif /* BTSENDDIALOGWIDGET_H */
--- a/bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialogplugin.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialogplugin.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -31,13 +31,12 @@
#include "btmoredevicesdialogwidget.h"
#include "btsenddialogwidget.h"
#include "btdevicedialogrecvquerywidget.h"
-#include <qtranslator.h>
-#include <qcoreapplication.h>
+#include <hbtranslator.h>
Q_EXPORT_PLUGIN2(btdevicedialogplugin, BtDeviceDialogPlugin)
-const char* BTDIALOG_TRANSLATION = "btdialogs_en_GB";
-const char* BTVIEW_TRANSLATION = "btviews_en_GB";
+const char* BTDIALOG_TRANSLATION = "btdialogs";
+const char* BTVIEW_TRANSLATION = "btviews";
// This plugin implements one device dialog type
static const struct {
@@ -106,32 +105,13 @@
int i;
- //TODO: Uncomment the lines when actual translation files are available in sdk and remove loading locally.
- // QString locale = QLocale::system().name();
- // QString path = "z:/resource/qt/translations/";
- // QTranslator translator;
- //QTranslator translator_comm;
- //translator.load(path + QString("btdialogs_") + locale);
- //translator_comm.load(path + QString("common_") + locale);
-
- QString path = ":/";
if(!mDialogTranslator)
{
- mDialogTranslator = new QTranslator();
-// QString lang = QLocale::system().name();
-// QString appName = "btdialogs_";
- //todo need to handle failed case of transaltor loading
- bool ok = mDialogTranslator->load(BTDIALOG_TRANSLATION, path);
- QCoreApplication::installTranslator(mDialogTranslator);
+ mDialogTranslator = new HbTranslator(BTDIALOG_TRANSLATION);
}
if(!mViewTranslator)
{
- mViewTranslator = new QTranslator();
-// QString lang = QLocale::system().name();
-// QString appName = "btviews_";
- //todo need to handle failed case of transaltor loading
- bool ok = mViewTranslator->load(BTVIEW_TRANSLATION, path);
- QCoreApplication::installTranslator(mViewTranslator);
+ mViewTranslator = new HbTranslator(BTVIEW_TRANSLATION);
}
// verify that requested dialog type is supported
const int numTypes = sizeof(noteInfos) / sizeof(noteInfos[0]);
--- a/bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicesearchdialogwidget.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicesearchdialogwidget.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -199,7 +199,7 @@
connect(mViewByAction, SIGNAL(triggered()), this, SLOT(viewByClicked()));
connect(mStopRetryAction, SIGNAL(triggered()), this, SLOT(stopRetryClicked()));
- connect(mSearchDevicesDialog, SIGNAL(finished(HbAction*)), this, SLOT(searchDialogClosed(HbAction*)));
+ connect(mSearchDevicesDialog, SIGNAL(aboutToClose()), this, SLOT(searchDialogClosed()));
// QGraphicsWidget *widget = mLoader->findWidget(QString("container"));
//setContentWidget(widget);
@@ -207,6 +207,7 @@
mSearchDevicesDialog->setBackgroundFaded(false);
mSearchDevicesDialog->setDismissPolicy(HbPopup::TapOutside);
mSearchDevicesDialog->setTimeout(HbPopup::NoTimeout);
+ mSearchDevicesDialog->setAttribute(Qt::WA_DeleteOnClose);
/* mViewByDialog = new HbDialog();
mRbl = new HbRadioButtonList(mViewByDialog);
@@ -345,21 +346,13 @@
mViewByDialog->show();*/
}
-void BTDeviceSearchDialogWidget::searchDialogClosed(HbAction* action)
+void BTDeviceSearchDialogWidget::searchDialogClosed()
{
- HbDialog *dlg=static_cast<HbDialog*>(sender());
- if(dlg->actions().first() == action) {
- }
- else if(dlg->actions().at(1) == action) {
- }
- else
- {
- QVariantMap val;
- QVariant index(-1);
- val.insert("selectedindex",index);
- emit deviceDialogData(val);
- emit deviceDialogClosed();
- }
+ QVariantMap val;
+ QVariant index(-1);
+ val.insert("selectedindex",index);
+ emit deviceDialogData(val);
+ emit deviceDialogClosed();
}
void BTDeviceSearchDialogWidget::selectionDialogClosed(HbAction* action)
--- a/bluetoothengine/btnotif/btdevicedialogplugin/src/btmoredevicesdialogwidget.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btmoredevicesdialogwidget.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -163,6 +163,7 @@
mMoreDeviceDialog->setBackgroundFaded(false);
mMoreDeviceDialog->setDismissPolicy(HbPopup::NoDismiss);
mMoreDeviceDialog->setTimeout(HbPopup::NoTimeout);
+ mMoreDeviceDialog->setAttribute(Qt::WA_DeleteOnClose);
return true;
}
--- a/bluetoothengine/btnotif/btdevicedialogplugin/src/btrecvprgrsdialogwidget.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btrecvprgrsdialogwidget.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -79,8 +79,9 @@
mFileName = qobject_cast<HbLabel*>(mLoader->findWidget("fileName"));
mFileSize = qobject_cast<HbLabel*>(mLoader->findWidget("fileSize"));
- mFileCount = qobject_cast<HbLabel*>(mLoader->findWidget("fileCount"));
-
+ mFileCount = qobject_cast<HbLabel*>(mLoader->findWidget("fileCount_label"));
+ mFileCount->setVisible(false);
+
//TODO - set icon based on the file icon.
mHide = qobject_cast<HbAction*>(mLoader->findObject("hideaction"));
@@ -93,7 +94,6 @@
{
case TBluetoothDialogParams::EReceive:
{
- //TODO - Localization
QString headingStr(hbTrId("txt_bt_title_receiving_files_from_1"));
QString senderName(parameters.value(QString::number(TBluetoothDeviceDialog::EDeviceName)).toString());
mHeading->setPlainText(headingStr.arg(senderName));
@@ -140,13 +140,15 @@
mFileSize->setPlainText(fileSzB);
}
- //TODO - Set the received file count
-/*
- int count = parameters.value(QString::number(TBluetoothDeviceDialog::EReceivedFileCount)).toInt();
- QString fileCntStr;
- fileCntStr.setNum(count);
- mFileCount->setPlainText(fileCntStr);
-*/
+ //Set the received file count
+ int fCnt = parameters.value(QString::number(TBluetoothDeviceDialog::EReceivedFileCount)).toInt();
+ if(fCnt > 0)
+ {
+ mFileCount->setVisible(true);
+
+ QString fCntStr(hbTrId("txt_bt_info_ln_files_already_received"));
+ mFileCount->setPlainText(fCntStr.arg(fCnt));
+ }
}
mDialog->setBackgroundFaded(false);
--- a/bluetoothengine/btnotif/btdevicedialogplugin/src/btsenddialogwidget.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btsenddialogwidget.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -157,6 +157,7 @@
mSendDialog->setBackgroundFaded(false);
mSendDialog->setDismissPolicy(HbPopup::NoDismiss);
mSendDialog->setTimeout(HbPopup::NoTimeout);
+ mSendDialog->setAttribute(Qt::WA_DeleteOnClose);
mHideAction = static_cast<HbAction*>( mLoader->findObject( "hideaction" ) );
mHideAction->disconnect(mSendDialog);
--- a/bluetoothengine/btnotif/btnotifsrv/inc/btnotifserviceauthorizer.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btnotifsrv/inc/btnotifserviceauthorizer.h Tue Jul 06 14:27:09 2010 +0300
@@ -46,7 +46,8 @@
void MBRNotificationClosed(TInt aError, const TDesC8& aData);
private:
- void PrepareNotificationL(TBluetoothDialogParams::TBTDialogType aType,
+ void PrepareNotificationL(TBool& aAutoAuthorize,
+ TBluetoothDialogParams::TBTDialogType aType,
TBTDialogResourceId aResourceId, TBool aPaired);
TBool IsExistingConnectionToAudioL(const TBTDevAddr& aDevAddr);
--- a/bluetoothengine/btnotif/btnotifsrv/src/bluetoothnotification.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btnotifsrv/src/bluetoothnotification.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -148,7 +148,7 @@
BOstraceFunctionEntry1( DUMMY_DEVLIST, this );
iDialog->Cancel();
iManager->ReleaseNotification( this );
- BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+ BOstraceFunctionExit0( DUMMY_DEVLIST );
return KErrNone;
}
@@ -390,6 +390,6 @@
resultBuf.Close();
iManager->ReleaseNotification( this );
// Note that we might get deleted after releasing ourselves.
- BOstraceFunctionExit1( DUMMY_DEVLIST, this );
+ BOstraceFunctionExit0( DUMMY_DEVLIST );
}
--- a/bluetoothengine/btnotif/btnotifsrv/src/btnotifdeviceselector.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotifdeviceselector.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -274,6 +274,7 @@
//TODO compile fail here we need to send the discovery completed text to the dialog
+ //TODO change the hardcoded string
keyStr.Copy(_L("Search Completed"));
CHbSymbianVariant* devEntry( NULL );
TRAP_IGNORE( devEntry = CHbSymbianVariant::NewL( (TAny*) &(keyStr),
--- a/bluetoothengine/btnotif/btnotifsrv/src/btnotifincomingpairinghandler.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotifincomingpairinghandler.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -270,10 +270,12 @@
case EPhysicalLinkNotify:
{
iPla.CancelNextBasebandChangeEventNotifier();
+ break;
}
case EWaitingForPairingOk:
{
iPairingOkTimer.Cancel();
+ break;
}
}
BOstraceFunctionExit0( DUMMY_DEVLIST );
--- a/bluetoothengine/btnotif/btnotifsrv/src/btnotifoutgoingpairinghandler.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotifoutgoingpairinghandler.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -314,16 +314,19 @@
case EDedicatedBonding:
{
iBondingSession.Close();
+ break;
}
case EGeneralBonding:
case EGeneralBondingRetry:
{
iSocket.CancelConnect();
iSocket.Close();
+ break;
}
case EGeneralBondingRetryTimer:
{
iTimer.Cancel();
+ break;
}
}
}
--- a/bluetoothengine/btnotif/btnotifsrv/src/btnotifserviceauthorizer.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotifserviceauthorizer.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -65,6 +65,10 @@
iNotification->Close(); // Also dequeues the notification from the queue.
iNotification = NULL;
}
+ if ( !iNotifierMessage.IsNull() )
+ {
+ iNotifierMessage.Complete( KErrServerTerminated );
+ }
}
CBTNotifServiceAuthorizer::CBTNotifServiceAuthorizer(
@@ -92,7 +96,7 @@
User::Leave(KErrServerBusy );
}
- iParams.CreateL( aMessage.GetDesLengthL( EBTNotifSrvParamSlot ) );
+ iParams.ReAllocL( aMessage.GetDesLengthL( EBTNotifSrvParamSlot ) );
aMessage.ReadL( EBTNotifSrvParamSlot, iParams );
TBTAuthorisationParams params;
@@ -130,11 +134,24 @@
TBTNotifUtil::GetDeviceUiNameL(iCurrentDeviceName,
dev, paramsPckg().iName, paramsPckg().iBDAddr );
- PrepareNotificationL(TBluetoothDialogParams::EUserAuthorization, EAuthorization, iPairedDevice);
- iNotification->ShowL();
- // we do not save the message until all leavable functions have executed successfully.
- // This makes sure the iNotifierMessage has a valid handle.
- iNotifierMessage = aMessage;
+ TBool autoAuthorize;
+ PrepareNotificationL(autoAuthorize,
+ TBluetoothDialogParams::EUserAuthorization,
+ EAuthorization, iPairedDevice);
+ if ( autoAuthorize )
+ {
+ TPckgBuf<TBool> answer;
+ answer() = ETrue;
+ aMessage.Write(EBTNotifSrvReplySlot, answer);
+ aMessage.Complete(KErrNone);
+ }
+ else
+ {
+ iNotification->ShowL();
+ // we do not save the message until all leavable functions have executed successfully.
+ // This makes sure the iNotifierMessage has a valid handle.
+ iNotifierMessage = aMessage;
+ }
}
void CBTNotifServiceAuthorizer::MBRDataReceived( CHbSymbianVariantMap& aData )
@@ -173,8 +190,11 @@
iParent.BlockDevice(paramsPckg().iBDAddr,ETrue);
}
}
- iNotifierMessage.Write(EBTNotifSrvReplySlot, answer);
- iNotifierMessage.Complete(KErrNone);
+ if ( !iNotifierMessage.IsNull() )
+ {
+ iNotifierMessage.Write(EBTNotifSrvReplySlot, answer);
+ iNotifierMessage.Complete(KErrNone);
+ }
}
else if(aData.Keys().MdcaPoint(0).Compare(_L("checkBoxState")) == 0)
{
@@ -182,11 +202,16 @@
}
}
-void CBTNotifServiceAuthorizer::MBRNotificationClosed( TInt /*aError*/, const TDesC8& /*aData*/ )
+void CBTNotifServiceAuthorizer::MBRNotificationClosed( TInt aError, const TDesC8& aData )
{
+ (void) aError;
+ (void) aData;
+ iNotification->RemoveObserver();
+ iNotification = NULL;
}
-void CBTNotifServiceAuthorizer::PrepareNotificationL(TBluetoothDialogParams::TBTDialogType aType,
+void CBTNotifServiceAuthorizer::PrepareNotificationL(TBool& aAutoAuthorize,
+ TBluetoothDialogParams::TBTDialogType aType,
TBTDialogResourceId aResourceId, TBool aPaired)
{
iNotification = iParent.ConnectionTracker().NotificationManager()->GetNotification();
@@ -194,6 +219,7 @@
iNotification->SetObserver( this );
iNotification->SetNotificationType( aType, aResourceId );
TInt err = KErrNone;
+ aAutoAuthorize = EFalse;
//Set the dialog title based on the service IDs
switch(iServiceId)
@@ -214,7 +240,8 @@
iCheckBoxState = EFalse;
User::LeaveIfError(err);
}
- }break;
+ }
+ break;
case KBTSdpFax:
case KBTSdpDun:
@@ -227,7 +254,8 @@
// In case of an incoming connection, the checkbox is checked by default.
iCheckBoxState = ETrue;
User::LeaveIfError(err);
- }break;
+ }
+ break;
default:
{
@@ -240,10 +268,7 @@
// If there is no existing connection, then we pop up a query message.
if(IsExistingConnectionToAudioL(paramsPckg().iBDAddr))
{
- TPckgBuf<TBool> answer;
- answer() = ETrue;
- iNotifierMessage.Write(EBTNotifSrvReplySlot, answer);
- iNotifierMessage.Complete(KErrNone);
+ aAutoAuthorize = ETrue;
return;
}
else
@@ -253,7 +278,8 @@
iCheckBoxState = ETrue;
User::LeaveIfError(err);
}
- }break;
+ }
+ break;
}
//Add the device name
@@ -262,6 +288,7 @@
//Add the device class
err = iNotification->SetData( TBluetoothDeviceDialog::EDeviceClass, iDeviceClass );
User::LeaveIfError(err);
+
}
TBool CBTNotifServiceAuthorizer::IsExistingConnectionToAudioL(const TBTDevAddr& aDevAddr)
--- a/bluetoothengine/btui/btcpplugin/btcpplugin.pro Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/btcpplugin.pro Tue Jul 06 14:27:09 2010 +0300
@@ -26,11 +26,13 @@
OBJECTS_DIR = obj
TRANSLATIONS += btviews.ts \
- btdialogs.ts
+ btdialogs.ts \
+ btindimenu.ts
RESOURCES += btcpplugin.qrc
# Input
-HEADERS += btcpuimainlistviewitem.h \
+HEADERS += btcpuidevicedetailsview.h\
+ btcpuimainlistviewitem.h \
btcpuisearchlistviewitem.h \
btcpplugin.h \
btcpuibaseview.h \
@@ -38,15 +40,18 @@
btcpuisearchview.h \
btcpuideviceview.h \
btcpuisettingitem.h \
- btuiviewutil.h
-SOURCES += btcpuimainlistviewitem.cpp \
+ btuiviewutil.h \
+ btcpuidevicedetail.h
+SOURCES += btcpuidevicedetailsview.cpp \
+ btcpuimainlistviewitem.cpp \
btcpuisearchlistviewitem.cpp \
btcpplugin.cpp \
btcpuibaseview.cpp \
btcpuimainview.cpp \
btcpuisearchview.cpp \
btcpuideviceview.cpp \
- btcpuisettingitem.cpp
+ btcpuisettingitem.cpp \
+ btcpuidevicedetail.cpp
symbian: {
DEFINES += PLUGINUID3=0x2002434E
TARGET.UID3 = 0x2002434E
@@ -55,7 +60,8 @@
TARGET.EPOCALLOWDLLDATA = 1
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
- LIBS += -lbtdevice
+ LIBS += -lbtdevice \
+ -lbtdevsettingframework
PLUGIN_STUB_PATH = /resource/qt/plugins/controlpanel
--- a/bluetoothengine/btui/btcpplugin/btcpplugin.qrc Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/btcpplugin.qrc Tue Jul 06 14:27:09 2010 +0300
@@ -21,5 +21,6 @@
<file>docml/bt-main-view.docml</file>
<file>docml/bt-search-view.docml</file>
<file>docml/bt-device-view.docml</file>
+ <file>docml/bt-device-details-view.docml</file>
</qresource>
</RCC>
--- a/bluetoothengine/btui/btcpplugin/btcpuibaseview.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/btcpuibaseview.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -19,16 +19,27 @@
#include <hbaction.h>
/*!
- Constructor.
+ This constructor constructs new setting and device models.
+ */
+BtCpUiBaseView::BtCpUiBaseView(QGraphicsItem *parent )
+ :CpBaseSettingView( 0 , parent )
+{
+ mSettingModel = new BtSettingModel(this);
+ mDeviceModel = new BtDeviceModel(this);
+}
+
+/*!
+ This constructor constructs models from the given setting and device models.
+ This implies the model impl and data structure is shared.
*/
BtCpUiBaseView::BtCpUiBaseView(
BtSettingModel &settingModel,
BtDeviceModel &deviceModel,
QGraphicsItem *parent )
- :CpBaseSettingView( 0 , parent ),
- mSettingModel( &settingModel ),
- mDeviceModel( &deviceModel )
+ :CpBaseSettingView( 0 , parent )
{
+ mSettingModel = new BtSettingModel(settingModel, this);
+ mDeviceModel = new BtDeviceModel(deviceModel, this);
}
/*!
--- a/bluetoothengine/btui/btcpplugin/btcpuibaseview.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/btcpuibaseview.h Tue Jul 06 14:27:09 2010 +0300
@@ -36,13 +36,15 @@
public:
virtual ~BtCpUiBaseView();
- virtual void activateView( const QVariant& value, int cmdId ) = 0;
+ virtual void activateView( const QVariant& value, bool fromBackButton ) = 0;
virtual void deactivateView() = 0;
virtual void switchToPreviousView() = 0;
signals:
protected:
+ explicit BtCpUiBaseView(QGraphicsItem *parent = 0);
+
explicit BtCpUiBaseView(
BtSettingModel &settingModel,
BtDeviceModel &deviceModel,
@@ -55,10 +57,10 @@
protected:
- // not owned
+ // owned
BtSettingModel *mSettingModel;
- // not owned
+ // owned
BtDeviceModel *mDeviceModel;
QGraphicsItem *mParent;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpuidevicedetail.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,206 @@
+/*
+ * 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 "btcpuidevicedetail.h"
+#include "btcpuideviceview.h"
+#include "btcpuidevicedetailsview.h"
+
+#include <btdevsettingpluginloader.h>
+#include <bluetoothuitrace.h>
+#include <HbInstance>
+
+BtCpUiDeviceDetail::BtCpUiDeviceDetail(QObject *parent) :
+ QObject(parent), mDeviceDetailView(0)
+{
+ mMainWindow = hbInstance->allMainWindows().first();
+}
+
+BtCpUiDeviceDetail::~BtCpUiDeviceDetail()
+{
+ notifyViewStatusToPlugins(AboutToClose);
+ clearDeviceDetailList();
+ delete mDeviceDetailView;
+}
+
+void BtCpUiDeviceDetail::loadDeviceDetailPlugins(QString deviceAddress, QString deviceName)
+{
+ QList<BtDevSettingInterface*> interfaces;
+ BtAbstractDevSetting *devSetting;
+
+ clearDeviceDetailList();
+ interfaces = BtDevSettingPluginLoader::loadDevSettingInterfaces();
+ QList<BtDevSettingInterface*>::const_iterator i;
+
+ for (i = interfaces.constBegin(); i != interfaces.constEnd(); ++i) {
+ devSetting = 0;
+ devSetting = (*i)->createDevSetting( deviceAddress );
+ if(devSetting) {
+ appendDeviceToList(devSetting);
+ }
+ }
+
+ for (int i = interfaces.count() - 1; i >= 0; --i ) {
+ delete interfaces.at(i);
+ }
+
+ notifyDeviceDetailStatus();
+ createDeviceDetailsView(deviceName);
+}
+
+void BtCpUiDeviceDetail::appendDeviceToList(BtAbstractDevSetting *devSetting)
+{
+ bool ret = false;
+ BtDeviceDetails devicedetails;
+ devicedetails.mSetting = 0;
+ devicedetails.mSettingForm = 0;
+ devicedetails.mSettingAvailable = false;
+
+ devicedetails.mSetting = devSetting;
+ devicedetails.mSettingAvailable = devSetting->isSettingAvailable();
+ devicedetails.mSettingForm = devSetting->getSettingWidget();
+
+ mDeviceDetailList.append(devicedetails);
+
+ ret = connect(devicedetails.mSetting, SIGNAL(settingAvailabilityChanged(BtAbstractDevSetting *, bool)),
+ this, SLOT(handleSettingChange(BtAbstractDevSetting *, bool)));
+ BTUI_ASSERT_X( ret, "BtCpUiDeviceDetail::appendDeviceToList", "connect settingAvailabilityChanged() failed");
+
+}
+
+void BtCpUiDeviceDetail::handleSettingChange(BtAbstractDevSetting *setting, bool available)
+{
+ QList<BtDeviceDetails>::iterator i;
+ for (i = mDeviceDetailList.begin(); i != mDeviceDetailList.end(); ++i) {
+ if((setting == (*i).mSetting) && mDeviceDetailView) {
+ (*i).mSettingAvailable = available;
+ if(available) {
+ if(((*i).mSettingForm)) {
+ //If item already exists, remove it first.
+ mDeviceDetailView->removeItem((*i).mSettingForm);
+ }
+ (*i).mSettingForm = setting->getSettingWidget();
+ //add widget
+ mDeviceDetailView->addItem((*i).mSettingForm);
+ }
+ else {
+ if((*i).mSettingForm) {
+ //remove widget
+ //todo: In case if no items are there close this view
+ //and disable device settings button.
+ mDeviceDetailView->removeItem((*i).mSettingForm);
+ (*i).mSettingForm = 0;
+ }
+ }
+ notifyDeviceDetailStatus();
+ }
+ }
+}
+
+
+void BtCpUiDeviceDetail::notifyDeviceDetailStatus()
+{
+ QList<BtDeviceDetails>::const_iterator i;
+ bool devicedetail = false;
+
+ for (i = mDeviceDetailList.constBegin(); i != mDeviceDetailList.constEnd(); ++i) {
+ if(((*i).mSettingAvailable == true) && ((*i).mSettingForm) ) {
+ devicedetail = true;
+ break;
+ }
+ }
+ emit deviceSettingsChanged(devicedetail);
+}
+
+void BtCpUiDeviceDetail::clearDeviceDetailList()
+{
+ QList<BtDeviceDetails>::const_iterator i;
+
+ for (i = mDeviceDetailList.constBegin(); i != mDeviceDetailList.constEnd(); ++i) {
+ if((*i).mSetting ) {
+ disconnect((*i).mSetting);
+ delete (*i).mSetting;
+ }
+ }
+ mDeviceDetailList.clear();
+}
+
+void BtCpUiDeviceDetail::createDeviceDetailsView(QString deviceName)
+{
+ bool ret = false;
+ //Launch Device Detail View.
+ mDeviceDetailView = new BtCpUiDeviceDetailsView();
+ mDeviceDetailView->setDeviceName(deviceName);
+
+ ret = connect(mDeviceDetailView, SIGNAL(aboutToClose()), this,
+ SLOT(handleDeviceDetailViewClose()));
+ BTUI_ASSERT_X( ret, "BtCpUiDeviceDetail::loadDeviceDetailsView", "connect deviceDetailViewClosed() failed");
+
+ QList<BtDeviceDetails>::const_iterator i;
+
+ for (i = mDeviceDetailList.constBegin(); i != mDeviceDetailList.constEnd(); ++i) {
+ if((*i).mSettingForm) {
+ mDeviceDetailView->addItem((*i).mSettingForm);
+ }
+ }
+
+}
+
+void BtCpUiDeviceDetail::loadDeviceDetailsView()
+{
+
+ mPreviousView = mMainWindow->currentView();
+ mMainWindow->addView(mDeviceDetailView);
+
+ notifyViewStatusToPlugins(AboutToShow);
+
+ mMainWindow->setCurrentView( mDeviceDetailView );
+}
+
+void BtCpUiDeviceDetail::handleDeviceDetailViewClose()
+{
+ notifyViewStatusToPlugins(AboutToHide);
+
+ mMainWindow->removeView(mDeviceDetailView);
+
+ mMainWindow->setCurrentView( mPreviousView );
+
+}
+
+void BtCpUiDeviceDetail::notifyViewStatusToPlugins(BtCpUiDeviceDetail::NotifyType type)
+{
+ QList<BtDeviceDetails>::const_iterator i;
+ BtAbstractDevSetting *deviceSetting = 0;
+ for (i = mDeviceDetailList.constBegin(); i != mDeviceDetailList.constEnd(); ++i) {
+ deviceSetting = (*i).mSetting;
+ if(deviceSetting) {
+ switch(type) {
+ case AboutToShow:
+ deviceSetting->aboutToForeground();
+ break;
+ case AboutToHide:
+ deviceSetting->aboutToBackground();
+ break;
+ case AboutToClose:
+ deviceSetting->aboutToClose();
+ break;
+ }
+ }
+ }
+
+}
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpuidevicedetail.h Tue Jul 06 14:27:09 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:
+ *
+ */
+
+#ifndef BTCPUIDEVICEDETAIL_H
+#define BTCPUIDEVICEDETAIL_H
+
+#include <qobject.h>
+#include <btdevsettinginterface.h>
+#include <HbView>
+
+class BtCpUiDeviceView;
+class BtCpUiDeviceDetailsView;
+
+class BtDeviceDetails
+{
+public:
+ BtAbstractDevSetting *mSetting;
+ bool mSettingAvailable;
+ HbDataForm *mSettingForm;
+};
+
+
+class BtCpUiDeviceDetail : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit BtCpUiDeviceDetail( QObject *parent = 0 );
+
+ virtual ~BtCpUiDeviceDetail();
+
+ void loadDeviceDetailPlugins(QString deviceAddress, QString deviceName);
+
+ void loadDeviceDetailsView();
+
+signals:
+ void deviceSettingsChanged(bool settingAvailable);
+
+public slots:
+ void handleSettingChange(BtAbstractDevSetting *setting, bool available);
+ void handleDeviceDetailViewClose();
+
+private:
+ enum NotifyType {
+ AboutToShow,
+ AboutToHide,
+ AboutToClose,
+ };
+
+ void appendDeviceToList(BtAbstractDevSetting *devSetting);
+ void clearDeviceDetailList();
+ void notifyDeviceDetailStatus();
+ void createDeviceDetailsView(QString deviceName);
+ void notifyViewStatusToPlugins(BtCpUiDeviceDetail::NotifyType type);
+
+private:
+
+ HbMainWindow* mMainWindow;
+ QList<BtDeviceDetails> mDeviceDetailList;
+ BtCpUiDeviceDetailsView* mDeviceDetailView;
+ HbView *mPreviousView;
+
+};
+
+
+#endif /* BTCPUIDEVICEDETAIL_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpuidevicedetailsview.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,94 @@
+/*
+* 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: BtCpUiDeviceDetailsView implementation
+*
+*/
+#include <QtGlobal>
+#include <QGraphicsLinearLayout>
+#include <HbInstance>
+#include <hblabel.h>
+#include <hbmenu.h>
+#include <hbaction.h>
+#include <hbcombobox.h>
+#include <hbgroupbox.h>
+#include <bluetoothuitrace.h>
+#include "btcpuidevicedetailsview.h"
+
+// docml to load
+const char* BTUI_DEVICEDETAILSVIEW_DOCML = ":/docml/bt-device-details-view.docml";
+
+BtCpUiDeviceDetailsView::BtCpUiDeviceDetailsView(QGraphicsItem *parent)
+ :CpBaseSettingView( 0 , parent )
+{
+
+ mSoftKeyBackAction = new HbAction(Hb::BackNaviAction, this);
+ BTUI_ASSERT_X(mSoftKeyBackAction, "BtCpUiBaseView::BtCpUiBaseView", "can't create back action");
+
+ // Create view for the application.
+ // Set the name for the view. The name should be same as the view's
+ // name in docml.
+ setObjectName("bt_device_details_view");
+
+ mLoader = new HbDocumentLoader();
+ // Pass the view to documentloader. Document loader uses this view
+ // when docml is parsed, instead of creating new view.
+ QObjectList objectList;
+ objectList.append(this);
+ mLoader->setObjectTree(objectList);
+
+ // read view info from docml file
+ bool ok = false;
+ mLoader->load( BTUI_DEVICEDETAILSVIEW_DOCML, &ok );
+ // Exit if the file format is invalid
+ BTUI_ASSERT_X( ok, "bt-device-details-view", "Invalid docml file" );
+
+ mLayout = new QGraphicsLinearLayout(Qt::Vertical, this);
+ mGroupBox = new HbGroupBox();
+ mLayout->addItem(mGroupBox);
+
+ setLayout( mLayout );
+
+}
+
+BtCpUiDeviceDetailsView::~BtCpUiDeviceDetailsView()
+{
+
+}
+
+void BtCpUiDeviceDetailsView::setDeviceName(const QString &deviceName)
+{
+ //todo: use Localised string Id.
+ QString heading(hbTrId("%1 details"));
+
+ if(mGroupBox) {
+ mGroupBox->setHeading(heading.arg(deviceName));
+ }
+}
+
+void BtCpUiDeviceDetailsView::addItem(HbDataForm *item)
+{
+ if (item && mLayout) {
+ mLayout->addItem(item);
+ }
+}
+
+void BtCpUiDeviceDetailsView::removeItem(HbDataForm *item)
+{
+ if (item && mLayout) {
+ //todo: with out this item is not removed from the view.
+ item->setVisible(false);
+ mLayout->removeItem(item);
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/btcpuidevicedetailsview.h Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* 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: BtCpUiDeviceDetailsView declaration
+*/
+
+#ifndef BTCPUIDEVICEDETAILSVIEW_H_
+#define BTCPUIDEVICEDETAILSVIEW_H_
+
+#include <hbview.h>
+#include <qglobal.h>
+#include <hbdataform.h>
+#include <hbgroupbox.h>
+#include <hbdocumentloader.h>
+#include <cpbasesettingview.h>
+#include <QGraphicsLinearLayout>
+
+class BtCpUiDeviceDetailsView : public CpBaseSettingView
+{
+ Q_OBJECT
+
+public:
+
+ explicit BtCpUiDeviceDetailsView(QGraphicsItem *parent = 0);
+
+ virtual ~BtCpUiDeviceDetailsView();
+
+ void setDeviceName(const QString &deviceName);
+ void addItem(HbDataForm *item);
+ void removeItem(HbDataForm *item);
+
+
+protected:
+ HbDocumentLoader *mLoader;
+ HbAction *mSoftKeyBackAction;
+
+ QGraphicsLinearLayout *mLayout;
+ HbGroupBox *mGroupBox;
+
+ Q_DISABLE_COPY(BtCpUiDeviceDetailsView)
+};
+
+#endif /* BTCPUIDEVICEDETAILSVIEW_H_ */
--- a/bluetoothengine/btui/btcpplugin/btcpuideviceview.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/btcpuideviceview.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -41,6 +41,8 @@
#include "btuiiconutil.h"
#include "btuidevtypemap.h"
+#include "btcpuidevicedetail.h"
+
// docml to load
const char* BTUI_DEVICEVIEW_DOCML = ":/docml/bt-device-view.docml";
@@ -51,7 +53,7 @@
QGraphicsItem *parent) :
BtCpUiBaseView(settingModel,deviceModel,parent),
mPairedStatus(false), mConnectedStatus(false), mTrustedStatus(false), mBlockedStatus(false),
- mConnectable(false), mAbstractDelegate(0)
+ mConnectable(false), mAbstractDelegate(0), mDeviceDetail(0)
{
mDeviceIndex = QModelIndex();//is it needed to initialize mIndex???
@@ -146,10 +148,14 @@
mDeviceSetting = 0;
mDeviceSetting = qobject_cast<HbPushButton *>( mLoader->findWidget( "pushButton_2" ) );
BTUI_ASSERT_X( mDeviceSetting != 0, "bt-device-view", "settings button not found" );
-
+
+
+ ret = connect(mDeviceSetting, SIGNAL(clicked()), this,
+ SLOT(handleDeviceSetting()));
+ BTUI_ASSERT_X( ret, "Btui, BtCpUiDeviceView::BtCpUiDeviceView", "clicked() connect failed");
+
setConnectionCombobox();
-
-
+
}
BtCpUiDeviceView::~BtCpUiDeviceView()
@@ -165,6 +171,7 @@
delete mAbstractDelegate;
mAbstractDelegate = 0;
}
+
}
@@ -180,11 +187,13 @@
{
BTUI_ASSERT_X(mMainView, "BtCpUiSearchView::switchToPreviousView", "invalid mMainView");
mMainView->switchToPreviousView();
+ delete mDeviceDetail;
+ mDeviceDetail = 0;
}
-void BtCpUiDeviceView::activateView( const QVariant& value, int cmdId )
+void BtCpUiDeviceView::activateView( const QVariant& value, bool fromBackButton )
{
- Q_UNUSED(cmdId);
+ Q_UNUSED( fromBackButton );
setSoftkeyBack();
@@ -195,10 +204,32 @@
//clearViewData();
updateDeviceData();
+ mDeviceSetting->setVisible(false);
+
+ mDeviceDetail = new BtCpUiDeviceDetail();
+
bool ret(false);
ret=connect(mDeviceModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(updateDeviceData()));
BTUI_ASSERT_X( ret, "Btui, BtCpUiDeviceView::activateView", "dataChanged() connect failed");
+
+ ret=connect(mDeviceDetail, SIGNAL(deviceSettingsChanged(bool)),
+ this, SLOT(handleDeviceSettingsChange(bool)));
+ BTUI_ASSERT_X( ret, "Btui, BtCpUiDeviceView::activateView", "deviceSettingsChanged() connect failed");
+
+
+ mDeviceDetail->loadDeviceDetailPlugins(mDeviceBdAddr.toString(), mDeviceName->text());
+
+}
+
+void BtCpUiDeviceView::handleDeviceSettingsChange(bool status)
+{
+ mDeviceSetting->setVisible(status);
+}
+
+void BtCpUiDeviceView::handleDeviceSetting()
+{
+ mDeviceDetail->loadDeviceDetailsView();
}
void BtCpUiDeviceView::deactivateView()
@@ -238,13 +269,6 @@
void BtCpUiDeviceView::updateDeviceData()
{
clearViewData();
- // ToDo: the groupbox header should only say "Bluetooth", ie. without device name;
- // check new TextMap file for the right TextId
- /*QModelIndex localIndex = mSettingModel->index( BtSettingModel::LocalBtNameRow, 0);
- QString localName = (mSettingModel->data(localIndex,BtSettingModel::settingDisplayRole)).toString();
- QString groupBoxTitle (hbTrId("txt_bt_subhead_bluetooth_1").arg(localName));
- mGroupBox->setHeading(groupBoxTitle);
- */
//Get the QModelIndex of the device using the device BDAddres
QModelIndex start = mDeviceModel->index(0,0);
QModelIndexList indexList = mDeviceModel->match(start,BtDeviceModel::ReadableBdaddrRole, mDeviceBdAddr);
@@ -258,14 +282,13 @@
int cod = (mDeviceModel->data(mDeviceIndex,BtDeviceModel::CoDRole)).toInt();
int majorRole = (mDeviceModel->data(mDeviceIndex,BtDeviceModel::MajorPropertyRole)).toInt();
- int minorRole = (mDeviceModel->data(mDeviceIndex,BtDeviceModel::MinorPropertyRole)).toInt();
- setDeviceCategory(cod, majorRole, minorRole);
+ setDeviceCategory(cod, majorRole);
setDeviceStatus(majorRole);
setTextAndVisibilityOfButtons();
}
-void BtCpUiDeviceView::setDeviceCategory(int cod,int majorRole, int minorRole)
+void BtCpUiDeviceView::setDeviceCategory(int cod,int majorRole)
{
mDeviceCategory->setPlainText( getDeviceTypeString( cod ));
HbIcon icon =
@@ -273,12 +296,9 @@
BtuiBottomLeft | BtuiBottomRight | BtuiTopLeft | BtuiTopRight );
mDeviceIcon->setIcon(icon);
- if (majorRole & BtuiDevProperty::AVDev) {
- if ( minorRole & BtuiDevProperty::Headset){
- // this is a Headset, it is possible to connect
- mConnectable = true;
- }
- }
+ if (majorRole & BtuiDevProperty::Connectable ) {
+ mConnectable = true;
+ }
}
void BtCpUiDeviceView::setDeviceStatus(int majorRole)
@@ -405,8 +425,6 @@
mConnect_Disconnect->setVisible(false);
}
- mDeviceSetting->setVisible(false);
-
}
--- a/bluetoothengine/btui/btcpplugin/btcpuideviceview.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/btcpuideviceview.h Tue Jul 06 14:27:09 2010 +0300
@@ -35,7 +35,7 @@
//class HbDataFormModelItem;
class CpSettingFormItemData;
class BtAbstractDelegate;
-
+class BtCpUiDeviceDetail;
class BtCpUiDeviceView : public BtCpUiBaseView
{
@@ -47,10 +47,10 @@
BtDeviceModel &deviceModel,
QGraphicsItem *parent = 0);
virtual ~BtCpUiDeviceView();
- virtual void activateView( const QVariant& value, int cmdId );
+ virtual void activateView( const QVariant& value, bool fromBackButton );
virtual void deactivateView();
virtual void setSoftkeyBack();
-
+
public slots:
virtual void switchToPreviousView();
@@ -64,14 +64,16 @@
void connectDelegateCompleted(int status);
void disconnectDelegateCompleted(int status);
void changeDevNameDelegateCompleted(int status, QVariant param);
-
+ void handleDeviceSetting();
+ void handleDeviceSettingsChange(bool status);
+
private:
void clearViewData();
void pairDevice();
void unpairDevice();
void connectDevice();
void disconnectDevice();
- void setDeviceCategory(int cod, int majorRole, int minorRole);//cod:class of device
+ void setDeviceCategory(int cod, int majorRole);//cod:class of device
void setDeviceStatus(int majorRole);
void setConnectionCombobox();
void setTextAndVisibilityOfButtons();
@@ -120,6 +122,7 @@
BtAbstractDelegate* mAbstractDelegate;
+ BtCpUiDeviceDetail* mDeviceDetail;
};
--- a/bluetoothengine/btui/btcpplugin/btcpuimainlistviewitem.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/btcpuimainlistviewitem.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -34,9 +34,9 @@
BtCpUiMainListViewItem::~BtCpUiMainListViewItem()
{
- delete mDeviceNameLabel;
- delete mDevTypeIconLabel;
- delete mDevTypeTextLabel;
+// delete mDeviceNameLabel;
+// delete mDevTypeIconLabel;
+// delete mDevTypeTextLabel;
}
/*
--- a/bluetoothengine/btui/btcpplugin/btcpuimainview.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/btcpuimainview.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -110,8 +110,8 @@
// if setting 1 min --> "(s)Visible for 1 min", ie p=plural, s=singular, but these should
// not be shown to the user!
// ToDo: change this to use translation once it starts working
-// QString tempVis(hbTrId("txt_bt_setlabel_visibility_val_visible_for_l1_min", TEMP_VISIBILITY_DEFAULT));
- QString tempVis(hbTrId("Visible for 5 min"));
+ QString tempVis(hbTrId("txt_bt_setlabel_visibility_val_visible_for_l1_min", 5));
+ //QString tempVis(hbTrId("Visible for 5 min"));
mVisibilityMode->addItem(tempVis, Qt::DisplayRole);
mDeviceList=0;
@@ -141,7 +141,7 @@
// load tool bar actions
mPairAction = static_cast<HbAction*>( mLoader->findObject( "pairedAction" ) );
BTUI_ASSERT_X( mPairAction, "bt-main-view", "Pair action missing" );
- ret = connect(mPairAction, SIGNAL(triggered()), this, SLOT(pairActiontriggered()));
+ ret = connect(mPairAction, SIGNAL(triggered()), this, SLOT(pairActionTriggered()));
BTUI_ASSERT_X( ret, "bt-main-view", "pair action can't connect" );
mGroupBox = qobject_cast<HbGroupBox *>( mLoader->findWidget( "groupBox" ) );
@@ -209,10 +209,10 @@
/*!
from base class, initialize the view
*/
-void BtCpUiMainView::activateView(const QVariant& value, int cmdId )
+void BtCpUiMainView::activateView(const QVariant& value, bool fromBackButton )
{
Q_UNUSED(value);
- Q_UNUSED(cmdId);
+ Q_UNUSED(fromBackButton);
}
@@ -226,7 +226,7 @@
void BtCpUiMainView::goToDiscoveryView()
{
- changeView( SearchView, false, 0 );
+ changeView( SearchView, false );
}
void BtCpUiMainView::goToDeviceView(const QModelIndex& modelIndex)
@@ -234,7 +234,7 @@
//the QModelIndex of the selected device should be given as parameter here
QVariant params;
params.setValue(modelIndex);
- changeView( DeviceView, false, 0, params );
+ changeView( DeviceView, false, params );
}
Qt::Orientation BtCpUiMainView::orientation()
@@ -258,8 +258,8 @@
void BtCpUiMainView::setPrevBtLocalName()
{
- //Should we notify user this as Error...?
- HbNotificationDialog::launchDialog(hbTrId("Error")); // ToDo: missing text id
+ //ToDo: Should we notify user this as Error...?
+ //HbNotificationDialog::launchDialog(hbTrId("Error"));
QModelIndex index = mSettingModel->index( BtSettingModel::LocalBtNameRow,0 );
mDeviceNameEdit->setText( mSettingModel->data(
@@ -324,7 +324,7 @@
updateDeviceListFilter(BtuiAll);
}
-void BtCpUiMainView::pairActiontriggered()
+void BtCpUiMainView::pairActionTriggered()
{
updateDeviceListFilter(BtuiPaired);
}
@@ -543,12 +543,11 @@
/*!
Switch between the views.
- Parameter cmdId is used for automatically executing command.
Parameter "value" is optional except for GadgetView,
- which needs the BT address (QString)
+ which needs the QModelIndex of device
*/
void BtCpUiMainView::changeView(int targetViewId, bool fromBackButton,
- int cmdId, const QVariant& value )
+ const QVariant& value )
{
mCurrentView->deactivateView();
@@ -557,14 +556,8 @@
// the previous viewId of target view should not be changed.
// Otherwise, loop happens between two views.
if(!fromBackButton) {
- if ((targetViewId == DeviceView) && (mCurrentViewId == SearchView)) {
- // we don't want to return to search view after e.g. pairing a new device
- mPreviousViewIds[ targetViewId ] = MainView;
- }
- else {
- // normal case: return to previous view
- mPreviousViewIds[ targetViewId ] = mCurrentViewId;
- }
+ // normal case: return to previous view
+ mPreviousViewIds[ targetViewId ] = mCurrentViewId;
}
// set the new current view
@@ -573,7 +566,7 @@
mMainWindow->setCurrentView( mCurrentView );
// do preparation or some actions when new view is activated
- mCurrentView->activateView( value, cmdId );
+ mCurrentView->activateView( value, fromBackButton );
}
@@ -584,7 +577,7 @@
QVariant params;
params.setValue(index);
- changeView( DeviceView, false, 0, params );
+ changeView( DeviceView, false, params );
}
BtCpUiBaseView * BtCpUiMainView::idToView(int targetViewId)
@@ -604,7 +597,7 @@
void BtCpUiMainView::setSoftkeyBack()
{
-
+ // not needed in main view
}
/*!
@@ -614,12 +607,8 @@
*/
void BtCpUiMainView::switchToPreviousView()
{
- // jump to previous view of current view.
- if( (mCurrentViewId >= 0) && (mCurrentViewId < LastView)) {
- changeView( mPreviousViewIds[mCurrentViewId], true, 0 );
- }
- else {
- BTUI_ASSERT_X(false, "BtCpUiMainView::switchToPreviousView", "invalid view id");
- }
+ BTUI_ASSERT_X( (mCurrentViewId >= 0) && (mCurrentViewId < LastView),
+ "BtCpUiMainView::switchToPreviousView", "invalid view id");
+ changeView( mPreviousViewIds[mCurrentViewId], true );
}
--- a/bluetoothengine/btui/btcpplugin/btcpuimainview.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/btcpuimainview.h Tue Jul 06 14:27:09 2010 +0300
@@ -50,33 +50,30 @@
// from base class BtCpUiBaseView
virtual void setSoftkeyBack();
- virtual void activateView( const QVariant& value, int cmdId );
+ virtual void activateView( const QVariant& value, bool fromBackButton );
virtual void deactivateView();
public slots:
void changeOrientation( Qt::Orientation orientation );
void changePowerState();
+ void visibilityChanged (int index);
+ void changeBtLocalName();
void updateSettingItems(const QModelIndex &topLeft, const QModelIndex &bottomRight);
void deviceSelected(const QModelIndex& modelIndex);
void goToDiscoveryView();
void goToDeviceView(const QModelIndex& modelIndex);
-
- // from view manager
- void changeView(int targetViewId, bool fromBackButton, int cmdId, const QVariant& value = 0 );
virtual void switchToPreviousView();
-
- void visibilityChanged (int index);
- void changeBtLocalName();
-
+
//from delegate classes
void powerDelegateCompleted(int status);
void visibilityDelegateCompleted(int status);
void btNameDelegateCompleted(int status, QVariant param);
void allActionTriggered();
- void pairActiontriggered();
+ void pairActionTriggered();
-protected:
+private slots:
+ void changeView(int targetViewId, bool fromBackButton, const QVariant& value = 0 );
private:
enum filterType {
--- a/bluetoothengine/btui/btcpplugin/btcpuisearchlistviewitem.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/btcpuisearchlistviewitem.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -34,9 +34,9 @@
BtCpUiSearchListViewItem::~BtCpUiSearchListViewItem()
{
- delete mDeviceNameLabel;
- delete mDevTypeIconLabel;
- delete mDevTypeTextLabel;
+// delete mDeviceNameLabel;
+// delete mDevTypeIconLabel;
+// delete mDevTypeTextLabel;
}
/*
--- a/bluetoothengine/btui/btcpplugin/btcpuisearchview.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/btcpuisearchview.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -48,7 +48,7 @@
{
bool ret(false);
- mLastSelectionIndex = 0;
+ mQuery = 0;
mMainView = (BtCpUiMainView *) parent;
mMainWindow = hbInstance->allMainWindows().first();
@@ -121,7 +121,6 @@
// load tool bar actions
mViewBy = static_cast<HbAction*>( mLoader->findObject( "viewByAction" ) );
BTUI_ASSERT_X( mViewBy, "bt-search-view", "view by action missing" );
-// TODO - Need to implement the View by
ret = connect(mViewBy, SIGNAL(triggered()), this, SLOT(viewByDeviceTypeDialog()));
BTUI_ASSERT_X( ret, "bt-search-view", "viewByAction can't connect" );
@@ -161,6 +160,34 @@
<< hbTrId("txt_bt_list_input_devices")
<< hbTrId("txt_bt_list_phones")
<< hbTrId("txt_bt_list_other_devices");
+
+ // initialize sort model & create
+ // inquiry delegate
+ // Sort is set to dynamic sort filter = true in the class, will sort automatically
+ mBtuiModelSortFilter = new BtuiModelSortFilter(this);
+ mBtuiModelSortFilter->setSourceModel(mDeviceModel);
+ mBtuiModelSortFilter->addDeviceMajorFilter(
+ BtuiDevProperty::InRange, BtuiModelSortFilter::AtLeastMatch);
+ mDeviceList->setModel(mBtuiModelSortFilter);
+ // add sort order to show devices in the order they are found
+ mBtuiModelSortFilter->setSortRole(BtDeviceModel::SeqNumRole);
+ // Sort according to the first column (and the only column) in the listview - sorted according SeqNumRole
+ mBtuiModelSortFilter->sort(0, Qt::AscendingOrder);
+
+ BtCpUiSearchListViewItem *prototype = new BtCpUiSearchListViewItem(mDeviceList);
+ prototype->setModelSortFilter(mBtuiModelSortFilter);
+ mDeviceList->setItemPrototype(prototype);
+
+ // Create the inquiry delegate.
+ mAbstractDelegate = BtDelegateFactory::newDelegate(BtDelegate::Inquiry, mSettingModel, mDeviceModel );
+
+ // Connect to the signal from the BtDelegateInquiry for completion of the search request
+ ret = connect(mAbstractDelegate, SIGNAL(commandCompleted(int)), this, SLOT(searchDelegateCompleted(int)));
+ BTUI_ASSERT_X( ret, "bt-search-view", "searchDelegateCompleted can't connect" );
+
+ // Connect to the signal from the BtuiModel when the search has been completed.
+ ret = connect(mDeviceModel, SIGNAL(deviceSearchCompleted(int)), this, SLOT(deviceSearchCompleted(int)));
+ BTUI_ASSERT_X( ret, "bt-search-view", "deviceSearchCompleted can't connect" );
}
BtCpUiSearchView::~BtCpUiSearchView()
@@ -174,16 +201,20 @@
if(mAbstractDelegate) {
delete mAbstractDelegate;
}
-
if(mBtuiModelSortFilter) {
delete mBtuiModelSortFilter;
}
+ if ( mQuery ) {
+ delete mQuery;
+ }
}
void BtCpUiSearchView::changeOrientation( Qt::Orientation orientation )
{
+ // ToDo: this does not handle redrawing list view items differently for portrait/landscape
bool ok = false;
mOrientation = orientation;
+
if( orientation == Qt::Vertical ) {
// load "portrait" section
mLoader->load( BTUI_SEARCHVIEW_DOCML, "portrait_ui", &ok );
@@ -198,47 +229,36 @@
void BtCpUiSearchView::viewByDeviceTypeDialog()
{
- HbSelectionDialog *query = new HbSelectionDialog;
- query->setStringItems(mDevTypeList, mLastSelectionIndex);
- query->setSelectionMode(HbAbstractItemView::MultiSelection);
-
- QList<QVariant> current;
- current.append(QVariant(0));
- query->setSelectedItems(current);
-
- query->setAttribute(Qt::WA_DeleteOnClose);
+ if ( !mQuery ) {
+ mQuery = new HbSelectionDialog;
+ mQuery->setStringItems(mDevTypeList, 0);
+ mQuery->setSelectionMode(HbAbstractItemView::MultiSelection);
- // Set the heading for the dialog.
- HbLabel *headingLabel = new HbLabel(hbTrId("txt_bt_title_show"), query);
- query->setHeadingWidget(headingLabel);
-
-
- query->open(this,SLOT(viewByDialogClosed(HbAction*)));
+ QList<QVariant> current;
+ current.append(QVariant(0));
+ mQuery->setSelectedItems(current);
+
+ // Set the heading for the dialog.
+ HbLabel *headingLabel = new HbLabel(hbTrId("txt_bt_title_show"), mQuery);
+ mQuery->setHeadingWidget(headingLabel);
+ }
+ mQuery->open(this,SLOT(viewByDialogClosed(HbAction*)));
}
/*!
- Callback for dialog closing
- ToDo: this API might change in the future, see e-mails in Orbit-dev list,
- e.g. 27.4.2010 Raju Abhilash
+ Callback for HbSelectionDialog closing
+
*/
void BtCpUiSearchView::viewByDialogClosed(HbAction* action)
{
- HbSelectionDialog *dlg = (HbSelectionDialog*)(sender());
- bool first = true;
-
- if (action == dlg->actions().first()) { // user pressed "Ok"
+ disconnect( mQuery ); // remove slot
+ if (action == mQuery->actions().first()) { // user pressed "Ok"
// Get selected items.
QList<QVariant> selections;
- selections = dlg->selectedItems();
-// QString result;
+ selections = mQuery->selectedItems();
+
int devTypesWanted = 0;
+
for (int i=0; i < selections.count(); i++) {
-// result += mDevTypeList.at(selections.at(i).toInt()) + " ";
- if (first) {
- // this will be used as default value when opening dialog again
- // there is no way to specify multiple default values with HbSelectionDialog
- mLastSelectionIndex = selections.at(i).toInt();
- first = false;
- }
switch (selections.at(i).toInt()) {
case BtUiDevAudioDevice:
devTypesWanted |= BtuiDevProperty::AVDev;
@@ -266,7 +286,6 @@
"wrong device type in viewBy dialog!");
}
}
-// qDebug() << result << "bits " << devTypesWanted;
if (devTypesWanted) {
mBtuiModelSortFilter->clearDeviceMajorFilters();
mBtuiModelSortFilter->addDeviceMajorFilter(BtuiDevProperty::InRange,
@@ -274,59 +293,38 @@
mBtuiModelSortFilter->addDeviceMajorFilter(devTypesWanted,
BtuiModelSortFilter::RoughMatch); // device can be any one of selected ones
}
+ mBtuiModelSortFilter->sort(0, Qt::AscendingOrder);
}
}
void BtCpUiSearchView::stopSearching()
{
- // Stop delegate
+ // Stop searching
// Change label and buttons to reflect status
mLabelSearching->setPlainText(hbTrId("txt_bt_subhead_search_done"));
mRetry->setEnabled(true);
mStop->setEnabled(false);
- // Stop delegate
+ // Stop search delegate
mAbstractDelegate->cancel();
}
void BtCpUiSearchView::startSearchDelegate ()
{
- bool ret(false);
-
- if(mAbstractDelegate) {
- mAbstractDelegate->cancel();
- disconnect( mAbstractDelegate );
- delete mAbstractDelegate;
- mAbstractDelegate = 0;
- }
- // Create the inquiry delegate.
- mAbstractDelegate = BtDelegateFactory::newDelegate(BtDelegate::Inquiry, mSettingModel, mDeviceModel );
-
- // Connect to the signal from the BtDelegateInquiry for completion of the search request
- ret = connect(mAbstractDelegate, SIGNAL(commandCompleted(int)), this, SLOT(searchDelegateCompleted(int)));
- BTUI_ASSERT_X( ret, "bt-search-view", "searchDelegateCompleted can't connect" );
-
- // Connect to the signal from the BtuiModel when the search has been completed.
- ret = connect(mDeviceModel, SIGNAL(deviceSearchCompleted(int)), this, SLOT(deviceSearchCompleted(int)));
- BTUI_ASSERT_X( ret, "bt-search-view", "deviceSearchCompleted can't connect" );
mAbstractDelegate->exec(QVariant());
}
void BtCpUiSearchView::retrySearch()
{
- // Retry delegate
+ // Retry search
// Change label and buttons to reflect status
mLabelSearching->setPlainText(hbTrId("txt_bt_subhead_searching"));
mRetry->setEnabled(false);
mStop->setEnabled(true);
- BtCpUiSearchListViewItem *prototype = new BtCpUiSearchListViewItem(mDeviceList);
- prototype->setModelSortFilter(mBtuiModelSortFilter);
- mDeviceList->setItemPrototype(prototype);
-
// Make use of the delegate and start the search.
startSearchDelegate ();
}
@@ -345,41 +343,31 @@
mMainView->switchToPreviousView();
}
-void BtCpUiSearchView::activateView( const QVariant& value, int cmdId )
+void BtCpUiSearchView::activateView( const QVariant& value, bool fromBackButton )
{
Q_UNUSED(value);
- Q_UNUSED(cmdId);
+
+ // ToDo: consider whether orientation should be updated here rather than when orientation really changes;
+ // advantage: if orientation changes temporarily in another view, but returns to previous setting before
+ // search is reactived, there is no processing overhead
setSoftkeyBack();
- if(!mBtuiModelSortFilter) {
- mBtuiModelSortFilter = new BtuiModelSortFilter(this);
+ if ( !fromBackButton ) {
+ startSearchDelegate();
}
- mBtuiModelSortFilter->setSourceModel(mDeviceModel);
- mBtuiModelSortFilter->addDeviceMajorFilter(
- BtuiDevProperty::InRange, BtuiModelSortFilter::AtLeastMatch);
- mDeviceList->setModel(mBtuiModelSortFilter);
-
- BtCpUiSearchListViewItem *prototype = new BtCpUiSearchListViewItem(mDeviceList);
- prototype->setModelSortFilter(mBtuiModelSortFilter);
- mDeviceList->setItemPrototype(prototype);
-
- // Make use of the delegate and start the search.
- startSearchDelegate ();
}
void BtCpUiSearchView::deactivateView()
{
- if( mAbstractDelegate ) {
- disconnect( mAbstractDelegate );
- }
- disconnect( mDeviceModel );
+ mAbstractDelegate->cancel(); // Stop searching when leaving view
+ deviceSearchCompleted(KErrNone); // reset view
}
void BtCpUiSearchView::searchDelegateCompleted(int error)
{
- //TODO - handle error.
Q_UNUSED(error);
+
}
void BtCpUiSearchView::deviceSearchCompleted(int error)
--- a/bluetoothengine/btui/btcpplugin/btcpuisearchview.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/btcpuisearchview.h Tue Jul 06 14:27:09 2010 +0300
@@ -30,6 +30,7 @@
class HbDocumentLoader;
class HbListView;
class BtAbstractDelegate;
+class HbSelectionDialog;
class BtCpUiSearchView : public BtCpUiBaseView
{
@@ -42,7 +43,7 @@
BtDeviceModel &deviceModel,
QGraphicsItem *parent = 0);
virtual ~BtCpUiSearchView();
- virtual void activateView( const QVariant& value, int cmdId );
+ virtual void activateView( const QVariant& value, bool fromBackButton );
virtual void deactivateView();
virtual void setSoftkeyBack();
@@ -75,18 +76,13 @@
HbLabel *mLabelSearching;
HbListView *mDeviceList;
QStringList mDevTypeList;
- int mLastSelectionIndex;
+ HbSelectionDialog *mQuery;
- // data structures for switching between views
- bool mEventFilterInstalled;
- int mAutoCmdId;
Qt::Orientation mOrientation;
HbMainWindow* mMainWindow;
BtCpUiBaseView* mMainView;
- BtCpUiBaseView* mDeviceView;
HbAction * mSoftKeyBackAction;
- HbToolBar* mToolBar;
HbAction* mViewBy;
HbAction* mStop;
HbAction* mRetry;
@@ -95,8 +91,6 @@
//pointer to abstract delegate, and it is instantiated at runtime
BtAbstractDelegate* mAbstractDelegate;
- QModelIndex* mParentIndex;
- int mNumOfRows;
BtuiModelSortFilter* mBtuiModelSortFilter;
};
--- a/bluetoothengine/btui/btcpplugin/btcpuisettingitem.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/btcpuisettingitem.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -27,8 +27,8 @@
{
bool ret(false);
loadTranslators();
- mSettingModel = new BtSettingModel();
- mDeviceModel = new BtDeviceModel();
+ mSettingModel = new BtSettingModel(this);
+ mDeviceModel = new BtDeviceModel(this);
ret = connect(mSettingModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(handleDataChanged(QModelIndex,QModelIndex)));
@@ -40,9 +40,6 @@
BtCpUiSettingItem::~BtCpUiSettingItem()
{
- delete mSettingModel;
- delete mDeviceModel;
-
delete mViewTranslator;
delete mDialogTranslator;
}
--- a/bluetoothengine/btui/btcpplugin/docml/bt-advanced-view.docml Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/docml/bt-advanced-view.docml Tue Jul 06 14:27:09 2010 +0300
@@ -65,7 +65,7 @@
<linearitem itemname="container"/>
</layout>
</widget>
- <string locid="Control Panel" name="title" value="Control Panel"/>
+ <string locid="txt_cp_title_control_panel" name="title" value="Control Panel"/>
</widget>
<section name="landscape">
<widget name="visibilityContainer" type="HbWidget">
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btcpplugin/docml/bt-device-details-view.docml Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.1">
+ <object name="exit" type="HbAction">
+ <string locid="txt_common_opt_exit" name="text" value="Exit"/>
+ </object>
+ <widget name="bt_device_details_view" type="HbView">
+ <string locid="txt_tsw_caption_control_panel" name="title" value="Control Panel"/>
+ </widget>
+ <section name="portrait"/>
+ <section name="landscape"/>
+ <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ <uistate name="portrait" sections="#common"/>
+ <uistate name="portrait_UI" sections="#common portrait"/>
+ <uistate name="landscape" sections="#common landscape"/>
+ </metadata>
+</hbdocument>
--- a/bluetoothengine/btui/btcpplugin/docml/bt-device-view.docml Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/docml/bt-device-view.docml Tue Jul 06 14:27:09 2010 +0300
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<hbdocument version="1.1">
<object name="Menu_item_exit" type="HbAction">
- <string name="text" value="Exit"/>
+ <string locid="txt_common_opt_exit" name="text" value="Exit"/>
</object>
<widget name="bt_device_view" type="HbView">
<widget name="content" role="HbView:widget" type="HbWidget">
@@ -97,7 +97,7 @@
<widget name="viewMenu" role="HbView:menu" type="HbMenu">
<ref object="Menu_item_exit" role="HbWidget:addAction"/>
</widget>
- <string name="title" value="Control Panel"/>
+ <string locid="txt_cp_title_control_panel" name="title" value="Control Panel"/>
</widget>
<section name="landscape">
<widget name="content" role="HbView:widget" type="HbWidget">
@@ -131,9 +131,36 @@
</widget>
</section>
<section name="portrait">
- <widget name="connectionCombobox" type="HbDataForm">
- <enums name="selectionMode" value="NoSelection"/>
- </widget>
+ <widget name="content" role="HbView:widget" type="HbWidget">
+ <layout type="anchor">
+ <anchoritem dst="groupBox_deviceView" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="groupBox_deviceView" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="groupBox_deviceView" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="deviceIcon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+ <anchoritem dst="deviceIcon" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="groupBox_deviceView" srcEdge="BOTTOM"/>
+ <anchoritem dst="deviceName" dstEdge="LEFT" spacing="2un" src="deviceIcon" srcEdge="RIGHT"/>
+ <anchoritem dst="deviceName" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="groupBox_deviceView" srcEdge="BOTTOM"/>
+ <anchoritem dst="deviceName" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="deviceStatus" dstEdge="LEFT" spacing="12un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="deviceStatus" dstEdge="TOP" spacing="var(hb-param-margin-gene-bottom)" src="deviceCategory" srcEdge="BOTTOM"/>
+ <anchoritem dst="deviceStatus" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="deviceCategory" dstEdge="LEFT" spacing="2un" src="deviceIcon" srcEdge="RIGHT"/>
+ <anchoritem dst="deviceCategory" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="deviceName" srcEdge="BOTTOM"/>
+ <anchoritem dst="deviceCategory" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="pushButton_2" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-left) )" src="" srcEdge="LEFT"/>
+ <anchoritem dst="pushButton_2" dstEdge="TOP" spacing="expr(var(hb-param-margin-gene-bottom) )" src="pushButton_1" srcEdge="BOTTOM"/>
+ <anchoritem dst="pushButton_2" dstEdge="RIGHT" spacing="expr(-var(hb-param-margin-gene-right) )" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="connectionCombobox" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="connectionCombobox" dstEdge="TOP" spacing="expr(var(hb-param-margin-gene-top) )" src="deviceStatus" srcEdge="BOTTOM"/>
+ <anchoritem dst="connectionCombobox" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="pushButton_1" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-left) )" src="" srcEdge="LEFT"/>
+ <anchoritem dst="pushButton_1" dstEdge="TOP" spacing="expr(var(hb-param-margin-gene-middle-vertical) )" src="pushButton_0" srcEdge="BOTTOM"/>
+ <anchoritem dst="pushButton_1" dstEdge="RIGHT" spacing="expr(-var(hb-param-margin-gene-right) )" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="pushButton_0" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-left) )" src="" srcEdge="LEFT"/>
+ <anchoritem dst="pushButton_0" dstEdge="TOP" spacing="expr(var(hb-param-margin-gene-top) )" src="connectionCombobox" srcEdge="BOTTOM"/>
+ <anchoritem dst="pushButton_0" dstEdge="RIGHT" spacing="expr(-var(hb-param-margin-gene-right) )" src="" srcEdge="RIGHT"/>
+ </layout>
+ </widget>
</section>
<metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
<uistate name="Common ui state" sections="#common"/>
--- a/bluetoothengine/btui/btcpplugin/docml/bt-main-view.docml Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/docml/bt-main-view.docml Tue Jul 06 14:27:09 2010 +0300
@@ -130,7 +130,7 @@
<ref object="removePairedDevices" role="HbWidget:addAction"/>
<ref object="exit" role="HbWidget:addAction"/>
</widget>
- <string locid="txt_tsw_caption" name="title" value="Control Panel"/>
+ <string locid="txt_cp_title_control_panel" name="title" value="Control Panel"/>
</widget>
<section name="portrait">
<widget name="container" type="HbWidget">
--- a/bluetoothengine/btui/btcpplugin/docml/bt-search-view.docml Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btcpplugin/docml/bt-search-view.docml Tue Jul 06 14:27:09 2010 +0300
@@ -82,7 +82,7 @@
<ref object="exitAction" role="HbWidget:addAction"/>
<ref object="connectAction" role="HbWidget:addAction"/>
</widget>
- <string name="title" value="Control Panel"/>
+ <string locid="txt_cp_title_control_panel" name="title" value="Control Panel"/>
<real name="z" value="1"/>
</widget>
<section name="landscape">
--- a/bluetoothengine/btui/btdevsettingframework/btdevsettingframework.pro Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btdevsettingframework/btdevsettingframework.pro Tue Jul 06 14:27:09 2010 +0300
@@ -19,30 +19,28 @@
MOC_DIR = moc
DEFINES += BUILD_BTDEVSETTINGFRAMEWORK
-
-INCLUDEPATH += inc
CONFIG += qt \
hb \
dll
-
-HEADERS += inc/btdevsettinginterface.h \
- inc/btabstractdevsetting.h \
- inc/btdevsettingpluginloader.h
+
+INCLUDEPATH += ../../../btservices_plat/bt_remote_device_setting_api/inc
+
+HEADERS += \
+ ../../../btservices_plat/bt_remote_device_setting_api/inc/btabstractdevsetting.h
+
SOURCES += src/btabstractdevsetting.cpp \
src/btdevsettingpluginloader.cpp
-
+
+defFilePath = .
+
symbian: {
SYMBIAN_PLATFORMS = WINSCW \
ARMV5
BLD_INF_RULES.prj_exports += \
"$${LITERAL_HASH}include<platform_paths.hrh>" \
- "inc/btdevsettingglobal.h MW_LAYER_PLATFORM_EXPORT_PATH(btdevsettingglobal.h)" \
- "inc/btdevsettinginterface.h MW_LAYER_PLATFORM_EXPORT_PATH(btdevsettinginterface.h)" \
- "inc/btabstractdevsetting.h MW_LAYER_PLATFORM_EXPORT_PATH(btabstractdevsetting.h)" \
- "inc/btdevsettingpluginloader.h MW_LAYER_PLATFORM_EXPORT_PATH(btdevsettingpluginloader.h)" \
"rom/btdevsettingframework.iby CORE_MW_LAYER_IBY_EXPORT_PATH(btdevsettingframework.iby)"
TARGET.EPOCALLOWDLLDATA = 1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btdevsettingframework/bwins/btdevsettingframeworku.def Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,24 @@
+EXPORTS
+ ?aboutToClose@BtAbstractDevSetting@@UAEXXZ @ 1 NONAME ; void BtAbstractDevSetting::aboutToClose(void)
+ ??0BtAbstractDevSetting@@QAE@ABVQString@@PAVQObject@@@Z @ 2 NONAME ; BtAbstractDevSetting::BtAbstractDevSetting(class QString const &, class QObject *)
+ ?tr@BtAbstractDevSetting@@SA?AVQString@@PBD0H@Z @ 3 NONAME ; class QString BtAbstractDevSetting::tr(char const *, char const *, int)
+ ?staticMetaObject@BtAbstractDevSetting@@2UQMetaObject@@B @ 4 NONAME ; struct QMetaObject const BtAbstractDevSetting::staticMetaObject
+ ?tr@BtAbstractDevSetting@@SA?AVQString@@PBD0@Z @ 5 NONAME ; class QString BtAbstractDevSetting::tr(char const *, char const *)
+ ?isSettingAvailable@BtAbstractDevSetting@@UAE_NXZ @ 6 NONAME ; bool BtAbstractDevSetting::isSettingAvailable(void)
+ ?trUtf8@BtAbstractDevSetting@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString BtAbstractDevSetting::trUtf8(char const *, char const *)
+ ?getStaticMetaObject@BtAbstractDevSetting@@SAABUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const & BtAbstractDevSetting::getStaticMetaObject(void)
+ ??_EBtDevSettingInterface@@UAE@I@Z @ 9 NONAME ; BtDevSettingInterface::~BtDevSettingInterface(unsigned int)
+ ?trUtf8@BtAbstractDevSetting@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString BtAbstractDevSetting::trUtf8(char const *, char const *, int)
+ ?aboutToBackground@BtAbstractDevSetting@@UAEXXZ @ 11 NONAME ; void BtAbstractDevSetting::aboutToBackground(void)
+ ??_EBtAbstractDevSetting@@UAE@I@Z @ 12 NONAME ; BtAbstractDevSetting::~BtAbstractDevSetting(unsigned int)
+ ?aboutToForeground@BtAbstractDevSetting@@UAEXXZ @ 13 NONAME ; void BtAbstractDevSetting::aboutToForeground(void)
+ ?getSettingWidget@BtAbstractDevSetting@@UAEPAVHbDataForm@@XZ @ 14 NONAME ; class HbDataForm * BtAbstractDevSetting::getSettingWidget(void)
+ ?metaObject@BtAbstractDevSetting@@UBEPBUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const * BtAbstractDevSetting::metaObject(void) const
+ ?qt_metacast@BtAbstractDevSetting@@UAEPAXPBD@Z @ 16 NONAME ; void * BtAbstractDevSetting::qt_metacast(char const *)
+ ??1BtAbstractDevSetting@@UAE@XZ @ 17 NONAME ; BtAbstractDevSetting::~BtAbstractDevSetting(void)
+ ?qt_metacall@BtAbstractDevSetting@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 18 NONAME ; int BtAbstractDevSetting::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?getRemote@BtAbstractDevSetting@@QBEABVQString@@XZ @ 19 NONAME ; class QString const & BtAbstractDevSetting::getRemote(void) const
+ ?loadDevSettingInterfaces@BtDevSettingPluginLoader@@SA?AV?$QList@PAVBtDevSettingInterface@@@@XZ @ 20 NONAME ; class QList<class BtDevSettingInterface *> BtDevSettingPluginLoader::loadDevSettingInterfaces(void)
+ ?settingAvailabilityChanged@BtAbstractDevSetting@@IAEXPAV1@_N@Z @ 21 NONAME ; void BtAbstractDevSetting::settingAvailabilityChanged(class BtAbstractDevSetting *, bool)
+ ??1BtDevSettingInterface@@UAE@XZ @ 22 NONAME ; BtDevSettingInterface::~BtDevSettingInterface(void)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btdevsettingframework/eabi/btdevsettingframeworku.def Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,22 @@
+EXPORTS
+ _ZN20BtAbstractDevSetting11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
+ _ZN20BtAbstractDevSetting11qt_metacastEPKc @ 2 NONAME
+ _ZN20BtAbstractDevSetting12aboutToCloseEv @ 3 NONAME
+ _ZN20BtAbstractDevSetting16getSettingWidgetEv @ 4 NONAME
+ _ZN20BtAbstractDevSetting16staticMetaObjectE @ 5 NONAME DATA 16
+ _ZN20BtAbstractDevSetting17aboutToBackgroundEv @ 6 NONAME
+ _ZN20BtAbstractDevSetting17aboutToForegroundEv @ 7 NONAME
+ _ZN20BtAbstractDevSetting18isSettingAvailableEv @ 8 NONAME
+ _ZN20BtAbstractDevSetting19getStaticMetaObjectEv @ 9 NONAME
+ _ZN20BtAbstractDevSetting26settingAvailabilityChangedEPS_b @ 10 NONAME
+ _ZN20BtAbstractDevSettingC1ERK7QStringP7QObject @ 11 NONAME
+ _ZN20BtAbstractDevSettingC2ERK7QStringP7QObject @ 12 NONAME
+ _ZN20BtAbstractDevSettingD0Ev @ 13 NONAME
+ _ZN20BtAbstractDevSettingD1Ev @ 14 NONAME
+ _ZN20BtAbstractDevSettingD2Ev @ 15 NONAME
+ _ZN24BtDevSettingPluginLoader24loadDevSettingInterfacesEv @ 16 NONAME
+ _ZNK20BtAbstractDevSetting10metaObjectEv @ 17 NONAME
+ _ZNK20BtAbstractDevSetting9getRemoteEv @ 18 NONAME
+ _ZTI20BtAbstractDevSetting @ 19 NONAME
+ _ZTV20BtAbstractDevSetting @ 20 NONAME
+
--- a/bluetoothengine/btui/btdevsettingframework/inc/btabstractdevsetting.h Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0""
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: The plugin interface of Bluetooth device setting ui
-*
-*/
-
-#ifndef BTABSTRACTDEVSETTING_H
-#define BTABSTRACTDEVSETTING_H
-
-#include <hbwidget.h>
-#include <btdevsettingglobal.h>
-
-/*!
- \class BtAbstractDevSetting
- \brief The class BtAbstractDevSetting is the base class
- for offering a UI to manage certain settings of
- a remote Bluetooth device, e.g., accessory and keyboard settings.
- */
-class BTDEVSETTINGINTERFACE_EXPORT BtAbstractDevSetting : public QObject
-{
- Q_OBJECT
-
-public:
-
- /*!
- Constructs a device setting plugin entry.
-
- \param address the BD_ADDR of the remote device which this setting
- plugin is provided for. Its format is XXXXXXXXXXXX, where X is a
- hexadecimal digit. Case is insensitive.
- \parent the parent of this object.
- */
- explicit BtAbstractDevSetting(const QString &address, QObject *parent = 0 );
-
- /*!
- Destructor of BtAbstractDeviceSetting.
- */
- virtual ~BtAbstractDevSetting();
-
- /*!
- Gets the BD_ADDR of the remote device which this setting
- plugin is provided for.
-
- \return the device address of the remote device in hex string
- */
- const QString &getRemote() const;
-
- /*!
- Tells if this setting plugin can provide a setting UI
- for the target device. If the answer is true, this plugin may be
- requested to create a setting widget by function
- \code createSettingWidget() \endcode.
-
- \return true if a setting is currently available. false, otherwise.
-
- The default implementation returns false.
- */
- virtual bool isSettingAvailable();
-
- /*!
- Gets a \code HbWidget \endcode instance which consists of the
- setting UI from this specific plugin. The loader of this plugin will
- add this widget into its setting view if its setting is available at
- a time.
-
- The ownership of this widget is not transferred. That is, the plugin
- is responsible to free it at plugin destruction.
-
- The default implementation returns 0.
-
- \return an \code HbWidget \endcode instance.
- */
- virtual HbWidget *getSettingWidget();
-
- /*!
- Informs that device setting is going to foreground. This
- implies that the \code HbWidget \endcode from function
- \code createSettingWidget \endcode will be shown if the setting
- from this plugin is available.
-
- The default implementation does nothing.
- */
- virtual void aboutToForeground();
-
- /*!
- Informs that device setting is going to background.
-
- The default implementation does nothing.
- */
- virtual void aboutToBackground();
-
- /*!
- Informs that device setting is going to close.
-
- The default implementation does nothing.
- */
- virtual void aboutToClose();
-
-signals:
-
- /*!
- The signal the plugin should emit for informing that the
- availability of this setting is changed.
-
- If the setting becomes available, the owner of this plugin may
- request the plugin to create a setting widget.
-
- If the setting becomes unavailable, the owner of this plugin may close and
- destroy the setting widget.
-
- \param setting the pointer of the setting whose status has changed.
-
- \param available true if the setting is available; false otherwise.
-
- \sa isSettingAvailable().
- */
- void settingAvailabilityChanged(BtAbstractDevSetting *setting, bool available);
-
-private:
-
- /*!
- The remote device address in format XXXXXXXXXXXX where X is a
- hexadecimal digit.
- */
- QString mRemote;
-};
-
-#endif /* BTABSTRACTDEVSETTING_H */
--- a/bluetoothengine/btui/btdevsettingframework/inc/btdevsettingglobal.h Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0""
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef BTDEVSETTINGGLOBAL_H
-#define BTDEVSETTINGGLOBAL_H
-
-#include <QtGlobal>
-
-#ifdef BUILD_BTDEVSETTINGFRAMEWORK
-#define BTDEVSETTINGINTERFACE_EXPORT Q_DECL_EXPORT
-#else
-#define BTDEVSETTINGINTERFACE_EXPORT Q_DECL_IMPORT
-#endif
-
-#define BTDEVSETTING_PLUGIN_PATH QLatin1String("/resource/qt/plugins/btdevsetting")
-
-#endif /* BTDEVSETTINGGLOBAL_H */
--- a/bluetoothengine/btui/btdevsettingframework/inc/btdevsettinginterface.h Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0""
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: The plugin interface of Bluetooth device setting ui
-*
-*/
-
-#ifndef BTDEVSETTINGINTERFACE_H
-#define BTDEVSETTINGINTERFACE_H
-
-#include <QtPlugin>
-#include <btdevsettingglobal.h>
-#include <btabstractdevsetting.h>
-
-/*!
- \class BtDeviceSettingInterface
- \brief The class BtDeviceSettingInterface is an interface
- for creating a BT device setting plugin instance.
- */
-class BTDEVSETTINGINTERFACE_EXPORT BtDevSettingInterface
-{
-public:
-
- /*!
- Destructor of BtDeviceSettingPlugin.
- */
- virtual ~BtDevSettingInterface() {}
-
- /*!
- Creates a \code BtDeviceSettingPlugin \endcode instance from a
- specific plugin.
-
- \param address the BD_ADDR of the remote device which this setting
- plugin is provided for. Its format is XXXXXXXXXXXX, where X is a
- hexadecimal digit. Case is insensitive.
-
- \parent the parent of this object.
-
- \return an \code BtDeviceSettingPlugin \endcode instance the ownership of which is
- transferred to the plugin loader.
- */
- virtual BtAbstractDevSetting *createDevSetting(
- const QString &address, QObject *parent = 0) = 0;
-};
-
-Q_DECLARE_INTERFACE(BtDevSettingInterface, "com.nokia.bt.devsettinginterface/1.0");
-
-#endif /* BTDEVSETTINGINTERFACE_H */
--- a/bluetoothengine/btui/btdevsettingframework/inc/btdevsettingpluginloader.h Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0""
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef BTDEVSETTINGPLUGINLOADER_H
-#define BTDEVSETTINGPLUGINLOADER_H
-
-#include <QtGlobal>
-#include <btdevsettingglobal.h>
-#include <QList>
-
-class QString;
-class QStringList;
-class BtDevSettingInterface;
-
-class BTDEVSETTINGINTERFACE_EXPORT BtDevSettingPluginLoader
-{
-public:
-
- /*!
- Load all setting interfaces.
-
- \return the list of plugin interface.
- */
- static QList<BtDevSettingInterface*> loadDevSettingInterfaces();
-
-};
-
-#endif /* BTDEVSETTINGPLUGINLOADER_H */
--- a/bluetoothengine/btui/btdevsettingframework/src/btabstractdevsetting.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btdevsettingframework/src/btabstractdevsetting.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -58,19 +58,19 @@
}
/*!
- Gets a \code HbWidget \endcode instance which consists of the
+ Gets a \code HbDataForm \endcode instance which consists of the
setting UI from this specific plugin. The loader of this plugin will
- add this widget into its setting view if its setting is available at
- a time.
+ add this dataform into its setting view if its setting is available at
+ the time.
The ownership of this widget is not transferred. That is, the plugin
is responsible to free it at plugin destruction.
The default implementation returns 0.
- \return an \code HbWidget \endcode instance.
+ \return an \code HbDataForm \endcode instance.
*/
-HbWidget *BtAbstractDevSetting::getSettingWidget()
+HbDataForm *BtAbstractDevSetting::getSettingWidget()
{
return 0;
}
--- a/bluetoothengine/btui/btui.pro Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btui.pro Tue Jul 06 14:27:09 2010 +0300
@@ -21,7 +21,8 @@
SUBDIRS += btuimodel \
btdevsettingframework \
btuidelegate \
-btcpplugin
+btcpplugin \
+tsrc
CONFIG += ordered
@@ -34,4 +35,4 @@
"rom/btui_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(btui_resources.iby)" \
"inc/btuiiconutil.h MW_LAYER_PLATFORM_EXPORT_PATH(btservices/btuiiconutil.h)" \
"inc/btuidevtypemap.h MW_LAYER_PLATFORM_EXPORT_PATH(btservices/btuidevtypemap.h)"
-}
\ No newline at end of file
+}
--- a/bluetoothengine/btui/btuidelegate/btdelegateInquiry.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuidelegate/btdelegateInquiry.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -76,14 +76,8 @@
void BtDelegateInquiry::exec_inquiry()
{
bool err = getDeviceModel()->searchDevice();
- if (!err) {
- // TODO - Verify the error code to be used.
- // Complete command with error
- emit commandCompleted(KErrNotSupported);
- return;
- }
-
- emit commandCompleted(KErrNone);
+
+ emit commandCompleted(err); // in case of error, passing original error back
}
void BtDelegateInquiry::cancel()
--- a/bluetoothengine/btui/btuidelegate/btdelegateconnect.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuidelegate/btdelegateconnect.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -44,6 +44,10 @@
delete mBtengConnMan;
}
+/*!
+ * execute connect operation
+ * first check if power is on
+ */
void BtDelegateConnect::exec( const QVariant ¶ms )
{
if ( mActiveHandling ) {
@@ -61,9 +65,7 @@
mMajorProperty = (mIndex.data(BtDeviceModel::MajorPropertyRole)).toInt();
// first turn on power if needed
- QModelIndex powerIndex = getSettingModel()->index(BtSettingModel::PowerStateRow, 0);
- PowerStateQtValue powerState = (PowerStateQtValue)getSettingModel()->data(powerIndex, Qt::EditRole).toInt();
- if (powerState == BtPowerOff) {
+ if (!isBtPowerOn()) {
if (!mAbstractDelegate) //if there is no other delegate running
{
mAbstractDelegate = BtDelegateFactory::newDelegate(BtDelegate::ManagePower,
@@ -78,9 +80,11 @@
}
}
+/*!
+ * power delegate has completed, continue processing
+ */
void BtDelegateConnect::powerDelegateCompleted(int status)
{
- //ToDo: Error handling here
if (mAbstractDelegate)
{
disconnect(mAbstractDelegate);
@@ -97,6 +101,9 @@
}
}
+/*!
+ * execute connect operation
+ */
void BtDelegateConnect::exec_connect()
{
int error = KErrNone;
@@ -115,6 +122,9 @@
}
}
+/*!
+ * connect callback from CBTengConnMan
+ */
void BtDelegateConnect::ConnectComplete( TBTDevAddr& aAddr, TInt aErr,
RBTDevAddrArray* aConflicts )
{
@@ -125,14 +135,6 @@
return;
}
- // bteng calls ConnectComplete even if cancelConnect is called,
- // we won't signal the interested party in this case.
- // ToDo: is this needed?
- if ( aErr == KErrCancel ) {
- mActiveHandling = false;
- return;
- }
-
// conflict could occur as well if another audio device is already connected
// since currently we don't support multiple audio device connections.
if ( aErr && aConflicts && aConflicts->Count() ) {
@@ -170,6 +172,9 @@
}
}
+/*!
+ * handle user response to query about disconnecting conflict device
+ */
void BtDelegateConnect::handleUserAnswer( HbAction* answer )
{
HbMessageBox* dlg = static_cast<HbMessageBox*>( sender() );
@@ -191,15 +196,17 @@
}
}
else {
- // Cancel
+ // Cancel connect operation
emitCommandComplete(KErrCancel);
}
}
+
/*!
- * returns true if call is ongoing
+ * returns true if phone call is ongoing
*/
bool BtDelegateConnect::callOngoing()
{
+ // ToDo: check if there exists Qt PS key for ongoing call
int callState;
int err = RProperty::Get(KPSUidCtsyCallInformation, KCTsyCallState, callState);
if (!err && (callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateUninitialized)) {
@@ -209,8 +216,18 @@
return true;
}
}
+
+/*!
+ * disconnecting conflict device has completed, continue connecting
+ */
void BtDelegateConnect::disconnectDelegateCompleted(int status)
{
+ if (mAbstractDelegate)
+ {
+ disconnect(mAbstractDelegate);
+ delete mAbstractDelegate;
+ mAbstractDelegate = 0;
+ }
// finished disconnecting conflict device, now reconnect to original device
if ( status == KErrNone ) {
exec_connect();
@@ -221,13 +238,19 @@
}
}
+/*!
+ * not used here
+ */
void BtDelegateConnect::DisconnectComplete( TBTDevAddr& aAddr, TInt aErr )
{
Q_UNUSED(aAddr);
Q_UNUSED(aErr);
}
-
+/*!
+ * cancel connect operation
+ * ConnectComplete() callback will be called upon completion of cancel with KErrCancel
+ */
void BtDelegateConnect::cancel()
{
if ( mBtengConnMan ) {
@@ -235,18 +258,22 @@
}
}
+/*!
+ * shows user notes with connection success/failure information
+ * cancel operation is handled without a user note
+ */
void BtDelegateConnect::emitCommandComplete(int error)
{
if ( error == KErrNone ) {
// success, show indicator with connection status
- HbIcon icon = getBadgedDeviceTypeIcon( mCod, mMajorProperty, 0); // no badging required, only icon
+ HbIcon icon = getBadgedDeviceTypeIcon( mCod, mMajorProperty, BtuiNoCorners);
QString str(hbTrId("txt_bt_dpopinfo_connected_to_1"));
HbNotificationDialog::launchDialog( icon, hbTrId("txt_bt_dpophead_connected"),
str.arg(mDeviceName) );
}
else if ( error == KErrCancel ) {
- // no user note, return success
+ // no user note, return success since cancel operation completed successfully
error = KErrNone;
}
else {
--- a/bluetoothengine/btui/btuidelegate/btdelegatedevsecurity.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuidelegate/btdelegatedevsecurity.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -128,16 +128,9 @@
void BtDelegateDevSecurity::emitCommandComplete(int error)
{
- QString str(hbTrId("Unpaired to %1"));
- QString err(hbTrId("Unpairing with %1 Failed"));
+ // no dialogs here since stack provides "unpaired to %1" dialog
+ // and failures are not reported
- if(error != KErrNone) {
- HbNotificationDialog::launchDialog(err.arg(mdeviceName));
- }
- else {
- HbNotificationDialog::launchDialog(str.arg(mdeviceName));
- }
-
emit commandCompleted(error);
}
--- a/bluetoothengine/btui/btuidelegate/btdelegatedisconnect.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuidelegate/btdelegatedisconnect.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -45,6 +45,10 @@
if ( ! mBtengConnMan ){
TRAP( err, mBtengConnMan = CBTEngConnMan::NewL(this) );
}
+ if(err) {
+ emit commandCompleted(err);
+ return;
+ }
if (params.canConvert<int>()){
mDisconOpt = (DisconnectOption)params.toInt();
mActiveHandling = true;
@@ -130,13 +134,18 @@
}
void BtDelegateDisconnect::disconnectSeviceLevel(){
int err;
- TBTEngConnectionStatus connStatus;
+ TBTEngConnectionStatus connStatus = EBTEngNotConnected;
err = mBtengConnMan->IsConnected(mBtEngAddr, connStatus);
if (connStatus == EBTEngConnected){
err = mBtengConnMan->Disconnect(mBtEngAddr, EBTDiscGraceful);
}
if(err) {
- emit commandCompleted(err);
+ if (mDisconOpt == AllOngoingConnections){
+ disconnectServiceLevelCompleted(err);
+ }
+ else{
+ emit commandCompleted(err);
+ }
}
}
@@ -152,33 +161,42 @@
}
err = mPhyLinks->Disconnect( mBtEngAddr );
if(err) {
- emit commandCompleted(err);
+ if (mDisconOpt == AllOngoingConnections){
+ disconnectPhysicalLinkCompleted(err);
+ }
+ else{
+ emit commandCompleted(err);
+ }
}
}
void BtDelegateDisconnect::disconnectServiceLevelCompleted(int err){
if (mDisconOpt == ServiceLevel){
- //emitCommandComplete(err);
mActiveHandling = false;
emit commandCompleted(err);
}
else if (mDisconOpt == AllOngoingConnections){
-
- mAddrArrayIndex++;
- if ( mAddrArrayIndex < mDevAddrArray.Count()){
- disconnectAllConnections_service();
+ if (err){
+ mActiveHandling = false;
+ emit commandCompleted(err);
}
else{
- mDevAddrArray.Reset();
- err = mBtengConnMan->GetConnectedAddresses(mDevAddrArray);
- mAddrArrayIndex = 0;
- //connect( mDisconnectDelegate, SIGNAL(commandCompleted(int)), this, SLOT(disconnectPhysicalLinkCompleted(int)) );
- disconnectAllConnections_physical();
- if(err) {
- emit commandCompleted(err);
+ mAddrArrayIndex++;
+ if ( mAddrArrayIndex < mDevAddrArray.Count()){
+ disconnectAllConnections_service();
}
-
+ else{
+ mDevAddrArray.Reset();
+ err = mBtengConnMan->GetConnectedAddresses(mDevAddrArray);
+ if(err) {
+ emit commandCompleted(err);
+ return;
+ }
+ mAddrArrayIndex = 0;
+ //connect( mDisconnectDelegate, SIGNAL(commandCompleted(int)), this, SLOT(disconnectPhysicalLinkCompleted(int)) );
+ disconnectAllConnections_physical();
+ }
}
}
}
@@ -190,14 +208,20 @@
emit commandCompleted(err);
}
else if (mDisconOpt == AllOngoingConnections){
- mAddrArrayIndex++;
- if ( mAddrArrayIndex < mDevAddrArray.Count()){
- disconnectAllConnections_physical();
+ if (err){
+ mActiveHandling = false;
+ emit commandCompleted(err);
}
else{
- //TODO: check if there is still ongoing connection from BTEngVonnMan. and close them again if there is any new
- mActiveHandling = false;
- emit commandCompleted(err);
+ mAddrArrayIndex++;
+ if ( mAddrArrayIndex < mDevAddrArray.Count()){
+ disconnectAllConnections_physical();
+ }
+ else{
+ //TODO: check if there is still ongoing connection from BTEngVonnMan. and close them again if there is any new
+ mActiveHandling = false;
+ emit commandCompleted(err);
+ }
}
}
@@ -217,12 +241,7 @@
return;
}
DisplayCommandCompleteNotif(aErr);
- if(aErr) {
- emit commandCompleted(aErr);
- }
- else{
- disconnectServiceLevelCompleted(aErr);
- }
+ disconnectServiceLevelCompleted(aErr);
}
@@ -238,13 +257,8 @@
void BtDelegateDisconnect::HandleDisconnectCompleteL( TInt err ){
if ( !mActiveHandling ) {
return;
- }
- if(err) {
- emit commandCompleted(err);
- }
- else{
- disconnectPhysicalLinkCompleted(err);
- }
+ }
+ disconnectPhysicalLinkCompleted(err);
}
@@ -254,13 +268,8 @@
void BtDelegateDisconnect::DisplayCommandCompleteNotif(int error)
{
- QString str(hbTrId("Disconnected to %1"));
- QString err(hbTrId("Disconnecting with %1 Failed"));
- if(error != KErrNone) {
- HbNotificationDialog::launchDialog(err.arg(mDeviceName));
- }
- else {
+ if(error == KErrNone) {
// success, show indicator with connection status
HbIcon icon = getBadgedDeviceTypeIcon( mCod, mMajorRole, 0 ); // no badging required, only icon
QString str( hbTrId("txt_bt_dpopinfo_disconnected_from_1") );
--- a/bluetoothengine/btui/btuidelegate/btdelegatedisconnect.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuidelegate/btdelegatedisconnect.h Tue Jul 06 14:27:09 2010 +0300
@@ -86,7 +86,7 @@
int mMajorRole;
bool mActiveHandling;
-
+
int mAddrArrayIndex;
DisconnectOption mDisconOpt;
--- a/bluetoothengine/btui/btuidelegate/btdelegatepair.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuidelegate/btdelegatepair.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -113,7 +113,7 @@
void BtDelegatePair::launchWaitDialog()
{
- QString headingText(hbTrId("Pairing with %1"));
+ QString headingText(hbTrId("txt_bt_title_pairing_with_1"));
HbLabel *heading;
HbProgressBar* progressBar;
@@ -165,15 +165,6 @@
void BtDelegatePair::emitCommandComplete(int error)
{
-// QString str(hbTrId("Paired to %1"));
-// QString err(hbTrId("Pairing with %1 Failed"));
-//
-// if(error != KErrNone) {
-// HbNotificationDialog::launchDialog(err.arg(mdeviceName));
-// }
-// else {
-// HbNotificationDialog::launchDialog(str.arg(mdeviceName));
-// }
emit commandCompleted(error);
}
--- a/bluetoothengine/btui/btuidelegate/btdelegatepower.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuidelegate/btdelegatepower.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -67,6 +67,7 @@
if ( mReqPowerState == curPowerState ) {
// no need to do anything
emit commandCompleted( KErrNone );
+ return;
}
// perform power on/off operation
@@ -150,27 +151,30 @@
Q_CHECK_PTR( btengConnMan );
RBTDevAddrArray devAddrArray;
err = btengConnMan->GetConnectedAddresses(devAddrArray);
+ if ( err != KErrNone) {
+ //TODO: handle the error here
+ emit commandCompleted(err);
+ return;
+ }
int count = devAddrArray.Count();
- //int count =3;
devAddrArray.Close();
delete btengConnMan;
- if( !err && count> 0 ){
- HbMessageBox::question( hbTrId("Turn Bluetooth off? There is an active connection." ),this,
- SLOT(btOffDialogClose(HbAction*)));
-
+ if( count> 0 ){
+ mActiveHandling = true;
+ disconnectOngoingConnections();
+ }
+ else{
+ mActiveHandling = true;
+ err = mBtengSettings->SetPowerState(EBTPowerOff);
+
+ if ( err ) {
+ //TODO: handle the error here
+ emit commandCompleted(KErrGeneral);
}
- else{
- mActiveHandling = true;
- err = mBtengSettings->SetPowerState(EBTPowerOff);
-
- if ( err ) {
- //TODO: handle the error here
- emit commandCompleted(KErrGeneral);
- }
- }
+ }
}
-
+/*
void BtDelegatePower::btOffDialogClose(HbAction *action)
{
HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
@@ -188,7 +192,7 @@
}
}
-
+*/
void BtDelegatePower::disconnectOngoingConnections(){
if (! mDisconnectDelegate){
mDisconnectDelegate = BtDelegateFactory::newDelegate(
--- a/bluetoothengine/btui/btuidelegate/btdelegatepower.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuidelegate/btdelegatepower.h Tue Jul 06 14:27:09 2010 +0300
@@ -57,8 +57,6 @@
void btOnWarningClose();
- void btOffDialogClose(HbAction *action);
-
void disconnectDelegateCompleted(int err);
--- a/bluetoothengine/btui/btuidelegate/btuidelegate.pro Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuidelegate/btuidelegate.pro Tue Jul 06 14:27:09 2010 +0300
@@ -50,6 +50,8 @@
btdelegatedisconnect.cpp \
btdelegatedevsecurity.cpp \
btdelegateremotedevname.cpp
+
+defFilePath = .
symbian: {
SYMBIAN_PLATFORMS = WINSCW \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/bwins/btuidelegateu.def Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,20 @@
+EXPORTS
+ ?qt_metacall@BtAbstractDelegate@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1 NONAME ; int BtAbstractDelegate::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ??1BtAbstractDelegate@@UAE@XZ @ 2 NONAME ; BtAbstractDelegate::~BtAbstractDelegate(void)
+ ?metaObject@BtAbstractDelegate@@UBEPBUQMetaObject@@XZ @ 3 NONAME ; struct QMetaObject const * BtAbstractDelegate::metaObject(void) const
+ ?tr@BtAbstractDelegate@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString BtAbstractDelegate::tr(char const *, char const *, int)
+ ?newDelegate@BtDelegateFactory@@SAPAVBtAbstractDelegate@@W4Command@BtDelegate@@PAVBtSettingModel@@PAVBtDeviceModel@@PAVQObject@@@Z @ 5 NONAME ; class BtAbstractDelegate * BtDelegateFactory::newDelegate(enum BtDelegate::Command, class BtSettingModel *, class BtDeviceModel *, class QObject *)
+ ?tr@BtAbstractDelegate@@SA?AVQString@@PBD0@Z @ 6 NONAME ; class QString BtAbstractDelegate::tr(char const *, char const *)
+ ?qt_metacast@BtAbstractDelegate@@UAEPAXPBD@Z @ 7 NONAME ; void * BtAbstractDelegate::qt_metacast(char const *)
+ ?getStaticMetaObject@BtAbstractDelegate@@SAABUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const & BtAbstractDelegate::getStaticMetaObject(void)
+ ??0BtAbstractDelegate@@QAE@PAVBtSettingModel@@PAVBtDeviceModel@@PAVQObject@@@Z @ 9 NONAME ; BtAbstractDelegate::BtAbstractDelegate(class BtSettingModel *, class BtDeviceModel *, class QObject *)
+ ?staticMetaObject@BtAbstractDelegate@@2UQMetaObject@@B @ 10 NONAME ; struct QMetaObject const BtAbstractDelegate::staticMetaObject
+ ??_EBtAbstractDelegate@@UAE@I@Z @ 11 NONAME ; BtAbstractDelegate::~BtAbstractDelegate(unsigned int)
+ ?commandCompleted@BtAbstractDelegate@@IAEXHVQVariant@@@Z @ 12 NONAME ; void BtAbstractDelegate::commandCompleted(int, class QVariant)
+ ?cancel@BtAbstractDelegate@@UAEXXZ @ 13 NONAME ; void BtAbstractDelegate::cancel(void)
+ ?trUtf8@BtAbstractDelegate@@SA?AVQString@@PBD0@Z @ 14 NONAME ; class QString BtAbstractDelegate::trUtf8(char const *, char const *)
+ ?getSettingModel@BtAbstractDelegate@@IAEPAVBtSettingModel@@XZ @ 15 NONAME ; class BtSettingModel * BtAbstractDelegate::getSettingModel(void)
+ ?getDeviceModel@BtAbstractDelegate@@IAEPAVBtDeviceModel@@XZ @ 16 NONAME ; class BtDeviceModel * BtAbstractDelegate::getDeviceModel(void)
+ ?trUtf8@BtAbstractDelegate@@SA?AVQString@@PBD0H@Z @ 17 NONAME ; class QString BtAbstractDelegate::trUtf8(char const *, char const *, int)
+ ?isBtPowerOn@BtAbstractDelegate@@IAE_NXZ @ 18 NONAME ; bool BtAbstractDelegate::isBtPowerOn(void)
+
--- a/bluetoothengine/btui/btuidelegate/docml/pairwaitingdialog.docml Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuidelegate/docml/pairwaitingdialog.docml Tue Jul 06 14:27:09 2010 +0300
@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="1.0">
+<hbdocument version="1.1">
<widget name="dialog" type="HbDialog">
+ <rect height="21.04478un" name="geometry" width="46.71642un" x="3.43284un" y="37.16418un"/>
<widget name="heading" role="HbDialog:headingWidget" type="HbLabel">
+ <enums name="textWrapping" value="TextWordWrap"/>
<enums name="alignment" value="AlignLeft|AlignJustify|AlignTop|AlignLeading"/>
+ <enums name="layoutDirection" value="LeftToRight"/>
<string name="plainText" value="=== Heading ==="/>
- <enums name="textWrapping" value="TextWordWrap"/>
- <enums name="layoutDirection" value="LeftToRight"/>
</widget>
<widget name="container" role="HbDialog:contentWidget" type="HbWidget">
<widget name="label" type="HbLabel">
<enums name="alignment" value="AlignLeft|AlignLeading"/>
- <string name="plainText" value="Waiting for other device"/>
+ <string locid="txt_bt_info_waiting_the_other_device" name="plainText" value="Waiting for other device"/>
</widget>
<widget name="progressBar" type="HbProgressBar">
<integer name="progressValue" value="30"/>
@@ -23,9 +24,8 @@
<linearitem itemname="progressBar"/>
</layout>
</widget>
- <rect height="21.04478un" name="geometry" width="46.71642un" x="3.43284un" y="37.16418un"/>
</widget>
- <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+ <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
<uistate name="Common ui state" sections="#common"/>
</metadata>
</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuidelegate/eabi/btuidelegateu.def Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,19 @@
+EXPORTS
+ _ZN17BtDelegateFactory11newDelegateEN10BtDelegate7CommandEP14BtSettingModelP13BtDeviceModelP7QObject @ 1 NONAME
+ _ZN18BtAbstractDelegate11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
+ _ZN18BtAbstractDelegate11qt_metacastEPKc @ 3 NONAME
+ _ZN18BtAbstractDelegate14getDeviceModelEv @ 4 NONAME
+ _ZN18BtAbstractDelegate15getSettingModelEv @ 5 NONAME
+ _ZN18BtAbstractDelegate16commandCompletedEi8QVariant @ 6 NONAME
+ _ZN18BtAbstractDelegate16staticMetaObjectE @ 7 NONAME DATA 16
+ _ZN18BtAbstractDelegate19getStaticMetaObjectEv @ 8 NONAME
+ _ZN18BtAbstractDelegate6cancelEv @ 9 NONAME
+ _ZN18BtAbstractDelegateC2EP14BtSettingModelP13BtDeviceModelP7QObject @ 10 NONAME
+ _ZN18BtAbstractDelegateD0Ev @ 11 NONAME
+ _ZN18BtAbstractDelegateD1Ev @ 12 NONAME
+ _ZN18BtAbstractDelegateD2Ev @ 13 NONAME
+ _ZNK18BtAbstractDelegate10metaObjectEv @ 14 NONAME
+ _ZTI18BtAbstractDelegate @ 15 NONAME
+ _ZTV18BtAbstractDelegate @ 16 NONAME
+ _ZN18BtAbstractDelegate11isBtPowerOnEv @ 17 NONAME
+
--- a/bluetoothengine/btui/btuimodel/btdevicedata.cpp Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,449 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "btdevicedata.h"
-#include <QDateTime>
-#include <btservices/advancedevdiscoverer.h>
-#include "btuiutil.h"
-#include "btuidevtypemap.h"
-#include "btqtconstants.h"
-
-/*!
- Constructor.
- */
-BtDeviceData::BtDeviceData( BtDeviceModel& model, QObject *parent )
- : QObject( parent ), mModel( model ), mDiscover( 0 )
-{
- mDeviceRepo = 0;
- isSearchingDevice = false;
- TRAP_IGNORE({
- mDeviceRepo = CBtDevRepository::NewL();
- });
- Q_CHECK_PTR( mDeviceRepo );
- TRAP_IGNORE( mDeviceRepo->AddObserverL( this ) );
-
- if ( mDeviceRepo->IsInitialized() ) {
- initializeDataStore();
- }
-}
-
-/*!
- Destructor.
- */
-BtDeviceData::~BtDeviceData()
-{
- delete mDeviceRepo;
- delete mDiscover;
-}
-
-
-/*!
- Tells whether the given column is in the range of the setting list.
-
- \param row the row number to be checked
- \param col the column number to be checked
-
- \return true if the given row and column are valid; false otherwise.
-*/
-bool BtDeviceData::isValid( int row, int column) const
-{
- return row >= 0 && row < mData.count() && column == 0;
-}
-
-/*!
- \return the total amount of rows.
-
-*/
-int BtDeviceData::rowCount() const
-{
- return mData.count();
-}
-
-/*!
- \return the total amount of columns.
-
-*/
-int BtDeviceData::columnCount() const
-{
- return 1;
-}
-
-/*!
- Gets the value within a data item.
- \param val contains the value at return.
- \param row the row number which the value is from
- \param col the column number which the value is from
- \param role the role identifier of the value.
- */
-void BtDeviceData::data(QVariant& val, int row, int col, int role ) const
-{
- if ( isValid( row, col ) ) {
- val = mData.at( row ).value( role );
- }
- else {
- val = QVariant( QVariant::Invalid );
- }
-}
-
-/*!
- Gets the whole item data at the specified column
- \param row the row number of the item data to be returned
- \param col the column number of the item data to be returned
- \return the item data
- */
-BtuiModelDataItem BtDeviceData::itemData( int row, int col ) const
-{
- if ( isValid( row, col ) ) {
- return mData.at( row );
- }
- return BtuiModelDataItem();
-}
-
-
-/*!
- Requests the model to searching Bluetooth devices.
- \return true if the request is accepted; false otherwise
- */
-bool BtDeviceData::searchDevice()
-{
- int err ( 0 );
- removeTransientDevices();
- if ( !mDiscover ) {
- TRAP(err, mDiscover = CAdvanceDevDiscoverer::NewL( *mDeviceRepo, *this) );
- }
- if ( !err ) {
- TRAP(err, mDiscover->DiscoverDeviceL() );
- }
- isSearchingDevice = true;
- return err == 0;
-}
-
-/*!
- Cancels a possible outstanding device search request.
- */
-void BtDeviceData::cancelSearchDevice()
-{
- if ( mDiscover ) {
- isSearchingDevice = false;
- mDiscover->CancelDiscovery();
- }
-}
-
-/*!
- Removes transient (not-in-registry) devices
- (added as the result of device search).
- */
-void BtDeviceData::removeTransientDevices()
-{
- // clear in-range property for all device items in this model.
- int cnt = mData.count();
- for ( int i = mData.count() - 1; i > -1; --i)
- {
- const BtuiModelDataItem& qtdev = mData.at(i);
- if(isDeviceInRange(qtdev)) {
- if(isDeviceInRegistry(qtdev)) {
- // we cannot remove this device as it is in registry.
- // remove it in-range property.
- setMajorProperty(mData[i], BtuiDevProperty::InRange, false);
- updateRssi(mData[i], RssiInvalid);
- mModel.emitDataChanged( i, 0, this );
- }
- else {
- // this device is not in-registry. Delete it from local
- // store.
- mModel.beginRemoveRows(QModelIndex(), i, i);
- mData.removeAt( i );
- mModel.endRemoveRows();
- }
- }
- }
-}
-
-/*!
- callback from repository.
- re-initialize our store.
- */
-void BtDeviceData::RepositoryInitialized()
-{
- initializeDataStore();
-}
-
-/*!
- callback from repository.
- update our store.
- */
-void BtDeviceData::DeletedFromRegistry( const TBTDevAddr& addr )
-{
- int i = indexOf( addr );
- if ( i > -1 ) {
- if ( isSearchingDevice && isDeviceInRange( mData.at(i) ) ) {
- // device searching is ongoing, and it is in-range. we can not
- // remore it from model now.
- // clear-registry related properties, so that
- // we get a chance to clean it after device searching later.
- setMajorProperty(mData[i], BtuiDevProperty::RegistryProperties, false);
- mModel.emitDataChanged( i, 0, this );
- }
- else {
- mModel.beginRemoveRows(QModelIndex(), i, i);
- mData.removeAt( i );
- mModel.endRemoveRows();
- }
- }
-}
-
-/*!
- callback from repository.
- update our store.
- */
-void BtDeviceData::AddedToRegistry( const CBtDevExtension& dev )
-{
- ChangedInRegistry( dev, 0 );
-}
-
-/*!
- callback from repository.
- update our store.
- */
-void BtDeviceData::ChangedInRegistry(
- const CBtDevExtension& dev, TUint similarity )
-{
- int i = indexOf( dev.Addr() );
- if ( i == -1 ) {
- BtuiModelDataItem devData;
- if ( !isSearchingDevice ) {
- // Rssi is only available at device inquiry stage.
- // We initialize this property to an invalid value
- updateRssi(devData, RssiInvalid);
- }
- // add device-in-registry property:
- setMajorProperty(devData, BtuiDevProperty::InRegistry, true);
- updateDeviceProperty(devData, dev, 0 );
- mModel.beginInsertRows( QModelIndex(), mData.count(), mData.count() );
- mData.append( devData );
- mModel.endInsertRows();
- }
- else {
- updateDeviceProperty(mData[i], dev, similarity );
- setMajorProperty(mData[i], BtuiDevProperty::InRegistry, true);
- mModel.emitDataChanged( i, 0, this );
- }
-}
-
-/*!
- callback from repository.
- update our store.
- */
-void BtDeviceData::ServiceConnectionChanged(
- const CBtDevExtension& dev, TBool connected )
-{
- int i = indexOf( dev.Addr() );
- if ( i > -1 ) {
- int preconn = BtuiDevProperty::Connected
- & mData[i][BtDeviceModel::MajorPropertyRole].toInt();
- // we only update and signal if connection status is really
- // changed:
- if ( ( preconn != 0 && !connected )
- || ( preconn == 0 && connected ) ) {
- setMajorProperty(mData[i], BtuiDevProperty::Connected, connected );
- mModel.emitDataChanged( i, 0, this );
- }
- }
- // it is impossible that a device has connected but it is not in
- // our local store according to current bteng services.
- // need to take more care in future when this becomes possible.
-}
-
-/*!
- callback from device search.
- update our store.
- */
-void BtDeviceData::HandleNextDiscoveryResultL(
- const TInquirySockAddr& inqAddr, const TDesC& name )
-{
- int pos = indexOf( inqAddr.BTAddr() );
- const CBtDevExtension* dev = mDeviceRepo->Device( inqAddr.BTAddr() );
-
- //RssiRole
- int rssi( RssiInvalid ); // initialize to an invalid value.
- if( inqAddr.ResultFlags() & TInquirySockAddr::ERssiValid ) {
- rssi = inqAddr.Rssi();
- }
-
- if ( pos == -1 ) {
- BtuiModelDataItem devData;
- setMajorProperty(devData, BtuiDevProperty::InRange, true);
- updateRssi(devData, rssi);
- CBtDevExtension* devExt(NULL);
- TRAP_IGNORE( {
- devExt = CBtDevExtension::NewLC( inqAddr, name );
- CleanupStack::Pop(); });
- updateDeviceProperty(devData, *devExt, 0);
- delete devExt;
- mModel.beginInsertRows( QModelIndex(), mData.count(), mData.count() );
- mData.append( devData );
- mModel.endInsertRows();
- }
- else {
- setMajorProperty(mData[pos], BtuiDevProperty::InRange, true);
- updateRssi(mData[pos], rssi);
- mModel.emitDataChanged( pos, 0, this );
- }
-}
-
-/*!
- callback from device search.
- inform client.
- */
-void BtDeviceData::HandleDiscoveryCompleted( TInt error )
-{
- isSearchingDevice = false;
- mModel.emitdeviceSearchCompleted( (int) error );
-}
-
-void BtDeviceData::initializeDataStore()
- {
- // it is possible that we are searching devices.
- // We use a simple but not-so-efficient method to update the model.
-
- // If the device store is not empty, we clear
- // registry property from these devices first.
- for (int i = 0; i < mData.count(); ++i) {
- setMajorProperty(mData[i], BtuiDevProperty::RegistryProperties, false);
- }
- if ( mData.count() ) {
- // need to update view because we have changed device properties.
- QModelIndex top = mModel.createIndex(0, 0, this);
- QModelIndex bottom = mModel.createIndex(mData.count() - 1, 0, this);
- mModel.emitDataChanged( top, bottom );
- }
-
- const RDevExtensionArray& devs = mDeviceRepo->AllDevices();
- for (int i = 0; i < devs.Count(); ++i) {
- int pos = indexOf( devs[i]->Addr() );
- if ( pos > -1 ) {
- // add device-in-registry property:
- setMajorProperty(mData[pos], BtuiDevProperty::InRegistry, true);
- updateDeviceProperty(mData[pos], *(devs[i]), 0);
- mModel.emitDataChanged( pos, 0, this );
- }
- else {
- BtuiModelDataItem devData;
- // add device-in-registry property:
- setMajorProperty(devData, BtuiDevProperty::InRegistry, true);
- updateDeviceProperty(devData, *( devs[i] ), 0 );
- mModel.beginInsertRows(QModelIndex(), mData.count(), mData.count() );
- mData.append( devData );
- mModel.endInsertRows();
- }
- }
-}
-
-void BtDeviceData::updateDeviceProperty(BtuiModelDataItem& qtdev,
- const CBtDevExtension& dev, TUint similarity )
-{
- // similarity is not used currently.
- // It is possible to gain better performance
- // with this info to avoid re-manipulate
- // unchanged properties.
- Q_UNUSED(similarity);
-
- //DevDisplayNameRole
- QString str = QString::fromUtf16(
- dev.Alias().Ptr(), dev.Alias().Length() );
- qtdev[BtDeviceModel::NameAliasRole] = QVariant( str );
-
- //DevAddrReadableRole
- addrSymbianToReadbleString( str, dev.Addr() );
- qtdev[BtDeviceModel::ReadableBdaddrRole] = QVariant( str );
-
- //LastUsedTimeRole
- TDateTime symDt = dev.Device().Used().DateTime();
- QDate date( symDt.Year(), symDt.Month(), symDt.Day() );
- QTime time( symDt.Hour(), symDt.Minute(), symDt.MicroSecond() / 1000 );
- QDateTime qdt(date, time);
- qtdev[BtDeviceModel::LastUsedTimeRole] = QVariant(qdt);
-
- // set paired status:
- setMajorProperty(qtdev, BtuiDevProperty::Bonded, isBonded( dev.Device() ));
-
- // set blocked status:
- setMajorProperty(qtdev, BtuiDevProperty::Blocked,
- dev.Device().GlobalSecurity().Banned() );
- // set trusted status:
- setMajorProperty(qtdev, BtuiDevProperty::Trusted,
- dev.Device().GlobalSecurity().NoAuthorise() );
-
- //CoDRole
- //MinorPropertyRole
- int cod = static_cast<int>( dev.Device().DeviceClass().DeviceClass() );
- qtdev[BtDeviceModel::CoDRole] = QVariant(cod);
-
- int majorDeviceType;
- int minorDeviceType;
- // device type is mapped according to CoD:
- BtuiDevProperty::mapDeiveType(majorDeviceType, minorDeviceType, cod);
-
- qtdev[BtDeviceModel::MajorPropertyRole] =
- QVariant( qtdev[BtDeviceModel::MajorPropertyRole].toInt() | majorDeviceType );
- qtdev[BtDeviceModel::MinorPropertyRole] = QVariant( minorDeviceType );
-}
-
-int BtDeviceData::indexOf( const TBTDevAddr& addr ) const
-{
- QString addrStr;
- addrSymbianToReadbleString( addrStr, addr );
- for (int i = 0; i < mData.count(); ++i ) {
- if ( mData.at( i ).value( BtDeviceModel::ReadableBdaddrRole )
- == addrStr ) {
- return i;
- }
- }
- return -1;
-}
-
-void BtDeviceData::updateRssi(BtuiModelDataItem& qtdev, int rssi )
- {
- qtdev[BtDeviceModel::RssiRole] = QVariant( rssi );
- }
-
-/*!
- Add the specified major property to the device if addto is true.
- Otherwise the property is removed from the device.
- */
-void BtDeviceData::setMajorProperty(
- BtuiModelDataItem& qtdev, int prop, bool addto)
-{
- if ( addto ) {
- qtdev[BtDeviceModel::MajorPropertyRole] =
- QVariant( qtdev[BtDeviceModel::MajorPropertyRole].toInt() | prop);
- }
- else {
- qtdev[BtDeviceModel::MajorPropertyRole] =
- QVariant( qtdev[BtDeviceModel::MajorPropertyRole].toInt() & ~prop);
- }
-}
-
-bool BtDeviceData::isDeviceInRange( const BtuiModelDataItem& qtdev )
-{
- return BtuiDevProperty::InRange & qtdev[BtDeviceModel::MajorPropertyRole].toInt();
-}
-
-bool BtDeviceData::isDeviceInRegistry( const BtuiModelDataItem& qtdev )
-{
- return BtuiDevProperty::InRegistry & qtdev[BtDeviceModel::MajorPropertyRole].toInt();
-}
--- a/bluetoothengine/btui/btuimodel/btdevicedata.h Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef BTDEVICEDATA_H
-#define BTDEVICEDATA_H
-
-#include "btuimodeltypes.h"
-#include <btdevicemodel.h>
-
-#include <e32base.h>
-#include <btservices/btdevrepository.h>
-#include <btservices/devdiscoveryobserver.h>
-
-
-class CAdvanceDevDiscoverer;
-
-/*!
- \class BtDeviceData
- \brief class for providing remote device data.
-
- BtDeviceData class is responsible for providing the latest information
- regarding the properties of remote devices.
-
- \\sa bluetoothuimodel
- */
-class BtDeviceData : public QObject,
- public MBtDevRepositoryObserver,
- public MDevDiscoveryObserver
-{
- Q_OBJECT
-
-public:
- explicit BtDeviceData( BtDeviceModel& model, QObject *parent = 0 );
-
- virtual ~BtDeviceData();
-
- bool isValid( int row, int col ) const;
-
- int rowCount() const;
-
- int columnCount() const;
-
- void data(QVariant& val, int row, int col, int role ) const;
-
- BtuiModelDataItem itemData( int row, int col ) const;
-
- bool searchDevice();
-
- void cancelSearchDevice();
-
- void removeTransientDevices();
-
-private:
- // From MBtDeviceRepositoryObserver
-
- void RepositoryInitialized();
-
- void DeletedFromRegistry( const TBTDevAddr& addr );
-
- void AddedToRegistry( const CBtDevExtension& dev );
-
- void ChangedInRegistry( const CBtDevExtension& dev, TUint similarity );
-
- void ServiceConnectionChanged(
- const CBtDevExtension& dev, TBool connected );
-
- // from MDevDiscoveryObserver
- void HandleNextDiscoveryResultL(
- const TInquirySockAddr& inqAddr, const TDesC& name );
-
- void HandleDiscoveryCompleted( TInt error );
-
-public slots:
- //void activeRequestCompleted( int status, int id );
-
-private:
-
- void initializeDataStore();
-
- void updateDeviceProperty(BtuiModelDataItem& qtdev,
- const CBtDevExtension& dev, TUint similarity );
-
- int indexOf( const TBTDevAddr& addr ) const;
-
- void updateRssi(BtuiModelDataItem& qtdev, int rssi );
-
- void setMajorProperty( BtuiModelDataItem& qtdev, int prop, bool addto);
-
- bool isDeviceInRange( const BtuiModelDataItem& qtdev );
-
- bool isDeviceInRegistry( const BtuiModelDataItem& qtdev );
-
-private:
-
- BtuiModelDataSource mData;
-
- BtDeviceModel& mModel;
-
- CBtDevRepository* mDeviceRepo;
-
- CAdvanceDevDiscoverer* mDiscover;
-
- bool isSearchingDevice;
-
- Q_DISABLE_COPY(BtDeviceData)
-
-};
-
-#endif // BTLOCALSETTING_H
--- a/bluetoothengine/btui/btuimodel/btdevicemodel.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuimodel/btdevicemodel.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -16,7 +16,8 @@
*/
#include <btdevicemodel.h>
-#include "btdevicedata.h"
+#include "btdevicemodel_p.h"
+#include "bluetoothuitrace.h"
/*!
This Constructor creates new instances of model data structure.
@@ -24,17 +25,18 @@
BtDeviceModel::BtDeviceModel( QObject *parent )
: QAbstractItemModel( parent )
{
- mDeviceData = QSharedPointer<BtDeviceData>( new BtDeviceData( *this ) );
+ d = QSharedPointer<BtDeviceModelPrivate>( new BtDeviceModelPrivate( *this ) );
+ connectModelSignals();
}
/*!
- This Constructor shares the instances of model data structure with the
- given model.
+ This Constructor shares the private implementation of the device model.
*/
BtDeviceModel::BtDeviceModel( const BtDeviceModel &model, QObject *parent )
: QAbstractItemModel( parent )
{
- mDeviceData = model.mDeviceData;
+ d = model.d;
+ connectModelSignals();
}
/*!
@@ -50,7 +52,7 @@
*/
bool BtDeviceModel::searchDevice()
{
- return mDeviceData->searchDevice();
+ return d->searchDevice();
}
/*!
@@ -58,7 +60,7 @@
*/
void BtDeviceModel::cancelSearchDevice()
{
- mDeviceData->cancelSearchDevice();
+ d->cancelSearchDevice();
}
/*!
@@ -67,7 +69,7 @@
*/
void BtDeviceModel::removeTransientDevices()
{
- mDeviceData->removeTransientDevices();
+ d->removeTransientDevices();
}
/*!
@@ -76,8 +78,8 @@
QModelIndex BtDeviceModel::index( int row, int column, const QModelIndex &parent ) const
{
Q_UNUSED( parent );
- if ( mDeviceData->isValid( row, column ) ) {
- return createIndex( row, column, mDeviceData.data() );
+ if ( d->isValid( row, column ) ) {
+ return createIndex( row, column, d.data() );
}
// invalid row and column:
return QModelIndex();
@@ -99,7 +101,7 @@
int BtDeviceModel::rowCount( const QModelIndex &parent ) const
{
Q_UNUSED( parent );
- return mDeviceData->rowCount();
+ return d->rowCount();
}
/*!
@@ -108,7 +110,7 @@
int BtDeviceModel::columnCount( const QModelIndex &parent ) const
{
Q_UNUSED( parent );
- return mDeviceData->columnCount();
+ return d->columnCount();
}
/*!
@@ -117,33 +119,94 @@
QVariant BtDeviceModel::data( const QModelIndex &index, int role ) const
{
QVariant val( QVariant::Invalid );
- mDeviceData.data()->data( val, index.row(), index.column(), role );
+ d.data()->data( val, index.row(), index.column(), role );
return val;
}
QMap<int, QVariant> BtDeviceModel::itemData( const QModelIndex & index ) const
{
- return mDeviceData.data()->itemData( index.row(), index.column() );
+ return d.data()->itemData( index.row(), index.column() );
+}
+
+
+/*!
+ emits dataChanged signal.
+ */
+void BtDeviceModel::deviceDataChanged( int row, void *parent )
+{
+ QModelIndex idx = createIndex( row, 0, parent );
+ emit dataChanged( idx, idx );
}
/*!
emits dataChanged signal.
*/
-void BtDeviceModel::emitDataChanged( int row, int column, void *parent )
+void BtDeviceModel::deviceDataChanged( int first, int last, void *parent )
{
- QModelIndex idx = createIndex( row, column, parent );
- emit dataChanged( idx, idx );
+ QModelIndex top = createIndex( first, 0, parent );
+ QModelIndex bottom = createIndex( last, 0, parent );
+ emit dataChanged( top, bottom );
+}
+
+/*!
+ call beginInsertRows.
+ */
+void BtDeviceModel::beginInsertDevices(int first, int last, void *parent)
+{
+ Q_UNUSED( parent);
+ beginInsertRows(QModelIndex(), first, last);
}
-void BtDeviceModel::emitDataChanged(const QModelIndex &top, const QModelIndex &bottom )
- {
- emit dataChanged( top, bottom );
- }
+/*!
+ calls endInsertRows.
+ */
+void BtDeviceModel::BtDeviceModel::endInsertDevices()
+{
+ endInsertRows();
+}
+
+/*!
+ calls beginRemoveRows.
+ */
+void BtDeviceModel::beginRemoveDevices(int first, int last, void *parent)
+{
+ Q_UNUSED( parent);
+ beginRemoveRows(QModelIndex(), first, last);
+}
+
+/*!
+ calls endRemoveRows.
+ */
+void BtDeviceModel::endRemoveDevices()
+{
+ endRemoveRows();
+}
/*!
emits deviceSearchCompleted signal.
*/
-void BtDeviceModel::emitdeviceSearchCompleted( int error )
+void BtDeviceModel::emitDeviceSearchCompleted( int error )
{
emit deviceSearchCompleted( error );
}
+
+/*!
+ connects all signals of private impl to slots of this
+ */
+void BtDeviceModel::connectModelSignals()
+{
+ bool ok = connect(d.data(), SIGNAL(deviceDataChanged(int,void*)), SLOT(deviceDataChanged(int,void*)));
+ BTUI_ASSERT_X( ok, "BtDeviceModel", "deviceDataChanged can't connect" );
+ ok = connect(d.data(), SIGNAL(deviceDataChanged(int,int,void*)), SLOT(deviceDataChanged(int,int,void*)));
+ BTUI_ASSERT_X( ok, "BtDeviceModel", "deviceDataChanged can't connect 2" );
+ ok = connect(d.data(), SIGNAL(beginInsertDevices(int,int,void*)), SLOT(beginInsertDevices(int,int,void*)));
+ BTUI_ASSERT_X( ok, "BtDeviceModel", "beginInsertDevices can't connect" );
+ ok = connect(d.data(), SIGNAL(endInsertDevices()), SLOT(endInsertDevices()));
+ BTUI_ASSERT_X( ok, "BtDeviceModel", "endInsertDevices can't connect" );
+ ok = connect(d.data(), SIGNAL(beginRemoveDevices(int,int,void*)), SLOT(beginRemoveDevices(int,int,void*)));
+ BTUI_ASSERT_X( ok, "BtDeviceModel", "beginRemoveDevices can't connect" );
+ ok = connect(d.data(), SIGNAL(endRemoveDevices()), SLOT(endRemoveDevices()));
+ BTUI_ASSERT_X( ok, "BtDeviceModel", "endRemoveDevices can't connect" );
+ ok = connect(d.data(), SIGNAL(deviceSearchCompleted(int)), SLOT(emitDeviceSearchCompleted(int)));
+ BTUI_ASSERT_X( ok, "BtDeviceModel", "emitDeviceSearchCompleted can't connect" );
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/btdevicemodel_p.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,478 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "btdevicemodel_p.h"
+#include <QDateTime>
+#include <btservices/advancedevdiscoverer.h>
+#include <btengconnman.h>
+#include "btuiutil.h"
+#include "btuidevtypemap.h"
+#include "btqtconstants.h"
+
+/*!
+ Constructor.
+ */
+BtDeviceModelPrivate::BtDeviceModelPrivate( BtDeviceModel& model, QObject *parent )
+ : QObject( parent ), mModel( model ), mDiscover( 0 ), mSeqNum( 0 )
+{
+ mDeviceRepo = 0;
+ isSearchingDevice = false;
+ TRAP_IGNORE({
+ mDeviceRepo = CBtDevRepository::NewL();
+ });
+ Q_CHECK_PTR( mDeviceRepo );
+ TRAP_IGNORE( mDeviceRepo->AddObserverL( this ) );
+
+ if ( mDeviceRepo->IsInitialized() ) {
+ initializeDataStore();
+ }
+}
+
+/*!
+ Destructor.
+ */
+BtDeviceModelPrivate::~BtDeviceModelPrivate()
+{
+ delete mDeviceRepo;
+ delete mDiscover;
+}
+
+
+/*!
+ Tells whether the given column is in the range of the setting list.
+
+ \param row the row number to be checked
+ \param col the column number to be checked
+
+ \return true if the given row and column are valid; false otherwise.
+*/
+bool BtDeviceModelPrivate::isValid( int row, int column) const
+{
+ return row >= 0 && row < mData.count() && column == 0;
+}
+
+/*!
+ \return the total amount of rows.
+
+*/
+int BtDeviceModelPrivate::rowCount() const
+{
+ return mData.count();
+}
+
+/*!
+ \return the total amount of columns.
+
+*/
+int BtDeviceModelPrivate::columnCount() const
+{
+ return 1;
+}
+
+/*!
+ Gets the value within a data item.
+ \param val contains the value at return.
+ \param row the row number which the value is from
+ \param col the column number which the value is from
+ \param role the role identifier of the value.
+ */
+void BtDeviceModelPrivate::data(QVariant& val, int row, int col, int role ) const
+{
+ if ( isValid( row, col ) ) {
+ val = mData.at( row ).value( role );
+ }
+ else {
+ val = QVariant( QVariant::Invalid );
+ }
+}
+
+/*!
+ Gets the whole item data at the specified column
+ \param row the row number of the item data to be returned
+ \param col the column number of the item data to be returned
+ \return the item data
+ */
+BtuiModelDataItem BtDeviceModelPrivate::itemData( int row, int col ) const
+{
+ if ( isValid( row, col ) ) {
+ return mData.at( row );
+ }
+ return BtuiModelDataItem();
+}
+
+
+/*!
+ Requests the model to searching Bluetooth devices.
+ \return true if the request is accepted; false otherwise
+ */
+bool BtDeviceModelPrivate::searchDevice()
+{
+ int err ( 0 );
+ removeTransientDevices();
+ if ( !mDiscover ) {
+ TRAP(err, mDiscover = CAdvanceDevDiscoverer::NewL( *mDeviceRepo, *this) );
+ }
+ if ( !err ) {
+ TRAP(err, mDiscover->DiscoverDeviceL() );
+ }
+ isSearchingDevice = true;
+ return err == 0;
+}
+
+/*!
+ Cancels a possible outstanding device search request.
+ */
+void BtDeviceModelPrivate::cancelSearchDevice()
+{
+ if ( mDiscover ) {
+ isSearchingDevice = false;
+ mDiscover->CancelDiscovery();
+ }
+}
+
+/*!
+ Removes transient (not-in-registry) devices
+ (added as the result of device search).
+ */
+void BtDeviceModelPrivate::removeTransientDevices()
+{
+ // clear in-range property for all device items in this model.
+ int cnt = mData.count();
+ for ( int i = mData.count() - 1; i > -1; --i)
+ {
+ const BtuiModelDataItem& qtdev = mData.at(i);
+ if(isDeviceInRange(qtdev)) {
+ if(isDeviceInRegistry(qtdev)) {
+ // we cannot remove this device as it is in registry.
+ // remove it in-range property.
+ setMajorProperty(mData[i], BtuiDevProperty::InRange, false);
+ updateRssi(mData[i], RssiInvalid);
+ updateSeqNum(mData[i], -1);
+ emit deviceDataChanged(i, this);
+ }
+ else {
+ // this device is not in-registry. Delete it from local
+ // store.
+ emit beginRemoveDevices(i, i, this);
+ mData.removeAt( i );
+ emit endRemoveDevices();
+ }
+ }
+ }
+}
+
+/*!
+ callback from repository.
+ re-initialize our store.
+ */
+void BtDeviceModelPrivate::RepositoryInitialized()
+{
+ initializeDataStore();
+}
+
+/*!
+ callback from repository.
+ update our store.
+ */
+void BtDeviceModelPrivate::DeletedFromRegistry( const TBTDevAddr& addr )
+{
+ int i = indexOf( addr );
+ if ( i > -1 ) {
+ if ( isSearchingDevice && isDeviceInRange( mData.at(i) ) ) {
+ // device searching is ongoing, and it is in-range. we can not
+ // remove it from model now.
+ // clear-registry related properties, so that
+ // we get a chance to clean it after device searching later.
+ setMajorProperty(mData[i], BtuiDevProperty::RegistryProperties, false);
+ emit deviceDataChanged(i, this);
+ }
+ else {
+ emit beginRemoveDevices(i, i, this);
+ mData.removeAt( i );
+ emit endRemoveDevices();
+ }
+ }
+}
+
+/*!
+ callback from repository.
+ update our store.
+ */
+void BtDeviceModelPrivate::AddedToRegistry( const CBtDevExtension& dev )
+{
+ ChangedInRegistry( dev, 0 );
+}
+
+/*!
+ callback from repository.
+ update our store.
+ */
+void BtDeviceModelPrivate::ChangedInRegistry(
+ const CBtDevExtension& dev, TUint similarity )
+{
+ int i = indexOf( dev.Addr() );
+ if ( i == -1 ) {
+ BtuiModelDataItem devData;
+ if ( !isSearchingDevice ) {
+ // Rssi is only available at device inquiry stage.
+ // We initialize this property to an invalid value
+ updateRssi(devData, RssiInvalid);
+ }
+ // add device-in-registry property:
+ setMajorProperty(devData, BtuiDevProperty::InRegistry, true);
+ updateDeviceProperty(devData, dev, 0 );
+ emit beginInsertDevices( mData.count(), mData.count(), this );
+ mData.append( devData );
+ emit endInsertDevices();
+ }
+ else {
+ updateDeviceProperty(mData[i], dev, similarity );
+ setMajorProperty(mData[i], BtuiDevProperty::InRegistry, true);
+ emit deviceDataChanged( i, this );
+ }
+}
+
+/*!
+ callback from repository.
+ update our store.
+ */
+void BtDeviceModelPrivate::ServiceConnectionChanged(
+ const CBtDevExtension& dev, TBool connected )
+{
+ int i = indexOf( dev.Addr() );
+ if ( i > -1 ) {
+ int preconn = BtuiDevProperty::Connected
+ & mData[i][BtDeviceModel::MajorPropertyRole].toInt();
+ // we only update and signal if connection status is really
+ // changed:
+ if ( ( preconn != 0 && !connected )
+ || ( preconn == 0 && connected ) ) {
+ setMajorProperty(mData[i], BtuiDevProperty::Connected, connected );
+ emit deviceDataChanged( i, this );
+ }
+ }
+ // it is impossible that a device has connected but it is not in
+ // our local store according to current bteng services.
+ // need to take more care in future when this becomes possible.
+}
+
+/*!
+ callback from device search.
+ update our store.
+ */
+void BtDeviceModelPrivate::HandleNextDiscoveryResultL(
+ const TInquirySockAddr& inqAddr, const TDesC& name )
+{
+ int pos = indexOf( inqAddr.BTAddr() );
+ const CBtDevExtension* dev = mDeviceRepo->Device( inqAddr.BTAddr() );
+
+ //RssiRole
+ int rssi( RssiInvalid ); // initialize to an invalid value.
+ if( inqAddr.ResultFlags() & TInquirySockAddr::ERssiValid ) {
+ rssi = inqAddr.Rssi();
+ }
+
+ if ( pos == -1 ) {
+ BtuiModelDataItem devData;
+ setMajorProperty(devData, BtuiDevProperty::InRange, true);
+ updateRssi(devData, rssi);
+ updateSeqNum( devData, mSeqNum++ );
+ CBtDevExtension* devExt(NULL);
+ TRAP_IGNORE( {
+ devExt = CBtDevExtension::NewLC( inqAddr, name );
+ CleanupStack::Pop(); });
+ updateDeviceProperty(devData, *devExt, 0);
+ delete devExt;
+ emit beginInsertDevices( mData.count(), mData.count(), this );
+ mData.append( devData );
+ emit endInsertDevices();
+ }
+ else {
+ setMajorProperty(mData[pos], BtuiDevProperty::InRange, true);
+ updateRssi(mData[pos], rssi);
+ updateSeqNum( mData[pos], mSeqNum++ );
+ emit deviceDataChanged( pos, this );
+ }
+}
+
+/*!
+ callback from device search.
+ inform client.
+ */
+void BtDeviceModelPrivate::HandleDiscoveryCompleted( TInt error )
+{
+ isSearchingDevice = false;
+ // Reset the sequence number for the next search
+ mSeqNum = 0;
+ emit deviceSearchCompleted( (int) error );
+}
+
+void BtDeviceModelPrivate::initializeDataStore()
+ {
+
+ mSeqNum = 0; // reset when starting search again
+
+ // it is possible that we are searching devices.
+ // We use a simple but not-so-efficient method to update the model.
+
+ // If the device store is not empty, we clear
+ // registry property from these devices first.
+ for (int i = 0; i < mData.count(); ++i) {
+ setMajorProperty(mData[i], BtuiDevProperty::RegistryProperties, false);
+ }
+ if ( mData.count() ) {
+ // need to update view because we have changed device properties.
+ emit deviceDataChanged( 0, mData.count() - 1, this );
+ }
+
+ const RDevExtensionArray& devs = mDeviceRepo->AllDevices();
+ for (int i = 0; i < devs.Count(); ++i) {
+ int pos = indexOf( devs[i]->Addr() );
+ if ( pos > -1 ) {
+ // add device-in-registry property:
+ setMajorProperty(mData[pos], BtuiDevProperty::InRegistry, true);
+ updateDeviceProperty(mData[pos], *(devs[i]), 0);
+ updateSeqNum(mData[pos], -1);
+ emit deviceDataChanged( pos, this );
+ }
+ else {
+ BtuiModelDataItem devData;
+ // add device-in-registry property:
+ setMajorProperty(devData, BtuiDevProperty::InRegistry, true);
+ updateDeviceProperty(devData, *( devs[i] ), 0 );
+ updateSeqNum(devData, -1);
+ emit beginInsertDevices(mData.count(), mData.count(), this );
+ mData.append( devData );
+ emit endInsertDevices();
+ }
+ }
+}
+
+void BtDeviceModelPrivate::updateDeviceProperty(BtuiModelDataItem& qtdev,
+ const CBtDevExtension& dev, TUint similarity )
+{
+ // similarity is not used currently.
+ // It is possible to gain better performance
+ // with this info to avoid re-manipulate
+ // unchanged properties.
+ Q_UNUSED(similarity);
+
+ //DevDisplayNameRole
+ QString str = QString::fromUtf16(
+ dev.Alias().Ptr(), dev.Alias().Length() );
+ qtdev[BtDeviceModel::NameAliasRole] = QVariant( str );
+
+ //DevAddrReadableRole
+ addrSymbianToReadbleString( str, dev.Addr() );
+ qtdev[BtDeviceModel::ReadableBdaddrRole] = QVariant( str );
+
+ //LastUsedTimeRole
+ TDateTime symDt = dev.Device().Used().DateTime();
+ QDate date( symDt.Year(), symDt.Month(), symDt.Day() );
+ QTime time( symDt.Hour(), symDt.Minute(), symDt.MicroSecond() / 1000 );
+ QDateTime qdt(date, time);
+ qtdev[BtDeviceModel::LastUsedTimeRole] = QVariant(qdt);
+
+ // set paired status:
+ setMajorProperty(qtdev, BtuiDevProperty::Bonded, isBonded( dev.Device() ));
+
+ // set blocked status:
+ setMajorProperty(qtdev, BtuiDevProperty::Blocked,
+ dev.Device().GlobalSecurity().Banned() );
+ // set trusted status:
+ setMajorProperty(qtdev, BtuiDevProperty::Trusted,
+ dev.Device().GlobalSecurity().NoAuthorise() );
+ // set connected status:
+ // EBTEngConnecting is an intermediate state between connected and not-connected,
+ // we do not treat it as connected:
+ setMajorProperty(qtdev, BtuiDevProperty::Connected, dev.ServiceConnectionStatus() == EBTEngConnected);
+
+ // Check whether the device has services that are connectable in bteng scope.
+ CBTEngConnMan* connMan( 0 );
+ TRAP_IGNORE( connMan = CBTEngConnMan::NewL(0));
+ TBool connectable(EFalse);
+ if ( connMan ) {
+ (void) connMan->IsConnectable(dev.Addr(), dev.Device().DeviceClass(), connectable);
+ delete connMan;
+ }
+ setMajorProperty(qtdev, BtuiDevProperty::Connectable, connectable);
+
+ int cod = static_cast<int>( dev.Device().DeviceClass().DeviceClass() );
+ qtdev[BtDeviceModel::CoDRole] = QVariant(cod);
+
+ int majorDeviceType;
+ int minorDeviceType;
+ // device type is mapped according to CoD:
+ BtuiDevProperty::mapDeiveType(majorDeviceType, minorDeviceType, cod);
+
+
+
+
+ qtdev[BtDeviceModel::MajorPropertyRole] =
+ QVariant( qtdev[BtDeviceModel::MajorPropertyRole].toInt() | majorDeviceType );
+ qtdev[BtDeviceModel::MinorPropertyRole] = QVariant( minorDeviceType );
+}
+
+int BtDeviceModelPrivate::indexOf( const TBTDevAddr& addr ) const
+{
+ QString addrStr;
+ addrSymbianToReadbleString( addrStr, addr );
+ for (int i = 0; i < mData.count(); ++i ) {
+ if ( mData.at( i ).value( BtDeviceModel::ReadableBdaddrRole )
+ == addrStr ) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+void BtDeviceModelPrivate::updateRssi(BtuiModelDataItem& qtdev, int rssi )
+{
+ qtdev[BtDeviceModel::RssiRole] = QVariant( rssi );
+}
+
+void BtDeviceModelPrivate::updateSeqNum(BtuiModelDataItem& qtdev, int seqNum )
+{
+ qtdev[BtDeviceModel::SeqNumRole] = QVariant( seqNum );
+}
+
+/*!
+ Add the specified major property to the device if addto is true.
+ Otherwise the property is removed from the device.
+ */
+void BtDeviceModelPrivate::setMajorProperty(
+ BtuiModelDataItem& qtdev, int prop, bool addto)
+{
+ if ( addto ) {
+ qtdev[BtDeviceModel::MajorPropertyRole] =
+ QVariant( qtdev[BtDeviceModel::MajorPropertyRole].toInt() | prop);
+ }
+ else {
+ qtdev[BtDeviceModel::MajorPropertyRole] =
+ QVariant( qtdev[BtDeviceModel::MajorPropertyRole].toInt() & ~prop);
+ }
+}
+
+bool BtDeviceModelPrivate::isDeviceInRange( const BtuiModelDataItem& qtdev )
+{
+ return BtuiDevProperty::InRange & qtdev[BtDeviceModel::MajorPropertyRole].toInt();
+}
+
+bool BtDeviceModelPrivate::isDeviceInRegistry( const BtuiModelDataItem& qtdev )
+{
+ return BtuiDevProperty::InRegistry & qtdev[BtDeviceModel::MajorPropertyRole].toInt();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/btdevicemodel_p.h Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,140 @@
+/*
+* 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 BTDEVICEMODE_P_H
+#define BTDEVICEMODE_P_H
+
+#include "btuimodeltypes.h"
+#include <btdevicemodel.h>
+
+#include <e32base.h>
+#include <btservices/btdevrepository.h>
+#include <btservices/devdiscoveryobserver.h>
+
+class CAdvanceDevDiscoverer;
+
+/*!
+ \class BtDeviceData
+ \brief class for providing remote device data.
+
+ BtDeviceData class is responsible for providing the latest information
+ regarding the properties of remote devices.
+
+ \\sa bluetoothuimodel
+ */
+class BtDeviceModelPrivate : public QObject,
+ public MBtDevRepositoryObserver,
+ public MDevDiscoveryObserver
+{
+ Q_OBJECT
+
+public:
+ explicit BtDeviceModelPrivate( BtDeviceModel& model, QObject *parent = 0 );
+
+ virtual ~BtDeviceModelPrivate();
+
+ bool isValid( int row, int col ) const;
+
+ int rowCount() const;
+
+ int columnCount() const;
+
+ void data(QVariant& val, int row, int col, int role ) const;
+
+ BtuiModelDataItem itemData( int row, int col ) const;
+
+ bool searchDevice();
+
+ void cancelSearchDevice();
+
+ void removeTransientDevices();
+
+private:
+ // From MBtDeviceRepositoryObserver
+
+ void RepositoryInitialized();
+
+ void DeletedFromRegistry( const TBTDevAddr& addr );
+
+ void AddedToRegistry( const CBtDevExtension& dev );
+
+ void ChangedInRegistry( const CBtDevExtension& dev, TUint similarity );
+
+ void ServiceConnectionChanged(
+ const CBtDevExtension& dev, TBool connected );
+
+ // from MDevDiscoveryObserver
+ void HandleNextDiscoveryResultL(
+ const TInquirySockAddr& inqAddr, const TDesC& name );
+
+ void HandleDiscoveryCompleted( TInt error );
+
+signals:
+
+ void deviceDataChanged( int row, void *parent );
+
+ void deviceDataChanged( int first, int last, void *parent );
+
+ void beginInsertDevices(int first, int last, void *parent);
+ void endInsertDevices();
+
+ void beginRemoveDevices(int first, int last, void *parent);
+ void endRemoveDevices();
+
+ void deviceSearchCompleted( int error );
+
+public slots:
+ //void activeRequestCompleted( int status, int id );
+
+private:
+
+ void initializeDataStore();
+
+ void updateDeviceProperty(BtuiModelDataItem& qtdev,
+ const CBtDevExtension& dev, TUint similarity );
+
+ int indexOf( const TBTDevAddr& addr ) const;
+
+ void updateRssi(BtuiModelDataItem& qtdev, int rssi );
+
+ void updateSeqNum(BtuiModelDataItem& qtdev, int seqNum );
+
+ void setMajorProperty( BtuiModelDataItem& qtdev, int prop, bool addto);
+
+ bool isDeviceInRange( const BtuiModelDataItem& qtdev );
+
+ bool isDeviceInRegistry( const BtuiModelDataItem& qtdev );
+
+private:
+
+ BtuiModelDataSource mData;
+
+ BtDeviceModel& mModel;
+
+ CBtDevRepository* mDeviceRepo;
+
+ CAdvanceDevDiscoverer* mDiscover;
+
+ bool isSearchingDevice;
+
+ int mSeqNum; // sequence number based on order the device is found during search
+
+ Q_DISABLE_COPY(BtDeviceModelPrivate)
+
+};
+
+#endif // BTLOCALSETTING_H
--- a/bluetoothengine/btui/btuimodel/btlocalsetting.cpp Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,267 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#include "btlocalsetting.h"
-#include <btdevice.h>
-#include <btmanclient.h>
-#include <bt_subscribe.h>
-#include "btqtconstants.h"
-
-const int KLocalDeviceNameWatcher = 10;
-const int KBtLinkCountWatcher = 11;
-
-/*!
- Constructor.
- */
-BtLocalSetting::BtLocalSetting( BtSettingModel& model, QObject *parent )
- : QObject( parent), mModel( model ), mLocalDeviceWatcher(0)
- {
- int err( 0 );
- if (!err ) {
- err = mLocalDeviceKey.Attach( KPropertyUidBluetoothCategory,
- KPropertyKeyBluetoothGetRegistryTableChange );
- }
-
- Q_CHECK_PTR( !err ); // other proper alternative?
-
- TRAP_IGNORE({
- mBtengSetting = CBTEngSettings::NewL( this );
- mLocalDeviceWatcher = CBtSimpleActive::NewL(*this, KLocalDeviceNameWatcher );
- });
-
- Q_CHECK_PTR( mBtengSetting );
- Q_CHECK_PTR( mLocalDeviceWatcher );
-
- for ( int i = 0; i < BtSettingModel::LocalSettingRowCount; ++i ) {
- // Initialize the list with empty values.
- mData.append( BtuiModelDataItem() );
- }
-
- // subscribe to local device table change:
- mLocalDeviceKey.Subscribe( mLocalDeviceWatcher->RequestStatus() );
- mLocalDeviceWatcher->GoActive();
-
- // Get the device name
- TBTDeviceName deviceName;
- (void) mBtengSetting->GetLocalName( deviceName );
- updateDeviceName( QString::fromUtf16( deviceName.Ptr(), deviceName.Length() ) );
-
- // Get the power setting.
- TBTPowerStateValue power( EBTPowerOff );
- (void) mBtengSetting->GetPowerState( power );
- setPowerSetting( power );
-
- // Get the visibility mode
- TBTVisibilityMode visibilityMode( EBTVisibilityModeNoScans );
- (void) mBtengSetting->GetVisibilityMode( visibilityMode );
- setVisibilityMode( visibilityMode );
-}
-
-/*!
- Destructor.
- */
-BtLocalSetting::~BtLocalSetting()
-{
- // delete main data structure
- delete mBtengSetting;
- delete mLocalDeviceWatcher;
- mLocalDeviceKey.Close();
-
- // delete mBtLinkCountWatcher;
- //mBtLinkCountKey.Close();
-}
-
-
-/*!
- Tells whether the given column is in the range of the setting list.
-
- \param row the row number to be checked
- \param col the column number to be checked
-
- \return true if the given row and column are valid; false otherwise.
-*/
-bool BtLocalSetting::isValid( int row, int column) const
-{
- return row >= 0 && row < mData.count() && column == 0;
-}
-
-/*!
- \return the total amount of rows.
-
-*/
-int BtLocalSetting::rowCount() const
-{
- return mData.count();
-}
-
-/*!
- \return the total amount of columns.
-
-*/
-int BtLocalSetting::columnCount() const
-{
- return 1;
-}
-
-/*!
- Gets the value within a data item.
- \param val contains the value at return.
- \param row the row number which the value is from
- \param col the column number which the value is from
- \param role the role idenfier of the value.
- */
-void BtLocalSetting::data(QVariant& val, int row, int col, int role ) const
-{
- if ( isValid( row, col ) ) {
- val = mData.at( row ).value( role );
- }
- else {
- val = QVariant( QVariant::Invalid );
- }
-}
-
-/*!
- Gets the whole item data at the specified column
- \param row the row number of the item data to be returned
- \param col the column number of the item data to be returned
- \return the item data
- */
-BtuiModelDataItem BtLocalSetting::itemData( int row, int col ) const
-{
- if ( isValid( row, col ) ) {
- return mData.at( row );
- }
- return BtuiModelDataItem();
-}
-
-/*!
- Provides notification of changes in the power state
- of the Bluetooth hardware.
-
- \param state EBTPowerOff if the BT hardware has been turned off,
- EBTPowerOn if it has been turned on.
- */
-void BtLocalSetting::PowerStateChanged( TBTPowerStateValue state )
-{
- setPowerSetting( state );
- mModel.emitDataChanged( BtSettingModel::PowerStateRow, 0, this );
-}
-
-/*!
- Provides notification of changes in the discoverability
- mode of the Bluetooth hardware.
- \param state EBTDiscModeHidden if the BT hardware is in hidden mode,
- EBTDiscModeGeneral if it is in visible mode.
- */
-void BtLocalSetting::VisibilityModeChanged( TBTVisibilityMode state )
-{
- setVisibilityMode( state );
- mModel.emitDataChanged( BtSettingModel::VisibilityRow, 0, this );
-}
-
-void BtLocalSetting::RequestCompletedL( CBtSimpleActive* active, TInt status ) {
- Q_UNUSED( active );
- Q_UNUSED( status );
- if ( active->RequestId() == KLocalDeviceNameWatcher ) {
- mLocalDeviceKey.Subscribe( mLocalDeviceWatcher->RequestStatus() );
- mLocalDeviceWatcher->GoActive();
- updateDeviceName( QString() );
- }
-}
-
-void BtLocalSetting::CancelRequest( TInt requestId ) {
- if ( requestId == KLocalDeviceNameWatcher ) {
- mLocalDeviceKey.Cancel();
- }
- else if ( requestId == KBtLinkCountWatcher ) {
- //mBtLinkCountKey.Cancel();
- }
-}
-
-void BtLocalSetting::HandleError( CBtSimpleActive* active, TInt error ) {
- Q_UNUSED( active );
- Q_UNUSED( error );
-}
-
-/*!
- Update local Bluetooth device name in the data store.
- @param name the latest Bluetooth name.
- */
-void BtLocalSetting::updateDeviceName( const QString &name )
-{
- // To-do: the data structure initialization is not impled yet in the model
- BtuiModelDataItem& item =
- mData[ BtSettingModel::LocalBtNameRow ];
-
- bool setByUser = !name.isEmpty();
-
- // The additional parameter is the flag indicating whether the
- // Bluetooth name has been set by the user.
- // The flag is set to true if the name has been set.
- // item[ BtSettingModel::SettingValueParamRole ] = QVariant( setByUser );
-
- QString resolvedName( name );
- if ( resolvedName.isEmpty() ) {
- // We get the default name as suggestion for the user to set.
- getNameFromRegistry( resolvedName );
- }
- item[ BtSettingModel::settingDisplayRole ] = QVariant( resolvedName );
- item[ BtSettingModel::SettingValueRole ] = QVariant( resolvedName );
-}
-
-/*!
- Updates all values related to the power setting.
- */
-void BtLocalSetting::setPowerSetting( TBTPowerStateValue state )
-{
- BtuiModelDataItem& item =
- mData[ BtSettingModel::PowerStateRow ];
-
- item[ BtSettingModel::SettingValueRole ] = QVariant( QtPowerMode(state) );
-}
-
-void BtLocalSetting::setVisibilityMode( TBTVisibilityMode state )
-{
- BtuiModelDataItem& item = mData[ BtSettingModel::VisibilityRow ];
-
- item [ BtSettingModel::SettingValueRole ] = QVariant( QtVisibilityMode(state) );
-}
-
-/*!
- Get local Bluetooth device name from BTRegistry.
- */
-void BtLocalSetting::getNameFromRegistry( QString &name )
-{
- RBTRegServ btRegServ; // Session with BTMan
- RBTLocalDevice btReg; // Subsession with local device table
- TBTLocalDevice localDev;// Data structure holding local device information
-
- TInt err = btRegServ.Connect();
- if ( !err ) {
- err = btReg.Open( btRegServ );
- }
- if ( !err ) {
- // Read the BT local name from BT Registry.
- err = btReg.Get( localDev );
- }
- if ( !err ) {
- name = QString::fromUtf8( (const char*) localDev.DeviceName().Ptr(), (int) localDev.DeviceName().Length() );
- }
- btReg.Close();
- btRegServ.Close();
-}
--- a/bluetoothengine/btui/btuimodel/btlocalsetting.h Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0""
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#ifndef BTLOCALSETTING_H
-#define BTLOCALSETTING_H
-
-#include "btsettingmodel.h"
-
-#include <e32base.h>
-#include <e32property.h>
-#include <btengsettings.h>
-#include <btservices/btsimpleactive.h>
-
-/*!
- \class BtuimSettings
- \brief class for handling local Bluetooth setting updates.
-
- BtLocalSetting class is responsible for providing the latest information
- regarding the local Bluetooth settings such as device name and power state.
-
- \\sa bluetoothuimodel
- */
-class BtLocalSetting : public QObject,
- public MBTEngSettingsObserver,
- public MBtSimpleActiveObserver
-{
- Q_OBJECT
-
-public:
- explicit BtLocalSetting( BtSettingModel& model, QObject *parent = 0 );
-
- virtual ~BtLocalSetting();
-
- bool isValid( int row, int col ) const;
-
- int rowCount() const;
-
- int columnCount() const;
-
- void data(QVariant& val, int row, int col, int role ) const;
-
- BtuiModelDataItem itemData( int row, int col ) const;
-
-private:
- // from MBTEngSettingsObserver
-
- void PowerStateChanged( TBTPowerStateValue state );
-
- void VisibilityModeChanged( TBTVisibilityMode state );
-
- // from MBtSimpleActiveObserver
-
- void RequestCompletedL( CBtSimpleActive* active, TInt status );
-
- void CancelRequest( TInt requestId );
-
- void HandleError( CBtSimpleActive* active, TInt error );
-
-
-public slots:
- //void activeRequestCompleted( int status, int id );
-
-private:
-
- void setVisibilityMode( TBTVisibilityMode state );
- void updateDeviceName( const QString &name );
-
- void setPowerSetting( TBTPowerStateValue state );
-
- //void setOfflineSetting( bool state );
- //void setBtConnectionsSetting( int connections );
-
- void getNameFromRegistry( QString &name );
-
-private:
-
- BtuiModelDataSource mData;
-
- BtSettingModel& mModel;
-
- CBTEngSettings *mBtengSetting;
-
- // For monitoring local device name change
- RProperty mLocalDeviceKey;
- CBtSimpleActive *mLocalDeviceWatcher;
-
- //RProperty mBtLinkCountKey;
- //CBTEngActive *mBtLinkCountWatcher;
- Q_DISABLE_COPY(BtLocalSetting)
-
-};
-
-#endif // BTLOCALSETTING_H
--- a/bluetoothengine/btui/btuimodel/btsettingmodel.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuimodel/btsettingmodel.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -16,7 +16,7 @@
*/
#include <btsettingmodel.h>
-#include "btlocalsetting.h"
+#include "btsettingmodel_p.h"
#include "bluetoothuitrace.h"
/*!
@@ -25,17 +25,18 @@
BtSettingModel::BtSettingModel( QObject *parent )
: QAbstractItemModel( parent )
{
- mLocalSetting = QSharedPointer<BtLocalSetting>( new BtLocalSetting( *this ) );
+ d = QSharedPointer<BtSettingModelPrivate>( new BtSettingModelPrivate( *this ) );
+ connectModelSignals();
}
/*!
- This Constructor shares the instances of model data structure with the
- given model.
+ This Constructor shares the private implementation of the setting model.
*/
BtSettingModel::BtSettingModel( const BtSettingModel &model, QObject *parent )
: QAbstractItemModel( parent )
{
- mLocalSetting = model.mLocalSetting;
+ d = model.d;
+ connectModelSignals();
}
/*!
@@ -51,8 +52,8 @@
QModelIndex BtSettingModel::index( int row, int column, const QModelIndex &parent ) const
{
Q_UNUSED( parent );
- if ( mLocalSetting->isValid( row, column ) ) {
- return createIndex( row, column, mLocalSetting.data() );
+ if ( d->isValid( row, column ) ) {
+ return createIndex( row, column, d.data() );
}
// invalid row and column:
return QModelIndex();
@@ -74,7 +75,7 @@
int BtSettingModel::rowCount( const QModelIndex &parent ) const
{
Q_UNUSED( parent );
- return mLocalSetting->rowCount();
+ return d->rowCount();
}
/*!
@@ -83,7 +84,7 @@
int BtSettingModel::columnCount( const QModelIndex &parent ) const
{
Q_UNUSED( parent );
- return mLocalSetting->columnCount();
+ return d->columnCount();
}
/*!
@@ -92,25 +93,41 @@
QVariant BtSettingModel::data( const QModelIndex &index, int role ) const
{
QVariant val( QVariant::Invalid );
- mLocalSetting.data()->data( val, index.row(), index.column(), role );
+ d.data()->data( val, index.row(), index.column(), role );
return val;
}
QMap<int, QVariant> BtSettingModel::itemData( const QModelIndex & index ) const
{
- return mLocalSetting.data()->itemData( index.row(), index.column() );
+ return d.data()->itemData( index.row(), index.column() );
+}
+
+/*!
+ emits dataChanged signal.
+ */
+void BtSettingModel::settingDataChanged( int row, void *parent )
+{
+ QModelIndex idx = createIndex( row, 0, parent );
+ emit dataChanged( idx, idx );
}
/*!
emits dataChanged signal.
*/
-void BtSettingModel::emitDataChanged( int row, int column, void *parent )
-{
- QModelIndex idx = createIndex( row, column, parent );
- emit dataChanged( idx, idx );
-}
-
-void BtSettingModel::emitDataChanged(const QModelIndex &top, const QModelIndex &bottom )
+void BtSettingModel::settingDataChanged(int first, int last, void *parent )
{
+ QModelIndex top = createIndex( first, 0, parent );
+ QModelIndex bottom = createIndex( last, 0, parent );
emit dataChanged( top, bottom );
}
+
+/*!
+ connects all signals of private impl to slots of this
+ */
+void BtSettingModel::connectModelSignals()
+{
+ bool ok = connect(d.data(), SIGNAL(settingDataChanged(int,void*)), SLOT(settingDataChanged(int,void*)));
+ BTUI_ASSERT_X( ok, "BtSettingModel", "settingDataChanged can't connect" );
+ ok = connect(d.data(), SIGNAL(settingDataChanged(int,int,void*)), SLOT(settingDataChanged(int,int,void*)));
+ BTUI_ASSERT_X( ok, "BtSettingModel", "settingDataChanged can't connect 2" );
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/btsettingmodel_p.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,267 @@
+/*
+* 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 "btsettingmodel_p.h"
+#include <btdevice.h>
+#include <btmanclient.h>
+#include <bt_subscribe.h>
+#include "btqtconstants.h"
+
+const int KLocalDeviceNameWatcher = 10;
+const int KBtLinkCountWatcher = 11;
+
+/*!
+ Constructor.
+ */
+BtSettingModelPrivate::BtSettingModelPrivate( BtSettingModel& model, QObject *parent )
+ : QObject( parent), mModel( model ), mLocalDeviceWatcher(0)
+ {
+ int err( 0 );
+ if (!err ) {
+ err = mLocalDeviceKey.Attach( KPropertyUidBluetoothCategory,
+ KPropertyKeyBluetoothGetRegistryTableChange );
+ }
+
+ Q_CHECK_PTR( !err ); // other proper alternative?
+
+ TRAP_IGNORE({
+ mBtengSetting = CBTEngSettings::NewL( this );
+ mLocalDeviceWatcher = CBtSimpleActive::NewL(*this, KLocalDeviceNameWatcher );
+ });
+
+ Q_CHECK_PTR( mBtengSetting );
+ Q_CHECK_PTR( mLocalDeviceWatcher );
+
+ for ( int i = 0; i < BtSettingModel::LocalSettingRowCount; ++i ) {
+ // Initialize the list with empty values.
+ mData.append( BtuiModelDataItem() );
+ }
+
+ // subscribe to local device table change:
+ mLocalDeviceKey.Subscribe( mLocalDeviceWatcher->RequestStatus() );
+ mLocalDeviceWatcher->GoActive();
+
+ // Get the device name
+ TBTDeviceName deviceName;
+ (void) mBtengSetting->GetLocalName( deviceName );
+ updateDeviceName( QString::fromUtf16( deviceName.Ptr(), deviceName.Length() ) );
+
+ // Get the power setting.
+ TBTPowerStateValue power( EBTPowerOff );
+ (void) mBtengSetting->GetPowerState( power );
+ setPowerSetting( power );
+
+ // Get the visibility mode
+ TBTVisibilityMode visibilityMode( EBTVisibilityModeNoScans );
+ (void) mBtengSetting->GetVisibilityMode( visibilityMode );
+ setVisibilityMode( visibilityMode );
+}
+
+/*!
+ Destructor.
+ */
+BtSettingModelPrivate::~BtSettingModelPrivate()
+{
+ // delete main data structure
+ delete mBtengSetting;
+ delete mLocalDeviceWatcher;
+ mLocalDeviceKey.Close();
+
+ // delete mBtLinkCountWatcher;
+ //mBtLinkCountKey.Close();
+}
+
+
+/*!
+ Tells whether the given column is in the range of the setting list.
+
+ \param row the row number to be checked
+ \param col the column number to be checked
+
+ \return true if the given row and column are valid; false otherwise.
+*/
+bool BtSettingModelPrivate::isValid( int row, int column) const
+{
+ return row >= 0 && row < mData.count() && column == 0;
+}
+
+/*!
+ \return the total amount of rows.
+
+*/
+int BtSettingModelPrivate::rowCount() const
+{
+ return mData.count();
+}
+
+/*!
+ \return the total amount of columns.
+
+*/
+int BtSettingModelPrivate::columnCount() const
+{
+ return 1;
+}
+
+/*!
+ Gets the value within a data item.
+ \param val contains the value at return.
+ \param row the row number which the value is from
+ \param col the column number which the value is from
+ \param role the role idenfier of the value.
+ */
+void BtSettingModelPrivate::data(QVariant& val, int row, int col, int role ) const
+{
+ if ( isValid( row, col ) ) {
+ val = mData.at( row ).value( role );
+ }
+ else {
+ val = QVariant( QVariant::Invalid );
+ }
+}
+
+/*!
+ Gets the whole item data at the specified column
+ \param row the row number of the item data to be returned
+ \param col the column number of the item data to be returned
+ \return the item data
+ */
+BtuiModelDataItem BtSettingModelPrivate::itemData( int row, int col ) const
+{
+ if ( isValid( row, col ) ) {
+ return mData.at( row );
+ }
+ return BtuiModelDataItem();
+}
+
+/*!
+ Provides notification of changes in the power state
+ of the Bluetooth hardware.
+
+ \param state EBTPowerOff if the BT hardware has been turned off,
+ EBTPowerOn if it has been turned on.
+ */
+void BtSettingModelPrivate::PowerStateChanged( TBTPowerStateValue state )
+{
+ setPowerSetting( state );
+ emit settingDataChanged( BtSettingModel::PowerStateRow, this );
+}
+
+/*!
+ Provides notification of changes in the discoverability
+ mode of the Bluetooth hardware.
+ \param state EBTDiscModeHidden if the BT hardware is in hidden mode,
+ EBTDiscModeGeneral if it is in visible mode.
+ */
+void BtSettingModelPrivate::VisibilityModeChanged( TBTVisibilityMode state )
+{
+ setVisibilityMode( state );
+ emit settingDataChanged( BtSettingModel::VisibilityRow, this );
+}
+
+void BtSettingModelPrivate::RequestCompletedL( CBtSimpleActive* active, TInt status ) {
+ Q_UNUSED( active );
+ Q_UNUSED( status );
+ if ( active->RequestId() == KLocalDeviceNameWatcher ) {
+ mLocalDeviceKey.Subscribe( mLocalDeviceWatcher->RequestStatus() );
+ mLocalDeviceWatcher->GoActive();
+ updateDeviceName( QString() );
+ }
+}
+
+void BtSettingModelPrivate::CancelRequest( TInt requestId ) {
+ if ( requestId == KLocalDeviceNameWatcher ) {
+ mLocalDeviceKey.Cancel();
+ }
+ else if ( requestId == KBtLinkCountWatcher ) {
+ //mBtLinkCountKey.Cancel();
+ }
+}
+
+void BtSettingModelPrivate::HandleError( CBtSimpleActive* active, TInt error ) {
+ Q_UNUSED( active );
+ Q_UNUSED( error );
+}
+
+/*!
+ Update local Bluetooth device name in the data store.
+ @param name the latest Bluetooth name.
+ */
+void BtSettingModelPrivate::updateDeviceName( const QString &name )
+{
+ // To-do: the data structure initialization is not impled yet in the model
+ BtuiModelDataItem& item =
+ mData[ BtSettingModel::LocalBtNameRow ];
+
+ bool setByUser = !name.isEmpty();
+
+ // The additional parameter is the flag indicating whether the
+ // Bluetooth name has been set by the user.
+ // The flag is set to true if the name has been set.
+ // item[ BtSettingModel::SettingValueParamRole ] = QVariant( setByUser );
+
+ QString resolvedName( name );
+ if ( resolvedName.isEmpty() ) {
+ // We get the default name as suggestion for the user to set.
+ getNameFromRegistry( resolvedName );
+ }
+ item[ BtSettingModel::settingDisplayRole ] = QVariant( resolvedName );
+ item[ BtSettingModel::SettingValueRole ] = QVariant( resolvedName );
+}
+
+/*!
+ Updates all values related to the power setting.
+ */
+void BtSettingModelPrivate::setPowerSetting( TBTPowerStateValue state )
+{
+ BtuiModelDataItem& item =
+ mData[ BtSettingModel::PowerStateRow ];
+
+ item[ BtSettingModel::SettingValueRole ] = QVariant( QtPowerMode(state) );
+}
+
+void BtSettingModelPrivate::setVisibilityMode( TBTVisibilityMode state )
+{
+ BtuiModelDataItem& item = mData[ BtSettingModel::VisibilityRow ];
+
+ item [ BtSettingModel::SettingValueRole ] = QVariant( QtVisibilityMode(state) );
+}
+
+/*!
+ Get local Bluetooth device name from BTRegistry.
+ */
+void BtSettingModelPrivate::getNameFromRegistry( QString &name )
+{
+ RBTRegServ btRegServ; // Session with BTMan
+ RBTLocalDevice btReg; // Subsession with local device table
+ TBTLocalDevice localDev;// Data structure holding local device information
+
+ TInt err = btRegServ.Connect();
+ if ( !err ) {
+ err = btReg.Open( btRegServ );
+ }
+ if ( !err ) {
+ // Read the BT local name from BT Registry.
+ err = btReg.Get( localDev );
+ }
+ if ( !err ) {
+ name = QString::fromUtf8( (const char*) localDev.DeviceName().Ptr(), (int) localDev.DeviceName().Length() );
+ }
+ btReg.Close();
+ btRegServ.Close();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/btsettingmodel_p.h Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,108 @@
+/*
+ * 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 BTSETTINGMODEL_P_H
+#define BTSETTINGMODEL_P_H
+
+#include <btsettingmodel.h>
+
+#include <e32base.h>
+#include <e32property.h>
+#include <btengsettings.h>
+#include <btservices/btsimpleactive.h>
+
+/*!
+ \class BtuimSettings
+ \brief class for handling local Bluetooth setting updates.
+
+ BtLocalSetting class is responsible for providing the latest information
+ regarding the local Bluetooth settings such as device name and power state.
+
+ \\sa bluetoothuimodel
+ */
+class BtSettingModelPrivate : public QObject,
+ public MBTEngSettingsObserver,
+ public MBtSimpleActiveObserver
+{
+ Q_OBJECT
+
+public:
+ explicit BtSettingModelPrivate( BtSettingModel& model, QObject *parent = 0 );
+
+ virtual ~BtSettingModelPrivate();
+
+ bool isValid( int row, int col ) const;
+
+ int rowCount() const;
+
+ int columnCount() const;
+
+ void data(QVariant& val, int row, int col, int role ) const;
+
+ BtuiModelDataItem itemData( int row, int col ) const;
+signals:
+
+ void settingDataChanged( int row, void *parent );
+
+ void settingDataChanged( int first, int last, void *parent );
+
+private:
+ // from MBTEngSettingsObserver
+
+ void PowerStateChanged( TBTPowerStateValue state );
+
+ void VisibilityModeChanged( TBTVisibilityMode state );
+
+ // from MBtSimpleActiveObserver
+
+ void RequestCompletedL( CBtSimpleActive* active, TInt status );
+
+ void CancelRequest( TInt requestId );
+
+ void HandleError( CBtSimpleActive* active, TInt error );
+
+private:
+
+ void setVisibilityMode( TBTVisibilityMode state );
+ void updateDeviceName( const QString &name );
+
+ void setPowerSetting( TBTPowerStateValue state );
+
+ //void setOfflineSetting( bool state );
+ //void setBtConnectionsSetting( int connections );
+
+ void getNameFromRegistry( QString &name );
+
+private:
+
+ BtuiModelDataSource mData;
+
+ BtSettingModel& mModel;
+
+ CBTEngSettings *mBtengSetting;
+
+ // For monitoring local device name change
+ RProperty mLocalDeviceKey;
+ CBtSimpleActive *mLocalDeviceWatcher;
+
+ //RProperty mBtLinkCountKey;
+ //CBTEngActive *mBtLinkCountWatcher;
+ Q_DISABLE_COPY(BtSettingModelPrivate)
+
+};
+
+#endif // BTSETTINGMODEL_P_H
--- a/bluetoothengine/btui/btuimodel/btuimodel.pro Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuimodel/btuimodel.pro Tue Jul 06 14:27:09 2010 +0300
@@ -26,19 +26,21 @@
CONFIG += qt \
hb \
dll
-HEADERS += btdevicedata.h \
- btlocalsetting.h \
+HEADERS += btdevicemodel_p.h \
+ btsettingmodel_p.h \
../inc/btsettingmodel.h \
../inc/btdevicemodel.h \
../inc/btuimodelsortfilter.h \
../inc/btuiutil.h
-SOURCES += btdevicedata.cpp \
- btlocalsetting.cpp \
+SOURCES += btdevicemodel_p.cpp \
+ btsettingmodel_p.cpp \
btsettingmodel.cpp \
btdevicemodel.cpp \
btuimodelsortfilter.cpp
+defFilePath = .
+
symbian: {
SYMBIAN_PLATFORMS = WINSCW \
ARMV5
--- a/bluetoothengine/btui/btuimodel/btuimodelsortfilter.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/btuimodel/btuimodelsortfilter.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -150,11 +150,10 @@
bool BtuiModelSortFilter::lessThan(
const QModelIndex &left, const QModelIndex &right) const
{
- Q_UNUSED( left );
- Q_UNUSED( right );
if (sortRole() == BtDeviceModel::NameAliasRole ||
sortRole() == BtDeviceModel::LastUsedTimeRole ||
- sortRole() == BtDeviceModel::RssiRole) {
+ sortRole() == BtDeviceModel::RssiRole ||
+ sortRole() == BtDeviceModel::SeqNumRole) {
// base class provides sorting for these types already:
return QSortFilterProxyModel::lessThan(left, right);
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/bwins/btuimodelu.def Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,75 @@
+EXPORTS
+ ?emitDeviceSearchCompleted@BtDeviceModel@@AAEXH@Z @ 1 NONAME ; void BtDeviceModel::emitDeviceSearchCompleted(int)
+ ??1BtDeviceModel@@UAE@XZ @ 2 NONAME ; BtDeviceModel::~BtDeviceModel(void)
+ ?tr@BtDeviceModel@@SA?AVQString@@PBD0H@Z @ 3 NONAME ; class QString BtDeviceModel::tr(char const *, char const *, int)
+ ?searchDevice@BtDeviceModel@@QAE_NXZ @ 4 NONAME ; bool BtDeviceModel::searchDevice(void)
+ ?parent@BtSettingModel@@UBE?AVQModelIndex@@ABV2@@Z @ 5 NONAME ; class QModelIndex BtSettingModel::parent(class QModelIndex const &) const
+ ?settingDataChanged@BtSettingModel@@AAEXHPAX@Z @ 6 NONAME ; void BtSettingModel::settingDataChanged(int, void *)
+ ?setDeviceMajorFilter@BtuiModelSortFilter@@QAEXHW4FilterMode@1@@Z @ 7 NONAME ; void BtuiModelSortFilter::setDeviceMajorFilter(int, enum BtuiModelSortFilter::FilterMode)
+ ?metaObject@BtuiModelSortFilter@@UBEPBUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const * BtuiModelSortFilter::metaObject(void) const
+ ?metaObject@BtSettingModel@@UBEPBUQMetaObject@@XZ @ 9 NONAME ; struct QMetaObject const * BtSettingModel::metaObject(void) const
+ ?hasFilter@BtuiModelSortFilter@@QAE_NHW4FilterMode@1@@Z @ 10 NONAME ; bool BtuiModelSortFilter::hasFilter(int, enum BtuiModelSortFilter::FilterMode)
+ ?itemData@BtSettingModel@@UBE?AV?$QMap@HVQVariant@@@@ABVQModelIndex@@@Z @ 11 NONAME ; class QMap<int, class QVariant> BtSettingModel::itemData(class QModelIndex const &) const
+ ?tr@BtSettingModel@@SA?AVQString@@PBD0@Z @ 12 NONAME ; class QString BtSettingModel::tr(char const *, char const *)
+ ??0BtDeviceModel@@QAE@PAVQObject@@@Z @ 13 NONAME ; BtDeviceModel::BtDeviceModel(class QObject *)
+ ?tr@BtDeviceModel@@SA?AVQString@@PBD0@Z @ 14 NONAME ; class QString BtDeviceModel::tr(char const *, char const *)
+ ?staticMetaObject@BtuiModelSortFilter@@2UQMetaObject@@B @ 15 NONAME ; struct QMetaObject const BtuiModelSortFilter::staticMetaObject
+ ?qt_metacast@BtuiModelSortFilter@@UAEPAXPBD@Z @ 16 NONAME ; void * BtuiModelSortFilter::qt_metacast(char const *)
+ ?qt_metacall@BtDeviceModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 17 NONAME ; int BtDeviceModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ??_EBtDeviceModel@@UAE@I@Z @ 18 NONAME ; BtDeviceModel::~BtDeviceModel(unsigned int)
+ ?index@BtSettingModel@@UBE?AVQModelIndex@@HHABV2@@Z @ 19 NONAME ; class QModelIndex BtSettingModel::index(int, int, class QModelIndex const &) const
+ ?trUtf8@BtuiModelSortFilter@@SA?AVQString@@PBD0@Z @ 20 NONAME ; class QString BtuiModelSortFilter::trUtf8(char const *, char const *)
+ ?qt_metacall@BtSettingModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 21 NONAME ; int BtSettingModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?settingDataChanged@BtSettingModel@@AAEXHHPAX@Z @ 22 NONAME ; void BtSettingModel::settingDataChanged(int, int, void *)
+ ??0BtuiModelSortFilter@@QAE@PAVQObject@@@Z @ 23 NONAME ; BtuiModelSortFilter::BtuiModelSortFilter(class QObject *)
+ ?lessThan@BtuiModelSortFilter@@MBE_NABVQModelIndex@@0@Z @ 24 NONAME ; bool BtuiModelSortFilter::lessThan(class QModelIndex const &, class QModelIndex const &) const
+ ??1BtuiModelSortFilter@@UAE@XZ @ 25 NONAME ; BtuiModelSortFilter::~BtuiModelSortFilter(void)
+ ?deviceDataChanged@BtDeviceModel@@AAEXHHPAX@Z @ 26 NONAME ; void BtDeviceModel::deviceDataChanged(int, int, void *)
+ ?columnCount@BtDeviceModel@@UBEHABVQModelIndex@@@Z @ 27 NONAME ; int BtDeviceModel::columnCount(class QModelIndex const &) const
+ ?trUtf8@BtDeviceModel@@SA?AVQString@@PBD0H@Z @ 28 NONAME ; class QString BtDeviceModel::trUtf8(char const *, char const *, int)
+ ?deviceSearchCompleted@BtDeviceModel@@IAEXH@Z @ 29 NONAME ; void BtDeviceModel::deviceSearchCompleted(int)
+ ?cancelSearchDevice@BtDeviceModel@@QAEXXZ @ 30 NONAME ; void BtDeviceModel::cancelSearchDevice(void)
+ ??_EBtuiModelSortFilter@@UAE@I@Z @ 31 NONAME ; BtuiModelSortFilter::~BtuiModelSortFilter(unsigned int)
+ ??0BtSettingModel@@QAE@PAVQObject@@@Z @ 32 NONAME ; BtSettingModel::BtSettingModel(class QObject *)
+ ?deviceAcceptedByFilter@BtuiModelSortFilter@@IAEXH@Z @ 33 NONAME ; void BtuiModelSortFilter::deviceAcceptedByFilter(int)
+ ?index@BtDeviceModel@@UBE?AVQModelIndex@@HHABV2@@Z @ 34 NONAME ; class QModelIndex BtDeviceModel::index(int, int, class QModelIndex const &) const
+ ?qt_metacast@BtDeviceModel@@UAEPAXPBD@Z @ 35 NONAME ; void * BtDeviceModel::qt_metacast(char const *)
+ ?rowCount@BtSettingModel@@UBEHABVQModelIndex@@@Z @ 36 NONAME ; int BtSettingModel::rowCount(class QModelIndex const &) const
+ ??1BtSettingModel@@UAE@XZ @ 37 NONAME ; BtSettingModel::~BtSettingModel(void)
+ ??0BtSettingModel@@QAE@ABV0@PAVQObject@@@Z @ 38 NONAME ; BtSettingModel::BtSettingModel(class BtSettingModel const &, class QObject *)
+ ?endRemoveDevices@BtDeviceModel@@AAEXXZ @ 39 NONAME ; void BtDeviceModel::endRemoveDevices(void)
+ ?trUtf8@BtSettingModel@@SA?AVQString@@PBD0@Z @ 40 NONAME ; class QString BtSettingModel::trUtf8(char const *, char const *)
+ ??_EBtSettingModel@@UAE@I@Z @ 41 NONAME ; BtSettingModel::~BtSettingModel(unsigned int)
+ ?filterAcceptsRow@BtuiModelSortFilter@@MBE_NHABVQModelIndex@@@Z @ 42 NONAME ; bool BtuiModelSortFilter::filterAcceptsRow(int, class QModelIndex const &) const
+ ?clearDeviceMajorFilter@BtuiModelSortFilter@@QAEXHW4FilterMode@1@@Z @ 43 NONAME ; void BtuiModelSortFilter::clearDeviceMajorFilter(int, enum BtuiModelSortFilter::FilterMode)
+ ?tr@BtuiModelSortFilter@@SA?AVQString@@PBD0@Z @ 44 NONAME ; class QString BtuiModelSortFilter::tr(char const *, char const *)
+ ?addDeviceMajorFilter@BtuiModelSortFilter@@QAEXHW4FilterMode@1@@Z @ 45 NONAME ; void BtuiModelSortFilter::addDeviceMajorFilter(int, enum BtuiModelSortFilter::FilterMode)
+ ?qt_metacall@BtuiModelSortFilter@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 46 NONAME ; int BtuiModelSortFilter::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?rowCount@BtDeviceModel@@UBEHABVQModelIndex@@@Z @ 47 NONAME ; int BtDeviceModel::rowCount(class QModelIndex const &) const
+ ?itemData@BtDeviceModel@@UBE?AV?$QMap@HVQVariant@@@@ABVQModelIndex@@@Z @ 48 NONAME ; class QMap<int, class QVariant> BtDeviceModel::itemData(class QModelIndex const &) const
+ ?parent@BtDeviceModel@@UBE?AVQModelIndex@@ABV2@@Z @ 49 NONAME ; class QModelIndex BtDeviceModel::parent(class QModelIndex const &) const
+ ?staticMetaObject@BtDeviceModel@@2UQMetaObject@@B @ 50 NONAME ; struct QMetaObject const BtDeviceModel::staticMetaObject
+ ?getStaticMetaObject@BtSettingModel@@SAABUQMetaObject@@XZ @ 51 NONAME ; struct QMetaObject const & BtSettingModel::getStaticMetaObject(void)
+ ?qt_metacast@BtSettingModel@@UAEPAXPBD@Z @ 52 NONAME ; void * BtSettingModel::qt_metacast(char const *)
+ ??0BtDeviceModel@@QAE@ABV0@PAVQObject@@@Z @ 53 NONAME ; BtDeviceModel::BtDeviceModel(class BtDeviceModel const &, class QObject *)
+ ?trUtf8@BtuiModelSortFilter@@SA?AVQString@@PBD0H@Z @ 54 NONAME ; class QString BtuiModelSortFilter::trUtf8(char const *, char const *, int)
+ ?tr@BtuiModelSortFilter@@SA?AVQString@@PBD0H@Z @ 55 NONAME ; class QString BtuiModelSortFilter::tr(char const *, char const *, int)
+ ?beginInsertDevices@BtDeviceModel@@AAEXHHPAX@Z @ 56 NONAME ; void BtDeviceModel::beginInsertDevices(int, int, void *)
+ ?staticMetaObject@BtSettingModel@@2UQMetaObject@@B @ 57 NONAME ; struct QMetaObject const BtSettingModel::staticMetaObject
+ ?data@BtSettingModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 58 NONAME ; class QVariant BtSettingModel::data(class QModelIndex const &, int) const
+ ?columnCount@BtSettingModel@@UBEHABVQModelIndex@@@Z @ 59 NONAME ; int BtSettingModel::columnCount(class QModelIndex const &) const
+ ?removeTransientDevices@BtDeviceModel@@QAEXXZ @ 60 NONAME ; void BtDeviceModel::removeTransientDevices(void)
+ ?trUtf8@BtDeviceModel@@SA?AVQString@@PBD0@Z @ 61 NONAME ; class QString BtDeviceModel::trUtf8(char const *, char const *)
+ ?metaObject@BtDeviceModel@@UBEPBUQMetaObject@@XZ @ 62 NONAME ; struct QMetaObject const * BtDeviceModel::metaObject(void) const
+ ?deviceDataChanged@BtDeviceModel@@AAEXHPAX@Z @ 63 NONAME ; void BtDeviceModel::deviceDataChanged(int, void *)
+ ?endInsertDevices@BtDeviceModel@@AAEXXZ @ 64 NONAME ; void BtDeviceModel::endInsertDevices(void)
+ ?trUtf8@BtSettingModel@@SA?AVQString@@PBD0H@Z @ 65 NONAME ; class QString BtSettingModel::trUtf8(char const *, char const *, int)
+ ?getStaticMetaObject@BtuiModelSortFilter@@SAABUQMetaObject@@XZ @ 66 NONAME ; struct QMetaObject const & BtuiModelSortFilter::getStaticMetaObject(void)
+ ?clearDeviceMajorFilters@BtuiModelSortFilter@@QAEXXZ @ 67 NONAME ; void BtuiModelSortFilter::clearDeviceMajorFilters(void)
+ ?tr@BtSettingModel@@SA?AVQString@@PBD0H@Z @ 68 NONAME ; class QString BtSettingModel::tr(char const *, char const *, int)
+ ?beginRemoveDevices@BtDeviceModel@@AAEXHHPAX@Z @ 69 NONAME ; void BtDeviceModel::beginRemoveDevices(int, int, void *)
+ ?getStaticMetaObject@BtDeviceModel@@SAABUQMetaObject@@XZ @ 70 NONAME ; struct QMetaObject const & BtDeviceModel::getStaticMetaObject(void)
+ ?data@BtDeviceModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 71 NONAME ; class QVariant BtDeviceModel::data(class QModelIndex const &, int) const
+ ?connectModelSignals@BtDeviceModel@@AAEXXZ @ 72 NONAME ; void BtDeviceModel::connectModelSignals(void)
+ ?connectModelSignals@BtSettingModel@@AAEXXZ @ 73 NONAME ; void BtSettingModel::connectModelSignals(void)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/btui/btuimodel/eabi/btuimodelu.def Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,77 @@
+EXPORTS
+ _ZN13BtDeviceModel11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
+ _ZN13BtDeviceModel11qt_metacastEPKc @ 2 NONAME
+ _ZN13BtDeviceModel12searchDeviceEv @ 3 NONAME
+ _ZN13BtDeviceModel16endInsertDevicesEv @ 4 NONAME
+ _ZN13BtDeviceModel16endRemoveDevicesEv @ 5 NONAME
+ _ZN13BtDeviceModel16staticMetaObjectE @ 6 NONAME DATA 16
+ _ZN13BtDeviceModel17deviceDataChangedEiPv @ 7 NONAME
+ _ZN13BtDeviceModel17deviceDataChangedEiiPv @ 8 NONAME
+ _ZN13BtDeviceModel18beginInsertDevicesEiiPv @ 9 NONAME
+ _ZN13BtDeviceModel18beginRemoveDevicesEiiPv @ 10 NONAME
+ _ZN13BtDeviceModel18cancelSearchDeviceEv @ 11 NONAME
+ _ZN13BtDeviceModel19getStaticMetaObjectEv @ 12 NONAME
+ _ZN13BtDeviceModel21deviceSearchCompletedEi @ 13 NONAME
+ _ZN13BtDeviceModel22removeTransientDevicesEv @ 14 NONAME
+ _ZN13BtDeviceModel25emitDeviceSearchCompletedEi @ 15 NONAME
+ _ZN13BtDeviceModelC1EP7QObject @ 16 NONAME
+ _ZN13BtDeviceModelC1ERKS_P7QObject @ 17 NONAME
+ _ZN13BtDeviceModelC2EP7QObject @ 18 NONAME
+ _ZN13BtDeviceModelC2ERKS_P7QObject @ 19 NONAME
+ _ZN13BtDeviceModelD0Ev @ 20 NONAME
+ _ZN13BtDeviceModelD1Ev @ 21 NONAME
+ _ZN13BtDeviceModelD2Ev @ 22 NONAME
+ _ZN14BtSettingModel11qt_metacallEN11QMetaObject4CallEiPPv @ 23 NONAME
+ _ZN14BtSettingModel11qt_metacastEPKc @ 24 NONAME
+ _ZN14BtSettingModel16staticMetaObjectE @ 25 NONAME DATA 16
+ _ZN14BtSettingModel18settingDataChangedEiPv @ 26 NONAME
+ _ZN14BtSettingModel18settingDataChangedEiiPv @ 27 NONAME
+ _ZN14BtSettingModel19getStaticMetaObjectEv @ 28 NONAME
+ _ZN14BtSettingModelC1EP7QObject @ 29 NONAME
+ _ZN14BtSettingModelC1ERKS_P7QObject @ 30 NONAME
+ _ZN14BtSettingModelC2EP7QObject @ 31 NONAME
+ _ZN14BtSettingModelC2ERKS_P7QObject @ 32 NONAME
+ _ZN14BtSettingModelD0Ev @ 33 NONAME
+ _ZN14BtSettingModelD1Ev @ 34 NONAME
+ _ZN14BtSettingModelD2Ev @ 35 NONAME
+ _ZN19BtuiModelSortFilter11qt_metacallEN11QMetaObject4CallEiPPv @ 36 NONAME
+ _ZN19BtuiModelSortFilter11qt_metacastEPKc @ 37 NONAME
+ _ZN19BtuiModelSortFilter16staticMetaObjectE @ 38 NONAME DATA 16
+ _ZN19BtuiModelSortFilter19getStaticMetaObjectEv @ 39 NONAME
+ _ZN19BtuiModelSortFilter20addDeviceMajorFilterEiNS_10FilterModeE @ 40 NONAME
+ _ZN19BtuiModelSortFilter20setDeviceMajorFilterEiNS_10FilterModeE @ 41 NONAME
+ _ZN19BtuiModelSortFilter22clearDeviceMajorFilterEiNS_10FilterModeE @ 42 NONAME
+ _ZN19BtuiModelSortFilter22deviceAcceptedByFilterEi @ 43 NONAME
+ _ZN19BtuiModelSortFilter23clearDeviceMajorFiltersEv @ 44 NONAME
+ _ZN19BtuiModelSortFilter9hasFilterEiNS_10FilterModeE @ 45 NONAME
+ _ZN19BtuiModelSortFilterC1EP7QObject @ 46 NONAME
+ _ZN19BtuiModelSortFilterC2EP7QObject @ 47 NONAME
+ _ZN19BtuiModelSortFilterD0Ev @ 48 NONAME
+ _ZN19BtuiModelSortFilterD1Ev @ 49 NONAME
+ _ZN19BtuiModelSortFilterD2Ev @ 50 NONAME
+ _ZNK13BtDeviceModel10metaObjectEv @ 51 NONAME
+ _ZNK13BtDeviceModel11columnCountERK11QModelIndex @ 52 NONAME
+ _ZNK13BtDeviceModel4dataERK11QModelIndexi @ 53 NONAME
+ _ZNK13BtDeviceModel5indexEiiRK11QModelIndex @ 54 NONAME
+ _ZNK13BtDeviceModel6parentERK11QModelIndex @ 55 NONAME
+ _ZNK13BtDeviceModel8itemDataERK11QModelIndex @ 56 NONAME
+ _ZNK13BtDeviceModel8rowCountERK11QModelIndex @ 57 NONAME
+ _ZNK14BtSettingModel10metaObjectEv @ 58 NONAME
+ _ZNK14BtSettingModel11columnCountERK11QModelIndex @ 59 NONAME
+ _ZNK14BtSettingModel4dataERK11QModelIndexi @ 60 NONAME
+ _ZNK14BtSettingModel5indexEiiRK11QModelIndex @ 61 NONAME
+ _ZNK14BtSettingModel6parentERK11QModelIndex @ 62 NONAME
+ _ZNK14BtSettingModel8itemDataERK11QModelIndex @ 63 NONAME
+ _ZNK14BtSettingModel8rowCountERK11QModelIndex @ 64 NONAME
+ _ZNK19BtuiModelSortFilter10metaObjectEv @ 65 NONAME
+ _ZNK19BtuiModelSortFilter16filterAcceptsRowEiRK11QModelIndex @ 66 NONAME
+ _ZNK19BtuiModelSortFilter8lessThanERK11QModelIndexS2_ @ 67 NONAME
+ _ZTI13BtDeviceModel @ 68 NONAME
+ _ZTI14BtSettingModel @ 69 NONAME
+ _ZTI19BtuiModelSortFilter @ 70 NONAME
+ _ZTV13BtDeviceModel @ 71 NONAME
+ _ZTV14BtSettingModel @ 72 NONAME
+ _ZTV19BtuiModelSortFilter @ 73 NONAME
+ _ZN14BtSettingModel19connectModelSignalsEv @ 74 NONAME
+ _ZN13BtDeviceModel19connectModelSignalsEv @ 75 NONAME
+
--- a/bluetoothengine/btui/bwins/btdevsettingframeworku.def Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-EXPORTS
- ?aboutToClose@BtAbstractDevSetting@@UAEXXZ @ 1 NONAME ; void BtAbstractDevSetting::aboutToClose(void)
- ??0BtAbstractDevSetting@@QAE@ABVQString@@PAVQObject@@@Z @ 2 NONAME ; BtAbstractDevSetting::BtAbstractDevSetting(class QString const &, class QObject *)
- ?tr@BtAbstractDevSetting@@SA?AVQString@@PBD0H@Z @ 3 NONAME ; class QString BtAbstractDevSetting::tr(char const *, char const *, int)
- ?staticMetaObject@BtAbstractDevSetting@@2UQMetaObject@@B @ 4 NONAME ; struct QMetaObject const BtAbstractDevSetting::staticMetaObject
- ?tr@BtAbstractDevSetting@@SA?AVQString@@PBD0@Z @ 5 NONAME ; class QString BtAbstractDevSetting::tr(char const *, char const *)
- ?isSettingAvailable@BtAbstractDevSetting@@UAE_NXZ @ 6 NONAME ; bool BtAbstractDevSetting::isSettingAvailable(void)
- ?trUtf8@BtAbstractDevSetting@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString BtAbstractDevSetting::trUtf8(char const *, char const *)
- ?getStaticMetaObject@BtAbstractDevSetting@@SAABUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const & BtAbstractDevSetting::getStaticMetaObject(void)
- ??_EBtDevSettingInterface@@UAE@I@Z @ 9 NONAME ; BtDevSettingInterface::~BtDevSettingInterface(unsigned int)
- ?trUtf8@BtAbstractDevSetting@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString BtAbstractDevSetting::trUtf8(char const *, char const *, int)
- ?aboutToBackground@BtAbstractDevSetting@@UAEXXZ @ 11 NONAME ; void BtAbstractDevSetting::aboutToBackground(void)
- ??_EBtAbstractDevSetting@@UAE@I@Z @ 12 NONAME ; BtAbstractDevSetting::~BtAbstractDevSetting(unsigned int)
- ?aboutToForeground@BtAbstractDevSetting@@UAEXXZ @ 13 NONAME ; void BtAbstractDevSetting::aboutToForeground(void)
- ?metaObject@BtAbstractDevSetting@@UBEPBUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const * BtAbstractDevSetting::metaObject(void) const
- ?qt_metacast@BtAbstractDevSetting@@UAEPAXPBD@Z @ 15 NONAME ; void * BtAbstractDevSetting::qt_metacast(char const *)
- ??1BtAbstractDevSetting@@UAE@XZ @ 16 NONAME ; BtAbstractDevSetting::~BtAbstractDevSetting(void)
- ?qt_metacall@BtAbstractDevSetting@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 17 NONAME ; int BtAbstractDevSetting::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?getRemote@BtAbstractDevSetting@@QBEABVQString@@XZ @ 18 NONAME ; class QString const & BtAbstractDevSetting::getRemote(void) const
- ?loadDevSettingInterfaces@BtDevSettingPluginLoader@@SA?AV?$QList@PAVBtDevSettingInterface@@@@XZ @ 19 NONAME ; class QList<class BtDevSettingInterface *> BtDevSettingPluginLoader::loadDevSettingInterfaces(void)
- ?settingAvailabilityChanged@BtAbstractDevSetting@@IAEXPAV1@_N@Z @ 20 NONAME ; void BtAbstractDevSetting::settingAvailabilityChanged(class BtAbstractDevSetting *, bool)
- ?getSettingWidget@BtAbstractDevSetting@@UAEPAVHbWidget@@XZ @ 21 NONAME ; class HbWidget * BtAbstractDevSetting::getSettingWidget(void)
- ??1BtDevSettingInterface@@UAE@XZ @ 22 NONAME ; BtDevSettingInterface::~BtDevSettingInterface(void)
-
--- a/bluetoothengine/btui/bwins/btuidelegateu.def Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-EXPORTS
- ?qt_metacall@BtAbstractDelegate@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1 NONAME ; int BtAbstractDelegate::qt_metacall(enum QMetaObject::Call, int, void * *)
- ??1BtAbstractDelegate@@UAE@XZ @ 2 NONAME ; BtAbstractDelegate::~BtAbstractDelegate(void)
- ?metaObject@BtAbstractDelegate@@UBEPBUQMetaObject@@XZ @ 3 NONAME ; struct QMetaObject const * BtAbstractDelegate::metaObject(void) const
- ?tr@BtAbstractDelegate@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString BtAbstractDelegate::tr(char const *, char const *, int)
- ?newDelegate@BtDelegateFactory@@SAPAVBtAbstractDelegate@@W4Command@BtDelegate@@PAVBtSettingModel@@PAVBtDeviceModel@@PAVQObject@@@Z @ 5 NONAME ; class BtAbstractDelegate * BtDelegateFactory::newDelegate(enum BtDelegate::Command, class BtSettingModel *, class BtDeviceModel *, class QObject *)
- ?tr@BtAbstractDelegate@@SA?AVQString@@PBD0@Z @ 6 NONAME ; class QString BtAbstractDelegate::tr(char const *, char const *)
- ?qt_metacast@BtAbstractDelegate@@UAEPAXPBD@Z @ 7 NONAME ; void * BtAbstractDelegate::qt_metacast(char const *)
- ?getStaticMetaObject@BtAbstractDelegate@@SAABUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const & BtAbstractDelegate::getStaticMetaObject(void)
- ??0BtAbstractDelegate@@QAE@PAVBtSettingModel@@PAVBtDeviceModel@@PAVQObject@@@Z @ 9 NONAME ; BtAbstractDelegate::BtAbstractDelegate(class BtSettingModel *, class BtDeviceModel *, class QObject *)
- ?staticMetaObject@BtAbstractDelegate@@2UQMetaObject@@B @ 10 NONAME ; struct QMetaObject const BtAbstractDelegate::staticMetaObject
- ??_EBtAbstractDelegate@@UAE@I@Z @ 11 NONAME ; BtAbstractDelegate::~BtAbstractDelegate(unsigned int)
- ?commandCompleted@BtAbstractDelegate@@IAEXHVQVariant@@@Z @ 12 NONAME ; void BtAbstractDelegate::commandCompleted(int, class QVariant)
- ?cancel@BtAbstractDelegate@@UAEXXZ @ 13 NONAME ; void BtAbstractDelegate::cancel(void)
- ?trUtf8@BtAbstractDelegate@@SA?AVQString@@PBD0@Z @ 14 NONAME ; class QString BtAbstractDelegate::trUtf8(char const *, char const *)
- ?getSettingModel@BtAbstractDelegate@@IAEPAVBtSettingModel@@XZ @ 15 NONAME ; class BtSettingModel * BtAbstractDelegate::getSettingModel(void)
- ?getDeviceModel@BtAbstractDelegate@@IAEPAVBtDeviceModel@@XZ @ 16 NONAME ; class BtDeviceModel * BtAbstractDelegate::getDeviceModel(void)
- ?trUtf8@BtAbstractDelegate@@SA?AVQString@@PBD0H@Z @ 17 NONAME ; class QString BtAbstractDelegate::trUtf8(char const *, char const *, int)
- ?isBtPowerOn@BtAbstractDelegate@@IAE_NXZ @ 18 NONAME ; bool BtAbstractDelegate::isBtPowerOn(void)
-
--- a/bluetoothengine/btui/bwins/btuimodelu.def Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-EXPORTS
- ?deviceSearchCompleted@BtDeviceModel@@IAEXH@Z @ 1 NONAME ; void BtDeviceModel::deviceSearchCompleted(int)
- ?cancelSearchDevice@BtDeviceModel@@QAEXXZ @ 2 NONAME ; void BtDeviceModel::cancelSearchDevice(void)
- ??0BtSettingModel@@QAE@PAVQObject@@@Z @ 3 NONAME ; BtSettingModel::BtSettingModel(class QObject *)
- ??1BtDeviceModel@@UAE@XZ @ 4 NONAME ; BtDeviceModel::~BtDeviceModel(void)
- ?emitdeviceSearchCompleted@BtDeviceModel@@AAEXH@Z @ 5 NONAME ; void BtDeviceModel::emitdeviceSearchCompleted(int)
- ?tr@BtDeviceModel@@SA?AVQString@@PBD0H@Z @ 6 NONAME ; class QString BtDeviceModel::tr(char const *, char const *, int)
- ?qt_metacast@BtDeviceModel@@UAEPAXPBD@Z @ 7 NONAME ; void * BtDeviceModel::qt_metacast(char const *)
- ?index@BtDeviceModel@@UBE?AVQModelIndex@@HHABV2@@Z @ 8 NONAME ; class QModelIndex BtDeviceModel::index(int, int, class QModelIndex const &) const
- ?rowCount@BtSettingModel@@UBEHABVQModelIndex@@@Z @ 9 NONAME ; int BtSettingModel::rowCount(class QModelIndex const &) const
- ?emitDataChanged@BtSettingModel@@AAEXHHPAX@Z @ 10 NONAME ; void BtSettingModel::emitDataChanged(int, int, void *)
- ??1BtSettingModel@@UAE@XZ @ 11 NONAME ; BtSettingModel::~BtSettingModel(void)
- ??0BtSettingModel@@QAE@ABV0@PAVQObject@@@Z @ 12 NONAME ; BtSettingModel::BtSettingModel(class BtSettingModel const &, class QObject *)
- ?searchDevice@BtDeviceModel@@QAE_NXZ @ 13 NONAME ; bool BtDeviceModel::searchDevice(void)
- ?parent@BtSettingModel@@UBE?AVQModelIndex@@ABV2@@Z @ 14 NONAME ; class QModelIndex BtSettingModel::parent(class QModelIndex const &) const
- ?trUtf8@BtSettingModel@@SA?AVQString@@PBD0@Z @ 15 NONAME ; class QString BtSettingModel::trUtf8(char const *, char const *)
- ??_EBtSettingModel@@UAE@I@Z @ 16 NONAME ; BtSettingModel::~BtSettingModel(unsigned int)
- ?emitDataChanged@BtSettingModel@@AAEXABVQModelIndex@@0@Z @ 17 NONAME ; void BtSettingModel::emitDataChanged(class QModelIndex const &, class QModelIndex const &)
- ?rowCount@BtDeviceModel@@UBEHABVQModelIndex@@@Z @ 18 NONAME ; int BtDeviceModel::rowCount(class QModelIndex const &) const
- ?metaObject@BtSettingModel@@UBEPBUQMetaObject@@XZ @ 19 NONAME ; struct QMetaObject const * BtSettingModel::metaObject(void) const
- ?itemData@BtDeviceModel@@UBE?AV?$QMap@HVQVariant@@@@ABVQModelIndex@@@Z @ 20 NONAME ; class QMap<int, class QVariant> BtDeviceModel::itemData(class QModelIndex const &) const
- ?staticMetaObject@BtDeviceModel@@2UQMetaObject@@B @ 21 NONAME ; struct QMetaObject const BtDeviceModel::staticMetaObject
- ?parent@BtDeviceModel@@UBE?AVQModelIndex@@ABV2@@Z @ 22 NONAME ; class QModelIndex BtDeviceModel::parent(class QModelIndex const &) const
- ?itemData@BtSettingModel@@UBE?AV?$QMap@HVQVariant@@@@ABVQModelIndex@@@Z @ 23 NONAME ; class QMap<int, class QVariant> BtSettingModel::itemData(class QModelIndex const &) const
- ?tr@BtSettingModel@@SA?AVQString@@PBD0@Z @ 24 NONAME ; class QString BtSettingModel::tr(char const *, char const *)
- ??0BtDeviceModel@@QAE@PAVQObject@@@Z @ 25 NONAME ; BtDeviceModel::BtDeviceModel(class QObject *)
- ?tr@BtDeviceModel@@SA?AVQString@@PBD0@Z @ 26 NONAME ; class QString BtDeviceModel::tr(char const *, char const *)
- ?qt_metacast@BtSettingModel@@UAEPAXPBD@Z @ 27 NONAME ; void * BtSettingModel::qt_metacast(char const *)
- ?getStaticMetaObject@BtSettingModel@@SAABUQMetaObject@@XZ @ 28 NONAME ; struct QMetaObject const & BtSettingModel::getStaticMetaObject(void)
- ??0BtDeviceModel@@QAE@ABV0@PAVQObject@@@Z @ 29 NONAME ; BtDeviceModel::BtDeviceModel(class BtDeviceModel const &, class QObject *)
- ?emitDataChanged@BtDeviceModel@@AAEXHHPAX@Z @ 30 NONAME ; void BtDeviceModel::emitDataChanged(int, int, void *)
- ?staticMetaObject@BtSettingModel@@2UQMetaObject@@B @ 31 NONAME ; struct QMetaObject const BtSettingModel::staticMetaObject
- ?data@BtSettingModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 32 NONAME ; class QVariant BtSettingModel::data(class QModelIndex const &, int) const
- ?columnCount@BtSettingModel@@UBEHABVQModelIndex@@@Z @ 33 NONAME ; int BtSettingModel::columnCount(class QModelIndex const &) const
- ?removeTransientDevices@BtDeviceModel@@QAEXXZ @ 34 NONAME ; void BtDeviceModel::removeTransientDevices(void)
- ?qt_metacall@BtDeviceModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 35 NONAME ; int BtDeviceModel::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?trUtf8@BtDeviceModel@@SA?AVQString@@PBD0@Z @ 36 NONAME ; class QString BtDeviceModel::trUtf8(char const *, char const *)
- ??_EBtDeviceModel@@UAE@I@Z @ 37 NONAME ; BtDeviceModel::~BtDeviceModel(unsigned int)
- ?index@BtSettingModel@@UBE?AVQModelIndex@@HHABV2@@Z @ 38 NONAME ; class QModelIndex BtSettingModel::index(int, int, class QModelIndex const &) const
- ?qt_metacall@BtSettingModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 39 NONAME ; int BtSettingModel::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?metaObject@BtDeviceModel@@UBEPBUQMetaObject@@XZ @ 40 NONAME ; struct QMetaObject const * BtDeviceModel::metaObject(void) const
- ?trUtf8@BtSettingModel@@SA?AVQString@@PBD0H@Z @ 41 NONAME ; class QString BtSettingModel::trUtf8(char const *, char const *, int)
- ?columnCount@BtDeviceModel@@UBEHABVQModelIndex@@@Z @ 42 NONAME ; int BtDeviceModel::columnCount(class QModelIndex const &) const
- ?tr@BtSettingModel@@SA?AVQString@@PBD0H@Z @ 43 NONAME ; class QString BtSettingModel::tr(char const *, char const *, int)
- ?data@BtDeviceModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 44 NONAME ; class QVariant BtDeviceModel::data(class QModelIndex const &, int) const
- ?getStaticMetaObject@BtDeviceModel@@SAABUQMetaObject@@XZ @ 45 NONAME ; struct QMetaObject const & BtDeviceModel::getStaticMetaObject(void)
- ?emitDataChanged@BtDeviceModel@@AAEXABVQModelIndex@@0@Z @ 46 NONAME ; void BtDeviceModel::emitDataChanged(class QModelIndex const &, class QModelIndex const &)
- ?trUtf8@BtDeviceModel@@SA?AVQString@@PBD0H@Z @ 47 NONAME ; class QString BtDeviceModel::trUtf8(char const *, char const *, int)
- ?setDeviceMajorFilter@BtuiModelSortFilter@@QAEXHW4FilterMode@1@@Z @ 48 NONAME ; void BtuiModelSortFilter::setDeviceMajorFilter(int, enum BtuiModelSortFilter::FilterMode)
- ?metaObject@BtuiModelSortFilter@@UBEPBUQMetaObject@@XZ @ 49 NONAME ; struct QMetaObject const * BtuiModelSortFilter::metaObject(void) const
- ?hasFilter@BtuiModelSortFilter@@QAE_NHW4FilterMode@1@@Z @ 50 NONAME ; bool BtuiModelSortFilter::hasFilter(int, enum BtuiModelSortFilter::FilterMode)
- ?staticMetaObject@BtuiModelSortFilter@@2UQMetaObject@@B @ 51 NONAME ; struct QMetaObject const BtuiModelSortFilter::staticMetaObject
- ?qt_metacast@BtuiModelSortFilter@@UAEPAXPBD@Z @ 52 NONAME ; void * BtuiModelSortFilter::qt_metacast(char const *)
- ?trUtf8@BtuiModelSortFilter@@SA?AVQString@@PBD0@Z @ 53 NONAME ; class QString BtuiModelSortFilter::trUtf8(char const *, char const *)
- ??0BtuiModelSortFilter@@QAE@PAVQObject@@@Z @ 54 NONAME ; BtuiModelSortFilter::BtuiModelSortFilter(class QObject *)
- ?lessThan@BtuiModelSortFilter@@MBE_NABVQModelIndex@@0@Z @ 55 NONAME ; bool BtuiModelSortFilter::lessThan(class QModelIndex const &, class QModelIndex const &) const
- ??1BtuiModelSortFilter@@UAE@XZ @ 56 NONAME ; BtuiModelSortFilter::~BtuiModelSortFilter(void)
- ??_EBtuiModelSortFilter@@UAE@I@Z @ 57 NONAME ; BtuiModelSortFilter::~BtuiModelSortFilter(unsigned int)
- ?deviceAcceptedByFilter@BtuiModelSortFilter@@IAEXH@Z @ 58 NONAME ; void BtuiModelSortFilter::deviceAcceptedByFilter(int)
- ?filterAcceptsRow@BtuiModelSortFilter@@MBE_NHABVQModelIndex@@@Z @ 59 NONAME ; bool BtuiModelSortFilter::filterAcceptsRow(int, class QModelIndex const &) const
- ?clearDeviceMajorFilter@BtuiModelSortFilter@@QAEXHW4FilterMode@1@@Z @ 60 NONAME ; void BtuiModelSortFilter::clearDeviceMajorFilter(int, enum BtuiModelSortFilter::FilterMode)
- ?tr@BtuiModelSortFilter@@SA?AVQString@@PBD0@Z @ 61 NONAME ; class QString BtuiModelSortFilter::tr(char const *, char const *)
- ?addDeviceMajorFilter@BtuiModelSortFilter@@QAEXHW4FilterMode@1@@Z @ 62 NONAME ; void BtuiModelSortFilter::addDeviceMajorFilter(int, enum BtuiModelSortFilter::FilterMode)
- ?qt_metacall@BtuiModelSortFilter@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 63 NONAME ; int BtuiModelSortFilter::qt_metacall(enum QMetaObject::Call, int, void * *)
- ?trUtf8@BtuiModelSortFilter@@SA?AVQString@@PBD0H@Z @ 64 NONAME ; class QString BtuiModelSortFilter::trUtf8(char const *, char const *, int)
- ?tr@BtuiModelSortFilter@@SA?AVQString@@PBD0H@Z @ 65 NONAME ; class QString BtuiModelSortFilter::tr(char const *, char const *, int)
- ?getStaticMetaObject@BtuiModelSortFilter@@SAABUQMetaObject@@XZ @ 66 NONAME ; struct QMetaObject const & BtuiModelSortFilter::getStaticMetaObject(void)
- ?clearDeviceMajorFilters@BtuiModelSortFilter@@QAEXXZ @ 67 NONAME ; void BtuiModelSortFilter::clearDeviceMajorFilters(void)
-
--- a/bluetoothengine/btui/eabi/btdevsettingframeworku.def Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-EXPORTS
- _ZN20BtAbstractDevSetting11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
- _ZN20BtAbstractDevSetting11qt_metacastEPKc @ 2 NONAME
- _ZN20BtAbstractDevSetting12aboutToCloseEv @ 3 NONAME
- _ZN20BtAbstractDevSetting16getSettingWidgetEv @ 4 NONAME
- _ZN20BtAbstractDevSetting16staticMetaObjectE @ 5 NONAME DATA 16
- _ZN20BtAbstractDevSetting17aboutToBackgroundEv @ 6 NONAME
- _ZN20BtAbstractDevSetting17aboutToForegroundEv @ 7 NONAME
- _ZN20BtAbstractDevSetting18isSettingAvailableEv @ 8 NONAME
- _ZN20BtAbstractDevSetting19getStaticMetaObjectEv @ 9 NONAME
- _ZN20BtAbstractDevSetting26settingAvailabilityChangedEPS_b @ 10 NONAME
- _ZN20BtAbstractDevSettingC1ERK7QStringP7QObject @ 11 NONAME
- _ZN20BtAbstractDevSettingC2ERK7QStringP7QObject @ 12 NONAME
- _ZN20BtAbstractDevSettingD0Ev @ 13 NONAME
- _ZN20BtAbstractDevSettingD1Ev @ 14 NONAME
- _ZN20BtAbstractDevSettingD2Ev @ 15 NONAME
- _ZN24BtDevSettingPluginLoader24loadDevSettingInterfacesEv @ 16 NONAME
- _ZNK20BtAbstractDevSetting10metaObjectEv @ 17 NONAME
- _ZNK20BtAbstractDevSetting9getRemoteEv @ 18 NONAME
- _ZTI20BtAbstractDevSetting @ 19 NONAME
- _ZTV20BtAbstractDevSetting @ 20 NONAME
-
--- a/bluetoothengine/btui/eabi/btuidelegateu.def Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-EXPORTS
- _ZN17BtDelegateFactory11newDelegateEN10BtDelegate7CommandEP14BtSettingModelP13BtDeviceModelP7QObject @ 1 NONAME
- _ZN18BtAbstractDelegate11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
- _ZN18BtAbstractDelegate11qt_metacastEPKc @ 3 NONAME
- _ZN18BtAbstractDelegate14getDeviceModelEv @ 4 NONAME
- _ZN18BtAbstractDelegate15getSettingModelEv @ 5 NONAME
- _ZN18BtAbstractDelegate16commandCompletedEi8QVariant @ 6 NONAME
- _ZN18BtAbstractDelegate16staticMetaObjectE @ 7 NONAME DATA 16
- _ZN18BtAbstractDelegate19getStaticMetaObjectEv @ 8 NONAME
- _ZN18BtAbstractDelegate6cancelEv @ 9 NONAME
- _ZN18BtAbstractDelegateC2EP14BtSettingModelP13BtDeviceModelP7QObject @ 10 NONAME
- _ZN18BtAbstractDelegateD0Ev @ 11 NONAME
- _ZN18BtAbstractDelegateD1Ev @ 12 NONAME
- _ZN18BtAbstractDelegateD2Ev @ 13 NONAME
- _ZNK18BtAbstractDelegate10metaObjectEv @ 14 NONAME
- _ZTI18BtAbstractDelegate @ 15 NONAME
- _ZTV18BtAbstractDelegate @ 16 NONAME
- _ZN18BtAbstractDelegate11isBtPowerOnEv @ 17 NONAME
-
--- a/bluetoothengine/btui/eabi/btuimodelu.def Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-EXPORTS
- _ZN13BtDeviceModel11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
- _ZN13BtDeviceModel11qt_metacastEPKc @ 2 NONAME
- _ZN13BtDeviceModel12searchDeviceEv @ 3 NONAME
- _ZN13BtDeviceModel15emitDataChangedERK11QModelIndexS2_ @ 4 NONAME
- _ZN13BtDeviceModel15emitDataChangedEiiPv @ 5 NONAME
- _ZN13BtDeviceModel16staticMetaObjectE @ 6 NONAME DATA 16
- _ZN13BtDeviceModel18cancelSearchDeviceEv @ 7 NONAME
- _ZN13BtDeviceModel19getStaticMetaObjectEv @ 8 NONAME
- _ZN13BtDeviceModel21deviceSearchCompletedEi @ 9 NONAME
- _ZN13BtDeviceModel22removeTransientDevicesEv @ 10 NONAME
- _ZN13BtDeviceModel25emitdeviceSearchCompletedEi @ 11 NONAME
- _ZN13BtDeviceModelC1EP7QObject @ 12 NONAME
- _ZN13BtDeviceModelC1ERKS_P7QObject @ 13 NONAME
- _ZN13BtDeviceModelC2EP7QObject @ 14 NONAME
- _ZN13BtDeviceModelC2ERKS_P7QObject @ 15 NONAME
- _ZN13BtDeviceModelD0Ev @ 16 NONAME
- _ZN13BtDeviceModelD1Ev @ 17 NONAME
- _ZN13BtDeviceModelD2Ev @ 18 NONAME
- _ZN14BtSettingModel11qt_metacallEN11QMetaObject4CallEiPPv @ 19 NONAME
- _ZN14BtSettingModel11qt_metacastEPKc @ 20 NONAME
- _ZN14BtSettingModel15emitDataChangedERK11QModelIndexS2_ @ 21 NONAME
- _ZN14BtSettingModel15emitDataChangedEiiPv @ 22 NONAME
- _ZN14BtSettingModel16staticMetaObjectE @ 23 NONAME DATA 16
- _ZN14BtSettingModel19getStaticMetaObjectEv @ 24 NONAME
- _ZN14BtSettingModelC1EP7QObject @ 25 NONAME
- _ZN14BtSettingModelC1ERKS_P7QObject @ 26 NONAME
- _ZN14BtSettingModelC2EP7QObject @ 27 NONAME
- _ZN14BtSettingModelC2ERKS_P7QObject @ 28 NONAME
- _ZN14BtSettingModelD0Ev @ 29 NONAME
- _ZN14BtSettingModelD1Ev @ 30 NONAME
- _ZN14BtSettingModelD2Ev @ 31 NONAME
- _ZNK13BtDeviceModel10metaObjectEv @ 32 NONAME
- _ZNK13BtDeviceModel11columnCountERK11QModelIndex @ 33 NONAME
- _ZNK13BtDeviceModel4dataERK11QModelIndexi @ 34 NONAME
- _ZNK13BtDeviceModel5indexEiiRK11QModelIndex @ 35 NONAME
- _ZNK13BtDeviceModel6parentERK11QModelIndex @ 36 NONAME
- _ZNK13BtDeviceModel8itemDataERK11QModelIndex @ 37 NONAME
- _ZNK13BtDeviceModel8rowCountERK11QModelIndex @ 38 NONAME
- _ZNK14BtSettingModel10metaObjectEv @ 39 NONAME
- _ZNK14BtSettingModel11columnCountERK11QModelIndex @ 40 NONAME
- _ZNK14BtSettingModel4dataERK11QModelIndexi @ 41 NONAME
- _ZNK14BtSettingModel5indexEiiRK11QModelIndex @ 42 NONAME
- _ZNK14BtSettingModel6parentERK11QModelIndex @ 43 NONAME
- _ZNK14BtSettingModel8itemDataERK11QModelIndex @ 44 NONAME
- _ZNK14BtSettingModel8rowCountERK11QModelIndex @ 45 NONAME
- _ZTI13BtDeviceModel @ 46 NONAME
- _ZTI14BtSettingModel @ 47 NONAME
- _ZTV13BtDeviceModel @ 48 NONAME
- _ZTV14BtSettingModel @ 49 NONAME
- _ZN19BtuiModelSortFilter11qt_metacallEN11QMetaObject4CallEiPPv @ 50 NONAME
- _ZN19BtuiModelSortFilter11qt_metacastEPKc @ 51 NONAME
- _ZN19BtuiModelSortFilter16staticMetaObjectE @ 52 NONAME DATA 16
- _ZN19BtuiModelSortFilter19getStaticMetaObjectEv @ 53 NONAME
- _ZN19BtuiModelSortFilter20addDeviceMajorFilterEiNS_10FilterModeE @ 54 NONAME
- _ZN19BtuiModelSortFilter20setDeviceMajorFilterEiNS_10FilterModeE @ 55 NONAME
- _ZN19BtuiModelSortFilter22clearDeviceMajorFilterEiNS_10FilterModeE @ 56 NONAME
- _ZN19BtuiModelSortFilter22deviceAcceptedByFilterEi @ 57 NONAME
- _ZN19BtuiModelSortFilter23clearDeviceMajorFiltersEv @ 58 NONAME
- _ZN19BtuiModelSortFilter9hasFilterEiNS_10FilterModeE @ 59 NONAME
- _ZN19BtuiModelSortFilterC1EP7QObject @ 60 NONAME
- _ZN19BtuiModelSortFilterC2EP7QObject @ 61 NONAME
- _ZN19BtuiModelSortFilterD0Ev @ 62 NONAME
- _ZN19BtuiModelSortFilterD1Ev @ 63 NONAME
- _ZN19BtuiModelSortFilterD2Ev @ 64 NONAME
- _ZNK19BtuiModelSortFilter10metaObjectEv @ 65 NONAME
- _ZNK19BtuiModelSortFilter16filterAcceptsRowEiRK11QModelIndex @ 66 NONAME
- _ZNK19BtuiModelSortFilter8lessThanERK11QModelIndexS2_ @ 67 NONAME
- _ZTI19BtuiModelSortFilter @ 68 NONAME
- _ZTV19BtuiModelSortFilter @ 69 NONAME
-
--- a/bluetoothengine/btui/inc/btdevicemodel.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/inc/btdevicemodel.h Tue Jul 06 14:27:09 2010 +0300
@@ -23,7 +23,7 @@
#include <QSharedPointer>
#include <btuimodeltypes.h>
-class BtDeviceData;
+class BtDeviceModelPrivate;
/*!
\class BtDeviceModel
@@ -69,6 +69,7 @@
MajorPropertyRole, // QVariant::Int, bits of DevMajorProperty
MinorPropertyRole, // QVariant::Int, bits of DevMinorProperty
CoDRole, // QVariant::Int, the value of Class of Device
+ SeqNumRole // sequence number indicating order in which device was found
};
public:
@@ -101,19 +102,27 @@
signals:
void deviceSearchCompleted(int error);
+
+private slots:
+
+ void deviceDataChanged( int row, void *parent );
+ void deviceDataChanged( int first, int last, void *parent );
+
+ void beginInsertDevices(int first, int last, void *parent);
+ void endInsertDevices();
+
+ void beginRemoveDevices(int first, int last, void *parent);
+ void endRemoveDevices();
+
+ void emitDeviceSearchCompleted( int error );
+
private:
- void emitDataChanged(int row, int column, void *parent );
-
- void emitDataChanged(const QModelIndex &top, const QModelIndex &bottom );
-
- void emitdeviceSearchCompleted(int error);
+ void connectModelSignals();
private:
- QSharedPointer<BtDeviceData> mDeviceData;
-
- friend class BtDeviceData;
+ QSharedPointer<BtDeviceModelPrivate> d;
};
#endif // BTUIMODEL_H
--- a/bluetoothengine/btui/inc/btsettingmodel.h Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/inc/btsettingmodel.h Tue Jul 06 14:27:09 2010 +0300
@@ -23,7 +23,7 @@
#include <QSharedPointer>
#include <btuimodeltypes.h>
-class BtLocalSetting;
+class BtSettingModelPrivate;
/*!
\class BtSettingModel
@@ -97,16 +97,19 @@
virtual QMap<int, QVariant> itemData( const QModelIndex & index ) const;
+private slots:
+
+ void settingDataChanged( int row, void *parent );
+
+ void settingDataChanged( int first, int last, void *parent );
+
private:
- void emitDataChanged(int row, int column, void *parent );
-
- void emitDataChanged(const QModelIndex &top, const QModelIndex &bottom );
+ void connectModelSignals();
private:
- QSharedPointer<BtLocalSetting> mLocalSetting;
-
- friend class BtLocalSetting;
+ QSharedPointer<BtSettingModelPrivate> d;
+
};
#endif
--- a/bluetoothengine/btui/rom/btui_resources.iby Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/btui/rom/btui_resources.iby Tue Jul 06 14:27:09 2010 +0300
@@ -25,6 +25,7 @@
//For localization resource
data=DATAZ_/QT_TRANSLATIONS_DIR/btviews.qm QT_TRANSLATIONS_DIR/btviews.qm
data=DATAZ_/QT_TRANSLATIONS_DIR/btdialogs.qm QT_TRANSLATIONS_DIR/btdialogs.qm
+data=DATAZ_/QT_TRANSLATIONS_DIR/btindimenu.qm QT_TRANSLATIONS_DIR/btindimenu.qm
#endif //__BT
#endif // __BTCPPLUGIN_RESOURCES_IBY__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetoothengine/conf/TestFramework.ini Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,200 @@
+#
+# This is STIF initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+# - Set Test Reporting mode. TestReportMode's possible values are:
+# + 'Summary': Summary of the tested test cases.
+# + 'Environment': Hardware and software info.
+# + 'TestCases': Test case report.
+# + 'FullReport': Set of all above ones.
+# + Example 'TestReportMode= Summary TestCases'
+#
+# - CreateTestReport setting controls report creation mode
+# + YES, Test report will created.
+# + NO, No Test report.
+#
+# - File path indicates the base path of the test report.
+# - File name indicates the name of the test report.
+#
+# - File format indicates the type of the test report.
+# + TXT, Test report file will be txt type, for example 'TestReport.txt'.
+# + HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# - File output indicates output source of the test report.
+# + FILE, Test report logging to file.
+# + RDEBUG, Test report logging to using rdebug.
+#
+# - File Creation Mode indicates test report overwriting if file exist.
+# + OVERWRITE, Overwrites if the Test report file exist.
+# + APPEND, Continue logging after the old Test report information if
+# report exist.
+# - Sets a device reset module's dll name(Reboot).
+# + If Nokia specific reset module is not available or it is not correct one
+# StifHWResetStub module may use as a template for user specific reset
+# module.
+# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation
+# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02
+#
+
+[Engine_Defaults]
+
+TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment',
+ # 'TestCases' or 'FullReport'
+
+CreateTestReport= YES # Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT # Possible values: TXT or HTML
+TestReportOutput= FILE # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+DisableMeasurement= stifmeasurementdisablenone # Possible values are:
+ # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
+ # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
+ # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
+ # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
+
+Timeout= 0 # Default timeout value for each test case. In milliseconds
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= TestScripter
+TestCaseFile= c:\testframework\btserviceutiltest.cfg
+TestCaseFile= c:\testframework\btnotifwrappertest.cfg
+TestCaseFile= c:\testframework\btnotifsrvtest.cfg
+#TestCaseFile= c:\testframework\btnotifclienttest.cfg
+[End_Module]
+
+#
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIF logging overwrite parameters for Logger.
+# Hardware and emulator environment logging path and styles can
+# be configured from here to overwrite the Logger's implemented values.
+#
+# Settings description:
+# - Indicates option for creation log directory/directories. If log directory/directories
+# is/are not created by user they will make by software.
+# + YES, Create log directory/directories if not allready exist.
+# + NO, Log directory/directories not created. Only created one is used.
+#
+# - Overwrite emulator path setting.
+# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined
+# Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+# will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+# - Overwrite emulator's logging format.
+# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+# + HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+# - Overwrited emulator logging output source.
+# + FILE, Logging to file(s).
+# + RDEBUG, Logging to using rdebug(s).
+#
+# - Overwrite hardware path setting (Same description as above in emulator path).
+# - Overwrite hardware's logging format(Same description as above in emulator format).
+# - Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+# - File Creation Mode indicates file overwriting if file exist.
+# + OVERWRITE, Overwrites if file(s) exist.
+# + APPEND, Continue logging after the old logging information if file(s) exist.
+#
+# - Will thread id include to the log filename.
+# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+# + NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+# - Will time stamps include the to log file.
+# + YES, Time stamp added to each line in log file(s). Time stamp is
+# for example'12.Nov.2003 115958 LOGGING INFO'
+# + NO, No time stamp(s).
+#
+# - Will line breaks include to the log file.
+# + YES, Each logging event includes line break and next log event is in own line.
+# + NO, No line break(s).
+#
+# - Will event ranking include to the log file.
+# + YES, Event ranking number added to each line in log file(s). Ranking number
+# depends on environment's tics, for example(includes time stamp also)
+# '012 12.Nov.2003 115958 LOGGING INFO'
+# + NO, No event ranking.
+#
+# - Will write log file in unicode format.
+# + YES, Log file will be written in unicode format
+# + NO, Log will be written as normal, not unicode, file.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
+#NOTE: TestEngine and TestServer logging settings cannot change here
+
+#CreateLogDirectories= YES # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML # Possible values: TXT or HTML
+#EmulatorOutput= FILE # Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML # Possible values: TXT or HTML
+#HardwareOutput= FILE # Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES # Possible values: YES or NO
+#WithTimeStamp= YES # Possible values: YES or NO
+#WithLineBreak= YES # Possible values: YES or NO
+#WithEventRanking= YES # Possible values: YES or NO
+
+#FileUnicode= YES # Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
--- a/bluetoothengine/group/bld.inf Wed Jun 23 18:23:52 2010 +0300
+++ b/bluetoothengine/group/bld.inf Tue Jul 06 14:27:09 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description: Build information file for project ?myapp
+* Description: Build information file for project bluetoothengine
*
*/
@@ -44,3 +44,8 @@
PRJ_TESTMMPFILES
PRJ_TESTEXPORTS
+../conf/testframework.ini /epoc32/WINSCW/C/TestFramework/testframework.ini
+../btserviceutil/tsrc/btserviceutiltest/conf/btserviceutiltest.cfg /epoc32/winscw/c/TestFramework/btserviceutiltest.cfg
+../btnotif/btnotifclient/tsrc/btnotifclienttest/conf/btnotifclienttest.cfg /epoc32/WINSCW/C/TestFramework/btnotifclienttest.cfg
+../btnotif/btnotifwrapper/tsrc/btnotifwrappertest/conf/btnotifwrappertest.cfg /epoc32/WINSCW/C/TestFramework/btnotifwrappertest.cfg
+../btnotif/btnotifsrv/tsrc/btnotifsrvtest/conf/btnotifsrvtest.cfg /epoc32/WINSCW/C/TestFramework/btnotifsrvtest.cfg
--- a/btobexprofiles/obexreceiveservices/bip/inc/BIPController.h Wed Jun 23 18:23:52 2010 +0300
+++ b/btobexprofiles/obexreceiveservices/bip/inc/BIPController.h Tue Jul 06 14:27:09 2010 +0300
@@ -164,6 +164,7 @@
CObexUtilsDialog* iDialog;
CHbDeviceDialogSymbian* iProgressDialog;
TBool iDialogActive;
+ TInt iFileCount;
};
_LIT(KBipPanicCategory, "BIP");
--- a/btobexprofiles/obexreceiveservices/bip/src/BIPController.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/btobexprofiles/obexreceiveservices/bip/src/BIPController.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -254,6 +254,7 @@
iBTObject = NULL;
TRAP_IGNORE(TObexUtilsMessageHandler::RemoveTemporaryRFileL (iFullPathFilename));
iFs.Close();
+ iFileCount = 0;
}
// ---------------------------------------------------------
@@ -379,6 +380,7 @@
retVal = HandlePutCompleteIndication();
iBTTransferState = ETransferIdle;
CloseReceivingIndicator();
+ iFileCount++;
}
TRACE_FUNC_EXIT
return retVal;
@@ -807,7 +809,15 @@
fileSzKey.Num(TBluetoothDeviceDialog::EReceivingFileSize);
User::LeaveIfError(variantMap->Add(fileSzKey, fileSz));
CleanupStack::Pop(fileSz);
-
+
+ CHbSymbianVariant* fileCnt = CHbSymbianVariant::NewL( (TAny*) &iFileCount,
+ CHbSymbianVariant::EInt );
+ CleanupStack::PushL(fileCnt);
+ TBuf16<6> fileCntKey;
+ fileCntKey.Num(TBluetoothDeviceDialog::EReceivedFileCount);
+ User::LeaveIfError(variantMap->Add(fileCntKey, fileCnt));
+ CleanupStack::Pop(fileCnt);
+
iDialogActive = ETrue;
iProgressDialog->Show( KBTDevDialogId(), *variantMap, this );
CleanupStack::PopAndDestroy(variantMap);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btobexprofiles/obexreceiveservices/btmsgviewer/btmsgviewer.pro Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = app
+TARGET = btmsgviewer
+CONFIG += hb \
+ service
+symbian:
+ {
+ TARGET.UID3 = 0x2002ED70
+ TARGET.CAPABILITY = ALL \
+ -TCB
+}
+LIBS += -lhbcore \
+ -lxqservice \
+ -lxqserviceutil \
+ -lbluetooth \
+ -lmsgs \
+ -lapmime \
+ -lefsrv
+
+SERVICE.FILE = service_conf.xml
+libFiles.sources = xqservice.dll
+SERVICE.OPTIONS = embeddable \
+ hidden
+libFiles.path = "!:\sys\bin"
+DEPLOYMENT += libFiles
+HEADERS += ./inc/btmsgviewer.h \
+ ./inc/btmsgviewerutils.h
+SOURCES += ./src/btmsgviewer.cpp \
+ ./src/main.cpp \
+ ./src/btmsgviewerutils.cpp
+BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
+ "./rom/btmsgviewer.iby CORE_APP_LAYER_IBY_EXPORT_PATH(btmsgviewer.iby)"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btobexprofiles/obexreceiveservices/btmsgviewer/inc/btmsgviewer.h Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+
+#ifndef BTMSGVIEWER_H
+#define BTMSGVIEWER_H
+
+#include <xqserviceprovider.h>
+#include <hbview.h>
+#include <xqappmgr.h>
+#include "btmsgviewerutils.h"
+
+
+class BTMsgViewer : public XQServiceProvider
+{
+ Q_OBJECT
+
+public:
+ BTMsgViewer (QObject *parent = 0 );
+ ~BTMsgViewer ();
+public slots:
+ int displaymsg(int messageId);
+private:
+ bool isError(int aError);
+};
+
+#endif // BTMSGVIEWER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btobexprofiles/obexreceiveservices/btmsgviewer/inc/btmsgviewerutils.h Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef BTMSGVIEWERUTILS_H_
+#define BTMSGVIEWERUTILS_H_
+
+#include <msvapi.h>
+
+
+class CBtMsgViewerUtils: public CBase, public MMsvSessionObserver
+ {
+public:
+ static CBtMsgViewerUtils* NewL();
+ ~CBtMsgViewerUtils();
+ HBufC* GetMessagePath(TInt aMessageId, TInt aError);
+
+private: // From MMsvSessionObserver
+ void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
+
+private:
+ void GetMessagePathL(TPtr aMsgPath, const TInt aMessageId);
+
+private:
+ CBtMsgViewerUtils();
+ void ConstructL();
+
+private:
+ CMsvSession* iMsvSession;
+ };
+
+#endif // BTMSGVIEWERUTILS_H_
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btobexprofiles/obexreceiveservices/btmsgviewer/rom/btmsgviewer.iby Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+
+#ifndef __BTMSGVIEWER_IBY__
+#define __BTMSGVIEWER_IBY__
+
+file=ABI_DIR\UREL\btmsgviewer.exe SHARED_LIB_DIR\btmsgviewer.exe
+data=DATAZ_\resource\apps\btmsgviewer.rsc resource\apps\btmsgviewer.rsc
+data=DATAZ_\private\10003a3f\import\apps\btmsgviewer_reg.rsc private\10003a3f\import\apps\btmsgviewer_reg.rsc
+
+#endif
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btobexprofiles/obexreceiveservices/btmsgviewer/service_conf.xml Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<service name="com.nokia.services.btmsgdispservices" filepath="must-not-be-empty" >
+ <description>BT msg Disp service</description>
+ <interface name="displaymsg" version="1.0" capabilities="">
+ <description>display message from inbox</description>
+ </interface>
+</service>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btobexprofiles/obexreceiveservices/btmsgviewer/src/btmsgviewer.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies 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 "btmsgviewer.h"
+#include "apmstd.h"
+#include <xqaiwrequest.h>
+#include <f32file.h>
+//#include <documenthandler.h>
+
+
+BTMsgViewer::BTMsgViewer(QObject* parent)
+: XQServiceProvider("com.nokia.services.btmsgdispservices.displaymsg",parent)
+ {
+ publishAll();
+ }
+
+BTMsgViewer::~BTMsgViewer ()
+ {
+
+ }
+
+int BTMsgViewer::displaymsg( int messageId )
+ {
+ CBtMsgViewerUtils* btViewerUtils = 0;
+
+ TRAPD(error, btViewerUtils = CBtMsgViewerUtils::NewL());
+ if(isError(error))
+ {
+ if(btViewerUtils)
+ delete btViewerUtils;
+
+ return error;
+ }
+
+ HBufC* fileName = 0;
+ fileName = btViewerUtils->GetMessagePath(messageId, error);
+ if(isError(error))
+ {
+ if(fileName)
+ delete fileName;
+
+ delete btViewerUtils;
+ return error;
+ }
+
+ QString attachmentFName = QString::fromUtf16(fileName->Ptr(),fileName->Length());
+
+ delete fileName;
+ delete btViewerUtils;
+
+ XQSharableFile sf;
+ XQAiwRequest* request = 0;
+
+ if (!sf.open(attachmentFName)) {
+ return KErrNotFound;
+ }
+
+ // Get handlers
+ XQApplicationManager appManager;
+ QList<XQAiwInterfaceDescriptor> fileHandlers = appManager.list(sf);
+ if (fileHandlers.count() > 0) {
+ XQAiwInterfaceDescriptor d = fileHandlers.first();
+ request = appManager.create(sf, d);
+
+ if (!request) {
+ sf.close();
+ return KErrGeneral;
+ }
+ }
+ else {
+ sf.close();
+ return KErrGeneral;
+ }
+
+ request->setEmbedded(true);
+ request->setSynchronous(true);
+
+ // Fill args
+ QList<QVariant> args;
+ args << qVariantFromValue(sf);
+ request->setArguments(args);
+
+ bool res = request->send();
+ if (!res)
+ {
+ QString errMsg = request->lastErrorMessage();
+ }
+
+ // Cleanup
+ sf.close();
+ delete request;
+
+ if(!res)
+ return request->lastError();
+ else
+ return KErrNone;
+ }
+
+bool BTMsgViewer::isError(int aError)
+ {
+ return ((aError < KErrNone)?true:false);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btobexprofiles/obexreceiveservices/btmsgviewer/src/btmsgviewerutils.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include <mmsvattachmentmanager.h>
+#include "btmsgviewerutils.h"
+
+
+CBtMsgViewerUtils* CBtMsgViewerUtils::NewL()
+ {
+ CBtMsgViewerUtils* me = new (ELeave) CBtMsgViewerUtils();
+ CleanupStack::PushL(me);
+ me->ConstructL();
+ CleanupStack::Pop(me);
+ return me;
+ }
+
+CBtMsgViewerUtils::CBtMsgViewerUtils()
+ {
+
+ }
+
+void CBtMsgViewerUtils::ConstructL()
+ {
+ iMsvSession = CMsvSession::OpenSyncL(*this);
+ }
+
+CBtMsgViewerUtils::~CBtMsgViewerUtils()
+ {
+ if ( iMsvSession )
+ {
+ delete iMsvSession;
+ }
+ }
+
+HBufC* CBtMsgViewerUtils::GetMessagePath(TInt aMessageId, TInt aError)
+ {
+ HBufC* fileName = NULL;
+ TRAP(aError, fileName = HBufC::NewL(KMaxPath));
+ if(aError < KErrNone)
+ {
+ return fileName;
+ }
+
+ TRAP(aError, GetMessagePathL(fileName->Des(), aMessageId));
+ return fileName;
+ }
+
+void CBtMsgViewerUtils::GetMessagePathL(TPtr aMsgPath, const TInt aMessageId)
+ {
+ CMsvEntry* messageEntry = iMsvSession->GetEntryL(aMessageId);
+ CleanupStack::PushL(messageEntry);
+
+ CMsvEntry* attachmentEntry = iMsvSession->GetEntryL((*messageEntry)[0].Id());
+ CleanupStack::PushL(attachmentEntry);
+
+ CMsvStore* store = attachmentEntry->EditStoreL();
+ CleanupStack::PushL(store);
+
+ //get file handle for the attachment & the complete path of the file
+ RFile attachmentFile;
+ attachmentFile = store->AttachmentManagerL().GetAttachmentFileL(0);
+ attachmentFile.FullName(aMsgPath);
+ attachmentFile.Close();
+
+ //mark attachment as Read
+ TMsvEntry attachEntry = attachmentEntry->Entry();
+ attachEntry.SetUnread(EFalse);
+ attachmentEntry->ChangeL(attachEntry);
+
+ CleanupStack::PopAndDestroy(store);
+ CleanupStack::PopAndDestroy(attachmentEntry);
+ CleanupStack::PopAndDestroy(messageEntry);
+ }
+
+void CBtMsgViewerUtils::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1,
+ TAny* aArg2, TAny* aArg3)
+ {
+ (void) aEvent;
+ (void) aArg1;
+ (void) aArg2;
+ (void) aArg3;
+ }
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btobexprofiles/obexreceiveservices/btmsgviewer/src/main.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+
+#include <hbapplication.h>
+#include <xqservicerequest.h>
+#include "btmsgviewer.h"
+
+
+int main(int argc, char **argv)
+{
+ HbApplication a( argc, argv );
+
+ BTMsgViewer* btmsgviewer = new BTMsgViewer();
+ int retVal = a.exec();
+ delete btmsgviewer;
+ return retVal;
+}
+
--- a/btobexprofiles/obexreceiveservices/opp/inc/oppcontroller.h Wed Jun 23 18:23:52 2010 +0300
+++ b/btobexprofiles/obexreceiveservices/opp/inc/oppcontroller.h Tue Jul 06 14:27:09 2010 +0300
@@ -156,6 +156,7 @@
CObexUtilsDialog* iDialog;
CHbDeviceDialogSymbian* iProgressDialog;
TBool iDialogActive;
+ TInt iFileCount;
};
#endif // OPPCONTROLLER_H
--- a/btobexprofiles/obexreceiveservices/opp/src/oppcontroller.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/btobexprofiles/obexreceiveservices/opp/src/oppcontroller.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -224,6 +224,7 @@
iObexObject = NULL;
TRAP_IGNORE(TObexUtilsMessageHandler::RemoveTemporaryRFileL (iFullPathFilename));
iFs.Close();
+ iFileCount = 0;
}
// ---------------------------------------------------------
@@ -345,6 +346,7 @@
retVal = HandlePutCompleteIndication();
iObexTransferState = ETransferIdle;
CloseReceivingIndicator();
+ iFileCount++;
}
TRACE_FUNC_EXIT
return retVal;
@@ -762,7 +764,15 @@
fileSzKey.Num(TBluetoothDeviceDialog::EReceivingFileSize);
User::LeaveIfError(variantMap->Add(fileSzKey, fileSz));
CleanupStack::Pop(fileSz);
-
+
+ CHbSymbianVariant* fileCnt = CHbSymbianVariant::NewL( (TAny*) &iFileCount,
+ CHbSymbianVariant::EInt );
+ CleanupStack::PushL(fileCnt);
+ TBuf16<6> fileCntKey;
+ fileCntKey.Num(TBluetoothDeviceDialog::EReceivedFileCount);
+ User::LeaveIfError(variantMap->Add(fileCntKey, fileCnt));
+ CleanupStack::Pop(fileCnt);
+
iDialogActive = ETrue;
iProgressDialog->Show( KBTDevDialogId(), *variantMap, this );
CleanupStack::PopAndDestroy(variantMap);
--- a/btobexprofiles/obexsendservices/group/sendutils.mmp Wed Jun 23 18:23:52 2010 +0300
+++ b/btobexprofiles/obexsendservices/group/sendutils.mmp Tue Jul 06 14:27:09 2010 +0300
@@ -30,6 +30,7 @@
SOURCE BTServiceUtils.cpp
SOURCE BTServiceStarter.cpp
SOURCE BTServiceParameterList.cpp
+SOURCE BTServiceDelayedDestroyer.cpp
SOURCE BTSOPPController.cpp
SOURCE BTSBIPController.cpp
--- a/btobexprofiles/obexsendservices/obexservicesendutils/inc/BTSProgresstimer.h Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#ifndef BTSPROGRESSTIMER_H
-#define BTSPROGRESSTIMER_H
-
-
-#include <e32base.h>
-
-class MBTServiceObserver;
-
-// CLASS DECLARATION
-/**
-* A timer class for updating progress dialog.
-*/
-NONSHARABLE_CLASS( CBTSProgressTimer ) : public CTimer
- {
- public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CBTSProgressTimer* NewL( MBTServiceObserver* aProgressObserverPtr );
-
- /**
- * Destructor.
- */
- virtual ~CBTSProgressTimer();
-
- public: // New functions
-
- /**
- * Sets the timeout of the timer.
- * @param aTimeout The timeout in microseconds.
- * @return None.
- */
- void SetTimeout( TTimeIntervalMicroSeconds32 aTimeout );
-
- /**
- * Restarts the timer.
- * @return None.
- */
- void Tickle();
-
- private: // Functions from base classes
-
- /**
- * From CTimer Get's called when the timer expires.
- * @return None.
- */
- void RunL();
-
- TInt RunError( TInt aError );
-
- private:
-
- /**
- * C++ default constructor.
- */
- CBTSProgressTimer( MBTServiceObserver* aProgressObserverPtr );
-
- /**
- * By default Symbian OS constructor is private.
- */
- void ConstructL();
-
- private: // Data
- TTimeIntervalMicroSeconds32 iTimeout;
- MBTServiceObserver* iProgressObserverPtr;
- };
-
-#endif // BTSPROGRESSTIMER_H
-
-// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btobexprofiles/obexsendservices/obexservicesendutils/inc/BTServiceDelayedDestroyer.h Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: The base active object declaration
+*
+*/
+
+
+#ifndef BT_SERVICE_DELAYED_DESTROYER_H
+#define BT_SERVICE_DELAYED_DESTROYER_H
+
+// INCLUDES
+#include <btengdiscovery.h>
+#include <e32base.h>
+
+NONSHARABLE_CLASS (CBTServiceDelayedDestroyer) : public CActive
+ {
+
+public:
+
+ static CBTServiceDelayedDestroyer* NewL(CActive::TPriority aPriority);
+
+ static CBTServiceDelayedDestroyer* NewLC(CActive::TPriority aPriority);
+
+ virtual ~CBTServiceDelayedDestroyer();
+
+public:
+
+ /**
+ * Calls SetActive().
+ */
+ void GoActive();
+
+ // Sets the pointer which will be destroyed.
+ // Must be called with GoActive, they are pairs, first
+ // call SetDestructPointer and then GoActive.
+ void SetDestructPointer(CBTEngDiscovery* aPtr);
+
+private:
+
+ /**
+ * From CActive.
+ * cancels the outstanding request.
+ */
+ virtual void DoCancel();
+
+ /**
+ * From CActive.
+ * Handles the request completion event.
+ * Deletes CBTEngDiscovery object which is passed via SetDestructPointer method.
+ */
+ virtual void RunL();
+
+ /**
+ * From CActive.
+ * Handles the leave from RunL().
+ * @param aError the leave code in RunL()
+ * @return the error code to Active Scheduler
+ */
+ virtual TInt RunError(TInt aError);
+
+private:
+
+ CBTServiceDelayedDestroyer(CActive::TPriority aPriority);
+
+private:
+ TRequestStatus iStatus;
+ CBTEngDiscovery* iPtr;
+ };
+
+#endif // BT_SERVICE_DELAYED_DESTROYER_H
--- a/btobexprofiles/obexsendservices/obexservicesendutils/inc/BTServiceStarter.h Wed Jun 23 18:23:52 2010 +0300
+++ b/btobexprofiles/obexsendservices/obexservicesendutils/inc/BTServiceStarter.h Tue Jul 06 14:27:09 2010 +0300
@@ -24,6 +24,7 @@
#include "BTServiceAPI.h"
#include "BTServiceUtils.h"
#include "BTServiceParameterList.h"
+#include "BTServiceDelayedDestroyer.h"
#include <btengdiscovery.h>
#include <btengsettings.h>
@@ -392,7 +393,7 @@
* @param aReason Error value
* @return None.
*/
- void ShowNote( TInt aReason ) const;
+ void ShowErrorNote( TInt aReason ) const;
/**
* Cancel progress note
@@ -449,6 +450,8 @@
TBTServiceType iService;
TInt iClientChannel;
TBTServiceStarterState iState;
+ //todo verify the usage of below variable when file sending to mulitple devices or
+ //when files from different applications are sent simultaneously
TBool iServiceStarted;
TMsvId iMessageServerIndex;
@@ -456,6 +459,8 @@
CActiveSchedulerWait* iWaiter;
TBool iAllSend;
TInt iBytesSendWithBIP;
+ //todo verify the usage of below variable as this part of legacy code
+ //and false condition will never be hit.
TBool iProgressDialogActive;
TBool iUserCancel;
CBTEngSettings* iBTEngSettings;
@@ -468,6 +473,8 @@
TBool iFeatureManagerInitialized;
TBool iTriedBIP;
TBool iTriedOPP;
+ CBTServiceDelayedDestroyer* iDelayedDestroyer;
+ TBool iLocalisationInit;
};
#endif // BT_SERVICE_CONTROLLER_H
--- a/btobexprofiles/obexsendservices/obexservicesendutils/src/BTSProgresstimer.cpp Wed Jun 23 18:23:52 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +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:
-*
-*/
-
-
-// INCLUDE FILES
-#include "BTSProgresstimer.h"
-#include "BTServiceStarter.h"
-#include "BTSUDebug.h"
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CBTSProgressTimer::CBTSProgressTimer( MBTServiceObserver* aProgressObserverPtr)
- : CTimer( EPriorityLow ),
- iProgressObserverPtr( aProgressObserverPtr )
- {
- CActiveScheduler::Add( this );
- }
-
-// -----------------------------------------------------------------------------
-// CObexUtilsDialogTimer::ConstructL
-// Symbian OS default constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CBTSProgressTimer::ConstructL()
- {
- FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::ConstructL()"));
-
- CTimer::ConstructL();
-
- FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::ConstructL() completed"));
- }
-
-// -----------------------------------------------------------------------------
-// CObexUtilsDialogTimer::NewL
-// -----------------------------------------------------------------------------
- CBTSProgressTimer* CBTSProgressTimer::NewL( MBTServiceObserver* aProgressObserverPtr)
- {
- CBTSProgressTimer* self =
- new( ELeave ) CBTSProgressTimer( aProgressObserverPtr );
-
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CBTSProgressTimer::~CBTSProgressTimer()
- {
- Cancel();
- }
-
-// -----------------------------------------------------------------------------
-// CObexUtilsDialogTimer::Tickle
-// -----------------------------------------------------------------------------
-//
- void CBTSProgressTimer::Tickle()
- {
- FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::Tickle()"));
-
- Cancel();
- After( iTimeout );
-
- FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::Tickle() completed"));
- }
-
-// -----------------------------------------------------------------------------
-// CObexUtilsDialogTimer::RunL
-// -----------------------------------------------------------------------------
-//
-void CBTSProgressTimer::RunL()
- {
- FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::RunL()"));
- if (iProgressObserverPtr)
- {
- // iProgressObserverPtr->UpdateProgressInfoL();
- }
-
- FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::RunL() completed"));
- }
-
-TInt CBTSProgressTimer::RunError( TInt aError )
- {
- FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::RunError()"));
- (void) aError;
- FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::RunError() - completed"));
- return KErrNone;
- }
-
-// -----------------------------------------------------------------------------
-// CObexUtilsDialogTimer::SetTimeout
-// -----------------------------------------------------------------------------
-//
- void CBTSProgressTimer::SetTimeout( TTimeIntervalMicroSeconds32 aTimeout )
- {
- iTimeout = aTimeout;
- }
-
-// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btobexprofiles/obexsendservices/obexservicesendutils/src/BTServiceDelayedDestroyer.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: The base active class definition
+*
+*/
+
+
+#include "BTServiceDelayedDestroyer.h"
+#include "BTSUDebug.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// -----------------------------------------------------------------------------
+// CBTServiceDelayedDestroyer::NewL()
+// -----------------------------------------------------------------------------
+//
+CBTServiceDelayedDestroyer* CBTServiceDelayedDestroyer::NewL(CActive::TPriority aPriority)
+ {
+ CBTServiceDelayedDestroyer* self = CBTServiceDelayedDestroyer::NewLC(aPriority);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CBTServiceDelayedDestroyer::NewLC()
+// -----------------------------------------------------------------------------
+//
+CBTServiceDelayedDestroyer* CBTServiceDelayedDestroyer::NewLC(CActive::TPriority aPriority)
+ {
+ CBTServiceDelayedDestroyer* self = new (ELeave) CBTServiceDelayedDestroyer(aPriority);
+ CleanupStack::PushL(self);
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+// CBTServiceDelayedDestroyer::CBTServiceDelayedDestroyer()
+// -----------------------------------------------------------------------------
+//
+CBTServiceDelayedDestroyer::CBTServiceDelayedDestroyer(CActive::TPriority aPriority)
+ : CActive(aPriority), iPtr(NULL)
+ {
+ FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::CBTServiceDelayedDestroyer()"));
+ CActiveScheduler::Add(this);
+ }
+
+// -----------------------------------------------------------------------------
+// CBTServiceDelayedDestroyer::~CBTServiceDelayedDestroyer()
+// -----------------------------------------------------------------------------
+//
+CBTServiceDelayedDestroyer::~CBTServiceDelayedDestroyer()
+ {
+ FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::Destructor()"));
+ if( iPtr )
+ {
+ delete iPtr;
+ iPtr = NULL;
+ }
+ Cancel();
+ }
+
+// -----------------------------------------------------------------------------
+// CBTServiceDelayedDestroyer::GoActive()
+// -----------------------------------------------------------------------------
+//
+void CBTServiceDelayedDestroyer::GoActive()
+ {
+ FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::GoActive()"));
+ if( !IsActive() )
+ {
+ TRequestStatus* status = &iStatus;
+ iStatus = KRequestPending;
+ User::RequestComplete(status, KErrNone);
+ SetActive();
+ }
+ else
+ {
+ FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::GoActive(), Already active"));
+ }
+ }
+
+// -----------------------------------------------------------------------------
+// CBTServiceDelayedDestroyer::SetDestructPointer()
+// Must be called with GoActive, they are pairs, first call SetDestructPointer
+// and then GoActive.
+// -----------------------------------------------------------------------------
+//
+void CBTServiceDelayedDestroyer::SetDestructPointer(CBTEngDiscovery* aPtr)
+ {
+ FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::SetDestructPointer()"));
+ if( iPtr )
+ {
+ // If previous is not deleted yet, meaning, RunL is not called yet,
+ // we can safely delete previous here.
+ delete iPtr;
+ }
+ iPtr = aPtr;
+ }
+
+// -----------------------------------------------------------------------------
+// CBTServiceDelayedDestroyer::DoCancel()
+// -----------------------------------------------------------------------------
+//
+void CBTServiceDelayedDestroyer::DoCancel()
+ {
+ FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::DoCancel()"));
+ }
+
+// -----------------------------------------------------------------------------
+// CBTServiceDelayedDestroyer::RunL()
+// -----------------------------------------------------------------------------
+//
+void CBTServiceDelayedDestroyer::RunL()
+ {
+ FLOG(_L("[BTSU]\t CBTServiceDelayedDestroyer::RunL()"));
+ delete iPtr;
+ iPtr = NULL;
+ }
+
+// -----------------------------------------------------------------------------
+// CBTServiceDelayedDestroyer::RunError()
+// -----------------------------------------------------------------------------
+//
+TInt CBTServiceDelayedDestroyer::RunError(TInt aError)
+ {
+ FTRACE(FPrint(_L("[BTSU]\t CBTServiceStarter::RunError() aError = %d"), aError) );
+ (void) aError;
+ return KErrNone;
+ }
--- a/btobexprofiles/obexsendservices/obexservicesendutils/src/BTServiceStarter.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/btobexprofiles/obexsendservices/obexservicesendutils/src/BTServiceStarter.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -88,14 +88,10 @@
FLOG(_L("[BTSU]\t CBTServiceStarter::ConstructL()"));
iDevice = CBTDevice::NewL();
iDialog = CObexUtilsDialog::NewL( this );
-
+ iDelayedDestroyer = CBTServiceDelayedDestroyer::NewL(CActive::EPriorityStandard);
FeatureManager::InitializeLibL();
iFeatureManagerInitialized = ETrue;
- TBool ok = HbTextResolverSymbian::Init(KLocFileName, KPath);
- if (!ok)
- {
- User::Leave( KErrNotFound );
- }
+ iLocalisationInit = HbTextResolverSymbian::Init(KLocFileName, KPath);
FLOG(_L("[BTSU]\t CBTServiceStarter::ConstructL() completed"));
}
@@ -130,7 +126,8 @@
delete iController;
delete iBTEngDiscovery;
delete iDialog;
-
+ delete iDelayedDestroyer;
+
if(iWaiter && iWaiter->IsStarted() )
{
iWaiter->AsyncStop();
@@ -518,11 +515,16 @@
FLOG(_L("[BTSU]\t CBTServiceStarter::LaunchProgressNoteL() completed"));
}
+// -----------------------------------------------------------------------------
+// CBTServiceStarter::UpdateProgressNoteL
+// -----------------------------------------------------------------------------
+//
void CBTServiceStarter::UpdateProgressNoteL(TInt aFileSize,TInt aFileIndex, const TDesC& aFileName )
{
iDialog->UpdateProgressNoteL(aFileSize,aFileIndex,aFileName);
}
+
// -----------------------------------------------------------------------------
// CBTServiceStarter::CancelProgressNote
// -----------------------------------------------------------------------------
@@ -573,12 +575,12 @@
}
// -----------------------------------------------------------------------------
-// CBTServiceStarter::ShowNote
+// CBTServiceStarter::ShowErrorNote
// -----------------------------------------------------------------------------
//
-void CBTServiceStarter::ShowNote( TInt aReason ) const
+void CBTServiceStarter::ShowErrorNote( TInt aReason ) const
{
- FLOG(_L("[BTSU]\t CBTServiceStarter::ShowNote()"));
+ FLOG(_L("[BTSU]\t CBTServiceStarter::ShowErrorNote()"));
TBuf<KMaxDesCLength> buf;
TPtrC sendTextMapId;
@@ -604,6 +606,8 @@
case EBTSGettingFailed:
case EBTSPuttingFailed:
case EBTSNoSuitableProfiles:
+ //todo below three enums are not valid and it is not being used at anywhere do we need to have it
+
// case EBTSBIPSomeSend:
// case EBTSBIPOneNotSend:
// case EBTSBIPNoneSend:
@@ -612,19 +616,24 @@
sendTextMapId.Set(KSendingFailedText());
break;
}
- //todo below three enums are not valid and it is not being used at anywhere do we need to have it
-
}
- TRAP_IGNORE(
- HBufC* sendText = HbTextResolverSymbian::LoadLC(sendTextMapId);
- HBufC* deviceName = HbTextResolverSymbian::LoadLC(KDeviceText,buf);
- CHbDeviceNotificationDialogSymbian::NotificationL(KNullDesC, deviceName->Des(), sendText->Des());
- CleanupStack::PopAndDestroy( deviceName );
- CleanupStack::PopAndDestroy( sendText );
- );
-
- FLOG(_L("[BTSU]\t CBTServiceStarter::ShowNote() completed"));
+
+ if(iLocalisationInit)
+ {
+ TRAP_IGNORE(
+ HBufC* sendText = HbTextResolverSymbian::LoadLC(sendTextMapId);
+ HBufC* deviceName = HbTextResolverSymbian::LoadLC(KDeviceText,buf);
+ CHbDeviceNotificationDialogSymbian::NotificationL(KNullDesC, deviceName->Des(), sendText->Des());
+ CleanupStack::PopAndDestroy( deviceName );
+ CleanupStack::PopAndDestroy( sendText );
+ );
+ }
+ else
+ {
+ TRAP_IGNORE(CHbDeviceNotificationDialogSymbian::NotificationL(KNullDesC, KDeviceText(), sendTextMapId));
+ }
+ FLOG(_L("[BTSU]\t CBTServiceStarter::ShowErrorNote() completed"));
}
@@ -654,7 +663,7 @@
if ( aError != KErrCancel )
{
- ShowNote( aError );
+ ShowErrorNote( aError );
}
}
if ( iMessageServerIndex != 0 )
@@ -805,7 +814,12 @@
}
else
{
- delete iBTEngDiscovery;
+ // Set destroyer AO active (destroys CBTEngDiscovery/CBTEngSdpQuery classes). This is done
+ // to ensure that CBTEngDiscovery/CBTEngSdpQuery classes have finished all their activities,
+ // callbacks etc.. Destructing it self is handled in CBTServiceDelayedDestroyer's RunL.
+ iDelayedDestroyer->SetDestructPointer(iBTEngDiscovery);
+ iDelayedDestroyer->GoActive();
+ // Set iBTEngDiscovery pointer to zero. Pointer doesn't exist CBTServiceStarter point of view anymore.
iBTEngDiscovery = NULL;
StopTransfer(EBTSConnectingFailed);
}
--- a/btobexprofiles/obexserviceman/obexservicemanserver/src/obexsmmain.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/btobexprofiles/obexserviceman/obexservicemanserver/src/obexsmmain.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -99,7 +99,8 @@
TInt E32Main() //used in all case( WINS and TARGET)
{
- __UHEAP_MARK;
+ //TODO uncomment UHEAP macros after orbit memory leaks are resolved till then it should be commented.
+// __UHEAP_MARK;
CTrapCleanup* cleanup=CTrapCleanup::New();
TInt retVal = KErrNoMemory;
@@ -109,7 +110,7 @@
delete cleanup;
}
- __UHEAP_MARKEND;
+ // __UHEAP_MARKEND;
return retVal;
}
--- a/btobexprofiles/obexserviceman/utils/src/obexutilsdialog.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/btobexprofiles/obexserviceman/utils/src/obexutilsdialog.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -116,7 +116,8 @@
const TDesC& aDeviceName, TInt aTimeoutValue )
{
FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::LaunchProgressDialogL()"));
-
+
+ TBuf<KMinStringSize> key;
if ( aObserverPtr )
{
// The observerPtr was given, so store it and start a timer
@@ -138,11 +139,10 @@
CHbSymbianVariantMap* map = CHbSymbianVariantMap::NewL();
CleanupStack::PushL(map);
- TBuf<KMinStringSize> key;
TInt data = TBluetoothDialogParams::ESend;
key.Num(TBluetoothDialogParams::EDialogType);
AddDataL( map, key, &data, CHbSymbianVariant::EInt );
- iProgressDialog->Show(KSendingDialog(),*map,this);
+ User::LeaveIfError(iProgressDialog->Show(KSendingDialog(),*map,this));
CleanupStack::PopAndDestroy(map);
if ( iProgressObserverPtr )
@@ -420,20 +420,23 @@
delete iProgressDialog;
iProgressDialog = NULL;
- TRAP_IGNORE(
- TBool ok = HbTextResolverSymbian::Init(KLocFileName, KPath);
- if (!ok)
- {
- User::Leave( KErrNotFound );
- }
- HBufC* deviceName = HbTextResolverSymbian::LoadLC(KDeviceText,iDeviceName);
- HBufC* sendText = HbTextResolverSymbian::LoadLC(KSendingCancelledText);
- CHbDeviceNotificationDialogSymbian::NotificationL(
- KNullDesC, deviceName->Des(), sendText->Des());
- CleanupStack::PopAndDestroy( sendText );
- CleanupStack::PopAndDestroy( deviceName );
- );
-
+ TBool ok = HbTextResolverSymbian::Init(KLocFileName, KPath);
+ if(ok)
+ {
+ TRAP_IGNORE(
+ HBufC* deviceName = HbTextResolverSymbian::LoadLC(KDeviceText,iDeviceName);
+ HBufC* sendText = HbTextResolverSymbian::LoadLC(KSendingCancelledText);
+ CHbDeviceNotificationDialogSymbian::NotificationL(
+ KNullDesC, deviceName->Des(), sendText->Des());
+ CleanupStack::PopAndDestroy( sendText );
+ CleanupStack::PopAndDestroy( deviceName );
+ );
+ }
+ else
+ {
+ CHbDeviceNotificationDialogSymbian::NotificationL(
+ KNullDesC, KDeviceText(), KSendingCancelledText());
+ }
if ( iDialogObserverPtr )
{
iDialogObserverPtr->DialogDismissed(ECancelButton);
--- a/btobexprofiles/obexserviceman/utils/src/obexutilsmessagehandler.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/btobexprofiles/obexserviceman/utils/src/obexutilsmessagehandler.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -1005,7 +1005,7 @@
FLOG(_L("[OBEXUTILS]\t TObexUtilsMessageHandler::AddEntryToInboxL() BIO"));
RFile file;
- User::LeaveIfError(file.Open(fsSess,aFullName,EFileRead));
+ User::LeaveIfError(file.Open(fsSess,aFullName,EFileShareReadersOnly));
TReceivedData receivedData;
receivedData.bytesReceived = fileEntry.iSize;
receivedData.recTime = fileEntry.iModified;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btservices.pro Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,29 @@
+#
+# 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
+
+# Directories
+SUBDIRS += btservices_plat \
+ bluetoothengine/btui \
+ bluetoothengine/btnotif/btdevicedialogplugin \
+ bluetoothengine/btindicator \
+ btobexprofiles/obexsendservices/obexhighway \
+ btobexprofiles/obexreceiveservices/btmsgviewer \
+
+CONFIG += ordered
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btservices_plat/bt_remote_device_setting_api/bt_remote_device_setting_api.metaxml Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="a0cc3394936d8941cbfd0036b3d3b851" dataversion="2.0">
+ <name>bt_remote_device_setting_api</name>
+ <description>The framework API for implementing the settings UI for remote Bluetooth devices.</description>
+ <type>c++</type>
+ <collection>bluetoothengine</collection>
+ <libs/>
+ <release category="platform" sinceversion="5.2"/>
+ <attributes>
+ <htmldocprovided>no</htmldocprovided>
+ <adaptation>no</adaptation>
+ </attributes>
+</api>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btservices_plat/bt_remote_device_setting_api/bt_remote_device_setting_api.pri Tue Jul 06 14:27:09 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:
+#
+#
+
+symbian*: {
+ # Build.inf rules
+ BLD_INF_RULES.prj_exports += \
+ "$${LITERAL_HASH}include<platform_paths.hrh>" \
+ "bt_remote_device_setting_api/inc/btdevsettingglobal.h MW_LAYER_PLATFORM_EXPORT_PATH(btdevsettingglobal.h)" \
+ "bt_remote_device_setting_api/inc/btdevsettinginterface.h MW_LAYER_PLATFORM_EXPORT_PATH(btdevsettinginterface.h)" \
+ "bt_remote_device_setting_api/inc/btabstractdevsetting.h MW_LAYER_PLATFORM_EXPORT_PATH(btabstractdevsetting.h)" \
+ "bt_remote_device_setting_api/inc/btdevsettingpluginloader.h MW_LAYER_PLATFORM_EXPORT_PATH(btdevsettingpluginloader.h)"
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btservices_plat/bt_remote_device_setting_api/inc/btabstractdevsetting.h Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,138 @@
+/*
+* 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: The plugin interface of Bluetooth device setting ui
+*
+*/
+
+#ifndef BTABSTRACTDEVSETTING_H
+#define BTABSTRACTDEVSETTING_H
+
+#include <HbDataForm>
+#include <btdevsettingglobal.h>
+
+/*!
+ \class BtAbstractDevSetting
+ \brief The class BtAbstractDevSetting is the base class
+ for offering a UI to manage certain settings of
+ a remote Bluetooth device, e.g., accessory and keyboard settings.
+ */
+class BTDEVSETTINGINTERFACE_EXPORT BtAbstractDevSetting : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ /*!
+ Constructs a device setting plugin entry.
+
+ \param address the BD_ADDR of the remote device which this setting
+ plugin is provided for. Its format is XXXXXXXXXXXX, where X is a
+ hexadecimal digit. Case is insensitive.
+ \parent the parent of this object.
+ */
+ explicit BtAbstractDevSetting(const QString &address, QObject *parent = 0 );
+
+ /*!
+ Destructor of BtAbstractDeviceSetting.
+ */
+ virtual ~BtAbstractDevSetting();
+
+ /*!
+ Gets the BD_ADDR of the remote device which this setting
+ plugin is provided for.
+
+ \return the device address of the remote device in hex string
+ */
+ const QString &getRemote() const;
+
+ /*!
+ Tells if this setting plugin can provide a setting UI
+ for the target device. If the answer is true, this plugin may be
+ requested to create a setting widget by function
+ \code createSettingWidget() \endcode.
+
+ \return true if a setting is currently available. false, otherwise.
+
+ The default implementation returns false.
+ */
+ virtual bool isSettingAvailable();
+
+ /*!
+ Gets a \code HbDataForm \endcode instance which consists of the
+ setting UI from this specific plugin. The loader of this plugin will
+ add this dataform into its setting view if its setting is available at
+ the time.
+
+ The ownership of this widget is transferred to the plugin loader.
+
+ The default implementation returns 0.
+
+ \return an \code HbDataForm \endcode instance.
+ */
+ virtual HbDataForm *getSettingWidget();
+
+ /*!
+ Informs that device setting is going to foreground. This
+ implies that the \code HbWidget \endcode from function
+ \code createSettingWidget \endcode will be shown if the setting
+ from this plugin is available.
+
+ The default implementation does nothing.
+ */
+ virtual void aboutToForeground();
+
+ /*!
+ Informs that device setting is going to background.
+
+ The default implementation does nothing.
+ */
+ virtual void aboutToBackground();
+
+ /*!
+ Informs that device setting is going to close.
+
+ The default implementation does nothing.
+ */
+ virtual void aboutToClose();
+
+signals:
+
+ /*!
+ The signal the plugin should emit for informing that the
+ availability of this setting is changed.
+
+ If the setting becomes available, the owner of this plugin may
+ request the plugin to create a setting widget.
+
+ If the setting becomes unavailable, the owner of this plugin may close and
+ destroy the setting widget.
+
+ \param setting the pointer of the setting whose status has changed.
+
+ \param available true if the setting is available; false otherwise.
+
+ \sa isSettingAvailable().
+ */
+ void settingAvailabilityChanged(BtAbstractDevSetting *setting, bool available);
+
+private:
+
+ /*!
+ The remote device address in format XXXXXXXXXXXX where X is a
+ hexadecimal digit.
+ */
+ QString mRemote;
+};
+
+#endif /* BTABSTRACTDEVSETTING_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btservices_plat/bt_remote_device_setting_api/inc/btdevsettingglobal.h Tue Jul 06 14:27:09 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 BTDEVSETTINGGLOBAL_H
+#define BTDEVSETTINGGLOBAL_H
+
+#include <QtGlobal>
+
+#ifdef BUILD_BTDEVSETTINGFRAMEWORK
+#define BTDEVSETTINGINTERFACE_EXPORT Q_DECL_EXPORT
+#else
+#define BTDEVSETTINGINTERFACE_EXPORT Q_DECL_IMPORT
+#endif
+
+#define BTDEVSETTING_PLUGIN_PATH QLatin1String("/resource/qt/plugins/btdevsetting")
+
+#endif /* BTDEVSETTINGGLOBAL_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btservices_plat/bt_remote_device_setting_api/inc/btdevsettinginterface.h Tue Jul 06 14:27:09 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: The plugin interface of Bluetooth device setting ui
+*
+*/
+
+#ifndef BTDEVSETTINGINTERFACE_H
+#define BTDEVSETTINGINTERFACE_H
+
+#include <QtPlugin>
+#include <btdevsettingglobal.h>
+#include <btabstractdevsetting.h>
+
+/*!
+ \class BtDeviceSettingInterface
+ \brief The class BtDeviceSettingInterface is an interface
+ for creating a BT device setting plugin instance.
+ */
+class BTDEVSETTINGINTERFACE_EXPORT BtDevSettingInterface
+{
+public:
+
+ /*!
+ Destructor of BtDeviceSettingPlugin.
+ */
+ virtual ~BtDevSettingInterface() {}
+
+ /*!
+ Creates a \code BtDeviceSettingPlugin \endcode instance from a
+ specific plugin.
+
+ \param address the BD_ADDR of the remote device which this setting
+ plugin is provided for. Its format is XXXXXXXXXXXX, where X is a
+ hexadecimal digit. Case is insensitive.
+
+ \parent the parent of this object.
+
+ \return an \code BtDeviceSettingPlugin \endcode instance the ownership of which is
+ transferred to the plugin loader.
+ */
+ virtual BtAbstractDevSetting *createDevSetting(
+ const QString &address, QObject *parent = 0) = 0;
+};
+
+Q_DECLARE_INTERFACE(BtDevSettingInterface, "com.nokia.bt.devsettinginterface/1.0");
+
+#endif /* BTDEVSETTINGINTERFACE_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btservices_plat/bt_remote_device_setting_api/inc/btdevsettingpluginloader.h Tue Jul 06 14:27:09 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:
+*
+*/
+
+#ifndef BTDEVSETTINGPLUGINLOADER_H
+#define BTDEVSETTINGPLUGINLOADER_H
+
+#include <QtGlobal>
+#include <btdevsettingglobal.h>
+#include <QList>
+
+class QString;
+class QStringList;
+class BtDevSettingInterface;
+
+class BTDEVSETTINGINTERFACE_EXPORT BtDevSettingPluginLoader
+{
+public:
+
+ /*!
+ Load all setting interfaces.
+
+ \return the list of plugin interface.
+ */
+ static QList<BtDevSettingInterface*> loadDevSettingInterfaces();
+
+};
+
+#endif /* BTDEVSETTINGPLUGINLOADER_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/btservices_plat/btservices_plat.pro Tue Jul 06 14:27:09 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:
+#
+#
+
+TEMPLATE = subdirs
+
+symbian*: {
+ include(bt_remote_device_setting_api/bt_remote_device_setting_api.pri)
+}
--- a/cbsatplugin/atmisccmdplugin/src/cfuncommandhandler.cpp Wed Jun 23 18:23:52 2010 +0300
+++ b/cbsatplugin/atmisccmdplugin/src/cfuncommandhandler.cpp Tue Jul 06 14:27:09 2010 +0300
@@ -154,7 +154,7 @@
TInt systemState;
TInt ret = iProperty.Get(systemState);
- if (ret != KErrNone)
+ if (ret == KErrNone)
{
if (systemState != iExpectedState)
{
@@ -166,6 +166,7 @@
ret = RestartDevice();
}
}
+
if (!IsActive())
{
if (ret != KErrNone)
@@ -206,7 +207,7 @@
TRACE_FUNC_EXIT
return err;
}
-
+
switch (aFunc)
{
case (0):
@@ -216,15 +217,17 @@
// issue the profile change request and start monitoring the property
if (systemState != ESwStateNormalRfOff)
{
- err = SetActiveProfile(KOfflineProfileId);
-
-
+ err = SetActiveProfile(KOfflineProfileId);
if (err == KErrNone)
{
iExpectedState = ESwStateNormalRfOff;
iProperty.Subscribe(iStatus);
SetActive();
- }
+ }
+ }
+ else if (iReset)
+ {
+ err = RestartDevice();
}
break;
}
@@ -243,6 +246,10 @@
SetActive();
}
}
+ else if (iReset)
+ {
+ err = RestartDevice();
+ }
break;
}
default:
--- a/layers.sysdef.xml Wed Jun 23 18:23:52 2010 +0300
+++ b/layers.sysdef.xml Tue Jul 06 14:27:09 2010 +0300
@@ -9,14 +9,8 @@
<module name="btservices">
<unit unitID="lcdo.btservices" mrp="" bldFile="&layer_real_source_path;/group" name="btservices" />
</module>
- <module name="btcpplugin">
- <unit unitID="lcdo.btservices.btcpplugin" mrp="" bldFile="&layer_real_source_path;/bluetoothengine/btui" name="bluetooth_setting_plugin" proFile="btui.pro" qmakeArgs="" />
- </module>
- <module name="btdialog">
- <unit unitID="lcdo.btservices.btdialog" mrp="" bldFile="&layer_real_source_path;/bluetoothengine/btnotif/btdevicedialogplugin" name="bluetooth_dialogs" proFile="btdevicedialogplugin.pro" qmakeArgs="" />
- </module>
- <module name="obexhighway">
- <unit unitID="lcdo.btservices.obexhighway" mrp="" bldFile="&layer_real_source_path;/btobexprofiles/obexsendservices/obexhighway" name="localconn_obexhighway" proFile="obexhighway.pro" qmakeArgs="" />
+ <module name="btservices_qt">
+ <unit unitID="lcdo.btservices.qt" mrp="" bldFile="&layer_real_source_path;" name="btservices_qt" proFile="btservices.pro" qmakeArgs="" />
</module>
</layer>
<layer name="api_test_layer">