From 87c135ace11236fb33ebb0112f219b81425ed6f8 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Wed, 28 Jul 2010 14:21:35 +1000 Subject: Update Symbian emulator QtOpenVGu.def, QtNetworku.def, QtCoreu.def files for Qt 4.7 to be in sync between respective def files in Qt 4.6.3 Task-number: QTBUG-12468 Reviewed-by: Jason Barron --- src/s60installs/bwins/QtCoreu.def | 132 +++++++------ src/s60installs/bwins/QtNetworku.def | 364 +++++++++++++++++------------------ src/s60installs/bwins/QtOpenVGu.def | 15 +- 3 files changed, 252 insertions(+), 259 deletions(-) diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def index 94be1bb..1a79f63 100644 --- a/src/s60installs/bwins/QtCoreu.def +++ b/src/s60installs/bwins/QtCoreu.def @@ -3122,7 +3122,7 @@ EXPORTS ?reset@QIODevice@@UAE_NXZ @ 3121 NONAME ; bool QIODevice::reset(void) ?reset@QMetaProperty@@QBE_NPAVQObject@@@Z @ 3122 NONAME ; bool QMetaProperty::reset(class QObject *) const ?reset@QTextStream@@QAEXXZ @ 3123 NONAME ; void QTextStream::reset(void) - ?resetCurrentSender@QObjectPrivate@@SAXPAVQObject@@PAUSender@1@1@Z @ 3124 NONAME ABSENT ; void QObjectPrivate::resetCurrentSender(class QObject *, struct QObjectPrivate::Sender *, struct QObjectPrivate::Sender *) + ?resetCurrentSender@QObjectPrivate@@SAXPAVQObject@@PAUSender@1@1@Z @ 3124 NONAME ; void QObjectPrivate::resetCurrentSender(class QObject *, struct QObjectPrivate::Sender *, struct QObjectPrivate::Sender *) ?resetDeleteWatch@QObjectPrivate@@SAXPAV1@PAHH@Z @ 3125 NONAME ; void QObjectPrivate::resetDeleteWatch(class QObjectPrivate *, int *, int) ?resetStatus@QDataStream@@QAEXXZ @ 3126 NONAME ; void QDataStream::resetStatus(void) ?resetStatus@QTextStream@@QAEXXZ @ 3127 NONAME ; void QTextStream::resetStatus(void) @@ -3281,7 +3281,7 @@ EXPORTS ?setCoords@QRectF@@QAEXMMMM@Z @ 3280 NONAME ; void QRectF::setCoords(float, float, float, float) ?setCurrent@QDir@@SA_NABVQString@@@Z @ 3281 NONAME ; bool QDir::setCurrent(class QString const &) ?setCurrentPath@QFSFileEngine@@SA_NABVQString@@@Z @ 3282 NONAME ; bool QFSFileEngine::setCurrentPath(class QString const &) - ?setCurrentSender@QObjectPrivate@@SAPAUSender@1@PAVQObject@@PAU21@@Z @ 3283 NONAME ABSENT ; struct QObjectPrivate::Sender * QObjectPrivate::setCurrentSender(class QObject *, struct QObjectPrivate::Sender *) + ?setCurrentSender@QObjectPrivate@@SAPAUSender@1@PAVQObject@@PAU21@@Z @ 3283 NONAME ; struct QObjectPrivate::Sender * QObjectPrivate::setCurrentSender(class QObject *, struct QObjectPrivate::Sender *) ?setCurrentTime@QAbstractAnimation@@QAEXH@Z @ 3284 NONAME ; void QAbstractAnimation::setCurrentTime(int) ?setCurrentTime@QTimeLine@@QAEXH@Z @ 3285 NONAME ; void QTimeLine::setCurrentTime(int) ?setCurveShape@QTimeLine@@QAEXW4CurveShape@1@@Z @ 3286 NONAME ; void QTimeLine::setCurveShape(enum QTimeLine::CurveShape) @@ -4417,71 +4417,69 @@ EXPORTS ?QBasicAtomicInt_testAndSetRelease@@YA_NPCHHH@Z @ 4416 NONAME ; bool QBasicAtomicInt_testAndSetRelease(int volatile *, int, int) ?QBasicAtomicInt_fetchAndStoreAcquire@@YAHPCHH@Z @ 4417 NONAME ; int QBasicAtomicInt_fetchAndStoreAcquire(int volatile *, int) ?QBasicAtomicInt_fetchAndAddAcquire@@YAHPCHH@Z @ 4418 NONAME ; int QBasicAtomicInt_fetchAndAddAcquire(int volatile *, int) - ??0QString@@QAE@PBVQChar@@@Z @ 4419 NONAME ; QString::QString(class QChar const *) - ??0QTextDecoder@@QAE@PBVQTextCodec@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4420 NONAME ; QTextDecoder::QTextDecoder(class QTextCodec const *, class QFlags) - ??0QTextEncoder@@QAE@PBVQTextCodec@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4421 NONAME ; QTextEncoder::QTextEncoder(class QTextCodec const *, class QFlags) - ??0QVariant@@QAE@ABVQEasingCurve@@@Z @ 4422 NONAME ; QVariant::QVariant(class QEasingCurve const &) - ??5@YAAAVQDataStream@@AAV0@AAVQEasingCurve@@@Z @ 4423 NONAME ; class QDataStream & operator>>(class QDataStream &, class QEasingCurve &) - ??6@YAAAVQDataStream@@AAV0@ABVQEasingCurve@@@Z @ 4424 NONAME ; class QDataStream & operator<<(class QDataStream &, class QEasingCurve const &) - ??8QElapsedTimer@@QBE_NABV0@@Z @ 4425 NONAME ; bool QElapsedTimer::operator==(class QElapsedTimer const &) const - ??9QElapsedTimer@@QBE_NABV0@@Z @ 4426 NONAME ; bool QElapsedTimer::operator!=(class QElapsedTimer const &) const - ??M@YA_NABVQElapsedTimer@@0@Z @ 4427 NONAME ; bool operator<(class QElapsedTimer const &, class QElapsedTimer const &) - ?append@QListData@@QAEPAPAXH@Z @ 4428 NONAME ; void * * QListData::append(int) - ?clearHistory@QStateMachinePrivate@@QAEXXZ @ 4429 NONAME ; void QStateMachinePrivate::clearHistory(void) - ?clockType@QElapsedTimer@@SA?AW4ClockType@1@XZ @ 4430 NONAME ; enum QElapsedTimer::ClockType QElapsedTimer::clockType(void) - ?currentDateTimeUtc@QDateTime@@SA?AV1@XZ @ 4431 NONAME ; class QDateTime QDateTime::currentDateTimeUtc(void) - ?currentMSecsSinceEpoch@QDateTime@@SA_JXZ @ 4432 NONAME ; long long QDateTime::currentMSecsSinceEpoch(void) - ?detach@QListData@@QAEPAUData@1@H@Z @ 4433 NONAME ; struct QListData::Data * QListData::detach(int) - ?detach_grow@QListData@@QAEPAUData@1@PAHH@Z @ 4434 NONAME ; struct QListData::Data * QListData::detach_grow(int *, int) - ?elapsed@QElapsedTimer@@QBE_JXZ @ 4435 NONAME ; long long QElapsedTimer::elapsed(void) const - ?fromMSecsSinceEpoch@QDateTime@@SA?AV1@_J@Z @ 4436 NONAME ; class QDateTime QDateTime::fromMSecsSinceEpoch(long long) - ?hasExpired@QElapsedTimer@@QBE_N_J@Z @ 4437 NONAME ; bool QElapsedTimer::hasExpired(long long) const - ?invalidate@QElapsedTimer@@QAEXXZ @ 4438 NONAME ; void QElapsedTimer::invalidate(void) - ?isMonotonic@QElapsedTimer@@SA_NXZ @ 4439 NONAME ; bool QElapsedTimer::isMonotonic(void) - ?isSharedWith@QByteArray@@QBE_NABV1@@Z @ 4440 NONAME ; bool QByteArray::isSharedWith(class QByteArray const &) const - ?isSharedWith@QString@@QBE_NABV1@@Z @ 4441 NONAME ; bool QString::isSharedWith(class QString const &) const - ?isValid@QElapsedTimer@@QBE_NXZ @ 4442 NONAME ; bool QElapsedTimer::isValid(void) const - ?makeDecoder@QTextCodec@@QBEPAVQTextDecoder@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4443 NONAME ; class QTextDecoder * QTextCodec::makeDecoder(class QFlags) const - ?makeEncoder@QTextCodec@@QBEPAVQTextEncoder@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4444 NONAME ; class QTextEncoder * QTextCodec::makeEncoder(class QFlags) const - ?msecsSinceReference@QElapsedTimer@@QBE_JXZ @ 4445 NONAME ; long long QElapsedTimer::msecsSinceReference(void) const - ?msecsTo@QElapsedTimer@@QBE_JABV1@@Z @ 4446 NONAME ; long long QElapsedTimer::msecsTo(class QElapsedTimer const &) const - ?qDecodeDataUrl@@YA?AU?$QPair@VQString@@VQByteArray@@@@ABVQUrl@@@Z @ 4447 NONAME ; struct QPair qDecodeDataUrl(class QUrl const &) - ?qDetectCPUFeatures@@YAIXZ @ 4448 NONAME ; unsigned int qDetectCPUFeatures(void) + ?validCodecs@QTextCodec@@CA_NXZ @ 4419 NONAME ; bool QTextCodec::validCodecs(void) + ?clearHistory@QStateMachinePrivate@@QAEXXZ @ 4420 NONAME ; void QStateMachinePrivate::clearHistory(void) + ?nativeArguments@QProcess@@QBE?AVQString@@XZ @ 4421 NONAME ; class QString QProcess::nativeArguments(void) const + ?detach@QListData@@QAEPAUData@1@H@Z @ 4422 NONAME ; struct QListData::Data * QListData::detach(int) + ?trUtf8@QEventDispatcherSymbian@@SA?AVQString@@PBD0H@Z @ 4423 NONAME ; class QString QEventDispatcherSymbian::trUtf8(char const *, char const *, int) + ?destroyed@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@@ZA @ 4424 NONAME ; void (*QAbstractDeclarativeData::destroyed)(class QAbstractDeclarativeData *, class QObject *) + ??M@YA_NABVQElapsedTimer@@0@Z @ 4425 NONAME ; bool operator<(class QElapsedTimer const &, class QElapsedTimer const &) + ?clockType@QElapsedTimer@@SA?AW4ClockType@1@XZ @ 4426 NONAME ; enum QElapsedTimer::ClockType QElapsedTimer::clockType(void) + ?isHighSurrogate@QChar@@SA_NI@Z @ 4427 NONAME ; bool QChar::isHighSurrogate(unsigned int) + ?start@QElapsedTimer@@QAEXXZ @ 4428 NONAME ; void QElapsedTimer::start(void) + ??0QVariant@@QAE@ABVQEasingCurve@@@Z @ 4429 NONAME ; QVariant::QVariant(class QEasingCurve const &) + ?isValid@QElapsedTimer@@QBE_NXZ @ 4430 NONAME ; bool QElapsedTimer::isValid(void) const + ?qt_metacast@QEventDispatcherSymbian@@UAEPAXPBD@Z @ 4431 NONAME ; void * QEventDispatcherSymbian::qt_metacast(char const *) + ?toMSecsSinceEpoch@QDateTime@@QBE_JXZ @ 4432 NONAME ; long long QDateTime::toMSecsSinceEpoch(void) const + ?hasExpired@QElapsedTimer@@QBE_N_J@Z @ 4433 NONAME ; bool QElapsedTimer::hasExpired(long long) const + ?makeEncoder@QTextCodec@@QBEPAVQTextEncoder@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4434 NONAME ; class QTextEncoder * QTextCodec::makeEncoder(class QFlags) const + ??9QElapsedTimer@@QBE_NABV0@@Z @ 4435 NONAME ; bool QElapsedTimer::operator!=(class QElapsedTimer const &) const + ?setRawData@QString@@QAEAAV1@PBVQChar@@H@Z @ 4436 NONAME ; class QString & QString::setRawData(class QChar const *, int) + ?registerTypedef@QMetaType@@SAHPBDH@Z @ 4437 NONAME ; int QMetaType::registerTypedef(char const *, int) + ??8QElapsedTimer@@QBE_NABV0@@Z @ 4438 NONAME ; bool QElapsedTimer::operator==(class QElapsedTimer const &) const + ?makeDecoder@QTextCodec@@QBEPAVQTextDecoder@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4439 NONAME ; class QTextDecoder * QTextCodec::makeDecoder(class QFlags) const + ?metaObject@QEventDispatcherSymbian@@UBEPBUQMetaObject@@XZ @ 4440 NONAME ; struct QMetaObject const * QEventDispatcherSymbian::metaObject(void) const + ?transitions@QState@@QBE?AV?$QList@PAVQAbstractTransition@@@@XZ @ 4441 NONAME ; class QList QState::transitions(void) const + ?qDetectCPUFeatures@@YAIXZ @ 4442 NONAME ; unsigned int qDetectCPUFeatures(void) + ?isSharedWith@QString@@QBE_NABV1@@Z @ 4443 NONAME ; bool QString::isSharedWith(class QString const &) const + ?parentChanged@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@1@ZA @ 4444 NONAME ; void (*QAbstractDeclarativeData::parentChanged)(class QAbstractDeclarativeData *, class QObject *, class QObject *) + ?currentMSecsSinceEpoch@QDateTime@@SA_JXZ @ 4445 NONAME ; long long QDateTime::currentMSecsSinceEpoch(void) + ?staticMetaObject@QEventDispatcherSymbian@@2UQMetaObject@@B @ 4446 NONAME ; struct QMetaObject const QEventDispatcherSymbian::staticMetaObject + ?msecsTo@QElapsedTimer@@QBE_JABV1@@Z @ 4447 NONAME ; long long QElapsedTimer::msecsTo(class QElapsedTimer const &) const + ?toEasingCurve@QVariant@@QBE?AVQEasingCurve@@XZ @ 4448 NONAME ; class QEasingCurve QVariant::toEasingCurve(void) const ?registerStreamOperators@QMetaType@@SAXHP6AXAAVQDataStream@@PBX@ZP6AX0PAX@Z@Z @ 4449 NONAME ; void QMetaType::registerStreamOperators(int, void (*)(class QDataStream &, void const *), void (*)(class QDataStream &, void *)) - ?registerTypedef@QMetaType@@SAHPBDH@Z @ 4450 NONAME ; int QMetaType::registerTypedef(char const *, int) - ?replace@QByteArray@@QAEAAV1@HHPBDH@Z @ 4451 NONAME ; class QByteArray & QByteArray::replace(int, int, char const *, int) - ?restart@QElapsedTimer@@QAE_JXZ @ 4452 NONAME ; long long QElapsedTimer::restart(void) - ?secsTo@QElapsedTimer@@QBE_JABV1@@Z @ 4453 NONAME ; long long QElapsedTimer::secsTo(class QElapsedTimer const &) const - ?setMSecsSinceEpoch@QDateTime@@QAEX_J@Z @ 4454 NONAME ; void QDateTime::setMSecsSinceEpoch(long long) - ?start@QElapsedTimer@@QAEXXZ @ 4455 NONAME ; void QElapsedTimer::start(void) - ?toEasingCurve@QVariant@@QBE?AVQEasingCurve@@XZ @ 4456 NONAME ; class QEasingCurve QVariant::toEasingCurve(void) const - ?toMSecsSinceEpoch@QDateTime@@QBE_JXZ @ 4457 NONAME ; long long QDateTime::toMSecsSinceEpoch(void) const - ?transitions@QState@@QBE?AV?$QList@PAVQAbstractTransition@@@@XZ @ 4458 NONAME ; class QList QState::transitions(void) const - ?validCodecs@QTextCodec@@CA_NXZ @ 4459 NONAME ; bool QTextCodec::validCodecs(void) - ?destroyed@QDeclarativeData@@2P6AXPAV1@PAVQObject@@@ZA @ 4460 NONAME ABSENT ; void (*QDeclarativeData::destroyed)(class QDeclarativeData *, class QObject *) - ?parentChanged@QDeclarativeData@@2P6AXPAV1@PAVQObject@@1@ZA @ 4461 NONAME ABSENT ; void (*QDeclarativeData::parentChanged)(class QDeclarativeData *, class QObject *, class QObject *) - ?parentChanged@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@1@ZA @ 4462 NONAME ; void (*QAbstractDeclarativeData::parentChanged)(class QAbstractDeclarativeData *, class QObject *, class QObject *) - ?destroyed@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@@ZA @ 4463 NONAME ; void (*QAbstractDeclarativeData::destroyed)(class QAbstractDeclarativeData *, class QObject *) - ?selectThread@QEventDispatcherSymbian@@AAEAAVQSelectThread@@XZ @ 4464 NONAME ; class QSelectThread & QEventDispatcherSymbian::selectThread(void) - ?setRawData@QByteArray@@QAEAAV1@PBDI@Z @ 4465 NONAME ; class QByteArray & QByteArray::setRawData(char const *, unsigned int) - ?setRawData@QString@@QAEAAV1@PBVQChar@@H@Z @ 4466 NONAME ; class QString & QString::setRawData(class QChar const *, int) - ?getStaticMetaObject@QEventDispatcherSymbian@@SAABUQMetaObject@@XZ @ 4467 NONAME ; struct QMetaObject const & QEventDispatcherSymbian::getStaticMetaObject(void) - ?isHighSurrogate@QChar@@SA_NI@Z @ 4468 NONAME ; bool QChar::isHighSurrogate(unsigned int) - ?isLowSurrogate@QChar@@SA_NI@Z @ 4469 NONAME ; bool QChar::isLowSurrogate(unsigned int) - ?metaObject@QEventDispatcherSymbian@@UBEPBUQMetaObject@@XZ @ 4470 NONAME ; struct QMetaObject const * QEventDispatcherSymbian::metaObject(void) const - ?msecsTo@QDateTime@@QBE_JABV1@@Z @ 4471 NONAME ; long long QDateTime::msecsTo(class QDateTime const &) const - ?qt_metacall@QEventDispatcherSymbian@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 4472 NONAME ; int QEventDispatcherSymbian::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacast@QEventDispatcherSymbian@@UAEPAXPBD@Z @ 4473 NONAME ; void * QEventDispatcherSymbian::qt_metacast(char const *) - ?requiresSurrogates@QChar@@SA_NI@Z @ 4474 NONAME ; bool QChar::requiresSurrogates(unsigned int) - ?symbianInit@QCoreApplicationPrivate@@QAEXXZ @ 4475 NONAME ; void QCoreApplicationPrivate::symbianInit(void) - ?tr@QEventDispatcherSymbian@@SA?AVQString@@PBD0@Z @ 4476 NONAME ; class QString QEventDispatcherSymbian::tr(char const *, char const *) - ?tr@QEventDispatcherSymbian@@SA?AVQString@@PBD0H@Z @ 4477 NONAME ; class QString QEventDispatcherSymbian::tr(char const *, char const *, int) - ?trUtf8@QEventDispatcherSymbian@@SA?AVQString@@PBD0@Z @ 4478 NONAME ; class QString QEventDispatcherSymbian::trUtf8(char const *, char const *) - ?trUtf8@QEventDispatcherSymbian@@SA?AVQString@@PBD0H@Z @ 4479 NONAME ; class QString QEventDispatcherSymbian::trUtf8(char const *, char const *, int) - ?staticMetaObject@QEventDispatcherSymbian@@2UQMetaObject@@B @ 4480 NONAME ; struct QMetaObject const QEventDispatcherSymbian::staticMetaObject + ?replace@QByteArray@@QAEAAV1@HHPBDH@Z @ 4450 NONAME ; class QByteArray & QByteArray::replace(int, int, char const *, int) + ?elapsed@QElapsedTimer@@QBE_JXZ @ 4451 NONAME ; long long QElapsedTimer::elapsed(void) const + ??0QTextEncoder@@QAE@PBVQTextCodec@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4452 NONAME ; QTextEncoder::QTextEncoder(class QTextCodec const *, class QFlags) + ??6@YAAAVQDataStream@@AAV0@ABVQEasingCurve@@@Z @ 4453 NONAME ; class QDataStream & operator<<(class QDataStream &, class QEasingCurve const &) + ?qDecodeDataUrl@@YA?AU?$QPair@VQString@@VQByteArray@@@@ABVQUrl@@@Z @ 4454 NONAME ; struct QPair qDecodeDataUrl(class QUrl const &) + ?trUtf8@QEventDispatcherSymbian@@SA?AVQString@@PBD0@Z @ 4455 NONAME ; class QString QEventDispatcherSymbian::trUtf8(char const *, char const *) + ?setNativeArguments@QProcess@@QAEXABVQString@@@Z @ 4456 NONAME ; void QProcess::setNativeArguments(class QString const &) + ?msecsTo@QDateTime@@QBE_JABV1@@Z @ 4457 NONAME ; long long QDateTime::msecsTo(class QDateTime const &) const + ?tr@QEventDispatcherSymbian@@SA?AVQString@@PBD0H@Z @ 4458 NONAME ; class QString QEventDispatcherSymbian::tr(char const *, char const *, int) + ?setMSecsSinceEpoch@QDateTime@@QAEX_J@Z @ 4459 NONAME ; void QDateTime::setMSecsSinceEpoch(long long) + ?tr@QEventDispatcherSymbian@@SA?AVQString@@PBD0@Z @ 4460 NONAME ; class QString QEventDispatcherSymbian::tr(char const *, char const *) + ?isSharedWith@QByteArray@@QBE_NABV1@@Z @ 4461 NONAME ; bool QByteArray::isSharedWith(class QByteArray const &) const + ?secsTo@QElapsedTimer@@QBE_JABV1@@Z @ 4462 NONAME ; long long QElapsedTimer::secsTo(class QElapsedTimer const &) const + ??5@YAAAVQDataStream@@AAV0@AAVQEasingCurve@@@Z @ 4463 NONAME ; class QDataStream & operator>>(class QDataStream &, class QEasingCurve &) + ??0QString@@QAE@PBVQChar@@@Z @ 4464 NONAME ; QString::QString(class QChar const *) + ?append@QListData@@QAEPAPAXH@Z @ 4465 NONAME ; void * * QListData::append(int) + ?getStaticMetaObject@QEventDispatcherSymbian@@SAABUQMetaObject@@XZ @ 4466 NONAME ; struct QMetaObject const & QEventDispatcherSymbian::getStaticMetaObject(void) + ?peek@QIODevicePrivate@@UAE?AVQByteArray@@_J@Z @ 4467 NONAME ; class QByteArray QIODevicePrivate::peek(long long) + ?detach_grow@QListData@@QAEPAUData@1@PAHH@Z @ 4468 NONAME ; struct QListData::Data * QListData::detach_grow(int *, int) + ?symbianInit@QCoreApplicationPrivate@@QAEXXZ @ 4469 NONAME ; void QCoreApplicationPrivate::symbianInit(void) + ??0QTextDecoder@@QAE@PBVQTextCodec@@V?$QFlags@W4ConversionFlag@QTextCodec@@@@@Z @ 4470 NONAME ; QTextDecoder::QTextDecoder(class QTextCodec const *, class QFlags) + ?requiresSurrogates@QChar@@SA_NI@Z @ 4471 NONAME ; bool QChar::requiresSurrogates(unsigned int) + ?isLowSurrogate@QChar@@SA_NI@Z @ 4472 NONAME ; bool QChar::isLowSurrogate(unsigned int) + ?qt_metacall@QEventDispatcherSymbian@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 4473 NONAME ; int QEventDispatcherSymbian::qt_metacall(enum QMetaObject::Call, int, void * *) + ?setRawData@QByteArray@@QAEAAV1@PBDI@Z @ 4474 NONAME ; class QByteArray & QByteArray::setRawData(char const *, unsigned int) + ?fromMSecsSinceEpoch@QDateTime@@SA?AV1@_J@Z @ 4475 NONAME ; class QDateTime QDateTime::fromMSecsSinceEpoch(long long) + ?invalidate@QElapsedTimer@@QAEXXZ @ 4476 NONAME ; void QElapsedTimer::invalidate(void) + ?restart@QElapsedTimer@@QAE_JXZ @ 4477 NONAME ; long long QElapsedTimer::restart(void) + ?currentDateTimeUtc@QDateTime@@SA?AV1@XZ @ 4478 NONAME ; class QDateTime QDateTime::currentDateTimeUtc(void) + ?isMonotonic@QElapsedTimer@@SA_NXZ @ 4479 NONAME ; bool QElapsedTimer::isMonotonic(void) + ?peek@QIODevicePrivate@@UAE_JPAD_J@Z @ 4480 NONAME ; long long QIODevicePrivate::peek(char *, long long) ?textDirection@QLocale@@QBE?AW4LayoutDirection@Qt@@XZ @ 4481 NONAME ; enum Qt::LayoutDirection QLocale::textDirection(void) const - ?peek@QIODevicePrivate@@UAE_JPAD_J@Z @ 4482 NONAME ; long long QIODevicePrivate::peek(char *, long long) - ?peek@QIODevicePrivate@@UAE?AVQByteArray@@_J@Z @ 4483 NONAME ; class QByteArray QIODevicePrivate::peek(long long) - ?nativeArguments@QProcess@@QBE?AVQString@@XZ @ 4484 NONAME ; class QString QProcess::nativeArguments(void) const - ?setNativeArguments@QProcess@@QAEXABVQString@@@Z @ 4485 NONAME ; void QProcess::setNativeArguments(class QString const &) + ?msecsSinceReference@QElapsedTimer@@QBE_JXZ @ 4482 NONAME ; long long QElapsedTimer::msecsSinceReference(void) const + ?selectThread@QEventDispatcherSymbian@@AAEAAVQSelectThread@@XZ @ 4483 NONAME ; class QSelectThread & QEventDispatcherSymbian::selectThread(void) diff --git a/src/s60installs/bwins/QtNetworku.def b/src/s60installs/bwins/QtNetworku.def index 9911b36..48af60c 100644 --- a/src/s60installs/bwins/QtNetworku.def +++ b/src/s60installs/bwins/QtNetworku.def @@ -962,189 +962,185 @@ EXPORTS ?staticMetaObject@QTcpServer@@2UQMetaObject@@B @ 961 NONAME ; struct QMetaObject const QTcpServer::staticMetaObject ?staticMetaObject@QUdpSocket@@2UQMetaObject@@B @ 962 NONAME ; struct QMetaObject const QUdpSocket::staticMetaObject ?staticMetaObject@QAbstractSocket@@2UQMetaObject@@B @ 963 NONAME ; struct QMetaObject const QAbstractSocket::staticMetaObject - ??0QBearerEngine@@QAE@PAVQObject@@@Z @ 964 NONAME ; QBearerEngine::QBearerEngine(class QObject *) - ??0QBearerEnginePlugin@@QAE@PAVQObject@@@Z @ 965 NONAME ; QBearerEnginePlugin::QBearerEnginePlugin(class QObject *) - ??0QNetworkConfiguration@@QAE@ABV0@@Z @ 966 NONAME ; QNetworkConfiguration::QNetworkConfiguration(class QNetworkConfiguration const &) - ??0QNetworkConfiguration@@QAE@XZ @ 967 NONAME ; QNetworkConfiguration::QNetworkConfiguration(void) - ??0QNetworkConfigurationManager@@QAE@PAVQObject@@@Z @ 968 NONAME ; QNetworkConfigurationManager::QNetworkConfigurationManager(class QObject *) - ??0QNetworkConfigurationManagerPrivate@@QAE@XZ @ 969 NONAME ; QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate(void) - ??0QNetworkSession@@QAE@ABVQNetworkConfiguration@@PAVQObject@@@Z @ 970 NONAME ; QNetworkSession::QNetworkSession(class QNetworkConfiguration const &, class QObject *) - ??0QNetworkSessionPrivate@@QAE@XZ @ 971 NONAME ; QNetworkSessionPrivate::QNetworkSessionPrivate(void) - ??1QBearerEngine@@UAE@XZ @ 972 NONAME ; QBearerEngine::~QBearerEngine(void) - ??1QBearerEngineFactoryInterface@@UAE@XZ @ 973 NONAME ; QBearerEngineFactoryInterface::~QBearerEngineFactoryInterface(void) - ??1QBearerEnginePlugin@@UAE@XZ @ 974 NONAME ; QBearerEnginePlugin::~QBearerEnginePlugin(void) - ??1QNetworkConfiguration@@QAE@XZ @ 975 NONAME ; QNetworkConfiguration::~QNetworkConfiguration(void) - ??1QNetworkConfigurationManager@@UAE@XZ @ 976 NONAME ; QNetworkConfigurationManager::~QNetworkConfigurationManager(void) - ??1QNetworkConfigurationManagerPrivate@@UAE@XZ @ 977 NONAME ; QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate(void) - ??1QNetworkSession@@UAE@XZ @ 978 NONAME ; QNetworkSession::~QNetworkSession(void) - ??1QNetworkSessionPrivate@@UAE@XZ @ 979 NONAME ; QNetworkSessionPrivate::~QNetworkSessionPrivate(void) - ??4QNetworkConfiguration@@QAEAAV0@ABV0@@Z @ 980 NONAME ; class QNetworkConfiguration & QNetworkConfiguration::operator=(class QNetworkConfiguration const &) - ??8QNetworkConfiguration@@QBE_NABV0@@Z @ 981 NONAME ; bool QNetworkConfiguration::operator==(class QNetworkConfiguration const &) const - ??9QNetworkConfiguration@@QBE_NABV0@@Z @ 982 NONAME ; bool QNetworkConfiguration::operator!=(class QNetworkConfiguration const &) const - ??_EQBearerEngine@@UAE@I@Z @ 983 NONAME ; QBearerEngine::~QBearerEngine(unsigned int) - ??_EQBearerEngineFactoryInterface@@UAE@I@Z @ 984 NONAME ; QBearerEngineFactoryInterface::~QBearerEngineFactoryInterface(unsigned int) - ??_EQBearerEnginePlugin@@UAE@I@Z @ 985 NONAME ; QBearerEnginePlugin::~QBearerEnginePlugin(unsigned int) - ??_EQNetworkConfigurationManager@@UAE@I@Z @ 986 NONAME ; QNetworkConfigurationManager::~QNetworkConfigurationManager(unsigned int) - ??_EQNetworkConfigurationManagerPrivate@@UAE@I@Z @ 987 NONAME ; QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate(unsigned int) - ??_EQNetworkSession@@UAE@I@Z @ 988 NONAME ; QNetworkSession::~QNetworkSession(unsigned int) - ??_EQNetworkSessionPrivate@@UAE@I@Z @ 989 NONAME ; QNetworkSessionPrivate::~QNetworkSessionPrivate(unsigned int) - ?abort@QNetworkConfigurationManagerPrivate@@IAEXXZ @ 990 NONAME ; void QNetworkConfigurationManagerPrivate::abort(void) - ?accept@QNetworkSession@@QAEXXZ @ 991 NONAME ; void QNetworkSession::accept(void) - ?activeConfiguration@QNetworkAccessManager@@QBE?AVQNetworkConfiguration@@XZ @ 992 NONAME ; class QNetworkConfiguration QNetworkAccessManager::activeConfiguration(void) const - ?activeTime@QNetworkSession@@QBE_KXZ @ 993 NONAME ; unsigned long long QNetworkSession::activeTime(void) const - ?allConfigurations@QNetworkConfigurationManager@@QBE?AV?$QList@VQNetworkConfiguration@@@@V?$QFlags@W4StateFlag@QNetworkConfiguration@@@@@Z @ 994 NONAME ; class QList QNetworkConfigurationManager::allConfigurations(class QFlags) const - ?bearerName@QNetworkConfiguration@@QBE?AVQString@@XZ @ 995 NONAME ; class QString QNetworkConfiguration::bearerName(void) const - ?bytesReceived@QNetworkSession@@QBE_KXZ @ 996 NONAME ; unsigned long long QNetworkSession::bytesReceived(void) const - ?bytesWritten@QNetworkSession@@QBE_KXZ @ 997 NONAME ; unsigned long long QNetworkSession::bytesWritten(void) const - ?capabilities@QNetworkConfigurationManager@@QBE?AV?$QFlags@W4Capability@QNetworkConfigurationManager@@@@XZ @ 998 NONAME ; class QFlags QNetworkConfigurationManager::capabilities(void) const - ?children@QNetworkConfiguration@@QBE?AV?$QList@VQNetworkConfiguration@@@@XZ @ 999 NONAME ; class QList QNetworkConfiguration::children(void) const - ?close@QNetworkSession@@QAEXXZ @ 1000 NONAME ; void QNetworkSession::close(void) - ?closed@QNetworkSession@@IAEXXZ @ 1001 NONAME ; void QNetworkSession::closed(void) - ?closed@QNetworkSessionPrivate@@IAEXXZ @ 1002 NONAME ; void QNetworkSessionPrivate::closed(void) - ?configuration@QNetworkAccessManager@@QBE?AVQNetworkConfiguration@@XZ @ 1003 NONAME ; class QNetworkConfiguration QNetworkAccessManager::configuration(void) const - ?configuration@QNetworkSession@@QBE?AVQNetworkConfiguration@@XZ @ 1004 NONAME ; class QNetworkConfiguration QNetworkSession::configuration(void) const - ?configurationAdded@QBearerEngine@@IAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1005 NONAME ; void QBearerEngine::configurationAdded(class QExplicitlySharedDataPointer) - ?configurationAdded@QNetworkConfigurationManager@@IAEXABVQNetworkConfiguration@@@Z @ 1006 NONAME ; void QNetworkConfigurationManager::configurationAdded(class QNetworkConfiguration const &) - ?configurationAdded@QNetworkConfigurationManagerPrivate@@AAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1007 NONAME ; void QNetworkConfigurationManagerPrivate::configurationAdded(class QExplicitlySharedDataPointer) - ?configurationAdded@QNetworkConfigurationManagerPrivate@@IAEXABVQNetworkConfiguration@@@Z @ 1008 NONAME ; void QNetworkConfigurationManagerPrivate::configurationAdded(class QNetworkConfiguration const &) - ?configurationChanged@QBearerEngine@@IAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1009 NONAME ; void QBearerEngine::configurationChanged(class QExplicitlySharedDataPointer) - ?configurationChanged@QNetworkConfigurationManager@@IAEXABVQNetworkConfiguration@@@Z @ 1010 NONAME ; void QNetworkConfigurationManager::configurationChanged(class QNetworkConfiguration const &) - ?configurationChanged@QNetworkConfigurationManagerPrivate@@AAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1011 NONAME ; void QNetworkConfigurationManagerPrivate::configurationChanged(class QExplicitlySharedDataPointer) - ?configurationChanged@QNetworkConfigurationManagerPrivate@@IAEXABVQNetworkConfiguration@@@Z @ 1012 NONAME ; void QNetworkConfigurationManagerPrivate::configurationChanged(class QNetworkConfiguration const &) - ?configurationFromIdentifier@QNetworkConfigurationManager@@QBE?AVQNetworkConfiguration@@ABVQString@@@Z @ 1013 NONAME ; class QNetworkConfiguration QNetworkConfigurationManager::configurationFromIdentifier(class QString const &) const - ?configurationRemoved@QBearerEngine@@IAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1014 NONAME ; void QBearerEngine::configurationRemoved(class QExplicitlySharedDataPointer) - ?configurationRemoved@QNetworkConfigurationManager@@IAEXABVQNetworkConfiguration@@@Z @ 1015 NONAME ; void QNetworkConfigurationManager::configurationRemoved(class QNetworkConfiguration const &) - ?configurationRemoved@QNetworkConfigurationManagerPrivate@@AAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1016 NONAME ; void QNetworkConfigurationManagerPrivate::configurationRemoved(class QExplicitlySharedDataPointer) - ?configurationRemoved@QNetworkConfigurationManagerPrivate@@IAEXABVQNetworkConfiguration@@@Z @ 1017 NONAME ; void QNetworkConfigurationManagerPrivate::configurationRemoved(class QNetworkConfiguration const &) - ?configurationUpdateComplete@QNetworkConfigurationManagerPrivate@@IAEXXZ @ 1018 NONAME ; void QNetworkConfigurationManagerPrivate::configurationUpdateComplete(void) - ?connectNotify@QNetworkSession@@MAEXPBD@Z @ 1019 NONAME ; void QNetworkSession::connectNotify(char const *) - ?defaultConfiguration@QNetworkConfigurationManager@@QBE?AVQNetworkConfiguration@@XZ @ 1020 NONAME ; class QNetworkConfiguration QNetworkConfigurationManager::defaultConfiguration(void) const - ?disconnectNotify@QNetworkSession@@MAEXPBD@Z @ 1021 NONAME ; void QNetworkSession::disconnectNotify(char const *) - ?engines@QNetworkConfigurationManagerPrivate@@QAE?AV?$QList@PAVQBearerEngine@@@@XZ @ 1022 NONAME ; class QList QNetworkConfigurationManagerPrivate::engines(void) - ?error@QNetworkSession@@IAEXW4SessionError@1@@Z @ 1023 NONAME ; void QNetworkSession::error(enum QNetworkSession::SessionError) - ?error@QNetworkSession@@QBE?AW4SessionError@1@XZ @ 1024 NONAME ; enum QNetworkSession::SessionError QNetworkSession::error(void) const - ?error@QNetworkSessionPrivate@@IAEXW4SessionError@QNetworkSession@@@Z @ 1025 NONAME ; void QNetworkSessionPrivate::error(enum QNetworkSession::SessionError) - ?errorString@QNetworkSession@@QBE?AVQString@@XZ @ 1026 NONAME ; class QString QNetworkSession::errorString(void) const - ?getStaticMetaObject@QBearerEngine@@SAABUQMetaObject@@XZ @ 1027 NONAME ; struct QMetaObject const & QBearerEngine::getStaticMetaObject(void) - ?getStaticMetaObject@QBearerEnginePlugin@@SAABUQMetaObject@@XZ @ 1028 NONAME ; struct QMetaObject const & QBearerEnginePlugin::getStaticMetaObject(void) - ?getStaticMetaObject@QNetworkConfigurationManager@@SAABUQMetaObject@@XZ @ 1029 NONAME ; struct QMetaObject const & QNetworkConfigurationManager::getStaticMetaObject(void) - ?getStaticMetaObject@QNetworkConfigurationManagerPrivate@@SAABUQMetaObject@@XZ @ 1030 NONAME ; struct QMetaObject const & QNetworkConfigurationManagerPrivate::getStaticMetaObject(void) - ?getStaticMetaObject@QNetworkSession@@SAABUQMetaObject@@XZ @ 1031 NONAME ; struct QMetaObject const & QNetworkSession::getStaticMetaObject(void) - ?getStaticMetaObject@QNetworkSessionPrivate@@SAABUQMetaObject@@XZ @ 1032 NONAME ; struct QMetaObject const & QNetworkSessionPrivate::getStaticMetaObject(void) - ?identifier@QNetworkConfiguration@@QBE?AVQString@@XZ @ 1033 NONAME ; class QString QNetworkConfiguration::identifier(void) const - ?ignore@QNetworkSession@@QAEXXZ @ 1034 NONAME ; void QNetworkSession::ignore(void) - ?interface@QNetworkSession@@QBE?AVQNetworkInterface@@XZ @ 1035 NONAME ; class QNetworkInterface QNetworkSession::interface(void) const - ?isOnline@QNetworkConfigurationManager@@QBE_NXZ @ 1036 NONAME ; bool QNetworkConfigurationManager::isOnline(void) const - ?isOpen@QNetworkSession@@QBE_NXZ @ 1037 NONAME ; bool QNetworkSession::isOpen(void) const - ?isRoamingAvailable@QNetworkConfiguration@@QBE_NXZ @ 1038 NONAME ; bool QNetworkConfiguration::isRoamingAvailable(void) const - ?isValid@QNetworkConfiguration@@QBE_NXZ @ 1039 NONAME ; bool QNetworkConfiguration::isValid(void) const - ?metaObject@QBearerEngine@@UBEPBUQMetaObject@@XZ @ 1040 NONAME ; struct QMetaObject const * QBearerEngine::metaObject(void) const - ?metaObject@QBearerEnginePlugin@@UBEPBUQMetaObject@@XZ @ 1041 NONAME ; struct QMetaObject const * QBearerEnginePlugin::metaObject(void) const - ?metaObject@QNetworkConfigurationManager@@UBEPBUQMetaObject@@XZ @ 1042 NONAME ; struct QMetaObject const * QNetworkConfigurationManager::metaObject(void) const - ?metaObject@QNetworkConfigurationManagerPrivate@@UBEPBUQMetaObject@@XZ @ 1043 NONAME ; struct QMetaObject const * QNetworkConfigurationManagerPrivate::metaObject(void) const - ?metaObject@QNetworkSession@@UBEPBUQMetaObject@@XZ @ 1044 NONAME ; struct QMetaObject const * QNetworkSession::metaObject(void) const - ?metaObject@QNetworkSessionPrivate@@UBEPBUQMetaObject@@XZ @ 1045 NONAME ; struct QMetaObject const * QNetworkSessionPrivate::metaObject(void) const - ?migrate@QNetworkSession@@QAEXXZ @ 1046 NONAME ; void QNetworkSession::migrate(void) - ?name@QNetworkConfiguration@@QBE?AVQString@@XZ @ 1047 NONAME ; class QString QNetworkConfiguration::name(void) const - ?networkAccessChanged@QNetworkAccessManager@@IAEX_N@Z @ 1048 NONAME ABSENT ; void QNetworkAccessManager::networkAccessChanged(bool) - ?networkAccessEnabled@QNetworkAccessManager@@QBE_NXZ @ 1049 NONAME ABSENT ; bool QNetworkAccessManager::networkAccessEnabled(void) const - ?networkSessionOnline@QNetworkAccessManager@@IAEXXZ @ 1050 NONAME ABSENT ; void QNetworkAccessManager::networkSessionOnline(void) - ?newConfigurationActivated@QNetworkSession@@IAEXXZ @ 1051 NONAME ; void QNetworkSession::newConfigurationActivated(void) - ?newConfigurationActivated@QNetworkSessionPrivate@@IAEXXZ @ 1052 NONAME ; void QNetworkSessionPrivate::newConfigurationActivated(void) - ?onlineStateChanged@QNetworkConfigurationManager@@IAEX_N@Z @ 1053 NONAME ; void QNetworkConfigurationManager::onlineStateChanged(bool) - ?onlineStateChanged@QNetworkConfigurationManagerPrivate@@IAEX_N@Z @ 1054 NONAME ; void QNetworkConfigurationManagerPrivate::onlineStateChanged(bool) - ?open@QNetworkSession@@QAEXXZ @ 1055 NONAME ; void QNetworkSession::open(void) - ?opened@QNetworkSession@@IAEXXZ @ 1056 NONAME ; void QNetworkSession::opened(void) - ?performAsyncConfigurationUpdate@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1057 NONAME ; void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate(void) - ?preferredConfigurationChanged@QNetworkSession@@IAEXABVQNetworkConfiguration@@_N@Z @ 1058 NONAME ; void QNetworkSession::preferredConfigurationChanged(class QNetworkConfiguration const &, bool) - ?preferredConfigurationChanged@QNetworkSessionPrivate@@IAEXABVQNetworkConfiguration@@_N@Z @ 1059 NONAME ; void QNetworkSessionPrivate::preferredConfigurationChanged(class QNetworkConfiguration const &, bool) - ?priority@QNetworkRequest@@QBE?AW4Priority@1@XZ @ 1060 NONAME ; enum QNetworkRequest::Priority QNetworkRequest::priority(void) const - ?privateConfiguration@QNetworkSessionPrivate@@IBE?AV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@ABVQNetworkConfiguration@@@Z @ 1061 NONAME ; class QExplicitlySharedDataPointer QNetworkSessionPrivate::privateConfiguration(class QNetworkConfiguration const &) const - ?purpose@QNetworkConfiguration@@QBE?AW4Purpose@1@XZ @ 1062 NONAME ; enum QNetworkConfiguration::Purpose QNetworkConfiguration::purpose(void) const - ?qNetworkConfigurationManagerPrivate@@YAPAVQNetworkConfigurationManagerPrivate@@XZ @ 1063 NONAME ; class QNetworkConfigurationManagerPrivate * qNetworkConfigurationManagerPrivate(void) - ?qt_metacall@QBearerEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1064 NONAME ; int QBearerEngine::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QBearerEnginePlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1065 NONAME ; int QBearerEnginePlugin::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QNetworkConfigurationManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1066 NONAME ; int QNetworkConfigurationManager::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QNetworkConfigurationManagerPrivate@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1067 NONAME ; int QNetworkConfigurationManagerPrivate::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QNetworkSession@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1068 NONAME ; int QNetworkSession::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QNetworkSessionPrivate@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1069 NONAME ; int QNetworkSessionPrivate::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacast@QBearerEngine@@UAEPAXPBD@Z @ 1070 NONAME ; void * QBearerEngine::qt_metacast(char const *) - ?qt_metacast@QBearerEnginePlugin@@UAEPAXPBD@Z @ 1071 NONAME ; void * QBearerEnginePlugin::qt_metacast(char const *) - ?qt_metacast@QNetworkConfigurationManager@@UAEPAXPBD@Z @ 1072 NONAME ; void * QNetworkConfigurationManager::qt_metacast(char const *) - ?qt_metacast@QNetworkConfigurationManagerPrivate@@UAEPAXPBD@Z @ 1073 NONAME ; void * QNetworkConfigurationManagerPrivate::qt_metacast(char const *) - ?qt_metacast@QNetworkSession@@UAEPAXPBD@Z @ 1074 NONAME ; void * QNetworkSession::qt_metacast(char const *) - ?qt_metacast@QNetworkSessionPrivate@@UAEPAXPBD@Z @ 1075 NONAME ; void * QNetworkSessionPrivate::qt_metacast(char const *) - ?quitPendingWaitsForOpened@QNetworkSessionPrivate@@IAEXXZ @ 1076 NONAME ; void QNetworkSessionPrivate::quitPendingWaitsForOpened(void) - ?rawHeaderPairs@QNetworkReply@@QBEABV?$QList@U?$QPair@VQByteArray@@V1@@@@@XZ @ 1077 NONAME ; class QList > const & QNetworkReply::rawHeaderPairs(void) const - ?reject@QNetworkSession@@QAEXXZ @ 1078 NONAME ; void QNetworkSession::reject(void) - ?sendCustomRequest@QNetworkAccessManager@@QAEPAVQNetworkReply@@ABVQNetworkRequest@@ABVQByteArray@@PAVQIODevice@@@Z @ 1079 NONAME ; class QNetworkReply * QNetworkAccessManager::sendCustomRequest(class QNetworkRequest const &, class QByteArray const &, class QIODevice *) - ?sessionProperty@QNetworkSession@@QBE?AVQVariant@@ABVQString@@@Z @ 1080 NONAME ; class QVariant QNetworkSession::sessionProperty(class QString const &) const - ?setALREnabled@QNetworkSessionPrivate@@UAEX_N@Z @ 1081 NONAME ; void QNetworkSessionPrivate::setALREnabled(bool) - ?setConfiguration@QNetworkAccessManager@@QAEXABVQNetworkConfiguration@@@Z @ 1082 NONAME ; void QNetworkAccessManager::setConfiguration(class QNetworkConfiguration const &) - ?setNetworkAccessEnabled@QNetworkAccessManager@@QAEX_N@Z @ 1083 NONAME ABSENT ; void QNetworkAccessManager::setNetworkAccessEnabled(bool) - ?setPriority@QNetworkRequest@@QAEXW4Priority@1@@Z @ 1084 NONAME ; void QNetworkRequest::setPriority(enum QNetworkRequest::Priority) - ?setPrivateConfiguration@QNetworkSessionPrivate@@IBEXAAVQNetworkConfiguration@@V?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1085 NONAME ; void QNetworkSessionPrivate::setPrivateConfiguration(class QNetworkConfiguration &, class QExplicitlySharedDataPointer) const - ?setSessionProperty@QNetworkSession@@QAEXABVQString@@ABVQVariant@@@Z @ 1086 NONAME ; void QNetworkSession::setSessionProperty(class QString const &, class QVariant const &) - ?state@QNetworkConfiguration@@QBE?AV?$QFlags@W4StateFlag@QNetworkConfiguration@@@@XZ @ 1087 NONAME ; class QFlags QNetworkConfiguration::state(void) const - ?state@QNetworkSession@@QBE?AW4State@1@XZ @ 1088 NONAME ; enum QNetworkSession::State QNetworkSession::state(void) const - ?stateChanged@QNetworkSession@@IAEXW4State@1@@Z @ 1089 NONAME ; void QNetworkSession::stateChanged(enum QNetworkSession::State) - ?stateChanged@QNetworkSessionPrivate@@IAEXW4State@QNetworkSession@@@Z @ 1090 NONAME ; void QNetworkSessionPrivate::stateChanged(enum QNetworkSession::State) - ?stop@QNetworkSession@@QAEXXZ @ 1091 NONAME ; void QNetworkSession::stop(void) - ?tr@QBearerEngine@@SA?AVQString@@PBD0@Z @ 1092 NONAME ; class QString QBearerEngine::tr(char const *, char const *) - ?tr@QBearerEngine@@SA?AVQString@@PBD0H@Z @ 1093 NONAME ; class QString QBearerEngine::tr(char const *, char const *, int) - ?tr@QBearerEnginePlugin@@SA?AVQString@@PBD0@Z @ 1094 NONAME ; class QString QBearerEnginePlugin::tr(char const *, char const *) - ?tr@QBearerEnginePlugin@@SA?AVQString@@PBD0H@Z @ 1095 NONAME ; class QString QBearerEnginePlugin::tr(char const *, char const *, int) - ?tr@QNetworkConfigurationManager@@SA?AVQString@@PBD0@Z @ 1096 NONAME ; class QString QNetworkConfigurationManager::tr(char const *, char const *) - ?tr@QNetworkConfigurationManager@@SA?AVQString@@PBD0H@Z @ 1097 NONAME ; class QString QNetworkConfigurationManager::tr(char const *, char const *, int) - ?tr@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0@Z @ 1098 NONAME ; class QString QNetworkConfigurationManagerPrivate::tr(char const *, char const *) - ?tr@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0H@Z @ 1099 NONAME ; class QString QNetworkConfigurationManagerPrivate::tr(char const *, char const *, int) - ?tr@QNetworkSession@@SA?AVQString@@PBD0@Z @ 1100 NONAME ; class QString QNetworkSession::tr(char const *, char const *) - ?tr@QNetworkSession@@SA?AVQString@@PBD0H@Z @ 1101 NONAME ; class QString QNetworkSession::tr(char const *, char const *, int) - ?tr@QNetworkSessionPrivate@@SA?AVQString@@PBD0@Z @ 1102 NONAME ; class QString QNetworkSessionPrivate::tr(char const *, char const *) - ?tr@QNetworkSessionPrivate@@SA?AVQString@@PBD0H@Z @ 1103 NONAME ; class QString QNetworkSessionPrivate::tr(char const *, char const *, int) - ?trUtf8@QBearerEngine@@SA?AVQString@@PBD0@Z @ 1104 NONAME ; class QString QBearerEngine::trUtf8(char const *, char const *) - ?trUtf8@QBearerEngine@@SA?AVQString@@PBD0H@Z @ 1105 NONAME ; class QString QBearerEngine::trUtf8(char const *, char const *, int) - ?trUtf8@QBearerEnginePlugin@@SA?AVQString@@PBD0@Z @ 1106 NONAME ; class QString QBearerEnginePlugin::trUtf8(char const *, char const *) - ?trUtf8@QBearerEnginePlugin@@SA?AVQString@@PBD0H@Z @ 1107 NONAME ; class QString QBearerEnginePlugin::trUtf8(char const *, char const *, int) - ?trUtf8@QNetworkConfigurationManager@@SA?AVQString@@PBD0@Z @ 1108 NONAME ; class QString QNetworkConfigurationManager::trUtf8(char const *, char const *) - ?trUtf8@QNetworkConfigurationManager@@SA?AVQString@@PBD0H@Z @ 1109 NONAME ; class QString QNetworkConfigurationManager::trUtf8(char const *, char const *, int) - ?trUtf8@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0@Z @ 1110 NONAME ; class QString QNetworkConfigurationManagerPrivate::trUtf8(char const *, char const *) - ?trUtf8@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0H@Z @ 1111 NONAME ; class QString QNetworkConfigurationManagerPrivate::trUtf8(char const *, char const *, int) - ?trUtf8@QNetworkSession@@SA?AVQString@@PBD0@Z @ 1112 NONAME ; class QString QNetworkSession::trUtf8(char const *, char const *) - ?trUtf8@QNetworkSession@@SA?AVQString@@PBD0H@Z @ 1113 NONAME ; class QString QNetworkSession::trUtf8(char const *, char const *, int) - ?trUtf8@QNetworkSessionPrivate@@SA?AVQString@@PBD0@Z @ 1114 NONAME ; class QString QNetworkSessionPrivate::trUtf8(char const *, char const *) - ?trUtf8@QNetworkSessionPrivate@@SA?AVQString@@PBD0H@Z @ 1115 NONAME ; class QString QNetworkSessionPrivate::trUtf8(char const *, char const *, int) - ?type@QNetworkConfiguration@@QBE?AW4Type@1@XZ @ 1116 NONAME ; enum QNetworkConfiguration::Type QNetworkConfiguration::type(void) const - ?updateCompleted@QBearerEngine@@IAEXXZ @ 1117 NONAME ; void QBearerEngine::updateCompleted(void) - ?updateCompleted@QNetworkConfigurationManager@@IAEXXZ @ 1118 NONAME ; void QNetworkConfigurationManager::updateCompleted(void) - ?updateConfigurations@QNetworkConfigurationManager@@QAEXXZ @ 1119 NONAME ; void QNetworkConfigurationManager::updateConfigurations(void) - ?updateConfigurations@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1120 NONAME ; void QNetworkConfigurationManagerPrivate::updateConfigurations(void) - ?waitForOpened@QNetworkSession@@QAE_NH@Z @ 1121 NONAME ; bool QNetworkSession::waitForOpened(int) - ?staticMetaObject@QNetworkSessionPrivate@@2UQMetaObject@@B @ 1122 NONAME ; struct QMetaObject const QNetworkSessionPrivate::staticMetaObject - ?staticMetaObject@QBearerEngine@@2UQMetaObject@@B @ 1123 NONAME ; struct QMetaObject const QBearerEngine::staticMetaObject - ?staticMetaObject@QNetworkSession@@2UQMetaObject@@B @ 1124 NONAME ; struct QMetaObject const QNetworkSession::staticMetaObject - ?staticMetaObject@QNetworkConfigurationManager@@2UQMetaObject@@B @ 1125 NONAME ; struct QMetaObject const QNetworkConfigurationManager::staticMetaObject - ?staticMetaObject@QBearerEnginePlugin@@2UQMetaObject@@B @ 1126 NONAME ; struct QMetaObject const QBearerEnginePlugin::staticMetaObject - ?staticMetaObject@QNetworkConfigurationManagerPrivate@@2UQMetaObject@@B @ 1127 NONAME ; struct QMetaObject const QNetworkConfigurationManagerPrivate::staticMetaObject - ?allConfigurations@QNetworkConfigurationManagerPrivate@@QAE?AV?$QList@VQNetworkConfiguration@@@@V?$QFlags@W4StateFlag@QNetworkConfiguration@@@@@Z @ 1128 NONAME ; class QList QNetworkConfigurationManagerPrivate::allConfigurations(class QFlags) - ?configurationFromIdentifier@QNetworkConfigurationManagerPrivate@@QAE?AVQNetworkConfiguration@@ABVQString@@@Z @ 1129 NONAME ; class QNetworkConfiguration QNetworkConfigurationManagerPrivate::configurationFromIdentifier(class QString const &) - ?configurationsInUse@QBearerEngine@@QBE_NXZ @ 1130 NONAME ; bool QBearerEngine::configurationsInUse(void) const - ?defaultConfiguration@QNetworkConfigurationManagerPrivate@@QAE?AVQNetworkConfiguration@@XZ @ 1131 NONAME ; class QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration(void) - ?disablePolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1132 NONAME ; void QNetworkConfigurationManagerPrivate::disablePolling(void) - ?enablePolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1133 NONAME ; void QNetworkConfigurationManagerPrivate::enablePolling(void) - ?isOnline@QNetworkConfigurationManagerPrivate@@QAE_NXZ @ 1134 NONAME ; bool QNetworkConfigurationManagerPrivate::isOnline(void) - ?networkAccessible@QNetworkAccessManager@@QBE?AW4NetworkAccessibility@1@XZ @ 1135 NONAME ; enum QNetworkAccessManager::NetworkAccessibility QNetworkAccessManager::networkAccessible(void) const - ?networkAccessibleChanged@QNetworkAccessManager@@IAEXW4NetworkAccessibility@1@@Z @ 1136 NONAME ; void QNetworkAccessManager::networkAccessibleChanged(enum QNetworkAccessManager::NetworkAccessibility) - ?networkSessionConnected@QNetworkAccessManager@@IAEXXZ @ 1137 NONAME ; void QNetworkAccessManager::networkSessionConnected(void) - ?pollEngines@QNetworkConfigurationManagerPrivate@@AAEXXZ @ 1138 NONAME ; void QNetworkConfigurationManagerPrivate::pollEngines(void) - ?qt_qhostinfo_clear_cache@@YAXXZ @ 1139 NONAME ABSENT ; void qt_qhostinfo_clear_cache(void) - ?qt_qhostinfo_lookup@@YA?AVQHostInfo@@ABVQString@@PAVQObject@@PBDPA_NPAH@Z @ 1140 NONAME ; class QHostInfo qt_qhostinfo_lookup(class QString const &, class QObject *, char const *, bool *, int *) - ?requiresPolling@QBearerEngine@@UBE_NXZ @ 1141 NONAME ; bool QBearerEngine::requiresPolling(void) const + ?qt_qhostinfo_clear_cache@@YAXXZ @ 964 NONAME ABSENT ; void qt_qhostinfo_clear_cache(void) + ?qt_qhostinfo_lookup@@YA?AVQHostInfo@@ABVQString@@PAVQObject@@PBDPA_NPAH@Z @ 965 NONAME ; class QHostInfo qt_qhostinfo_lookup(class QString const &, class QObject *, char const *, bool *, int *) + ?rawHeaderPairs@QNetworkReply@@QBEABV?$QList@U?$QPair@VQByteArray@@V1@@@@@XZ @ 966 NONAME ; class QList > const & QNetworkReply::rawHeaderPairs(void) const + ?tr@QBearerEnginePlugin@@SA?AVQString@@PBD0H@Z @ 967 NONAME ; class QString QBearerEnginePlugin::tr(char const *, char const *, int) + ?qt_metacall@QNetworkConfigurationManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 968 NONAME ; int QNetworkConfigurationManager::qt_metacall(enum QMetaObject::Call, int, void * *) + ?configurationAdded@QNetworkConfigurationManagerPrivate@@AAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 969 NONAME ; void QNetworkConfigurationManagerPrivate::configurationAdded(class QExplicitlySharedDataPointer) + ?metaObject@QNetworkConfigurationManagerPrivate@@UBEPBUQMetaObject@@XZ @ 970 NONAME ; struct QMetaObject const * QNetworkConfigurationManagerPrivate::metaObject(void) const + ??1QBearerEngineFactoryInterface@@UAE@XZ @ 971 NONAME ; QBearerEngineFactoryInterface::~QBearerEngineFactoryInterface(void) + ?setConfiguration@QNetworkAccessManager@@QAEXABVQNetworkConfiguration@@@Z @ 972 NONAME ; void QNetworkAccessManager::setConfiguration(class QNetworkConfiguration const &) + ?identifier@QNetworkConfiguration@@QBE?AVQString@@XZ @ 973 NONAME ; class QString QNetworkConfiguration::identifier(void) const + ??0QBearerEngine@@QAE@PAVQObject@@@Z @ 974 NONAME ; QBearerEngine::QBearerEngine(class QObject *) + ?isRoamingAvailable@QNetworkConfiguration@@QBE_NXZ @ 975 NONAME ; bool QNetworkConfiguration::isRoamingAvailable(void) const + ?quitPendingWaitsForOpened@QNetworkSessionPrivate@@IAEXXZ @ 976 NONAME ; void QNetworkSessionPrivate::quitPendingWaitsForOpened(void) + ?trUtf8@QNetworkSessionPrivate@@SA?AVQString@@PBD0H@Z @ 977 NONAME ; class QString QNetworkSessionPrivate::trUtf8(char const *, char const *, int) + ?setPrivateConfiguration@QNetworkSessionPrivate@@IBEXAAVQNetworkConfiguration@@V?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 978 NONAME ; void QNetworkSessionPrivate::setPrivateConfiguration(class QNetworkConfiguration &, class QExplicitlySharedDataPointer) const + ?trUtf8@QNetworkConfigurationManager@@SA?AVQString@@PBD0H@Z @ 979 NONAME ; class QString QNetworkConfigurationManager::trUtf8(char const *, char const *, int) + ?stateChanged@QNetworkSession@@IAEXW4State@1@@Z @ 980 NONAME ; void QNetworkSession::stateChanged(enum QNetworkSession::State) + ??1QNetworkConfigurationManagerPrivate@@UAE@XZ @ 981 NONAME ; QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate(void) + ?getStaticMetaObject@QBearerEnginePlugin@@SAABUQMetaObject@@XZ @ 982 NONAME ; struct QMetaObject const & QBearerEnginePlugin::getStaticMetaObject(void) + ?getStaticMetaObject@QNetworkConfigurationManagerPrivate@@SAABUQMetaObject@@XZ @ 983 NONAME ; struct QMetaObject const & QNetworkConfigurationManagerPrivate::getStaticMetaObject(void) + ??_EQNetworkConfigurationManagerPrivate@@UAE@I@Z @ 984 NONAME ; QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate(unsigned int) + ?metaObject@QBearerEnginePlugin@@UBEPBUQMetaObject@@XZ @ 985 NONAME ; struct QMetaObject const * QBearerEnginePlugin::metaObject(void) const + ??4QNetworkConfiguration@@QAEAAV0@ABV0@@Z @ 986 NONAME ; class QNetworkConfiguration & QNetworkConfiguration::operator=(class QNetworkConfiguration const &) + ?metaObject@QBearerEngine@@UBEPBUQMetaObject@@XZ @ 987 NONAME ; struct QMetaObject const * QBearerEngine::metaObject(void) const + ?getStaticMetaObject@QBearerEngine@@SAABUQMetaObject@@XZ @ 988 NONAME ; struct QMetaObject const & QBearerEngine::getStaticMetaObject(void) + ?waitForOpened@QNetworkSession@@QAE_NH@Z @ 989 NONAME ; bool QNetworkSession::waitForOpened(int) + ??_EQBearerEngine@@UAE@I@Z @ 990 NONAME ; QBearerEngine::~QBearerEngine(unsigned int) + ?error@QNetworkSession@@IAEXW4SessionError@1@@Z @ 991 NONAME ; void QNetworkSession::error(enum QNetworkSession::SessionError) + ?stop@QNetworkSession@@QAEXXZ @ 992 NONAME ; void QNetworkSession::stop(void) + ?accept@QNetworkSession@@QAEXXZ @ 993 NONAME ; void QNetworkSession::accept(void) + ?qNetworkConfigurationManagerPrivate@@YAPAVQNetworkConfigurationManagerPrivate@@XZ @ 994 NONAME ; class QNetworkConfigurationManagerPrivate * qNetworkConfigurationManagerPrivate(void) + ?open@QNetworkSession@@QAEXXZ @ 995 NONAME ; void QNetworkSession::open(void) + ?newConfigurationActivated@QNetworkSession@@IAEXXZ @ 996 NONAME ; void QNetworkSession::newConfigurationActivated(void) + ?staticMetaObject@QNetworkSessionPrivate@@2UQMetaObject@@B @ 997 NONAME ; struct QMetaObject const QNetworkSessionPrivate::staticMetaObject + ?error@QNetworkSession@@QBE?AW4SessionError@1@XZ @ 998 NONAME ; enum QNetworkSession::SessionError QNetworkSession::error(void) const + ?qt_metacast@QBearerEngine@@UAEPAXPBD@Z @ 999 NONAME ; void * QBearerEngine::qt_metacast(char const *) + ?staticMetaObject@QNetworkSession@@2UQMetaObject@@B @ 1000 NONAME ; struct QMetaObject const QNetworkSession::staticMetaObject + ?trUtf8@QBearerEngine@@SA?AVQString@@PBD0@Z @ 1001 NONAME ; class QString QBearerEngine::trUtf8(char const *, char const *) + ?privateConfiguration@QNetworkSessionPrivate@@IBE?AV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@ABVQNetworkConfiguration@@@Z @ 1002 NONAME ; class QExplicitlySharedDataPointer QNetworkSessionPrivate::privateConfiguration(class QNetworkConfiguration const &) const + ?isOnline@QNetworkConfigurationManagerPrivate@@QAE_NXZ @ 1003 NONAME ; bool QNetworkConfigurationManagerPrivate::isOnline(void) + ?state@QNetworkConfiguration@@QBE?AV?$QFlags@W4StateFlag@QNetworkConfiguration@@@@XZ @ 1004 NONAME ; class QFlags QNetworkConfiguration::state(void) const + ?configurationAdded@QNetworkConfigurationManagerPrivate@@IAEXABVQNetworkConfiguration@@@Z @ 1005 NONAME ; void QNetworkConfigurationManagerPrivate::configurationAdded(class QNetworkConfiguration const &) + ?defaultConfiguration@QNetworkConfigurationManager@@QBE?AVQNetworkConfiguration@@XZ @ 1006 NONAME ; class QNetworkConfiguration QNetworkConfigurationManager::defaultConfiguration(void) const + ?bytesReceived@QNetworkSession@@QBE_KXZ @ 1007 NONAME ; unsigned long long QNetworkSession::bytesReceived(void) const + ?updateConfigurations@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1008 NONAME ; void QNetworkConfigurationManagerPrivate::updateConfigurations(void) + ?errorString@QNetworkSession@@QBE?AVQString@@XZ @ 1009 NONAME ; class QString QNetworkSession::errorString(void) const + ?tr@QNetworkSession@@SA?AVQString@@PBD0H@Z @ 1010 NONAME ; class QString QNetworkSession::tr(char const *, char const *, int) + ??1QNetworkConfigurationManager@@UAE@XZ @ 1011 NONAME ; QNetworkConfigurationManager::~QNetworkConfigurationManager(void) + ?isOpen@QNetworkSession@@QBE_NXZ @ 1012 NONAME ; bool QNetworkSession::isOpen(void) const + ?configurationChanged@QNetworkConfigurationManager@@IAEXABVQNetworkConfiguration@@@Z @ 1013 NONAME ; void QNetworkConfigurationManager::configurationChanged(class QNetworkConfiguration const &) + ?configurationChanged@QNetworkConfigurationManagerPrivate@@AAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1014 NONAME ; void QNetworkConfigurationManagerPrivate::configurationChanged(class QExplicitlySharedDataPointer) + ?configurationRemoved@QBearerEngine@@IAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1015 NONAME ; void QBearerEngine::configurationRemoved(class QExplicitlySharedDataPointer) + ?qt_metacall@QBearerEnginePlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1016 NONAME ; int QBearerEnginePlugin::qt_metacall(enum QMetaObject::Call, int, void * *) + ??0QBearerEnginePlugin@@QAE@PAVQObject@@@Z @ 1017 NONAME ; QBearerEnginePlugin::QBearerEnginePlugin(class QObject *) + ?trUtf8@QNetworkSession@@SA?AVQString@@PBD0@Z @ 1018 NONAME ; class QString QNetworkSession::trUtf8(char const *, char const *) + ?metaObject@QNetworkSessionPrivate@@UBEPBUQMetaObject@@XZ @ 1019 NONAME ; struct QMetaObject const * QNetworkSessionPrivate::metaObject(void) const + ??_EQNetworkConfigurationManager@@UAE@I@Z @ 1020 NONAME ; QNetworkConfigurationManager::~QNetworkConfigurationManager(unsigned int) + ?trUtf8@QNetworkSessionPrivate@@SA?AVQString@@PBD0@Z @ 1021 NONAME ; class QString QNetworkSessionPrivate::trUtf8(char const *, char const *) + ?bearerName@QNetworkConfiguration@@QBE?AVQString@@XZ @ 1022 NONAME ; class QString QNetworkConfiguration::bearerName(void) const + ?trUtf8@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0H@Z @ 1023 NONAME ; class QString QNetworkConfigurationManagerPrivate::trUtf8(char const *, char const *, int) + ?setSessionProperty@QNetworkSession@@QAEXABVQString@@ABVQVariant@@@Z @ 1024 NONAME ; void QNetworkSession::setSessionProperty(class QString const &, class QVariant const &) + ?qt_metacall@QNetworkSession@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1025 NONAME ; int QNetworkSession::qt_metacall(enum QMetaObject::Call, int, void * *) + ?staticMetaObject@QBearerEngine@@2UQMetaObject@@B @ 1026 NONAME ; struct QMetaObject const QBearerEngine::staticMetaObject + ?networkSessionConnected@QNetworkAccessManager@@IAEXXZ @ 1027 NONAME ; void QNetworkAccessManager::networkSessionConnected(void) + ??1QBearerEngine@@UAE@XZ @ 1028 NONAME ; QBearerEngine::~QBearerEngine(void) + ?capabilities@QNetworkConfigurationManagerPrivate@@QAE?AV?$QFlags@W4Capability@QNetworkConfigurationManager@@@@XZ @ 1029 NONAME ; class QFlags QNetworkConfigurationManagerPrivate::capabilities(void) + ??1QNetworkConfiguration@@QAE@XZ @ 1030 NONAME ; QNetworkConfiguration::~QNetworkConfiguration(void) + ??0QNetworkConfigurationManagerPrivate@@QAE@XZ @ 1031 NONAME ; QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate(void) + ?preferredConfigurationChanged@QNetworkSession@@IAEXABVQNetworkConfiguration@@_N@Z @ 1032 NONAME ; void QNetworkSession::preferredConfigurationChanged(class QNetworkConfiguration const &, bool) + ?isValid@QNetworkConfiguration@@QBE_NXZ @ 1033 NONAME ; bool QNetworkConfiguration::isValid(void) const + ?configurationAdded@QBearerEngine@@IAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1034 NONAME ; void QBearerEngine::configurationAdded(class QExplicitlySharedDataPointer) + ??1QNetworkSession@@UAE@XZ @ 1035 NONAME ; QNetworkSession::~QNetworkSession(void) + ?qt_metacast@QBearerEnginePlugin@@UAEPAXPBD@Z @ 1036 NONAME ; void * QBearerEnginePlugin::qt_metacast(char const *) + ??0QNetworkSession@@QAE@ABVQNetworkConfiguration@@PAVQObject@@@Z @ 1037 NONAME ; QNetworkSession::QNetworkSession(class QNetworkConfiguration const &, class QObject *) + ?error@QNetworkSessionPrivate@@IAEXW4SessionError@QNetworkSession@@@Z @ 1038 NONAME ; void QNetworkSessionPrivate::error(enum QNetworkSession::SessionError) + ?name@QNetworkConfiguration@@QBE?AVQString@@XZ @ 1039 NONAME ; class QString QNetworkConfiguration::name(void) const + ?close@QNetworkSession@@QAEXXZ @ 1040 NONAME ; void QNetworkSession::close(void) + ?sessionProperty@QNetworkSession@@QBE?AVQVariant@@ABVQString@@@Z @ 1041 NONAME ; class QVariant QNetworkSession::sessionProperty(class QString const &) const + ?engines@QNetworkConfigurationManagerPrivate@@QAE?AV?$QList@PAVQBearerEngine@@@@XZ @ 1042 NONAME ; class QList QNetworkConfigurationManagerPrivate::engines(void) + ?isOnline@QNetworkConfigurationManager@@QBE_NXZ @ 1043 NONAME ; bool QNetworkConfigurationManager::isOnline(void) const + ?capabilities@QNetworkConfigurationManager@@QBE?AV?$QFlags@W4Capability@QNetworkConfigurationManager@@@@XZ @ 1044 NONAME ; class QFlags QNetworkConfigurationManager::capabilities(void) const + ?configurationRemoved@QNetworkConfigurationManagerPrivate@@AAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1045 NONAME ; void QNetworkConfigurationManagerPrivate::configurationRemoved(class QExplicitlySharedDataPointer) + ??0QNetworkConfiguration@@QAE@ABV0@@Z @ 1046 NONAME ; QNetworkConfiguration::QNetworkConfiguration(class QNetworkConfiguration const &) + ?setPriority@QNetworkRequest@@QAEXW4Priority@1@@Z @ 1047 NONAME ; void QNetworkRequest::setPriority(enum QNetworkRequest::Priority) + ?disconnectNotify@QNetworkSession@@MAEXPBD@Z @ 1048 NONAME ; void QNetworkSession::disconnectNotify(char const *) + ?metaObject@QNetworkSession@@UBEPBUQMetaObject@@XZ @ 1049 NONAME ; struct QMetaObject const * QNetworkSession::metaObject(void) const + ?trUtf8@QBearerEngine@@SA?AVQString@@PBD0H@Z @ 1050 NONAME ; class QString QBearerEngine::trUtf8(char const *, char const *, int) + ?configuration@QNetworkSession@@QBE?AVQNetworkConfiguration@@XZ @ 1051 NONAME ; class QNetworkConfiguration QNetworkSession::configuration(void) const + ?closed@QNetworkSessionPrivate@@IAEXXZ @ 1052 NONAME ; void QNetworkSessionPrivate::closed(void) + ??1QNetworkSessionPrivate@@UAE@XZ @ 1053 NONAME ; QNetworkSessionPrivate::~QNetworkSessionPrivate(void) + ?staticMetaObject@QNetworkConfigurationManager@@2UQMetaObject@@B @ 1054 NONAME ; struct QMetaObject const QNetworkConfigurationManager::staticMetaObject + ?tr@QNetworkConfigurationManager@@SA?AVQString@@PBD0H@Z @ 1055 NONAME ; class QString QNetworkConfigurationManager::tr(char const *, char const *, int) + ?tr@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0H@Z @ 1056 NONAME ; class QString QNetworkConfigurationManagerPrivate::tr(char const *, char const *, int) + ?configurationChanged@QBearerEngine@@IAEXV?$QExplicitlySharedDataPointer@VQNetworkConfigurationPrivate@@@@@Z @ 1057 NONAME ; void QBearerEngine::configurationChanged(class QExplicitlySharedDataPointer) + ?tr@QBearerEngine@@SA?AVQString@@PBD0@Z @ 1058 NONAME ; class QString QBearerEngine::tr(char const *, char const *) + ??0QNetworkConfiguration@@QAE@XZ @ 1059 NONAME ; QNetworkConfiguration::QNetworkConfiguration(void) + ?configurationRemoved@QNetworkConfigurationManager@@IAEXABVQNetworkConfiguration@@@Z @ 1060 NONAME ; void QNetworkConfigurationManager::configurationRemoved(class QNetworkConfiguration const &) + ?preferredConfigurationChanged@QNetworkSessionPrivate@@IAEXABVQNetworkConfiguration@@_N@Z @ 1061 NONAME ; void QNetworkSessionPrivate::preferredConfigurationChanged(class QNetworkConfiguration const &, bool) + ??1QBearerEnginePlugin@@UAE@XZ @ 1062 NONAME ; QBearerEnginePlugin::~QBearerEnginePlugin(void) + ?tr@QNetworkSession@@SA?AVQString@@PBD0@Z @ 1063 NONAME ; class QString QNetworkSession::tr(char const *, char const *) + ??0QNetworkConfigurationManager@@QAE@PAVQObject@@@Z @ 1064 NONAME ; QNetworkConfigurationManager::QNetworkConfigurationManager(class QObject *) + ?qt_metacall@QNetworkConfigurationManagerPrivate@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1065 NONAME ; int QNetworkConfigurationManagerPrivate::qt_metacall(enum QMetaObject::Call, int, void * *) + ??_EQNetworkSession@@UAE@I@Z @ 1066 NONAME ; QNetworkSession::~QNetworkSession(unsigned int) + ??9QNetworkConfiguration@@QBE_NABV0@@Z @ 1067 NONAME ; bool QNetworkConfiguration::operator!=(class QNetworkConfiguration const &) const + ?configurationsInUse@QBearerEngine@@QBE_NXZ @ 1068 NONAME ; bool QBearerEngine::configurationsInUse(void) const + ?tr@QBearerEngine@@SA?AVQString@@PBD0H@Z @ 1069 NONAME ; class QString QBearerEngine::tr(char const *, char const *, int) + ?configuration@QNetworkAccessManager@@QBE?AVQNetworkConfiguration@@XZ @ 1070 NONAME ; class QNetworkConfiguration QNetworkAccessManager::configuration(void) const + ?tr@QNetworkSessionPrivate@@SA?AVQString@@PBD0@Z @ 1071 NONAME ; class QString QNetworkSessionPrivate::tr(char const *, char const *) + ?activeTime@QNetworkSession@@QBE_KXZ @ 1072 NONAME ; unsigned long long QNetworkSession::activeTime(void) const + ?state@QNetworkSession@@QBE?AW4State@1@XZ @ 1073 NONAME ; enum QNetworkSession::State QNetworkSession::state(void) const + ?disablePolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1074 NONAME ; void QNetworkConfigurationManagerPrivate::disablePolling(void) + ?getStaticMetaObject@QNetworkSessionPrivate@@SAABUQMetaObject@@XZ @ 1075 NONAME ; struct QMetaObject const & QNetworkSessionPrivate::getStaticMetaObject(void) + ?configurationAdded@QNetworkConfigurationManager@@IAEXABVQNetworkConfiguration@@@Z @ 1076 NONAME ; void QNetworkConfigurationManager::configurationAdded(class QNetworkConfiguration const &) + ?tr@QNetworkSessionPrivate@@SA?AVQString@@PBD0H@Z @ 1077 NONAME ; class QString QNetworkSessionPrivate::tr(char const *, char const *, int) + ?performAsyncConfigurationUpdate@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1078 NONAME ; void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate(void) + ?trUtf8@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0@Z @ 1079 NONAME ; class QString QNetworkConfigurationManagerPrivate::trUtf8(char const *, char const *) + ?networkAccessible@QNetworkAccessManager@@QBE?AW4NetworkAccessibility@1@XZ @ 1080 NONAME ; enum QNetworkAccessManager::NetworkAccessibility QNetworkAccessManager::networkAccessible(void) const + ?setOption@QAuthenticator@@QAEXABVQString@@ABVQVariant@@@Z @ 1081 NONAME ; void QAuthenticator::setOption(class QString const &, class QVariant const &) + ?trUtf8@QBearerEnginePlugin@@SA?AVQString@@PBD0H@Z @ 1082 NONAME ; class QString QBearerEnginePlugin::trUtf8(char const *, char const *, int) + ?trUtf8@QNetworkConfigurationManager@@SA?AVQString@@PBD0@Z @ 1083 NONAME ; class QString QNetworkConfigurationManager::trUtf8(char const *, char const *) + ?allConfigurations@QNetworkConfigurationManager@@QBE?AV?$QList@VQNetworkConfiguration@@@@V?$QFlags@W4StateFlag@QNetworkConfiguration@@@@@Z @ 1084 NONAME ; class QList QNetworkConfigurationManager::allConfigurations(class QFlags) const + ?requiresPolling@QBearerEngine@@UBE_NXZ @ 1085 NONAME ; bool QBearerEngine::requiresPolling(void) const + ?priority@QNetworkRequest@@QBE?AW4Priority@1@XZ @ 1086 NONAME ; enum QNetworkRequest::Priority QNetworkRequest::priority(void) const + ?networkAccessibleChanged@QNetworkAccessManager@@IAEXW4NetworkAccessibility@1@@Z @ 1087 NONAME ; void QNetworkAccessManager::networkAccessibleChanged(enum QNetworkAccessManager::NetworkAccessibility) + ??8QNetworkConfiguration@@QBE_NABV0@@Z @ 1088 NONAME ; bool QNetworkConfiguration::operator==(class QNetworkConfiguration const &) const + ?option@QAuthenticator@@QBE?AVQVariant@@ABVQString@@@Z @ 1089 NONAME ; class QVariant QAuthenticator::option(class QString const &) const + ?tr@QBearerEnginePlugin@@SA?AVQString@@PBD0@Z @ 1090 NONAME ; class QString QBearerEnginePlugin::tr(char const *, char const *) + ?configurationFromIdentifier@QNetworkConfigurationManager@@QBE?AVQNetworkConfiguration@@ABVQString@@@Z @ 1091 NONAME ; class QNetworkConfiguration QNetworkConfigurationManager::configurationFromIdentifier(class QString const &) const + ??_EQBearerEnginePlugin@@UAE@I@Z @ 1092 NONAME ; QBearerEnginePlugin::~QBearerEnginePlugin(unsigned int) + ?children@QNetworkConfiguration@@QBE?AV?$QList@VQNetworkConfiguration@@@@XZ @ 1093 NONAME ; class QList QNetworkConfiguration::children(void) const + ?activeConfiguration@QNetworkAccessManager@@QBE?AVQNetworkConfiguration@@XZ @ 1094 NONAME ; class QNetworkConfiguration QNetworkAccessManager::activeConfiguration(void) const + ?defaultConfiguration@QNetworkConfigurationManagerPrivate@@QAE?AVQNetworkConfiguration@@XZ @ 1095 NONAME ; class QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration(void) + ?getStaticMetaObject@QNetworkSession@@SAABUQMetaObject@@XZ @ 1096 NONAME ; struct QMetaObject const & QNetworkSession::getStaticMetaObject(void) + ?qt_metacast@QNetworkSession@@UAEPAXPBD@Z @ 1097 NONAME ; void * QNetworkSession::qt_metacast(char const *) + ?updateCompleted@QBearerEngine@@IAEXXZ @ 1098 NONAME ; void QBearerEngine::updateCompleted(void) + ?qt_metacall@QNetworkSessionPrivate@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1099 NONAME ; int QNetworkSessionPrivate::qt_metacall(enum QMetaObject::Call, int, void * *) + ?onlineStateChanged@QNetworkConfigurationManager@@IAEX_N@Z @ 1100 NONAME ; void QNetworkConfigurationManager::onlineStateChanged(bool) + ?getStaticMetaObject@QNetworkConfigurationManager@@SAABUQMetaObject@@XZ @ 1101 NONAME ; struct QMetaObject const & QNetworkConfigurationManager::getStaticMetaObject(void) + ??0QNetworkSessionPrivate@@QAE@XZ @ 1102 NONAME ; QNetworkSessionPrivate::QNetworkSessionPrivate(void) + ?qt_metacast@QNetworkConfigurationManager@@UAEPAXPBD@Z @ 1103 NONAME ; void * QNetworkConfigurationManager::qt_metacast(char const *) + ?configurationChanged@QNetworkConfigurationManagerPrivate@@IAEXABVQNetworkConfiguration@@@Z @ 1104 NONAME ; void QNetworkConfigurationManagerPrivate::configurationChanged(class QNetworkConfiguration const &) + ?staticMetaObject@QBearerEnginePlugin@@2UQMetaObject@@B @ 1105 NONAME ; struct QMetaObject const QBearerEnginePlugin::staticMetaObject + ?qt_metacast@QNetworkConfigurationManagerPrivate@@UAEPAXPBD@Z @ 1106 NONAME ; void * QNetworkConfigurationManagerPrivate::qt_metacast(char const *) + ?newConfigurationActivated@QNetworkSessionPrivate@@IAEXXZ @ 1107 NONAME ; void QNetworkSessionPrivate::newConfigurationActivated(void) + ?qt_metacast@QNetworkSessionPrivate@@UAEPAXPBD@Z @ 1108 NONAME ; void * QNetworkSessionPrivate::qt_metacast(char const *) + ?startPolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1109 NONAME ; void QNetworkConfigurationManagerPrivate::startPolling(void) + ?allConfigurations@QNetworkConfigurationManagerPrivate@@QAE?AV?$QList@VQNetworkConfiguration@@@@V?$QFlags@W4StateFlag@QNetworkConfiguration@@@@@Z @ 1110 NONAME ; class QList QNetworkConfigurationManagerPrivate::allConfigurations(class QFlags) + ?connectNotify@QNetworkSession@@MAEXPBD@Z @ 1111 NONAME ; void QNetworkSession::connectNotify(char const *) + ?onlineStateChanged@QNetworkConfigurationManagerPrivate@@IAEX_N@Z @ 1112 NONAME ; void QNetworkConfigurationManagerPrivate::onlineStateChanged(bool) + ?bytesWritten@QNetworkSession@@QBE_KXZ @ 1113 NONAME ; unsigned long long QNetworkSession::bytesWritten(void) const + ?sendCustomRequest@QNetworkAccessManager@@QAEPAVQNetworkReply@@ABVQNetworkRequest@@ABVQByteArray@@PAVQIODevice@@@Z @ 1114 NONAME ; class QNetworkReply * QNetworkAccessManager::sendCustomRequest(class QNetworkRequest const &, class QByteArray const &, class QIODevice *) + ?addPendingConnection@QTcpServer@@IAEXPAVQTcpSocket@@@Z @ 1115 NONAME ; void QTcpServer::addPendingConnection(class QTcpSocket *) + ?ignore@QNetworkSession@@QAEXXZ @ 1116 NONAME ; void QNetworkSession::ignore(void) + ?updateConfigurations@QNetworkConfigurationManager@@QAEXXZ @ 1117 NONAME ; void QNetworkConfigurationManager::updateConfigurations(void) + ?stateChanged@QNetworkSessionPrivate@@IAEXW4State@QNetworkSession@@@Z @ 1118 NONAME ; void QNetworkSessionPrivate::stateChanged(enum QNetworkSession::State) + ?setALREnabled@QNetworkSessionPrivate@@UAEX_N@Z @ 1119 NONAME ; void QNetworkSessionPrivate::setALREnabled(bool) + ?configurationRemoved@QNetworkConfigurationManagerPrivate@@IAEXABVQNetworkConfiguration@@@Z @ 1120 NONAME ; void QNetworkConfigurationManagerPrivate::configurationRemoved(class QNetworkConfiguration const &) + ?qt_metacall@QBearerEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1121 NONAME ; int QBearerEngine::qt_metacall(enum QMetaObject::Call, int, void * *) + ?interface@QNetworkSession@@QBE?AVQNetworkInterface@@XZ @ 1122 NONAME ; class QNetworkInterface QNetworkSession::interface(void) const + ?opened@QNetworkSession@@IAEXXZ @ 1123 NONAME ; void QNetworkSession::opened(void) + ?type@QNetworkConfiguration@@QBE?AW4Type@1@XZ @ 1124 NONAME ; enum QNetworkConfiguration::Type QNetworkConfiguration::type(void) const + ?migrate@QNetworkSession@@QAEXXZ @ 1125 NONAME ; void QNetworkSession::migrate(void) + ?closed@QNetworkSession@@IAEXXZ @ 1126 NONAME ; void QNetworkSession::closed(void) + ?pollEngines@QNetworkConfigurationManagerPrivate@@AAEXXZ @ 1127 NONAME ; void QNetworkConfigurationManagerPrivate::pollEngines(void) + ?staticMetaObject@QNetworkConfigurationManagerPrivate@@2UQMetaObject@@B @ 1128 NONAME ; struct QMetaObject const QNetworkConfigurationManagerPrivate::staticMetaObject + ?reject@QNetworkSession@@QAEXXZ @ 1129 NONAME ; void QNetworkSession::reject(void) + ?options@QAuthenticator@@QBE?AV?$QHash@VQString@@VQVariant@@@@XZ @ 1130 NONAME ; class QHash QAuthenticator::options(void) const + ?purpose@QNetworkConfiguration@@QBE?AW4Purpose@1@XZ @ 1131 NONAME ; enum QNetworkConfiguration::Purpose QNetworkConfiguration::purpose(void) const + ?configurationFromIdentifier@QNetworkConfigurationManagerPrivate@@QAE?AVQNetworkConfiguration@@ABVQString@@@Z @ 1132 NONAME ; class QNetworkConfiguration QNetworkConfigurationManagerPrivate::configurationFromIdentifier(class QString const &) + ?abort@QNetworkConfigurationManagerPrivate@@IAEXXZ @ 1133 NONAME ; void QNetworkConfigurationManagerPrivate::abort(void) + ?tr@QNetworkConfigurationManager@@SA?AVQString@@PBD0@Z @ 1134 NONAME ; class QString QNetworkConfigurationManager::tr(char const *, char const *) + ?trUtf8@QNetworkSession@@SA?AVQString@@PBD0H@Z @ 1135 NONAME ; class QString QNetworkSession::trUtf8(char const *, char const *, int) + ?trUtf8@QBearerEnginePlugin@@SA?AVQString@@PBD0@Z @ 1136 NONAME ; class QString QBearerEnginePlugin::trUtf8(char const *, char const *) + ??_EQNetworkSessionPrivate@@UAE@I@Z @ 1137 NONAME ; QNetworkSessionPrivate::~QNetworkSessionPrivate(unsigned int) + ?configurationUpdateComplete@QNetworkConfigurationManagerPrivate@@IAEXXZ @ 1138 NONAME ; void QNetworkConfigurationManagerPrivate::configurationUpdateComplete(void) + ?metaObject@QNetworkConfigurationManager@@UBEPBUQMetaObject@@XZ @ 1139 NONAME ; struct QMetaObject const * QNetworkConfigurationManager::metaObject(void) const + ?tr@QNetworkConfigurationManagerPrivate@@SA?AVQString@@PBD0@Z @ 1140 NONAME ; class QString QNetworkConfigurationManagerPrivate::tr(char const *, char const *) + ?updateCompleted@QNetworkConfigurationManager@@IAEXXZ @ 1141 NONAME ; void QNetworkConfigurationManager::updateCompleted(void) ?setNetworkAccessible@QNetworkAccessManager@@QAEXW4NetworkAccessibility@1@@Z @ 1142 NONAME ; void QNetworkAccessManager::setNetworkAccessible(enum QNetworkAccessManager::NetworkAccessibility) - ?startPolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1143 NONAME ; void QNetworkConfigurationManagerPrivate::startPolling(void) - ?capabilities@QNetworkConfigurationManagerPrivate@@QAE?AV?$QFlags@W4Capability@QNetworkConfigurationManager@@@@XZ @ 1144 NONAME ; class QFlags QNetworkConfigurationManagerPrivate::capabilities(void) - ?addPendingConnection@QTcpServer@@IAEXPAVQTcpSocket@@@Z @ 1145 NONAME ; void QTcpServer::addPendingConnection(class QTcpSocket *) - ?option@QAuthenticator@@QBE?AVQVariant@@ABVQString@@@Z @ 1146 NONAME ; class QVariant QAuthenticator::option(class QString const &) const - ?options@QAuthenticator@@QBE?AV?$QHash@VQString@@VQVariant@@@@XZ @ 1147 NONAME ; class QHash QAuthenticator::options(void) const - ?setOption@QAuthenticator@@QAEXABVQString@@ABVQVariant@@@Z @ 1148 NONAME ; void QAuthenticator::setOption(class QString const &, class QVariant const &) + ??_EQBearerEngineFactoryInterface@@UAE@I@Z @ 1143 NONAME ; QBearerEngineFactoryInterface::~QBearerEngineFactoryInterface(unsigned int) + ?enablePolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1144 NONAME ; void QNetworkConfigurationManagerPrivate::enablePolling(void) diff --git a/src/s60installs/bwins/QtOpenVGu.def b/src/s60installs/bwins/QtOpenVGu.def index f398055..1452383 100644 --- a/src/s60installs/bwins/QtOpenVGu.def +++ b/src/s60installs/bwins/QtOpenVGu.def @@ -164,12 +164,11 @@ EXPORTS ?qt_vg_create_context@@YAPAVQEglContext@@PAVQPaintDevice@@H@Z @ 163 NONAME ; class QEglContext * qt_vg_create_context(class QPaintDevice *, int) ?reclaimImages@QVGPixmapData@@UAEXXZ @ 164 NONAME ; void QVGPixmapData::reclaimImages(void) ?hibernate@QVGPixmapData@@UAEXXZ @ 165 NONAME ; void QVGPixmapData::hibernate(void) - ?drawStaticTextItem@QVGPaintEngine@@UAEXPAVQStaticTextItem@@@Z @ 166 NONAME ; void QVGPaintEngine::drawStaticTextItem(class QStaticTextItem *) - ?drawPixmapFragments@QVGPaintEngine@@UAEXPBVPixmapFragment@QPainter@@HABVQPixmap@@V?$QFlags@W4PixmapFragmentHint@QPainter@@@@@Z @ 167 NONAME ; void QVGPaintEngine::drawPixmapFragments(class QPainter::PixmapFragment const *, int, class QPixmap const &, class QFlags) - ?drawCachedGlyphs@QVGPaintEngine@@QAE_NHPBIABVQFont@@PAVQFontEngine@@ABVQPointF@@@Z @ 168 NONAME ABSENT ; bool QVGPaintEngine::drawCachedGlyphs(int, unsigned int const *, class QFont const &, class QFontEngine *, class QPointF const &) - ?supportsStaticContents@QVGEGLWindowSurfaceDirect@@UBE_NXZ @ 169 NONAME ; bool QVGEGLWindowSurfaceDirect::supportsStaticContents(void) const - ?scroll@QVGEGLWindowSurfacePrivate@@UAE_NPAVQWidget@@ABVQRegion@@HH@Z @ 170 NONAME ; bool QVGEGLWindowSurfacePrivate::scroll(class QWidget *, class QRegion const &, int, int) - ?scroll@QVGEGLWindowSurfaceDirect@@UAE_NPAVQWidget@@ABVQRegion@@HH@Z @ 171 NONAME ; bool QVGEGLWindowSurfaceDirect::scroll(class QWidget *, class QRegion const &, int, int) - ?supportsStaticContents@QVGEGLWindowSurfacePrivate@@UBE_NXZ @ 172 NONAME ; bool QVGEGLWindowSurfacePrivate::supportsStaticContents(void) const - ?drawCachedGlyphs@QVGPaintEngine@@QAE_NHPBIABVQFont@@PAVQFontEngine@@ABVQPointF@@PBUQFixedPoint@@@Z @ 173 NONAME ; bool QVGPaintEngine::drawCachedGlyphs(int, unsigned int const *, class QFont const &, class QFontEngine *, class QPointF const &, struct QFixedPoint const *) + ?supportsStaticContents@QVGEGLWindowSurfaceDirect@@UBE_NXZ @ 166 NONAME ; bool QVGEGLWindowSurfaceDirect::supportsStaticContents(void) const + ?scroll@QVGEGLWindowSurfacePrivate@@UAE_NPAVQWidget@@ABVQRegion@@HH@Z @ 167 NONAME ; bool QVGEGLWindowSurfacePrivate::scroll(class QWidget *, class QRegion const &, int, int) + ?scroll@QVGEGLWindowSurfaceDirect@@UAE_NPAVQWidget@@ABVQRegion@@HH@Z @ 168 NONAME ; bool QVGEGLWindowSurfaceDirect::scroll(class QWidget *, class QRegion const &, int, int) + ?supportsStaticContents@QVGEGLWindowSurfacePrivate@@UBE_NXZ @ 169 NONAME ; bool QVGEGLWindowSurfacePrivate::supportsStaticContents(void) const + ?drawCachedGlyphs@QVGPaintEngine@@QAE_NHPBIABVQFont@@PAVQFontEngine@@ABVQPointF@@PBUQFixedPoint@@@Z @ 170 NONAME ; bool QVGPaintEngine::drawCachedGlyphs(int, unsigned int const *, class QFont const &, class QFontEngine *, class QPointF const &, struct QFixedPoint const *) + ?drawPixmapFragments@QVGPaintEngine@@UAEXPBVPixmapFragment@QPainter@@HABVQPixmap@@V?$QFlags@W4PixmapFragmentHint@QPainter@@@@@Z @ 171 NONAME ; void QVGPaintEngine::drawPixmapFragments(class QPainter::PixmapFragment const *, int, class QPixmap const &, class QFlags) + ?drawStaticTextItem@QVGPaintEngine@@UAEXPAVQStaticTextItem@@@Z @ 172 NONAME ; void QVGPaintEngine::drawStaticTextItem(class QStaticTextItem *) -- cgit v0.12 /property> + + Unknown + + + + + + + + + + + Identifier: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Roaming: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Children: + + + + + + + + 0 + 0 + + + + + + + + + + + + + Network Location Awareness + + + + + + Register + + + + + + + Unregister + + + + + + + + + + New Session + + + + + + + Delete Session + + + + + + + Scan + + + + + + + 0 + + + -1 + + + false + + + false + + + %p% + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + Qt::ScrollBarAlwaysOff + + + false + + + + 1 + + + + + + + + + + + + + Sessions + + + true + + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + 0 + + + + Session 1 + + + + + + + + + + + + + + + + diff --git a/examples/network/bearermonitor/bearermonitor_640_480.ui b/examples/network/bearermonitor/bearermonitor_640_480.ui new file mode 100644 index 0000000..941eaa0 --- /dev/null +++ b/examples/network/bearermonitor/bearermonitor_640_480.ui @@ -0,0 +1,386 @@ + + + BearerMonitor + + + + 0 + 0 + 640 + 515 + + + + Form + + + + + + System State + + + true + + + + 0 + + + 0 + + + 0 + + + + + + + Online State: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + Configurations + + + true + + + + 0 + + + 0 + + + 0 + + + + + false + + + + 1 + + + + + + + + + + + + Name: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + State: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Type: + + + + + + + + 0 + 0 + + + + Invalid + + + + + + + + + + + Purpose: + + + + + + + + 0 + 0 + + + + Unknown + + + + + + + + + + + Identifier: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Roaming: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Children: + + + + + + + + 0 + 0 + + + + + + + + + + + + + Network Location Awareness + + + + + + Register + + + + + + + Unregister + + + + + + + + + + New Session + + + + + + + Delete Session + + + + + + + Scan + + + + + + + 0 + + + -1 + + + false + + + false + + + %p% + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + Sessions + + + true + + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + 0 + + + + Session 1 + + + + + + + + + + + + diff --git a/examples/network/bearermonitor/main.cpp b/examples/network/bearermonitor/main.cpp new file mode 100644 index 0000000..9685181 --- /dev/null +++ b/examples/network/bearermonitor/main.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "bearermonitor.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + BearerMonitor monitor; + monitor.show(); + + return app.exec(); +} + diff --git a/examples/network/bearermonitor/sessionwidget.cpp b/examples/network/bearermonitor/sessionwidget.cpp new file mode 100644 index 0000000..7633dd7 --- /dev/null +++ b/examples/network/bearermonitor/sessionwidget.cpp @@ -0,0 +1,156 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "sessionwidget.h" + +SessionWidget::SessionWidget(const QNetworkConfiguration &config, QWidget *parent) +: QWidget(parent) +{ + setupUi(this); + + session = new QNetworkSession(config, this); + + connect(session, SIGNAL(stateChanged(QNetworkSession::State)), + this, SLOT(updateSession())); + connect(session, SIGNAL(error(QNetworkSession::SessionError)), + this, SLOT(updateSession())); + + updateSession(); + + sessionId->setText(QString("0x%1").arg(qulonglong(session), 8, 16, QChar('0'))); + + configuration->setText(session->configuration().name()); + + connect(openSessionButton, SIGNAL(clicked()), + this, SLOT(openSession())); + connect(openSyncSessionButton, SIGNAL(clicked()), + this, SLOT(openSyncSession())); + connect(closeSessionButton, SIGNAL(clicked()), + this, SLOT(closeSession())); + connect(stopSessionButton, SIGNAL(clicked()), + this, SLOT(stopSession())); +} + +SessionWidget::~SessionWidget() +{ + delete session; +} + +void SessionWidget::updateSession() +{ + updateSessionState(session->state()); + updateSessionError(session->error()); + + bearer->setText(session->bearerName()); + + interfaceName->setText(session->interface().humanReadableName()); + interfaceGuid->setText(session->interface().name()); +} + +void SessionWidget::openSession() +{ + session->open(); + updateSession(); +} + +void SessionWidget::openSyncSession() +{ + session->open(); + session->waitForOpened(); + updateSession(); +} + +void SessionWidget::closeSession() +{ + session->close(); + updateSession(); +} + +void SessionWidget::stopSession() +{ + session->stop(); + updateSession(); +} + +void SessionWidget::updateSessionState(QNetworkSession::State state) +{ + QString s = tr("%1 (%2)"); + + switch (state) { + case QNetworkSession::Invalid: + s = s.arg(tr("Invalid")); + break; + case QNetworkSession::NotAvailable: + s = s.arg(tr("Not Available")); + break; + case QNetworkSession::Connecting: + s = s.arg(tr("Connecting")); + break; + case QNetworkSession::Connected: + s = s.arg(tr("Connected")); + break; + case QNetworkSession::Closing: + s = s.arg(tr("Closing")); + break; + case QNetworkSession::Disconnected: + s = s.arg(tr("Disconnected")); + break; + case QNetworkSession::Roaming: + s = s.arg(tr("Roaming")); + break; + default: + s = s.arg(tr("Unknown")); + } + + if (session->isActive()) + s = s.arg(tr("Active")); + else + s = s.arg(tr("Inactive")); + + sessionState->setText(s); +} + +void SessionWidget::updateSessionError(QNetworkSession::SessionError error) +{ + lastError->setText(QString::number(error)); + errorString->setText(session->errorString()); +} + diff --git a/examples/network/bearermonitor/sessionwidget.h b/examples/network/bearermonitor/sessionwidget.h new file mode 100644 index 0000000..cb6591e --- /dev/null +++ b/examples/network/bearermonitor/sessionwidget.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SESSIONWIDGET_H +#define SESSIONWIDGET_H + +#include "ui_sessionwidget.h" + +#include + +QTM_USE_NAMESPACE + +class SessionWidget : public QWidget, public Ui_SessionWidget +{ + Q_OBJECT + +public: + SessionWidget(const QNetworkConfiguration &config, QWidget *parent = 0); + ~SessionWidget(); + +private: + void updateSessionState(QNetworkSession::State state); + void updateSessionError(QNetworkSession::SessionError error); + +private Q_SLOTS: + void openSession(); + void openSyncSession(); + void closeSession(); + void stopSession(); + void updateSession(); + +private: + QNetworkSession *session; +}; + +#endif + diff --git a/examples/network/bearermonitor/sessionwidget.ui b/examples/network/bearermonitor/sessionwidget.ui new file mode 100644 index 0000000..f02f306 --- /dev/null +++ b/examples/network/bearermonitor/sessionwidget.ui @@ -0,0 +1,251 @@ + + + SessionWidget + + + + 0 + 0 + 340 + 220 + + + + Form + + + + + + + + Session ID: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + 0 + 0 + + + + Session State: + + + + + + + + 0 + 0 + + + + Invalid + + + + + + + + + + + Configuration: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Bearer: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Interface Name: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Interface GUID: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Last Error: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Error String + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Open + + + + + + + Blocking Open + + + + + + + Close + + + + + + + Stop + + + + + + + + + + diff --git a/src/network/bearer/bearer.pro b/src/network/bearer/bearer.pro new file mode 100644 index 0000000..2255b7c --- /dev/null +++ b/src/network/bearer/bearer.pro @@ -0,0 +1,163 @@ +# Qt bearer management library +TEMPLATE = lib +TARGET = QtBearer + +QT += network +include (../../common.pri) + +DEFINES += QT_BUILD_BEARER_LIB QT_MAKEDLL + +#DEFINES += BEARER_MANAGEMENT_DEBUG + +PUBLIC_HEADERS += qnetworkconfiguration.h \ + qnetworksession.h \ + qnetworkconfigmanager.h + +HEADERS += $$PUBLIC_HEADERS +SOURCES += qnetworksession.cpp \ + qnetworkconfigmanager.cpp \ + qnetworkconfiguration.cpp + +symbian: { + exists($${EPOCROOT}epoc32/release/winscw/udeb/cmmanager.lib)| \ + exists($${EPOCROOT}epoc32/release/armv5/lib/cmmanager.lib) { + message("Building with SNAP support") + DEFINES += SNAP_FUNCTIONALITY_AVAILABLE=1 + LIBS += -lcmmanager + } else { + message("Building without SNAP support") + LIBS += -lapengine + } + + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + + HEADERS += qnetworkconfigmanager_s60_p.h \ + qnetworkconfiguration_s60_p.h \ + qnetworksession_s60_p.h + SOURCES += qnetworkconfigmanager_s60_p.cpp \ + qnetworkconfiguration_s60_p.cpp \ + qnetworksession_s60_p.cpp + + LIBS += -lcommdb \ + -lapsettingshandlerui \ + -lconnmon \ + -lcentralrepository \ + -lesock \ + -linsock \ + -lecom \ + -lefsrv \ + -lnetmeta + + deploy.path = $${EPOCROOT} + exportheaders.sources = $$PUBLIC_HEADERS + exportheaders.path = epoc32/include + + for(header, exportheaders.sources) { + BLD_INF_RULES.prj_exports += "$$header $$deploy.path$$exportheaders.path/$$basename(header)" + } + + bearer_deployment.sources = QtBearer.dll + bearer_deployment.path = /sys/bin + DEPLOYMENT += bearer_deployment + + TARGET.CAPABILITY = All -TCB +} else { + maemo { + QT += dbus + CONFIG += link_pkgconfig + + exists(../debug) { + message("Enabling debug messages.") + DEFINES += BEARER_MANAGEMENT_DEBUG + } + + HEADERS += qnetworksession_maemo_p.h \ + qnetworkconfigmanager_maemo_p.h \ + qnetworkconfiguration_maemo_p.h + + SOURCES += qnetworkconfigmanager_maemo.cpp \ + qnetworksession_maemo.cpp + + documentation.path = $$QT_MOBILITY_PREFIX/doc + documentation.files = doc/html + + PKGCONFIG += glib-2.0 dbus-glib-1 gconf-2.0 osso-ic conninet + + CONFIG += create_pc create_prl + QMAKE_PKGCONFIG_REQUIRES = glib-2.0 dbus-glib-1 gconf-2.0 osso-ic conninet + pkgconfig.path = $$QT_MOBILITY_LIB/pkgconfig + pkgconfig.files = QtBearer.pc + + INSTALLS += pkgconfig documentation + + } else { + + DEFINES += BEARER_ENGINE + + HEADERS += qnetworkconfigmanager_p.h \ + qnetworkconfiguration_p.h \ + qnetworksession_p.h \ + qnetworksessionengine_p.h \ + qgenericengine_p.h + + SOURCES += qnetworkconfigmanager_p.cpp \ + qnetworksession_p.cpp \ + qnetworksessionengine.cpp \ + qgenericengine.cpp + + unix:!mac:contains(networkmanager_enabled, yes) { + contains(QT_CONFIG,dbus) { + DEFINES += BACKEND_NM + QT += dbus + + HEADERS += qnmdbushelper_p.h \ + qnetworkmanagerservice_p.h \ + qnmwifiengine_unix_p.h + + SOURCES += qnmdbushelper.cpp \ + qnetworkmanagerservice_p.cpp \ + qnmwifiengine_unix.cpp + } else { + message("NetworkManager backend requires Qt DBus support") + } + } + + win32: { + HEADERS += qnlaengine_win_p.h \ + qnetworksessionengine_win_p.h + + !wince*:HEADERS += qnativewifiengine_win_p.h + + SOURCES += qnlaengine_win.cpp + + !wince*:SOURCES += qnativewifiengine_win.cpp + + !wince*:LIBS += -lWs2_32 + wince*:LIBS += -lWs2 + } + } + macx: { + HEADERS += qcorewlanengine_mac_p.h + SOURCES+= qcorewlanengine_mac.mm + LIBS += -framework Foundation -framework SystemConfiguration + + contains(corewlan_enabled, yes) { + isEmpty(QMAKE_MAC_SDK) { + SDK6="yes" + } else { + contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.6.sdk") { + SDK6="yes" + } + } + + !isEmpty(SDK6) { + LIBS += -framework CoreWLAN + DEFINES += MAC_SDK_10_6 + } + } + + + } +} + +include(../../features/deploy.pri) diff --git a/src/network/bearer/qcorewlanengine_mac.mm b/src/network/bearer/qcorewlanengine_mac.mm new file mode 100644 index 0000000..5451615 --- /dev/null +++ b/src/network/bearer/qcorewlanengine_mac.mm @@ -0,0 +1,461 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qcorewlanengine_mac_p.h" +#include "qnetworkconfiguration_p.h" + +#include +#include +#include +#include + +#include + +#if defined(MAC_SDK_10_6) //not much functionality without this +#include +#include +#include +#include +#endif + +#include +#include +#include + +#include +QMap networkInterfaces; + +QTM_BEGIN_NAMESPACE + +Q_GLOBAL_STATIC(QCoreWlanEngine, coreWlanEngine) + +inline QString cfstringRefToQstring(CFStringRef cfStringRef) { +// return QString([cfStringRef UTF8String]); + QString retVal; + CFIndex maxLength = 2 * CFStringGetLength(cfStringRef) + 1/*zero term*/; // max UTF8 + char *cstring = new char[maxLength]; + if (CFStringGetCString(CFStringRef(cfStringRef), cstring, maxLength, kCFStringEncodingUTF8)) { + retVal = QString::fromUtf8(cstring); + } + delete cstring; + return retVal; +} + +inline CFStringRef qstringToCFStringRef(const QString &string) +{ + return CFStringCreateWithCharacters(0, reinterpret_cast(string.unicode()), + string.length()); +} + +inline NSString *qstringToNSString(const QString &qstr) +{ return [reinterpret_cast(qstringToCFStringRef(qstr)) autorelease]; } + +inline QString nsstringToQString(const NSString *nsstr) +{ return cfstringRefToQstring(reinterpret_cast(nsstr)); } + +inline QStringList nsarrayToQStringList(void *nsarray) +{ + QStringList result; + NSArray *array = static_cast(nsarray); + for (NSUInteger i=0; i<[array count]; ++i) + result << nsstringToQString([array objectAtIndex:i]); + return result; +} + +static QString qGetInterfaceType(const QString &interfaceString) +{ + return networkInterfaces.value(interfaceString); +} + +QCoreWlanEngine::QCoreWlanEngine(QObject *parent) +: QNetworkSessionEngine(parent) +{ + getAllScInterfaces(); + connect(&pollTimer, SIGNAL(timeout()), this, SIGNAL(configurationsChanged())); + pollTimer.setInterval(10000); +} + +QCoreWlanEngine::~QCoreWlanEngine() +{ +} + +QList QCoreWlanEngine::getWifiConfigurations() +{ + QMapIterator i(networkInterfaces); + while (i.hasNext()) { + i.next(); + QString interfaceName = i.key(); + if (i.value() == "WLAN") { + if(!isWifiReady(interfaceName)) { + qWarning() << "wifi not powered on"; + return QList(); + } else { + // QList profs = getWlanProfiles(interfaceName); + scanForSsids(interfaceName); + } + } else { + + } + } + return QList (); +} + +QList QCoreWlanEngine::getConfigurations(bool *ok) +{ + if (ok) + *ok = true; + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + + QList foundConfigurations; + QList wificonfigs = getWifiConfigurations(); + + uint identifier; + QMapIterator i(networkInterfaces); + while (i.hasNext()) { + i.next(); + if (i.value() == "WLAN") { + QList fetchedConfigurations = scanForSsids(i.key()); + for (int i = 0; i < fetchedConfigurations.count(); ++i) { + + QNetworkConfigurationPrivate *config = new QNetworkConfigurationPrivate; + config->name = fetchedConfigurations.at(i)->name; + config->isValid = fetchedConfigurations.at(i)->isValid; + config->id = fetchedConfigurations.at(i)->id; + + config->state = fetchedConfigurations.at(i)->state; + config->type = fetchedConfigurations.at(i)->type; + config->roamingSupported = fetchedConfigurations.at(i)->roamingSupported; + config->purpose = fetchedConfigurations.at(i)->purpose; + config->internet = fetchedConfigurations.at(i)->internet; + config->serviceInterface = fetchedConfigurations.at(i)->serviceInterface; + + identifier = config->name.toUInt(); + configurationInterface[identifier] = config->serviceInterface.name(); + foundConfigurations.append(config); + } + } + + QNetworkInterface interface = QNetworkInterface::interfaceFromName(i.key()); + QNetworkConfigurationPrivate *cpPriv = new QNetworkConfigurationPrivate; + const QString humanReadableName = interface.humanReadableName(); + cpPriv->name = humanReadableName.isEmpty() ? interface.name() : humanReadableName; + cpPriv->isValid = true; + + if (interface.index()) + identifier = interface.index(); + else + identifier = qHash(interface.hardwareAddress()); + + cpPriv->id = QString::number(identifier); + cpPriv->type = QNetworkConfiguration::InternetAccessPoint; + cpPriv->state = QNetworkConfiguration::Undefined; + + if (interface.flags() & QNetworkInterface::IsRunning) { + cpPriv->state = QNetworkConfiguration::Defined; + cpPriv->internet = true; + } + if ( !interface.addressEntries().isEmpty()) { + cpPriv->state |= QNetworkConfiguration::Active; + cpPriv->internet = true; + } + configurationInterface[identifier] = interface.name(); + foundConfigurations.append(cpPriv); + } + [autoreleasepool release]; + pollTimer.start(); + return foundConfigurations; +} + +QString QCoreWlanEngine::getInterfaceFromId(const QString &id) +{ + return configurationInterface.value(id.toUInt()); +} + +bool QCoreWlanEngine::hasIdentifier(const QString &id) +{ + return configurationInterface.contains(id.toUInt()); +} + +QString QCoreWlanEngine::bearerName(const QString &id) +{ + QString interface = getInterfaceFromId(id); + + if (interface.isEmpty()) + return QString(); + + return qGetInterfaceType(interface); +} + +void QCoreWlanEngine::connectToId(const QString &id) +{ + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + QString interfaceString = getInterfaceFromId(id); + + if(networkInterfaces.value(interfaceString) == "WLAN") { +#if defined(MAC_SDK_10_6) + CWInterface *wifiInterface = [CWInterface interfaceWithName: qstringToNSString(interfaceString)]; + CWConfiguration *userConfig = [ wifiInterface configuration]; + + NSSet *remNets = [userConfig rememberedNetworks]; //CWWirelessProfile + + NSEnumerator *enumerator = [remNets objectEnumerator]; + CWWirelessProfile *wProfile; + NSUInteger index=0; + while ((wProfile = [enumerator nextObject])) { //CWWirelessProfile + + if(id == nsstringToQString([wProfile ssid])) { + CW8021XProfile *user8021XProfile = nil; + user8021XProfile = [ wProfile user8021XProfile]; + + NSError *err = nil; + NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0]; + + if(user8021XProfile) { + [params setValue: user8021XProfile forKey:kCWAssocKey8021XProfile]; + } else { + [params setValue: [wProfile passphrase] forKey: kCWAssocKeyPassphrase]; + } + + NSDictionary *parametersDict = nil; + NSArray* apArray = [NSMutableArray arrayWithArray:[wifiInterface scanForNetworksWithParameters:parametersDict error:&err]]; + if(!err) { + for(uint row=0; row < [apArray count]; row++ ) { + CWNetwork *apNetwork = [apArray objectAtIndex:row]; + if([[apNetwork ssid] compare:[wProfile ssid]] == NSOrderedSame) { + bool result = [wifiInterface associateToNetwork: apNetwork parameters:[NSDictionary dictionaryWithDictionary:params] error:&err]; + if(!result) { + qWarning() <<"ERROR"<< nsstringToQString([err localizedDescription ]); + emit connectionError(id, ConnectError); + } else { + [autoreleasepool release]; + return; + } + } + } + } + } + index++; + } + emit connectionError(id, InterfaceLookupError); +#endif + } else { + // not wifi + } + emit connectionError(id, OperationNotSupported); + [autoreleasepool release]; +} + +void QCoreWlanEngine::disconnectFromId(const QString &id) +{ + QString interfaceString = getInterfaceFromId(id); + if(networkInterfaces.value(getInterfaceFromId(id)) == "WLAN") { //wifi only for now +#if defined(MAC_SDK_10_6) + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + CWInterface *wifiInterface = [CWInterface interfaceWithName: qstringToNSString(interfaceString)]; + [wifiInterface disassociate]; + if([[wifiInterface interfaceState]intValue] != kCWInterfaceStateInactive) { + emit connectionError(id, DisconnectionError); + } + [autoreleasepool release]; + return; +#endif + } else { + + } + emit connectionError(id, OperationNotSupported); +} + +void QCoreWlanEngine::requestUpdate() +{ + getAllScInterfaces(); + emit configurationsChanged(); +} + +QCoreWlanEngine *QCoreWlanEngine::instance() +{ + return coreWlanEngine(); +} + +QList QCoreWlanEngine::scanForSsids(const QString &interfaceName) +{ + QList foundConfigs; +#if defined(MAC_SDK_10_6) + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + + CWInterface *currentInterface = [CWInterface interfaceWithName:qstringToNSString(interfaceName)]; + NSError *err = nil; + NSDictionary *parametersDict = nil; + NSArray* apArray = [NSMutableArray arrayWithArray:[currentInterface scanForNetworksWithParameters:parametersDict error:&err]]; + + if(!err) { + for(uint row=0; row < [apArray count]; row++ ) { + CWNetwork *apNetwork = [apArray objectAtIndex:row]; + QNetworkConfigurationPrivate* cpPriv = new QNetworkConfigurationPrivate(); + QString networkSsid = nsstringToQString([apNetwork ssid]); + cpPriv->name = networkSsid; + cpPriv->isValid = true; + cpPriv->id = networkSsid; + cpPriv->internet = true; + cpPriv->type = QNetworkConfiguration::InternetAccessPoint; + cpPriv->serviceInterface = QNetworkInterface::interfaceFromName(nsstringToQString([[CWInterface interface] name])); + + CWWirelessProfile *networkProfile = apNetwork.wirelessProfile; + CW8021XProfile *userNetworkProfile = networkProfile.user8021XProfile; + if(!userNetworkProfile) { + } else { + qWarning() <<"Has profile!" ; + } + + if( [currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) { + QString interfaceSsidString = nsstringToQString( [currentInterface ssid]); + if( cpPriv->name == interfaceSsidString) { + cpPriv->state |= QNetworkConfiguration::Active; + } + } else { + if(isKnownSsid(cpPriv->serviceInterface.name(), networkSsid)) { + cpPriv->state = QNetworkConfiguration::Discovered; + } else { + cpPriv->state = QNetworkConfiguration::Defined; + } + } + if(!cpPriv->state) { + cpPriv->state = QNetworkConfiguration::Undefined; + } + if([[apNetwork securityMode ] intValue]== kCWSecurityModeOpen) + cpPriv->purpose = QNetworkConfiguration::PublicPurpose; + else + cpPriv->purpose = QNetworkConfiguration::PrivatePurpose; + foundConfigs.append(cpPriv); + } + } else { + qWarning() << "ERROR scanning for ssids" << nsstringToQString([err localizedDescription]) + < QCoreWlanEngine::getWlanProfiles(const QString &interfaceName) +{ + Q_UNUSED(interfaceName) +#if defined(MAC_SDK_10_6) +// for( CW8021XProfile *each8021XProfile in [CW8021XProfile allUser8021XProfiles] ) { +// qWarning() << "Profile name" << nsstringToQString([each8021XProfile ssid]); +// } + +#endif + return QList (); +} + +bool QCoreWlanEngine::getAllScInterfaces() +{ + networkInterfaces.clear(); + NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + + CFArrayRef interfaces = SCNetworkInterfaceCopyAll(); + if (interfaces != NULL) { + CFIndex interfaceCount; + CFIndex interfaceIndex; + interfaceCount = CFArrayGetCount(interfaces); + for (interfaceIndex = 0; interfaceIndex < interfaceCount; interfaceIndex++) { + + CFStringRef bsdName; + CFTypeRef thisInterface = CFArrayGetValueAtIndex(interfaces, interfaceIndex); + bsdName = SCNetworkInterfaceGetBSDName((SCNetworkInterfaceRef)thisInterface); + QString interfaceName = cfstringRefToQstring(bsdName); + QString typeStr; + CFStringRef type = SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef)thisInterface); + if ( CFEqual(type, kSCNetworkInterfaceTypeIEEE80211)) { + typeStr = "WLAN"; +// } else if (CFEqual(type, kSCNetworkInterfaceTypeBluetooth)) { +// typeStr = "Bluetooth"; + } else if(CFEqual(type, kSCNetworkInterfaceTypeEthernet)) { + typeStr = "Ethernet"; + } else if(CFEqual(type, kSCNetworkInterfaceTypeFireWire)) { + typeStr = "Ethernet"; //ok a bit fudged + } + if(!networkInterfaces.contains(interfaceName) && !typeStr.isEmpty()) { + networkInterfaces.insert(interfaceName,typeStr); + } + } + } + CFRelease(interfaces); + + [autoreleasepool release]; + return true; +} + +#include "moc_qcorewlanengine_mac_p.cpp" + +QTM_END_NAMESPACE + diff --git a/src/network/bearer/qcorewlanengine_mac_p.h b/src/network/bearer/qcorewlanengine_mac_p.h new file mode 100644 index 0000000..fc8e4b5 --- /dev/null +++ b/src/network/bearer/qcorewlanengine_mac_p.h @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOREWLANENGINE_P_H +#define QCOREWLANENGINE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qnetworksessionengine_p.h" +#include +#include +QTM_BEGIN_NAMESPACE + +class QNetworkConfigurationPrivate; + +class QCoreWlanEngine : public QNetworkSessionEngine +{ + Q_OBJECT + +public: + QCoreWlanEngine(QObject *parent = 0); + ~QCoreWlanEngine(); + + QList getConfigurations(bool *ok = 0); + QString getInterfaceFromId(const QString &id); + bool hasIdentifier(const QString &id); + + QString bearerName(const QString &id); + + void connectToId(const QString &id); + void disconnectFromId(const QString &id); + + void requestUpdate(); + + static QCoreWlanEngine *instance(); + static bool getAllScInterfaces(); + +private: + bool isWifiReady(const QString &dev); + QMap configurationInterface; + QTimer pollTimer; + QList scanForSsids(const QString &interfaceName); + + QList getWlanProfiles(const QString &interfaceName); + + QList getWifiConfigurations(); + bool isKnownSsid(const QString &interfaceName, const QString &ssid); +}; + +QTM_END_NAMESPACE + +#endif + diff --git a/src/network/bearer/qgenericengine.cpp b/src/network/bearer/qgenericengine.cpp new file mode 100644 index 0000000..184a69c --- /dev/null +++ b/src/network/bearer/qgenericengine.cpp @@ -0,0 +1,234 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qgenericengine_p.h" +#include "qnetworkconfiguration_p.h" + +#include +#include +#include +#include + +#include + +#ifdef Q_OS_WIN +#include "qnetworksessionengine_win_p.h" +#endif + +QTM_BEGIN_NAMESPACE + +Q_GLOBAL_STATIC(QGenericEngine, genericEngine) + +static QString qGetInterfaceType(const QString &interface) +{ +#ifdef Q_OS_WIN32 + unsigned long oid; + DWORD bytesWritten; + + NDIS_MEDIUM medium; + NDIS_PHYSICAL_MEDIUM physicalMedium; + + HANDLE handle = CreateFile((TCHAR *)QString("\\\\.\\%1").arg(interface).utf16(), 0, + FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); + if (handle == INVALID_HANDLE_VALUE) + return QString(); + + oid = OID_GEN_MEDIA_SUPPORTED; + bytesWritten = 0; + bool result = DeviceIoControl(handle, IOCTL_NDIS_QUERY_GLOBAL_STATS, &oid, sizeof(oid), + &medium, sizeof(medium), &bytesWritten, 0); + if (!result) { + CloseHandle(handle); + return QString(); + } + + oid = OID_GEN_PHYSICAL_MEDIUM; + bytesWritten = 0; + result = DeviceIoControl(handle, IOCTL_NDIS_QUERY_GLOBAL_STATS, &oid, sizeof(oid), + &physicalMedium, sizeof(physicalMedium), &bytesWritten, 0); + if (!result) { + CloseHandle(handle); + + if (medium == NdisMedium802_3) + return QLatin1String("Ethernet"); + else + return QString(); + } + + CloseHandle(handle); + + if (medium == NdisMedium802_3) { + switch (physicalMedium) { + case NdisPhysicalMediumWirelessLan: + return QLatin1String("WLAN"); + case NdisPhysicalMediumBluetooth: + return QLatin1String("Bluetooth"); + case NdisPhysicalMediumWiMax: + return QLatin1String("WiMAX"); + default: +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug() << "Physical Medium" << physicalMedium; +#endif + return QLatin1String("Ethernet"); + } + } + +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug() << medium << physicalMedium; +#endif +#else + Q_UNUSED(interface); +#endif + + return QString(); +} + +QGenericEngine::QGenericEngine(QObject *parent) +: QNetworkSessionEngine(parent) +{ + connect(&pollTimer, SIGNAL(timeout()), this, SIGNAL(configurationsChanged())); + pollTimer.setInterval(10000); +} + +QGenericEngine::~QGenericEngine() +{ +} + +QList QGenericEngine::getConfigurations(bool *ok) +{ + if (ok) + *ok = true; + + QList foundConfigurations; + + // Immediately after connecting with a wireless access point + // QNetworkInterface::allInterfaces() will sometimes return an empty list. Calling it again a + // second time results in a non-empty list. If we loose interfaces we will end up removing + // network configurations which will break current sessions. + QList interfaces = QNetworkInterface::allInterfaces(); + if (interfaces.isEmpty()) + interfaces = QNetworkInterface::allInterfaces(); + + // create configuration for each interface + while (!interfaces.isEmpty()) { + QNetworkInterface interface = interfaces.takeFirst(); + + if (!interface.isValid()) + continue; + + // ignore loopback interface + if (interface.flags() & QNetworkInterface::IsLoopBack) + continue; + + // ignore WLAN interface handled in seperate engine + if (qGetInterfaceType(interface.name()) == "WLAN") + continue; + + QNetworkConfigurationPrivate *cpPriv = new QNetworkConfigurationPrivate; + const QString humanReadableName = interface.humanReadableName(); + cpPriv->name = humanReadableName.isEmpty() ? interface.name() : humanReadableName; + cpPriv->isValid = true; + + uint identifier; + if (interface.index()) + identifier = qHash(QLatin1String("NLA:") + QString::number(interface.index())); + else + identifier = qHash(QLatin1String("NLA:") + interface.hardwareAddress()); + + cpPriv->id = QString::number(identifier); + cpPriv->state = QNetworkConfiguration::Discovered; + cpPriv->type = QNetworkConfiguration::InternetAccessPoint; + if (interface.flags() & QNetworkInterface::IsUp) + cpPriv->state |= QNetworkConfiguration::Active; + + configurationInterface[identifier] = interface.name(); + + foundConfigurations.append(cpPriv); + } + + pollTimer.start(); + + return foundConfigurations; +} + +QString QGenericEngine::getInterfaceFromId(const QString &id) +{ + return configurationInterface.value(id.toUInt()); +} + +bool QGenericEngine::hasIdentifier(const QString &id) +{ + return configurationInterface.contains(id.toUInt()); +} + +QString QGenericEngine::bearerName(const QString &id) +{ + QString interface = getInterfaceFromId(id); + + if (interface.isEmpty()) + return QString(); + + return qGetInterfaceType(interface); +} + +void QGenericEngine::connectToId(const QString &id) +{ + emit connectionError(id, OperationNotSupported); +} + +void QGenericEngine::disconnectFromId(const QString &id) +{ + emit connectionError(id, OperationNotSupported); +} + +void QGenericEngine::requestUpdate() +{ + emit configurationsChanged(); +} + +QGenericEngine *QGenericEngine::instance() +{ + return genericEngine(); +} + +#include "moc_qgenericengine_p.cpp" +QTM_END_NAMESPACE + diff --git a/src/network/bearer/qgenericengine_p.h b/src/network/bearer/qgenericengine_p.h new file mode 100644 index 0000000..976776e --- /dev/null +++ b/src/network/bearer/qgenericengine_p.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QGENERICENGINE_P_H +#define QGENERICENGINE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qnetworksessionengine_p.h" + +#include +#include + +QTM_BEGIN_NAMESPACE + +class QNetworkConfigurationPrivate; + +class QGenericEngine : public QNetworkSessionEngine +{ + Q_OBJECT + +public: + QGenericEngine(QObject *parent = 0); + ~QGenericEngine(); + + QList getConfigurations(bool *ok = 0); + QString getInterfaceFromId(const QString &id); + bool hasIdentifier(const QString &id); + + QString bearerName(const QString &id); + + void connectToId(const QString &id); + void disconnectFromId(const QString &id); + + void requestUpdate(); + + static QGenericEngine *instance(); + +private: + QMap configurationInterface; + QTimer pollTimer; +}; + +QTM_END_NAMESPACE + +#endif + diff --git a/src/network/bearer/qnativewifiengine_win.cpp b/src/network/bearer/qnativewifiengine_win.cpp new file mode 100644 index 0000000..d8fe5fb --- /dev/null +++ b/src/network/bearer/qnativewifiengine_win.cpp @@ -0,0 +1,726 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qnativewifiengine_win_p.h" +#include "qnetworkconfiguration_p.h" + +#include +#include +#include +#include + +#include + +#include +#undef interface + +QTM_BEGIN_NAMESPACE + +Q_GLOBAL_STATIC(QNativeWifiEngine, nativeWifiEngine) + +#define WLAN_MAX_NAME_LENGTH 256 +#define WLAN_MAX_PHY_TYPE_NUMBER 8 +#define WLAN_NOTIFICATION_SOURCE_ALL 0x0000ffff +#define WLAN_AVAILABLE_NETWORK_CONNECTED 1 +#define WLAN_AVAILABLE_NETWORK_HAS_PROFILE 2 +#define DOT11_SSID_MAX_LENGTH 32 + +struct WLAN_NOTIFICATION_DATA { + DWORD NotificationSource; + DWORD NotificationCode; + GUID InterfaceGuid; + DWORD dwDataSize; + PVOID pData; +}; + +enum WLAN_INTERFACE_STATE { + wlan_interface_state_not_ready = 0, + wlan_interface_state_connected, + wlan_interface_state_ad_hoc_network_formed, + wlan_interface_state_disconnecting, + wlan_interface_state_disconnected, + wlan_interface_state_associating, + wlan_interface_state_discovering, + wlan_interface_state_authenticating +}; + +struct WLAN_INTERFACE_INFO { + GUID InterfaceGuid; + WCHAR strInterfaceDescription[WLAN_MAX_NAME_LENGTH]; + WLAN_INTERFACE_STATE isState; +}; + +struct WLAN_INTERFACE_INFO_LIST { + DWORD dwNumberOfItems; + DWORD dwIndex; + WLAN_INTERFACE_INFO InterfaceInfo[1]; +}; + +struct DOT11_SSID { + ULONG uSSIDLength; + UCHAR ucSSID[DOT11_SSID_MAX_LENGTH]; +}; + +struct NDIS_OBJECT_HEADER { + UCHAR Type; + UCHAR Revision; + USHORT Size; +}; + +typedef UCHAR DOT11_MAC_ADDRESS[6]; +struct DOT11_BSSID_LIST { + NDIS_OBJECT_HEADER Header; + ULONG uNumberOfEntries; + ULONG uTotalNumOfEntries; + DOT11_MAC_ADDRESS BSSIDs[1]; +}; + +enum DOT11_BSS_TYPE { + dot11_BSS_type_infrastructure = 1, + dot11_BSS_type_independent = 2, + dot11_BSS_type_any = 3 +}; + +enum DOT11_PHY_TYPE { + dot11_phy_type_unknown = 0, + dot11_phy_type_any = dot11_phy_type_unknown, + dot11_phy_type_fhss = 1, + dot11_phy_type_dsss = 2, + dot11_phy_type_irbaseband = 3, + dot11_phy_type_ofdm = 4, + dot11_phy_type_hrdsss = 5, + dot11_phy_type_erp = 6, + dot11_phy_type_ht = 7, + dot11_phy_type_IHV_start = 0x80000000, + dot11_phy_type_IHV_end = 0xffffffff +}; + +enum DOT11_AUTH_ALGORITHM { + DOT11_AUTH_ALGO_80211_OPEN = 1, + DOT11_AUTH_ALGO_80211_SHARED_KEY = 2, + DOT11_AUTH_ALGO_WPA = 3, + DOT11_AUTH_ALGO_WPA_PSK = 4, + DOT11_AUTH_ALGO_WPA_NONE = 5, + DOT11_AUTH_ALGO_RSNA = 6, + DOT11_AUTH_ALGO_RSNA_PSK = 7, + DOT11_AUTH_ALGO_IHV_START = 0x80000000, + DOT11_AUTH_ALGO_IHV_END = 0xffffffff +}; + +enum DOT11_CIPHER_ALGORITHM { + DOT11_CIPHER_ALGO_NONE = 0x00, + DOT11_CIPHER_ALGO_WEP40 = 0x01, + DOT11_CIPHER_ALGO_TKIP = 0x02, + DOT11_CIPHER_ALGO_CCMP = 0x04, + DOT11_CIPHER_ALGO_WEP104 = 0x05, + DOT11_CIPHER_ALGO_WPA_USE_GROUP = 0x100, + DOT11_CIPHER_ALGO_RSN_USE_GROUP = 0x100, + DOT11_CIPHER_ALGO_WEP = 0x101, + DOT11_CIPHER_ALGO_IHV_START = 0x80000000, + DOT11_CIPHER_ALGO_IHV_END = 0xffffffff +}; + +struct WLAN_AVAILABLE_NETWORK { + WCHAR strProfileName[WLAN_MAX_NAME_LENGTH]; + DOT11_SSID dot11Ssid; + DOT11_BSS_TYPE dot11BssType; + ULONG uNumberOfBssids; + BOOL bNetworkConnectable; + DWORD wlanNotConnectableReason; + ULONG uNumberOfPhyTypes; + DOT11_PHY_TYPE dot11PhyTypes[WLAN_MAX_PHY_TYPE_NUMBER]; + BOOL bMorePhyTypes; + ULONG wlanSignalQuality; + BOOL bSecurityEnabled; + DOT11_AUTH_ALGORITHM dot11DefaultAuthAlgorithm; + DOT11_CIPHER_ALGORITHM dot11DefaultCipherAlgorithm; + DWORD dwFlags; + DWORD dwReserved; +}; + +struct WLAN_AVAILABLE_NETWORK_LIST { + DWORD dwNumberOfItems; + DWORD dwIndex; + WLAN_AVAILABLE_NETWORK Network[1]; +}; + +enum WLAN_INTF_OPCODE { + wlan_intf_opcode_autoconf_start = 0x000000000, + wlan_intf_opcode_autoconf_enabled, + wlan_intf_opcode_background_scan_enabled, + wlan_intf_opcode_media_streaming_mode, + wlan_intf_opcode_radio_state, + wlan_intf_opcode_bss_type, + wlan_intf_opcode_interface_state, + wlan_intf_opcode_current_connection, + wlan_intf_opcode_channel_number, + wlan_intf_opcode_supported_infrastructure_auth_cipher_pairs, + wlan_intf_opcode_supported_adhoc_auth_cipher_pairs, + wlan_intf_opcode_supported_country_or_region_string_list, + wlan_intf_opcode_current_operation_mode, + wlan_intf_opcode_supported_safe_mode, + wlan_intf_opcode_certified_safe_mode, + wlan_intf_opcode_autoconf_end = 0x0fffffff, + wlan_intf_opcode_msm_start = 0x10000100, + wlan_intf_opcode_statistics, + wlan_intf_opcode_rssi, + wlan_intf_opcode_msm_end = 0x1fffffff, + wlan_intf_opcode_security_start = 0x20010000, + wlan_intf_opcode_security_end = 0x2fffffff, + wlan_intf_opcode_ihv_start = 0x30000000, + wlan_intf_opcode_ihv_end = 0x3fffffff +}; + +enum WLAN_OPCODE_VALUE_TYPE { + wlan_opcode_value_type_query_only = 0, + wlan_opcode_value_type_set_by_group_policy, + wlan_opcode_value_type_set_by_user, + wlan_opcode_value_type_invalid +}; + +enum WLAN_CONNECTION_MODE { + wlan_connection_mode_profile = 0, + wlan_connection_mode_temporary_profile, + wlan_connection_mode_discovery_secure, + wlan_connection_mode_discovery_unsecure, + wlan_connection_mode_auto, + wlan_connection_mode_invalid +}; + +struct WLAN_CONNECTION_PARAMETERS { + WLAN_CONNECTION_MODE wlanConnectionMode; + LPCWSTR strProfile; + DOT11_SSID *pDot11Ssid; + DOT11_BSSID_LIST *pDesiredBssidList; + DOT11_BSS_TYPE dot11BssType; + DWORD dwFlags; +}; + +struct WLAN_RAW_DATA { + DWORD dwDataSize; + BYTE DataBlob[1]; +}; + +enum WLAN_NOTIFICATION_ACM { + wlan_notification_acm_start = 0, + wlan_notification_acm_autoconf_enabled, + wlan_notification_acm_autoconf_disabled, + wlan_notification_acm_background_scan_enabled, + wlan_notification_acm_background_scan_disabled, + wlan_notification_acm_bss_type_change, + wlan_notification_acm_power_setting_change, + wlan_notification_acm_scan_complete, + wlan_notification_acm_scan_fail, + wlan_notification_acm_connection_start, + wlan_notification_acm_connection_complete, + wlan_notification_acm_connection_attempt_fail, + wlan_notification_acm_filter_list_change, + wlan_notification_acm_interface_arrival, + wlan_notification_acm_interface_removal, + wlan_notification_acm_profile_change, + wlan_notification_acm_profile_name_change, + wlan_notification_acm_profiles_exhausted, + wlan_notification_acm_network_not_available, + wlan_notification_acm_network_available, + wlan_notification_acm_disconnecting, + wlan_notification_acm_disconnected, + wlan_notification_acm_adhoc_network_state_change, + wlan_notification_acm_end +}; + +struct WLAN_ASSOCIATION_ATTRIBUTES { + DOT11_SSID dot11Ssid; + DOT11_BSS_TYPE dot11BssType; + DOT11_MAC_ADDRESS dot11Bssid; + DOT11_PHY_TYPE dot11PhyType; + ULONG uDot11PhyIndex; + ULONG wlanSignalQuality; + ULONG ulRxRate; + ULONG ulTxRate; +}; + +struct WLAN_SECURITY_ATTRIBUTES { + BOOL bSecurityEnabled; + BOOL bOneXEnabled; + DOT11_AUTH_ALGORITHM dot11AuthAlgorithm; + DOT11_CIPHER_ALGORITHM dot11CipherAlgorithm; +}; + +struct WLAN_CONNECTION_ATTRIBUTES { + WLAN_INTERFACE_STATE isState; + WLAN_CONNECTION_MODE wlanConnectionMode; + WCHAR strProfileName[WLAN_MAX_NAME_LENGTH]; + WLAN_ASSOCIATION_ATTRIBUTES wlanAssociationAttributes; + WLAN_SECURITY_ATTRIBUTES wlanSecurityAttributes; +}; + +typedef void (WINAPI *WLAN_NOTIFICATION_CALLBACK)(WLAN_NOTIFICATION_DATA *, PVOID); + +typedef DWORD (WINAPI *WlanOpenHandleProto) + (DWORD dwClientVersion, PVOID pReserved, PDWORD pdwNegotiatedVersion, PHANDLE phClientHandle); +typedef DWORD (WINAPI *WlanRegisterNotificationProto) + (HANDLE hClientHandle, DWORD dwNotifSource, BOOL bIgnoreDuplicate, + WLAN_NOTIFICATION_CALLBACK funcCallback, PVOID pCallbackContext, + PVOID pReserved, PDWORD pdwPrevNotifSource); +typedef DWORD (WINAPI *WlanEnumInterfacesProto) + (HANDLE hClientHandle, PVOID pReserved, WLAN_INTERFACE_INFO_LIST **ppInterfaceList); +typedef DWORD (WINAPI *WlanGetAvailableNetworkListProto) + (HANDLE hClientHandle, const GUID* pInterfaceGuid, DWORD dwFlags, PVOID pReserved, + WLAN_AVAILABLE_NETWORK_LIST **ppAvailableNetworkList); +typedef DWORD (WINAPI *WlanQueryInterfaceProto) + (HANDLE hClientHandle, const GUID *pInterfaceGuid, WLAN_INTF_OPCODE OpCode, PVOID pReserved, + PDWORD pdwDataSize, PVOID *ppData, WLAN_OPCODE_VALUE_TYPE *pWlanOpcodeValueType); +typedef DWORD (WINAPI *WlanConnectProto) + (HANDLE hClientHandle, const GUID *pInterfaceGuid, + const WLAN_CONNECTION_PARAMETERS *pConnectionParameters, PVOID pReserved); +typedef DWORD (WINAPI *WlanDisconnectProto) + (HANDLE hClientHandle, const GUID *pInterfaceGuid, PVOID pReserved); +typedef DWORD (WINAPI *WlanScanProto) + (HANDLE hClientHandle, const GUID *pInterfaceGuid, const DOT11_SSID *pDot11Ssid, + const WLAN_RAW_DATA *pIeData, PVOID pReserved); +typedef VOID (WINAPI *WlanFreeMemoryProto)(PVOID pMemory); +typedef DWORD (WINAPI *WlanCloseHandleProto)(HANDLE hClientHandle, PVOID pReserved); + +static WlanOpenHandleProto local_WlanOpenHandle = 0; +static WlanRegisterNotificationProto local_WlanRegisterNotification = 0; +static WlanEnumInterfacesProto local_WlanEnumInterfaces = 0; +static WlanGetAvailableNetworkListProto local_WlanGetAvailableNetworkList = 0; +static WlanQueryInterfaceProto local_WlanQueryInterface = 0; +static WlanConnectProto local_WlanConnect = 0; +static WlanDisconnectProto local_WlanDisconnect = 0; +static WlanScanProto local_WlanScan = 0; +static WlanFreeMemoryProto local_WlanFreeMemory = 0; +static WlanCloseHandleProto local_WlanCloseHandle = 0; + +static void resolveLibrary() +{ + static volatile bool triedResolve = false; + + if (!triedResolve) { +#ifndef QT_NO_THREAD + QMutexLocker locker(QMutexPool::globalInstanceGet(&local_WlanOpenHandle)); +#endif + + if (!triedResolve) { + local_WlanOpenHandle = (WlanOpenHandleProto) + QLibrary::resolve(QLatin1String("wlanapi.dll"), "WlanOpenHandle"); + local_WlanRegisterNotification = (WlanRegisterNotificationProto) + QLibrary::resolve(QLatin1String("wlanapi.dll"), "WlanRegisterNotification"); + local_WlanEnumInterfaces = (WlanEnumInterfacesProto) + QLibrary::resolve(QLatin1String("wlanapi.dll"), "WlanEnumInterfaces"); + local_WlanGetAvailableNetworkList = (WlanGetAvailableNetworkListProto) + QLibrary::resolve(QLatin1String("wlanapi.dll"), "WlanGetAvailableNetworkList"); + local_WlanQueryInterface = (WlanQueryInterfaceProto) + QLibrary::resolve(QLatin1String("wlanapi.dll"), "WlanQueryInterface"); + local_WlanConnect = (WlanConnectProto) + QLibrary::resolve(QLatin1String("wlanapi.dll"), "WlanConnect"); + local_WlanDisconnect = (WlanDisconnectProto) + QLibrary::resolve(QLatin1String("wlanapi.dll"), "WlanDisconnect"); + local_WlanScan = (WlanScanProto) + QLibrary::resolve(QLatin1String("wlanapi.dll"), "WlanScan"); + local_WlanFreeMemory = (WlanFreeMemoryProto) + QLibrary::resolve(QLatin1String("wlanapi.dll"), "WlanFreeMemory"); + local_WlanCloseHandle = (WlanCloseHandleProto) + QLibrary::resolve(QLatin1String("wlanapi.dll"), "WlanCloseHandle"); + + triedResolve = true; + } + } +} + +void qNotificationCallback(WLAN_NOTIFICATION_DATA *data, QNativeWifiEngine *d) +{ + Q_UNUSED(d); + + switch (data->NotificationCode) { + case wlan_notification_acm_connection_complete: + case wlan_notification_acm_disconnected: + d->emitConfigurationsChanged(); + break; + default: + qDebug() << "wlan unknown notification"; + } +} + +QNativeWifiEngine::QNativeWifiEngine(QObject *parent) +: QNetworkSessionEngine(parent), handle(0) +{ + DWORD clientVersion; + + DWORD result = local_WlanOpenHandle(1, 0, &clientVersion, &handle); + if (result != ERROR_SUCCESS) { + if (result != ERROR_SERVICE_NOT_ACTIVE) + qWarning("%s: WlanOpenHandle failed with error %ld\n", __FUNCTION__, result); + + return; + } + + result = local_WlanRegisterNotification(handle, WLAN_NOTIFICATION_SOURCE_ALL, true, + WLAN_NOTIFICATION_CALLBACK(qNotificationCallback), + this, 0, 0); + if (result != ERROR_SUCCESS) + qWarning("%s: WlanRegisterNotification failed with error %ld\n", __FUNCTION__, result); + + // On Windows XP SP2 and SP3 only connection and disconnection notifications are available. + // We need to poll for changes in available wireless networks. + connect(&pollTimer, SIGNAL(timeout()), this, SIGNAL(configurationsChanged())); + pollTimer.setInterval(10000); +} + +QNativeWifiEngine::~QNativeWifiEngine() +{ + local_WlanCloseHandle(handle, 0); +} + +QList QNativeWifiEngine::getConfigurations(bool *ok) +{ + if (ok) + *ok = false; + + QList foundConfigurations; + + // enumerate interfaces + WLAN_INTERFACE_INFO_LIST *interfaceList; + DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); + if (result != ERROR_SUCCESS) { + qWarning("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result); + return foundConfigurations; + } + + for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) { + const WLAN_INTERFACE_INFO &interface = interfaceList->InterfaceInfo[i]; + + WLAN_AVAILABLE_NETWORK_LIST *networkList; + result = local_WlanGetAvailableNetworkList(handle, &interface.InterfaceGuid, + 3, 0, &networkList); + if (result != ERROR_SUCCESS) { + qWarning("%s: WlanGetAvailableNetworkList failed with error %ld\n", + __FUNCTION__, result); + continue; + } + + QStringList seenNetworks; + + for (unsigned int j = 0; j < networkList->dwNumberOfItems; ++j) { + WLAN_AVAILABLE_NETWORK &network = networkList->Network[j]; + + QString networkName; + + if (network.strProfileName[0] != 0) { + networkName = QString::fromWCharArray(network.strProfileName); + } else { + networkName = QByteArray(reinterpret_cast(network.dot11Ssid.ucSSID), + network.dot11Ssid.uSSIDLength); + } + + // don't add duplicate networks + if (seenNetworks.contains(networkName)) + continue; + else + seenNetworks.append(networkName); + + QNetworkConfigurationPrivate *cpPriv = new QNetworkConfigurationPrivate; + + cpPriv->isValid = true; + + cpPriv->name = networkName; + cpPriv->id = QString::number(qHash(QLatin1String("WLAN:") + cpPriv->name)); + + if (!(network.dwFlags & WLAN_AVAILABLE_NETWORK_HAS_PROFILE)) + cpPriv->state = QNetworkConfiguration::Undefined; + + if (network.strProfileName[0] != 0) { + if (network.bNetworkConnectable) { + if (network.dwFlags & WLAN_AVAILABLE_NETWORK_CONNECTED) + cpPriv->state = QNetworkConfiguration::Active; + else + cpPriv->state = QNetworkConfiguration::Discovered; + } else { + cpPriv->state = QNetworkConfiguration::Defined; + } + } + + cpPriv->type = QNetworkConfiguration::InternetAccessPoint; + + foundConfigurations.append(cpPriv); + } + + local_WlanFreeMemory(networkList); + } + + local_WlanFreeMemory(interfaceList); + + if (ok) + *ok = true; + + pollTimer.start(); + + return foundConfigurations; +} + +QString QNativeWifiEngine::getInterfaceFromId(const QString &id) +{ + // enumerate interfaces + WLAN_INTERFACE_INFO_LIST *interfaceList; + DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); + if (result != ERROR_SUCCESS) { + qWarning("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result); + return QString(); + } + + for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) { + const WLAN_INTERFACE_INFO &interface = interfaceList->InterfaceInfo[i]; + + DWORD dataSize; + WLAN_CONNECTION_ATTRIBUTES *connectionAttributes; + result = local_WlanQueryInterface(handle, &interface.InterfaceGuid, + wlan_intf_opcode_current_connection, 0, &dataSize, + reinterpret_cast(&connectionAttributes), 0); + if (result != ERROR_SUCCESS) { + if (result != ERROR_INVALID_STATE) + qWarning("%s: WlanQueryInterface failed with error %ld\n", __FUNCTION__, result); + + continue; + } + + if (qHash(QLatin1String("WLAN:") + + QString::fromWCharArray(connectionAttributes->strProfileName)) == id.toUInt()) { + QString guid("{%1-%2-%3-%4%5-%6%7%8%9%10%11}"); + + guid = guid.arg(interface.InterfaceGuid.Data1, 8, 16, QChar('0')); + guid = guid.arg(interface.InterfaceGuid.Data2, 4, 16, QChar('0')); + guid = guid.arg(interface.InterfaceGuid.Data3, 4, 16, QChar('0')); + for (int i = 0; i < 8; ++i) + guid = guid.arg(interface.InterfaceGuid.Data4[i], 2, 16, QChar('0')); + + local_WlanFreeMemory(connectionAttributes); + + return guid.toUpper(); + } + + local_WlanFreeMemory(connectionAttributes); + } + + return QString(); +} + +bool QNativeWifiEngine::hasIdentifier(const QString &id) +{ + // enumerate interfaces + WLAN_INTERFACE_INFO_LIST *interfaceList; + DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); + if (result != ERROR_SUCCESS) { + qWarning("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result); + return false; + } + + for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) { + const WLAN_INTERFACE_INFO &interface = interfaceList->InterfaceInfo[i]; + + WLAN_AVAILABLE_NETWORK_LIST *networkList; + result = local_WlanGetAvailableNetworkList(handle, &interface.InterfaceGuid, + 3, 0, &networkList); + if (result != ERROR_SUCCESS) { + qWarning("%s: WlanGetAvailableNetworkList failed with error %ld\n", + __FUNCTION__, result); + continue; + } + + for (unsigned int j = 0; j < networkList->dwNumberOfItems; ++j) { + WLAN_AVAILABLE_NETWORK &network = networkList->Network[j]; + + QString networkName; + + if (network.strProfileName[0] != 0) { + networkName = QString::fromWCharArray(network.strProfileName); + } else { + networkName = QByteArray(reinterpret_cast(network.dot11Ssid.ucSSID), + network.dot11Ssid.uSSIDLength); + } + + if (qHash(QLatin1String("WLAN:") + networkName) == id.toUInt()) { + local_WlanFreeMemory(networkList); + local_WlanFreeMemory(interfaceList); + return true; + } + } + + local_WlanFreeMemory(networkList); + } + + local_WlanFreeMemory(interfaceList); + + return false; +} + +QString QNativeWifiEngine::bearerName(const QString &) +{ + return QLatin1String("WLAN"); +} + +void QNativeWifiEngine::connectToId(const QString &id) +{ + WLAN_INTERFACE_INFO_LIST *interfaceList; + DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); + if (result != ERROR_SUCCESS) { + qWarning("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result); + emit connectionError(id, InterfaceLookupError); + return; + } + + QString profile; + + for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) { + const WLAN_INTERFACE_INFO &interface = interfaceList->InterfaceInfo[i]; + + WLAN_AVAILABLE_NETWORK_LIST *networkList; + result = local_WlanGetAvailableNetworkList(handle, &interface.InterfaceGuid, + 3, 0, &networkList); + if (result != ERROR_SUCCESS) { + qWarning("%s: WlanGetAvailableNetworkList failed with error %ld\n", + __FUNCTION__, result); + continue; + } + + for (unsigned int j = 0; j < networkList->dwNumberOfItems; ++j) { + WLAN_AVAILABLE_NETWORK &network = networkList->Network[j]; + + profile = QString::fromWCharArray(network.strProfileName); + + if (qHash(QLatin1String("WLAN:") + profile) == id.toUInt()) + break; + else + profile.clear(); + } + + local_WlanFreeMemory(networkList); + + if (!profile.isEmpty()) { + WLAN_CONNECTION_PARAMETERS parameters; + parameters.wlanConnectionMode = wlan_connection_mode_profile; + parameters.strProfile = reinterpret_cast(profile.utf16()); + parameters.pDot11Ssid = 0; + parameters.pDesiredBssidList = 0; + parameters.dot11BssType = dot11_BSS_type_any; + parameters.dwFlags = 0; + + DWORD result = local_WlanConnect(handle, &interface.InterfaceGuid, ¶meters, 0); + if (result != ERROR_SUCCESS) { + qWarning("%s: WlanConnect failed with error %ld\n", __FUNCTION__, result); + emit connectionError(id, ConnectError); + break; + } + + break; + } + } + + local_WlanFreeMemory(interfaceList); + + if (profile.isEmpty()) + emit connectionError(id, InterfaceLookupError); +} + +void QNativeWifiEngine::disconnectFromId(const QString &id) +{ + QString interface = getInterfaceFromId(id); + + if (interface.isEmpty()) { + emit connectionError(id, InterfaceLookupError); + return; + } + + QStringList split = interface.mid(1, interface.length() - 2).split('-'); + + GUID guid; + guid.Data1 = split.at(0).toUInt(0, 16); + guid.Data2 = split.at(1).toUShort(0, 16); + guid.Data3 = split.at(2).toUShort(0, 16); + guid.Data4[0] = split.at(3).left(2).toUShort(0, 16); + guid.Data4[1] = split.at(3).right(2).toUShort(0, 16); + for (int i = 0; i < 6; ++i) + guid.Data4[i + 2] = split.at(4).mid(i*2, 2).toUShort(0, 16); + + DWORD result = local_WlanDisconnect(handle, &guid, 0); + if (result != ERROR_SUCCESS) { + qWarning("%s: WlanDisconnect failed with error %ld\n", __FUNCTION__, result); + emit connectionError(id, DisconnectionError); + return; + } +} + +void QNativeWifiEngine::requestUpdate() +{ + // enumerate interfaces + WLAN_INTERFACE_INFO_LIST *interfaceList; + DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); + if (result != ERROR_SUCCESS) { + qWarning("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result); + return; + } + + for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) { + result = local_WlanScan(handle, &interfaceList->InterfaceInfo[i].InterfaceGuid, 0, 0, 0); + if (result != ERROR_SUCCESS) + qWarning("%s: WlanScan failed with error %ld\n", __FUNCTION__, result); + } +} + +QNativeWifiEngine *QNativeWifiEngine::instance() +{ + resolveLibrary(); + + // native wifi dll not available + if (!local_WlanOpenHandle) + return 0; + + QNativeWifiEngine *engine = nativeWifiEngine(); + + // could not initialise subsystem + if (engine && engine->handle == 0) + return 0; + + return engine; +} + +#include "moc_qnativewifiengine_win_p.cpp" + +QTM_END_NAMESPACE diff --git a/src/network/bearer/qnativewifiengine_win_p.h b/src/network/bearer/qnativewifiengine_win_p.h new file mode 100644 index 0000000..0d5bcb0 --- /dev/null +++ b/src/network/bearer/qnativewifiengine_win_p.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNATIVEWIFIENGINE_P_H +#define QNATIVEWIFIENGINE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qnetworksessionengine_p.h" + +#include + +QTM_BEGIN_NAMESPACE + +class QNetworkConfigurationPrivate; + +class QNativeWifiEngine : public QNetworkSessionEngine +{ + Q_OBJECT + +public: + QNativeWifiEngine(QObject *parent = 0); + ~QNativeWifiEngine(); + + QList getConfigurations(bool *ok = 0); + QString getInterfaceFromId(const QString &id); + bool hasIdentifier(const QString &id); + + QString bearerName(const QString &id); + + void connectToId(const QString &id); + void disconnectFromId(const QString &id); + + void requestUpdate(); + + inline void emitConfigurationsChanged() { emit configurationsChanged(); } + + static QNativeWifiEngine *instance(); + +private: + QTimer pollTimer; + + Qt::HANDLE handle; +}; + +QTM_END_NAMESPACE + +#endif diff --git a/src/network/bearer/qnetworkconfigmanager.cpp b/src/network/bearer/qnetworkconfigmanager.cpp new file mode 100644 index 0000000..264f0df --- /dev/null +++ b/src/network/bearer/qnetworkconfigmanager.cpp @@ -0,0 +1,333 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qnetworkconfigmanager.h" + +#ifdef Q_OS_SYMBIAN +#include "qnetworkconfigmanager_s60_p.h" +#else +#include "qnetworkconfigmanager_p.h" +#endif + +QTM_BEGIN_NAMESPACE + +Q_GLOBAL_STATIC(QNetworkConfigurationManagerPrivate, connManager); + +/*! + \class QNetworkConfigurationManager + + \brief The QNetworkConfigurationManager class manages the network configurations provided + by the system. + + \inmodule QtNetwork + \ingroup bearer + + QNetworkConfigurationManager provides access to the network configurations known to the system and + enables applications to detect the system capabilities (with regards to network sessions) at runtime. + + A QNetworkConfiguration abstracts a set of configuration options describing how a + network interface has to be configured to connect to a particular target network. + QNetworkConfigurationManager maintains and updates the global list of + QNetworkConfigurations. Applications can access and filter this list via + allConfigurations(). If a new configuration is added or an existing one is removed or changed + the configurationAdded(), configurationRemoved() and configurationChanged() signals are emitted + respectively. + + The defaultConfiguration() can be used when intending to immediately create a new + network session without caring about the particular configuration. It returns + a \l QNetworkConfiguration::Discovered configuration. If there are not any + discovered ones an invalid configuration is returned. + + Some configuration updates may require some time to perform updates. A WLAN scan is + such an example. Unless the platform performs internal updates it may be required to + manually trigger configuration updates via QNetworkConfigurationManager::updateConfigurations(). + The completion of the update process is indicted by emitting the updateCompleted() + signal. The update process ensures that every existing QNetworkConfiguration instance + is updated. There is no need to ask for a renewed configuration list via allConfigurations(). + + \sa QNetworkConfiguration +*/ + +/*! + \fn void QNetworkConfigurationManager::configurationAdded(const QNetworkConfiguration& config) + + This signal is emitted whenever a new network configuration is added to the system. The new + configuration is specified by \a config. +*/ + +/*! + \fn void QNetworkConfigurationManager::configurationRemoved(const QNetworkConfiguration& configuration) + + This signal is emitted when a configuration is about to be removed from the system. The removed + \a configuration is invalid but retains name and identifier. +*/ + +/*! + \fn void QNetworkConfigurationManager::updateCompleted() + + This signal is emitted when the configuration update has been completed. Such an update can + be initiated via \l updateConfigurations(). +*/ + +/*! \fn void QNetworkConfigurationManager::configurationChanged(const QNetworkConfiguration& config) + + This signal is emitted when the \l {QNetworkConfiguration::state()}{state} of \a config changes. +*/ + +/*! + \fn void QNetworkConfigurationManager::onlineStateChanged(bool isOnline) + + This signal is emitted when the device changes from online to offline mode or vice versa. + \a isOnline represents the new state of the device. + + The state is considered to be online for as long as + \l{allConfigurations()}{allConfigurations}(QNetworkConfiguration::Active) returns a list with + at least one entry. +*/ + +/*! + \enum QNetworkConfigurationManager::Capability + + Specifies the system capabilities of the bearer API. The possible values are: + + \value CanStartAndStopInterfaces Network sessions and their underlying access points can be + started and stopped. If this flag is not set QNetworkSession + can only monitor but not influence the state of access points. + On some platforms this feature may require elevated user + permissions. This option is platform specific and may not + always be available. + \value DirectConnectionRouting Network sessions and their sockets can be bound to a + particular network interface. Any packet that passes through + the socket goes to the specified network interface and thus + disregards standard routing table entries. This may be useful + when two interfaces can reach overlapping IP ranges or an + application has specific needs in regards to target networks. + This option is platform specific and may not always be + available. + \value SystemSessionSupport If this flag is set the underlying platform ensures that a + network interface is not shut down until the last network + session has been \l{QNetworkSession::close()}{closed()}. This + works across multiple processes. If the platform session + support is missing this API can only ensure the above behavior + for network sessions within the same process. + In general mobile platforms (such as Symbian/S60) have such + support whereas most desktop platform lack this capability. + \value ApplicationLevelRoaming The system gives applications control over the systems roaming + behavior. Applications can initiate roaming (in case the + current link is not suitable) and are consulted if the system + has identified a more suitable access point. + \value ForcedRoaming The system disconnects an existing access point and reconnects + via a more suitable one. The application does not have any + control over this process and has to reconnect its active + sockets. + \value DataStatistics If this flag is set QNetworkSession can provide statistics + about transmitted and received data. +*/ + +/*! + Constructs a QNetworkConfigurationManager with the given \a parent. +*/ +QNetworkConfigurationManager::QNetworkConfigurationManager( QObject* parent ) + : QObject(parent) +{ + QNetworkConfigurationManagerPrivate* priv = connManager(); + connect(priv, SIGNAL(configurationAdded(QNetworkConfiguration)), + this, SIGNAL(configurationAdded(QNetworkConfiguration))); + connect(priv, SIGNAL(configurationRemoved(QNetworkConfiguration)), + this, SIGNAL(configurationRemoved(QNetworkConfiguration))); + connect(priv, SIGNAL(configurationUpdateComplete()), + this, SIGNAL(updateCompleted())); + connect(priv, SIGNAL(onlineStateChanged(bool)), + this, SIGNAL(onlineStateChanged(bool))); + connect(priv, SIGNAL(configurationChanged(QNetworkConfiguration)), + this, SIGNAL(configurationChanged(QNetworkConfiguration))); +} + +/*! + Frees the resources associated with the QNetworkConfigurationManager object. +*/ +QNetworkConfigurationManager::~QNetworkConfigurationManager() +{ +} + + +/*! + Returns the default configuration to be used. This function always returns a discovered + configuration; otherwise an invalid configuration. + + In some cases it may be required to call updateConfigurations() and wait for the + updateCompleted() signal before calling this function. + + \sa allConfigurations() +*/ +QNetworkConfiguration QNetworkConfigurationManager::defaultConfiguration() const +{ + return connManager()->defaultConfiguration(); +} + +/*! + Returns the list of configurations which comply with the given \a filter. + + By default this function returns all (defined and undefined) configurations. + + A wireless network with a particular SSID may only be accessible in a + certain area despite the fact that the system has a valid configuration + for it. Therefore the filter flag may be used to limit the list to + discovered and possibly connected configurations only. + + If \a filter is set to zero this function returns all possible configurations. + + Note that this function returns the states for all configurations as they are known at + the time of this function call. If for instance a configuration of type WLAN is defined + the system may have to perform a WLAN scan in order to determine whether it is + actually available. To obtain the most accurate state updateConfigurations() should + be used to update each configuration's state. Note that such an update may require + some time. It's completion is signalled by updateCompleted(). In the absence of a + configuration update this function returns the best estimate at the time of the call. +*/ +QList QNetworkConfigurationManager::allConfigurations(QNetworkConfiguration::StateFlags filter) const +{ + QList result; + QNetworkConfigurationManagerPrivate* conPriv = connManager(); + QList cpsIdents = conPriv->accessPointConfigurations.keys(); + + //find all InternetAccessPoints + foreach( QString ii, cpsIdents) { + QExplicitlySharedDataPointer p = + conPriv->accessPointConfigurations.value(ii); + if ( (p->state & filter) == filter ) { + QNetworkConfiguration pt; + pt.d = conPriv->accessPointConfigurations.value(ii); + result << pt; + } + } + + //find all service networks + cpsIdents = conPriv->snapConfigurations.keys(); + foreach( QString ii, cpsIdents) { + QExplicitlySharedDataPointer p = + conPriv->snapConfigurations.value(ii); + if ( (p->state & filter) == filter ) { + QNetworkConfiguration pt; + pt.d = conPriv->snapConfigurations.value(ii); + result << pt; + } + } + + return result; +} + +/*! + Returns the QNetworkConfiguration for \a identifier; otherwise returns an + invalid QNetworkConfiguration. + + \sa QNetworkConfiguration::identifier() +*/ +QNetworkConfiguration QNetworkConfigurationManager::configurationFromIdentifier(const QString& identifier) const +{ + QNetworkConfigurationManagerPrivate* conPriv = connManager(); + QNetworkConfiguration item; + if (conPriv->accessPointConfigurations.contains(identifier)) + item.d = conPriv->accessPointConfigurations.value(identifier); + else if (conPriv->snapConfigurations.contains(identifier)) + item.d = conPriv->snapConfigurations.value(identifier); + else if (conPriv->userChoiceConfigurations.contains(identifier)) + item.d = conPriv->userChoiceConfigurations.value(identifier); + return item; + +} + +/*! + Returns true if the system is considered to be connected to another device via an active + network interface; otherwise returns false. + + This is equivalent to the following code snippet: + + \code + QNetworkConfigurationManager mgr; + QList activeConfigs = mgr.allConfigurations(QNetworkConfiguration::Active) + if (activeConfigs.count() > 0) + Q_ASSERT(mgr.isOnline()) + else + Q_ASSERT(!mgr.isOnline()) + \endcode + + \sa onlineStateChanged() +*/ +bool QNetworkConfigurationManager::isOnline() const +{ + QNetworkConfigurationManagerPrivate* conPriv = connManager(); + Q_UNUSED(conPriv); + QList activeConfigs = allConfigurations(QNetworkConfiguration::Active); + return activeConfigs.count() > 0; +} + +/*! + Returns the capabilities supported by the current platform. +*/ +QNetworkConfigurationManager::Capabilities QNetworkConfigurationManager::capabilities() const +{ + return connManager()->capFlags; +} + +/*! + Initiates an update of all configurations. This may be used to initiate WLAN scans or other + time consuming updates which may be required to obtain the correct state for configurations. + + This call is asynchronous. On completion of this update the updateCompleted() signal is + emitted. If new configurations are discovered or old ones were removed or changed the update + process may trigger the emission of one or multiple configurationAdded(), + configurationRemoved() and configurationChanged() signals. + + If a configuration state changes as a result of this update all existing QNetworkConfiguration + instances are updated automatically. + + \sa allConfigurations() +*/ +void QNetworkConfigurationManager::updateConfigurations() +{ + connManager()->performAsyncConfigurationUpdate(); +} + +#include "moc_qnetworkconfigmanager.cpp" + +QTM_END_NAMESPACE + diff --git a/src/network/bearer/qnetworkconfigmanager.h b/src/network/bearer/qnetworkconfigmanager.h new file mode 100644 index 0000000..98641f6 --- /dev/null +++ b/src/network/bearer/qnetworkconfigmanager.h @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNETWORKCONFIGURATIONMANAGER_H +#define QNETWORKCONFIGURATIONMANAGER_H + +#include "qmobilityglobal.h" + +#include +#include "qnetworkconfiguration.h" + +QT_BEGIN_HEADER + +QTM_BEGIN_NAMESPACE + +class QNetworkConfigurationManagerPrivate; +class Q_BEARER_EXPORT QNetworkConfigurationManager : public QObject +{ + Q_OBJECT + +public: + + enum Capability { + CanStartAndStopInterfaces = 0x00000001, + DirectConnectionRouting = 0x00000002, + SystemSessionSupport = 0x00000004, + ApplicationLevelRoaming = 0x00000008, + ForcedRoaming = 0x00000010, + DataStatistics = 0x00000020 + }; + + Q_DECLARE_FLAGS(Capabilities, Capability) + + QNetworkConfigurationManager( QObject* parent = 0 ); + virtual ~QNetworkConfigurationManager(); + + + QNetworkConfigurationManager::Capabilities capabilities() const; + + QNetworkConfiguration defaultConfiguration() const; + QList allConfigurations(QNetworkConfiguration::StateFlags flags = 0) const; + QNetworkConfiguration configurationFromIdentifier(const QString& identifier) const; + void updateConfigurations(); + + bool isOnline() const; + +Q_SIGNALS: + void configurationAdded(const QNetworkConfiguration& config); + void configurationRemoved(const QNetworkConfiguration& config); + void configurationChanged(const QNetworkConfiguration& config); + void onlineStateChanged(bool isOnline); + void updateCompleted(); + +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QNetworkConfigurationManager::Capabilities) + +QTM_END_NAMESPACE + +QT_END_HEADER + +#endif //QNETWORKCONFIGURATIONMANAGER_H + diff --git a/src/network/bearer/qnetworkconfigmanager_maemo.cpp b/src/network/bearer/qnetworkconfigmanager_maemo.cpp new file mode 100644 index 0000000..795b054 --- /dev/null +++ b/src/network/bearer/qnetworkconfigmanager_maemo.cpp @@ -0,0 +1,760 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "qnetworkconfigmanager_maemo_p.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +QTM_BEGIN_NAMESPACE + +#define IAP "/system/osso/connectivity/IAP" +static int iap_prefix_len; +static void notify_iap(GConfClient *client, guint id, + GConfEntry *entry, gpointer user_data); + + +/* The IapAddTimer is a helper class that makes sure we update + * the configuration only after all gconf additions to certain + * iap are finished (after a certain timeout) + */ +class _IapAddTimer : public QObject +{ + Q_OBJECT + +public: + _IapAddTimer() {} + ~_IapAddTimer() + { + if (timer.isActive()) { + QObject::disconnect(&timer, SIGNAL(timeout()), this, SLOT(timeout())); + timer.stop(); + } + } + + void add(QString& iap_id, QNetworkConfigurationManagerPrivate *d); + + QString iap_id; + QTimer timer; + QNetworkConfigurationManagerPrivate *d; + +public Q_SLOTS: + void timeout(); +}; + + +void _IapAddTimer::add(QString& id, QNetworkConfigurationManagerPrivate *d_ptr) +{ + iap_id = id; + d = d_ptr; + + if (timer.isActive()) { + QObject::disconnect(&timer, SIGNAL(timeout()), this, SLOT(timeout())); + timer.stop(); + } + timer.setSingleShot(true); + QObject::connect(&timer, SIGNAL(timeout()), this, SLOT(timeout())); + timer.start(1500); +} + + +void _IapAddTimer::timeout() +{ + d->addConfiguration(iap_id); +} + + +class IapAddTimer { + QHash timers; + +public: + IapAddTimer() {} + ~IapAddTimer() {} + + void add(QString& iap_id, QNetworkConfigurationManagerPrivate *d); + void del(QString& iap_id); + void removeAll(); +}; + + +void IapAddTimer::removeAll() +{ + QHashIterator i(timers); + while (i.hasNext()) { + i.next(); + _IapAddTimer *t = i.value(); + delete t; + } + timers.clear(); +} + + +void IapAddTimer::add(QString& iap_id, QNetworkConfigurationManagerPrivate *d) +{ + if (timers.contains(iap_id)) { + _IapAddTimer *iap = timers.value(iap_id); + iap->add(iap_id, d); + } else { + _IapAddTimer *iap = new _IapAddTimer; + iap->add(iap_id, d); + timers.insert(iap_id, iap); + } +} + +void IapAddTimer::del(QString& iap_id) +{ + if (timers.contains(iap_id)) { + _IapAddTimer *iap = timers.take(iap_id); + delete iap; + } +} + + +class IapMonitor +{ +public: + IapMonitor() : first_call(true) { } + friend void notify_iap(GConfClient *, guint, + GConfEntry *entry, gpointer user_data); + + void setup(QNetworkConfigurationManagerPrivate *d); + void cleanup(); + +private: + bool first_call; + + void iapAdded(const char *key, GConfEntry *entry); + void iapDeleted(const char *key, GConfEntry *entry); + + Maemo::IAPMonitor *iap; + QNetworkConfigurationManagerPrivate *d; + IapAddTimer timers; +}; + +Q_GLOBAL_STATIC(IapMonitor, iapMonitor); + + +/* Notify func that is called when IAP is added or deleted */ +static void notify_iap(GConfClient *, guint, + GConfEntry *entry, gpointer user_data) +{ + const char *key = gconf_entry_get_key(entry); + if (key && g_str_has_prefix(key, IAP)) { + IapMonitor *ptr = (IapMonitor *)user_data; + if (gconf_entry_get_value(entry)) { + ptr->iapAdded(key, entry); + } else { + ptr->iapDeleted(key, entry); + } + } +} + + +void IapMonitor::setup(QNetworkConfigurationManagerPrivate *d_ptr) +{ + if (first_call) { + d = d_ptr; + iap_prefix_len = strlen(IAP); + iap = new Maemo::IAPMonitor(notify_iap, (gpointer)this); + first_call = false; + } +} + + +void IapMonitor::cleanup() +{ + if (!first_call) { + delete iap; + timers.removeAll(); + first_call = true; + } +} + + +void IapMonitor::iapAdded(const char *key, GConfEntry * /*entry*/) +{ + //qDebug("Notify called for added element: %s=%s", gconf_entry_get_key(entry), gconf_value_to_string(gconf_entry_get_value(entry))); + + /* We cannot know when the IAP is fully added to gconf, so a timer is + * installed instead. When the timer expires we hope that IAP is added ok. + */ + QString iap_id = QString(key + iap_prefix_len + 1).section('/',0,0); + timers.add(iap_id, d); +} + + +void IapMonitor::iapDeleted(const char *key, GConfEntry * /*entry*/) +{ + //qDebug("Notify called for deleted element: %s", gconf_entry_get_key(entry)); + + /* We are only interested in IAP deletions so we skip the config entries + */ + if (strstr(key + iap_prefix_len + 1, "/")) { + //qDebug("Deleting IAP config %s", key+iap_prefix_len); + return; + } + + QString iap_id = key + iap_prefix_len + 1; + d->deleteConfiguration(iap_id); +} + + + +void QNetworkConfigurationManagerPrivate::registerPlatformCapabilities() +{ + capFlags |= QNetworkConfigurationManager::CanStartAndStopInterfaces; + capFlags |= QNetworkConfigurationManager::DataStatistics; + capFlags |= QNetworkConfigurationManager::ForcedRoaming; +} + + +static inline QString network_attrs_to_security(uint network_attrs) +{ + uint cap = 0; + nwattr2cap(network_attrs, &cap); /* from libicd-network-wlan-dev.h */ + if (cap & WLANCOND_OPEN) + return "NONE"; + else if (cap & WLANCOND_WEP) + return "WEP"; + else if (cap & WLANCOND_WPA_PSK) + return "WPA_PSK"; + else if (cap & WLANCOND_WPA_EAP) + return "WPA_EAP"; + return ""; +} + + +struct SSIDInfo { + QString iap_id; + QString wlan_security; +}; + + +void QNetworkConfigurationManagerPrivate::configurationChanged(QNetworkConfigurationPrivate *ptr) +{ + QNetworkConfiguration item; + item.d = ptr; + emit configurationChanged(item); +} + +void QNetworkConfigurationManagerPrivate::deleteConfiguration(QString& iap_id) +{ + /* Called when IAPs are deleted in gconf, in this case we do not scan + * or read all the IAPs from gconf because it might take too much power + * (multiple applications would need to scan and read all IAPs from gconf) + */ + if (accessPointConfigurations.contains(iap_id)) { + QExplicitlySharedDataPointer priv = accessPointConfigurations.take(iap_id); + if (priv.data()) { + priv->isValid = false; +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug() << "IAP" << iap_id << "was removed from storage."; +#endif + + QNetworkConfiguration item; + item.d = priv; + emit configurationRemoved(item); + configChanged(priv.data(), false); + } else + qWarning("Configuration not found for IAP %s", iap_id.toAscii().data()); + } else { +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug("IAP: %s, already missing from the known list", iap_id.toAscii().data()); +#endif + } +} + + +uint32_t QNetworkConfigurationManagerPrivate::getNetworkAttrs(bool is_iap_id, + QString& iap_id, + QString& iap_type, + QString security_method) +{ + guint network_attr = 0; + dbus_uint32_t cap = 0; + + if (iap_type == "WLAN_INFRA") + cap |= WLANCOND_INFRA; + else if (iap_type == "WLAN_ADHOC") + cap |= WLANCOND_ADHOC; + + if (security_method.isEmpty() && (cap & (WLANCOND_INFRA | WLANCOND_ADHOC))) { + Maemo::IAPConf saved_ap(iap_id); + security_method = saved_ap.value("wlan_security").toString(); + } + + if (!security_method.isEmpty()) { + if (security_method == "WEP") + cap |= WLANCOND_WEP; + else if (security_method == "WPA_PSK") + cap |= WLANCOND_WPA_PSK; + else if (security_method == "WPA_EAP") + cap |= WLANCOND_WPA_EAP; + else if (security_method == "NONE") + cap |= WLANCOND_OPEN; + + if (cap & (WLANCOND_WPA_PSK | WLANCOND_WPA_EAP)) { + Maemo::IAPConf saved_iap(iap_id); + bool wpa2_only = saved_iap.value("EAP_wpa2_only_mode").toBool(); + if (wpa2_only) { + cap |= WLANCOND_WPA2; + } + } + } + + cap2nwattr(cap, &network_attr); + if (is_iap_id) + network_attr |= ICD_NW_ATTR_IAPNAME; + + return (uint32_t)network_attr; +} + + +void QNetworkConfigurationManagerPrivate::addConfiguration(QString& iap_id) +{ + if (!accessPointConfigurations.contains(iap_id)) { + Maemo::IAPConf saved_iap(iap_id); + QString iap_type = saved_iap.value("type").toString(); + if (!iap_type.isEmpty()) { + QNetworkConfigurationPrivate* cpPriv = new QNetworkConfigurationPrivate(); + cpPriv->name = saved_iap.value("name").toString(); + if (cpPriv->name.isEmpty()) + cpPriv->name = iap_id; + cpPriv->isValid = true; + cpPriv->id = iap_id; + cpPriv->iap_type = iap_type; + cpPriv->network_attrs = getNetworkAttrs(true, iap_id, iap_type, QString()); + cpPriv->service_id = saved_iap.value("service_id").toString(); + cpPriv->service_type = saved_iap.value("service_type").toString(); + if (iap_type.startsWith("WLAN")) { + QByteArray ssid = saved_iap.value("wlan_ssid").toByteArray(); + if (ssid.isEmpty()) { + qWarning() << "Cannot get ssid for" << iap_id; + } + } + cpPriv->type = QNetworkConfiguration::InternetAccessPoint; + cpPriv->state = QNetworkConfiguration::Defined; + + QExplicitlySharedDataPointer ptr(cpPriv); + accessPointConfigurations.insert(iap_id, ptr); + +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug("IAP: %s, name: %s, added to known list", iap_id.toAscii().data(), cpPriv->name.toAscii().data()); +#endif + + QNetworkConfiguration item; + item.d = ptr; + emit configurationAdded(item); + configChanged(ptr.data(), true); + } else { + qWarning("IAP %s does not have \"type\" field defined, skipping this IAP.", iap_id.toAscii().data()); + } + } else { +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug() << "IAP" << iap_id << "already in gconf."; +#endif + + /* Check if the data in gconf changed and update configuration + * accordingly + */ + QExplicitlySharedDataPointer ptr = accessPointConfigurations.take(iap_id); + if (ptr.data()) { + Maemo::IAPConf changed_iap(iap_id); + QString iap_type = changed_iap.value("type").toString(); + bool update_needed = false; /* if IAP type or ssid changed, we need to change the state */ + + ptr->network_attrs = getNetworkAttrs(true, iap_id, iap_type, QString()); + ptr->service_id = changed_iap.value("service_id").toString(); + ptr->service_type = changed_iap.value("service_type").toString(); + + if (!iap_type.isEmpty()) { + ptr->name = changed_iap.value("name").toString(); + if (ptr->name.isEmpty()) + ptr->name = iap_id; + ptr->isValid = true; + if (ptr->iap_type != iap_type) { + ptr->iap_type = iap_type; + update_needed = true; + } + if (iap_type.startsWith("WLAN")) { + QByteArray ssid = changed_iap.value("wlan_ssid").toByteArray(); + if (ssid.isEmpty()) { + qWarning() << "Cannot get ssid for" << iap_id; + } + if (ptr->network_id != ssid) { + ptr->network_id = ssid; + update_needed = true; + } + } + } + accessPointConfigurations.insert(iap_id, ptr); + if (update_needed) { + ptr->type = QNetworkConfiguration::InternetAccessPoint; + if (ptr->state != QNetworkConfiguration::Defined) { + ptr->state = QNetworkConfiguration::Defined; + configurationChanged(ptr.data()); + } + } + } else { + qWarning("Cannot find IAP %s from current configuration although it should be there.", iap_id.toAscii().data()); + } + } +} + + +void QNetworkConfigurationManagerPrivate::updateConfigurations() +{ + /* Contains known network id (like ssid) from storage */ + QMultiHash knownConfigs; + + /* All the scanned access points */ + QList scanned; + + /* Turn on IAP monitoring */ + iapMonitor()->setup(this); + + if (firstUpdate) { + /* We create a default configuration which is a pseudo config */ + QNetworkConfigurationPrivate* cpPriv = new QNetworkConfigurationPrivate(); + cpPriv->name = "UserChoice"; + cpPriv->state = QNetworkConfiguration::Discovered; + cpPriv->isValid = true; + cpPriv->id = OSSO_IAP_ANY; + cpPriv->type = QNetworkConfiguration::UserChoice; + cpPriv->purpose = QNetworkConfiguration::UnknownPurpose; + cpPriv->roamingSupported = false; + cpPriv->manager = this; + QExplicitlySharedDataPointer ptr(cpPriv); + userChoiceConfigurations.insert(cpPriv->id, ptr); + } + + /* We return currently configured IAPs in the first run and do the WLAN + * scan in subsequent runs. + */ + QList all_iaps; + Maemo::IAPConf::getAll(all_iaps); + + foreach (QString escaped_iap_id, all_iaps) { + QByteArray ssid; + + /* The key that is returned by getAll() needs to be unescaped */ + gchar *unescaped_id = gconf_unescape_key(escaped_iap_id.toUtf8().data(), -1); + QString iap_id = QString((char *)unescaped_id); + g_free(unescaped_id); + + Maemo::IAPConf saved_ap(iap_id); + bool is_temporary = saved_ap.value("temporary").toBool(); + if (is_temporary) { +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug() << "IAP" << iap_id << "is temporary, skipping it."; +#endif + continue; + } + + QString iap_type = saved_ap.value("type").toString(); + if (iap_type.startsWith("WLAN")) { + ssid = saved_ap.value("wlan_ssid").toByteArray(); + if (ssid.isEmpty()) { + qWarning() << "Cannot get ssid for" << iap_id; + continue; + } + + QString security_method = saved_ap.value("wlan_security").toString(); + SSIDInfo *info = new SSIDInfo; + info->iap_id = iap_id; + info->wlan_security = security_method; + knownConfigs.insert(ssid, info); + } else if (iap_type.isEmpty()) { + qWarning() << "IAP" << iap_id << "network type is not set! Skipping it"; + continue; + } else { +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug() << "IAP" << iap_id << "network type is" << iap_type; +#endif + ssid.clear(); + } + + if (!accessPointConfigurations.contains(iap_id)) { + QNetworkConfigurationPrivate* cpPriv = new QNetworkConfigurationPrivate(); + //cpPriv->name = iap_info.value().toString(); + cpPriv->name = saved_ap.value("name").toString(); + if (cpPriv->name.isEmpty()) + if (!ssid.isEmpty() && ssid.size() > 0) + cpPriv->name = ssid.data(); + else + cpPriv->name = iap_id; + cpPriv->isValid = true; + cpPriv->id = iap_id; + cpPriv->network_id = ssid; + cpPriv->network_attrs = getNetworkAttrs(true, iap_id, iap_type, QString()); + cpPriv->iap_type = iap_type; + cpPriv->service_id = saved_ap.value("service_id").toString(); + cpPriv->service_type = saved_ap.value("service_type").toString(); + cpPriv->type = QNetworkConfiguration::InternetAccessPoint; + cpPriv->state = QNetworkConfiguration::Defined; + cpPriv->manager = this; + + QExplicitlySharedDataPointer ptr(cpPriv); + accessPointConfigurations.insert(iap_id, ptr); + +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug("IAP: %s, name: %s, ssid: %s, added to known list", iap_id.toAscii().data(), cpPriv->name.toAscii().data(), !ssid.isEmpty() ? ssid.data() : "-"); +#endif + } else { +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug("IAP: %s, ssid: %s, already exists in the known list", iap_id.toAscii().data(), !ssid.isEmpty() ? ssid.data() : "-"); +#endif + } + } + + if (!firstUpdate) { + QStringList scannedNetworkTypes; + QStringList networkTypesToScan; + QString error; + Maemo::Icd icd(ICD_SHORT_SCAN_TIMEOUT); + + scannedNetworkTypes = icd.scan(ICD_SCAN_REQUEST_ACTIVE, + networkTypesToScan, + scanned, + error); + if (!error.isEmpty()) { + qWarning() << "Network scanning failed" << error; + } else { +#ifdef BEARER_MANAGEMENT_DEBUG + if (!scanned.isEmpty()) + qDebug() << "Scan returned" << scanned.size() << "networks"; + else + qDebug() << "Scan returned nothing."; +#endif + } + } + + + /* This is skipped in the first update as scanned size is zero */ + if (!scanned.isEmpty()) + for (int i=0; i priv = accessPointConfigurations.take(iapid); + if (priv.data()) { + priv->state = QNetworkConfiguration::Discovered; /* Defined is set automagically */ + priv->network_attrs = ap.scan.network_attrs; + priv->service_id = ap.scan.service_id; + priv->service_type = ap.scan.service_type; + priv->service_attrs = ap.scan.service_attrs; + + configurationChanged(priv.data()); + accessPointConfigurations.insert(iapid, priv); +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug("IAP: %s, ssid: %s, discovered", iapid.toAscii().data(), priv->network_id.data()); +#endif + + if (!ap.scan.network_type.startsWith("WLAN")) + continue; // not a wlan AP + + /* Remove scanned AP from known configurations so that we can + * emit configurationRemoved signal later + */ + QList known_iaps = knownConfigs.values(priv->network_id); + rescan_list: + if (!known_iaps.isEmpty()) { + for (int k=0; kiap_id << "security" << iap->wlan_security << "scan" << network_attrs_to_security(ap.scan.network_attrs); +#endif + + if (iap->wlan_security == + network_attrs_to_security(ap.scan.network_attrs)) { + /* Remove IAP from the list */ + knownConfigs.remove(priv->network_id, iap); +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug() << "Removed IAP" << iap->iap_id << "from unknown config"; +#endif + known_iaps.removeAt(k); + delete iap; + goto rescan_list; + } + } + } + } else { + qWarning() << "IAP" << iapid << "is missing in configuration."; + } + + } else { + /* Non saved access point data */ + QByteArray scanned_ssid = ap.scan.network_id; + QNetworkConfigurationPrivate* cpPriv = new QNetworkConfigurationPrivate(); + QString hrs = scanned_ssid.data(); + + cpPriv->name = ap.network_name.isEmpty() ? hrs : ap.network_name; + cpPriv->isValid = true; + cpPriv->id = scanned_ssid.data(); // Note: id is now ssid, it should be set to IAP id if the IAP is saved + cpPriv->network_id = scanned_ssid; + cpPriv->iap_type = ap.scan.network_type; + cpPriv->network_attrs = ap.scan.network_attrs; + cpPriv->service_id = ap.scan.service_id; + cpPriv->service_type = ap.scan.service_type; + cpPriv->service_attrs = ap.scan.service_attrs; + cpPriv->manager = this; + + cpPriv->type = QNetworkConfiguration::InternetAccessPoint; + cpPriv->state = QNetworkConfiguration::Undefined; + + QExplicitlySharedDataPointer ptr(cpPriv); + accessPointConfigurations.insert(cpPriv->id, ptr); + +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug() << "IAP with network id" << cpPriv->id << "was found in the scan."; +#endif + + QNetworkConfiguration item; + item.d = ptr; + emit configurationAdded(item); + } + } + + + /* Remove non existing iaps since last update */ + if (!firstUpdate) { + QHashIterator i(knownConfigs); + while (i.hasNext()) { + i.next(); + SSIDInfo *iap = i.value(); + QString iap_id = iap->iap_id; + //qDebug() << i.key() << ": " << iap_id; + + QExplicitlySharedDataPointer priv = accessPointConfigurations.take(iap_id); + if (priv.data()) { + priv->isValid = false; +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug() << "IAP" << iap_id << "was removed as it was not found in scan."; +#endif + + QNetworkConfiguration item; + item.d = priv; + emit configurationRemoved(item); + configChanged(priv.data(), false); + + //if we would have SNAP support we would have to remove the references + //from existing ServiceNetworks to the removed access point configuration + } + } + } + + + QMutableHashIterator i(knownConfigs); + while (i.hasNext()) { + i.next(); + SSIDInfo *iap = i.value(); + delete iap; + i.remove(); + } + + if (!firstUpdate) + emit configurationUpdateComplete(); + + if (firstUpdate) + firstUpdate = false; +} + + +QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration() +{ + /* Here we just return [ANY] request to icd and let the icd decide which + * IAP to connect. + */ + QNetworkConfiguration item; + if (userChoiceConfigurations.contains(OSSO_IAP_ANY)) + item.d = userChoiceConfigurations.value(OSSO_IAP_ANY); + return item; +} + + +void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate() +{ + QTimer::singleShot(0, this, SLOT(updateConfigurations())); +} + + +void QNetworkConfigurationManagerPrivate::cleanup() +{ + iapMonitor()->cleanup(); +} + + +void QNetworkConfigurationManagerPrivate::configChanged(QNetworkConfigurationPrivate *ptr, bool added) +{ + if (added) { + if (ptr && ptr->state == QNetworkConfiguration::Active) { + onlineConfigurations++; + if (!firstUpdate && onlineConfigurations == 1) + emit onlineStateChanged(true); + } + } else { + if (ptr && ptr->state == QNetworkConfiguration::Active) { + onlineConfigurations--; + if (!firstUpdate && onlineConfigurations == 0) + emit onlineStateChanged(false); + if (onlineConfigurations < 0) + onlineConfigurations = 0; + } + } +} + + +#include "qnetworkconfigmanager_maemo.moc" +#include "moc_qnetworkconfigmanager_maemo_p.cpp" + +QTM_END_NAMESPACE diff --git a/src/network/bearer/qnetworkconfigmanager_maemo_p.h b/src/network/bearer/qnetworkconfigmanager_maemo_p.h new file mode 100644 index 0000000..e182495 --- /dev/null +++ b/src/network/bearer/qnetworkconfigmanager_maemo_p.h @@ -0,0 +1,141 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNETWORKCONFIGURATIONMANAGERPRIVATE_H +#define QNETWORKCONFIGURATIONMANAGERPRIVATE_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the QLibrary class. This header file may change from +// version to version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +#include +#include + +QTM_BEGIN_NAMESPACE + + +class QNetworkConfigurationManagerPrivate : public QObject +{ + Q_OBJECT +public: + QNetworkConfigurationManagerPrivate() + : QObject(0), capFlags(0), firstUpdate(true), onlineConfigurations(0) + { + registerPlatformCapabilities(); + updateConfigurations(); + } + + virtual ~QNetworkConfigurationManagerPrivate() + { + QList configIdents = snapConfigurations.keys(); + foreach(const QString oldIface, configIdents) { + QExplicitlySharedDataPointer priv = snapConfigurations.take(oldIface); + priv->isValid = false; + priv->id.clear(); + } + + configIdents = accessPointConfigurations.keys(); + foreach(const QString oldIface, configIdents) { + QExplicitlySharedDataPointer priv = accessPointConfigurations.take(oldIface); + priv->isValid = false; + priv->id.clear(); + } + + configIdents = userChoiceConfigurations.keys(); + foreach(const QString oldIface, configIdents) { + QExplicitlySharedDataPointer priv = userChoiceConfigurations.take(oldIface); + priv->isValid = false; + priv->id.clear(); + } + + cleanup(); + } + + QNetworkConfiguration defaultConfiguration(); + + QNetworkConfigurationManager::Capabilities capFlags; + void registerPlatformCapabilities(); + + void performAsyncConfigurationUpdate(); + + //this table contains an up to date list of all configs at any time. + //it must be updated if configurations change, are added/removed or + //the members of ServiceNetworks change + QHash > accessPointConfigurations; + QHash > snapConfigurations; + QHash > userChoiceConfigurations; + bool firstUpdate; + int onlineConfigurations; + friend class IapMonitor; + void cleanup(); + void deleteConfiguration(QString &iap_id); + void addConfiguration(QString &iap_id); + void configurationChanged(QNetworkConfigurationPrivate *ptr); + uint32_t getNetworkAttrs(bool is_iap_id, QString& iap_id, + QString& iap_type, QString security_method); + void configChanged(QNetworkConfigurationPrivate *ptr, bool added); + friend class QNetworkSessionPrivate; + +public slots: + void updateConfigurations(); + +Q_SIGNALS: + void configurationAdded(const QNetworkConfiguration& config); + void configurationRemoved(const QNetworkConfiguration& config); + void configurationUpdateComplete(); + void configurationChanged(const QNetworkConfiguration& config); + void onlineStateChanged(bool isOnline); +}; + +QTM_END_NAMESPACE + +#endif //QNETWORKCONFIGURATIONMANAGERPRIVATE_H diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp new file mode 100644 index 0000000..8b15f41 --- /dev/null +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -0,0 +1,450 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qnetworkconfigmanager_p.h" +#include "qgenericengine_p.h" + +#ifdef Q_OS_WIN +#include "qnlaengine_win_p.h" +#endif +#ifdef Q_OS_WIN32 +#include "qnativewifiengine_win_p.h" +#endif +#if defined(BACKEND_NM) +#include "qnmwifiengine_unix_p.h" +#endif +#ifdef Q_OS_DARWIN +#include "qcorewlanengine_mac_p.h" +#endif + +#include +#include +#include + +QTM_BEGIN_NAMESPACE + +void QNetworkConfigurationManagerPrivate::registerPlatformCapabilities() +{ + capFlags = QNetworkConfigurationManager::ForcedRoaming; +} + +void QNetworkConfigurationManagerPrivate::configurationAdded(QNetworkConfigurationPrivate *cpPriv, QNetworkSessionEngine *engine) +{ + QExplicitlySharedDataPointer ptr(new QNetworkConfigurationPrivate); + + ptr.data()->isValid = cpPriv->isValid; + ptr.data()->name = cpPriv->name; + ptr.data()->id = cpPriv->id; + ptr.data()->state = cpPriv->state; + ptr.data()->type = cpPriv->type; + ptr.data()->roamingSupported = cpPriv->roamingSupported; + ptr.data()->purpose = cpPriv->purpose; + ptr.data()->internet = cpPriv->internet; + + accessPointConfigurations.insert(cpPriv->id, ptr); + configurationEngine.insert(cpPriv->id, engine); + + if (!firstUpdate) { + QNetworkConfiguration item; + item.d = ptr; + emit configurationAdded(item); + } + + if (ptr.data()->state == QNetworkConfiguration::Active) { + ++onlineConfigurations; + if (!firstUpdate && onlineConfigurations == 1) + emit onlineStateChanged(true); + } +} + +void QNetworkConfigurationManagerPrivate::configurationRemoved(const QString &id) +{ + if (!accessPointConfigurations.contains(id)) + return; + + QExplicitlySharedDataPointer ptr = + accessPointConfigurations.take(id); + + configurationEngine.remove(id); + + ptr.data()->isValid = false; + + if (!firstUpdate) { + QNetworkConfiguration item; + item.d = ptr; + emit configurationRemoved(item); + } + + if (ptr.data()->state == QNetworkConfiguration::Active) { + --onlineConfigurations; + if (!firstUpdate && onlineConfigurations == 0) + emit onlineStateChanged(false); + } +} + +void QNetworkConfigurationManagerPrivate::configurationChanged(QNetworkConfigurationPrivate *cpPriv) +{ + if (!accessPointConfigurations.contains(cpPriv->id)) + return; + + QExplicitlySharedDataPointer ptr = + accessPointConfigurations.value(cpPriv->id); + + if (ptr.data()->isValid != cpPriv->isValid || + ptr.data()->name != cpPriv->name || + ptr.data()->id != cpPriv->id || + ptr.data()->state != cpPriv->state || + ptr.data()->type != cpPriv->type || + ptr.data()->roamingSupported != cpPriv->roamingSupported || + ptr.data()->purpose != cpPriv->purpose || + ptr.data()->internet != cpPriv->internet) { + + const QNetworkConfiguration::StateFlags oldState = ptr.data()->state; + + ptr.data()->isValid = cpPriv->isValid; + ptr.data()->name = cpPriv->name; + ptr.data()->id = cpPriv->id; + ptr.data()->state = cpPriv->state; + ptr.data()->type = cpPriv->type; + ptr.data()->roamingSupported = cpPriv->roamingSupported; + ptr.data()->purpose = cpPriv->purpose; + ptr.data()->internet = cpPriv->internet; + + if (!firstUpdate) { + QNetworkConfiguration item; + item.d = ptr; + emit configurationChanged(item); + } + + if (ptr.data()->state == QNetworkConfiguration::Active && oldState != ptr.data()->state) { + // configuration went online + ++onlineConfigurations; + if (!firstUpdate && onlineConfigurations == 1) + emit onlineStateChanged(true); + } else if (ptr.data()->state != QNetworkConfiguration::Active && oldState == QNetworkConfiguration::Active) { + // configuration went offline + --onlineConfigurations; + if (!firstUpdate && onlineConfigurations == 0) + emit onlineStateChanged(false); + } + } +} + +void QNetworkConfigurationManagerPrivate::updateInternetServiceConfiguration() +{ + if (!snapConfigurations.contains(QLatin1String("Internet Service Network"))) { + QNetworkConfigurationPrivate *serviceNetwork = new QNetworkConfigurationPrivate; + serviceNetwork->name = tr("Internet"); + serviceNetwork->isValid = true; + serviceNetwork->id = QLatin1String("Internet Service Network"); + serviceNetwork->state = QNetworkConfiguration::Defined; + serviceNetwork->type = QNetworkConfiguration::ServiceNetwork; + + QExplicitlySharedDataPointer ptr(serviceNetwork); + + snapConfigurations.insert(serviceNetwork->id, ptr); + + if (!firstUpdate) { + QNetworkConfiguration item; + item.d = ptr; + emit configurationAdded(item); + } + } + + QExplicitlySharedDataPointer ptr = + snapConfigurations.value(QLatin1String("Internet Service Network")); + + QList > serviceNetworkMembers; + + QHash >::const_iterator i = + accessPointConfigurations.constBegin(); + + QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Defined; + while (i != accessPointConfigurations.constEnd()) { + QExplicitlySharedDataPointer child = i.value(); + + if (child.data()->internet && ((child.data()->state & QNetworkConfiguration::Defined) + == QNetworkConfiguration::Defined)) { + serviceNetworkMembers.append(child); + + state |= child.data()->state; + } + + ++i; + } + + + if (ptr.data()->state != state || ptr.data()->serviceNetworkMembers != serviceNetworkMembers) { + ptr.data()->state = state; + ptr.data()->serviceNetworkMembers = serviceNetworkMembers; + + QNetworkConfiguration item; + item.d = ptr; + emit configurationChanged(item); + } +} + +void QNetworkConfigurationManagerPrivate::updateConfigurations() +{ + if (firstUpdate) { + updateState = NotUpdating; + onlineConfigurations = 0; + +#if defined (Q_OS_DARWIN) + coreWifi = QCoreWlanEngine::instance(); + if (coreWifi) { + connect(coreWifi, SIGNAL(configurationsChanged()), + this, SLOT(updateConfigurations())); + } +#else +#if defined(BACKEND_NM) + nmWifi = QNmWifiEngine::instance(); + if (nmWifi) { + connect(nmWifi, SIGNAL(configurationsChanged()), + this, SLOT(updateConfigurations())); + } else { +#endif + generic = QGenericEngine::instance(); + if (generic) { + connect(generic, SIGNAL(configurationsChanged()), + this, SLOT(updateConfigurations())); + } +#if defined(BACKEND_NM) + } +#endif +#endif + +#ifdef Q_OS_WIN + nla = QNlaEngine::instance(); + if (nla) { + connect(nla, SIGNAL(configurationsChanged()), + this, SLOT(updateConfigurations())); + } +#endif + +#ifdef Q_OS_WIN32 + nativeWifi = QNativeWifiEngine::instance(); + if (nativeWifi) { + connect(nativeWifi, SIGNAL(configurationsChanged()), + this, SLOT(updateConfigurations())); + + capFlags |= QNetworkConfigurationManager::CanStartAndStopInterfaces; + } +#endif + } + + QNetworkSessionEngine *engine = qobject_cast(sender()); + if (updateState & Updating && engine) { +#if defined (Q_OS_DARWIN) + if (engine == coreWifi) + updateState &= ~CoreWifiUpdating; +#else +#if defined(BACKEND_NM) + if (engine == nmWifi) + updateState &= ~NmUpdating; + else if (engine == generic) + updateState &= ~GenericUpdating; +#else + if (engine == generic) + updateState &= ~GenericUpdating; +#endif +#endif + +#ifdef Q_OS_WIN + else if (engine == nla) + updateState &= ~NlaUpdating; +#ifdef Q_OS_WIN32 + else if (engine == nativeWifi) + updateState &= ~NativeWifiUpdating; +#endif +#endif + } + QList engines; + if (firstUpdate) { +#if defined (Q_OS_DARWIN) + if (coreWifi) + engines << coreWifi; +#else +#if defined(BACKEND_NM) + if (nmWifi) + engines << nmWifi; + else if (generic) + engines << generic; +#else + if (generic) + engines << generic; +#endif +#endif + +#ifdef Q_OS_WIN + if (nla) + engines << nla; +#ifdef Q_OS_WIN32 + if (nativeWifi) + engines << nativeWifi; +#endif +#endif + } else if (engine) { + engines << engine; + } + + while (!engines.isEmpty()) { + engine = engines.takeFirst(); + + bool ok; + QList foundConfigurations = engine->getConfigurations(&ok); + + // Find removed configurations. + QList removedIdentifiers = configurationEngine.keys(); + for (int i = 0; i < foundConfigurations.count(); ++i) + removedIdentifiers.removeOne(foundConfigurations.at(i)->id); + + // Update or add configurations. + while (!foundConfigurations.isEmpty()) { + QNetworkConfigurationPrivate *cpPriv = foundConfigurations.takeFirst(); + + if (accessPointConfigurations.contains(cpPriv->id)) + configurationChanged(cpPriv); + else + configurationAdded(cpPriv, engine); + + delete cpPriv; + } + + // Remove configurations. + while (!removedIdentifiers.isEmpty()) { + const QString id = removedIdentifiers.takeFirst(); + + if (configurationEngine.value(id) == engine) + configurationRemoved(id); + } + } + + updateInternetServiceConfiguration(); + + if (updateState == Updating) { + updateState = NotUpdating; + emit configurationUpdateComplete(); + } + + if (firstUpdate) + firstUpdate = false; +} + +/*! + Returns the first active configuration found, if one exists; otherwise returns the first + discovered configuration found, if one exists; otherwise returns an empty configuration. + + \internal +*/ +QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration() +{ + QExplicitlySharedDataPointer firstActive; + QExplicitlySharedDataPointer firstDiscovered; + + QHash >::const_iterator i = + accessPointConfigurations.constBegin(); + while (i != accessPointConfigurations.constEnd()) { + QNetworkConfigurationPrivate *priv = i.value().data(); + + if (!firstActive && priv->isValid && + (priv->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) + firstActive = i.value(); + if (!firstDiscovered && priv->isValid && + (priv->state & QNetworkConfiguration::Discovered) == QNetworkConfiguration::Discovered) + firstDiscovered = i.value(); + + ++i; + } + + QNetworkConfiguration item; + + if (firstActive) + item.d = firstActive; + else if (firstDiscovered) + item.d = firstDiscovered; + + return item; +} + +void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate() +{ + updateState = Updating; +#if defined (Q_OS_DARWIN) + if (coreWifi) { + updateState |= CoreWifiUpdating; + coreWifi->requestUpdate(); + } +#else +#if defined(BACKEND_NM) + if (nmWifi) { + updateState |= NmUpdating; + nmWifi->requestUpdate(); + } else if (generic) { + updateState |= GenericUpdating; + generic->requestUpdate(); + } +#else + if (generic) { + updateState |= GenericUpdating; + generic->requestUpdate(); + } +#endif +#endif +#ifdef Q_OS_WIN + if (nla) { + updateState |= NlaUpdating; + nla->requestUpdate(); + } +#endif + +#ifdef Q_OS_WIN32 + if (nativeWifi) { + updateState |= NativeWifiUpdating; + nativeWifi->requestUpdate(); + } +#endif +} + +#include "moc_qnetworkconfigmanager_p.cpp" + +QTM_END_NAMESPACE + diff --git a/src/network/bearer/qnetworkconfigmanager_p.h b/src/network/bearer/qnetworkconfigmanager_p.h new file mode 100644 index 0000000..0c42f9b --- /dev/null +++ b/src/network/bearer/qnetworkconfigmanager_p.h @@ -0,0 +1,178 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNETWORKCONFIGURATIONMANAGERPRIVATE_H +#define QNETWORKCONFIGURATIONMANAGERPRIVATE_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qnetworkconfigmanager.h" +#include "qnetworkconfiguration_p.h" + +#include +#include + +QTM_BEGIN_NAMESPACE + +#ifdef BEARER_ENGINE +class QNetworkSessionEngine; +class QGenericEngine; +class QNlaEngine; +class QNativeWifiEngine; +class QNmWifiEngine; +class QCoreWlanEngine; +#endif + + +class QNetworkConfigurationManagerPrivate : public QObject +{ + Q_OBJECT +public: + QNetworkConfigurationManagerPrivate() + : QObject(0), capFlags(0), firstUpdate(true) + { + registerPlatformCapabilities(); + updateConfigurations(); + } + + virtual ~QNetworkConfigurationManagerPrivate() + { + QList configIdents = snapConfigurations.keys(); + foreach(const QString oldIface, configIdents) { + QExplicitlySharedDataPointer priv = snapConfigurations.take(oldIface); + priv->isValid = false; + priv->id.clear(); + } + + configIdents = accessPointConfigurations.keys(); + foreach(const QString oldIface, configIdents) { + QExplicitlySharedDataPointer priv = accessPointConfigurations.take(oldIface); + priv->isValid = false; + priv->id.clear(); + } + } + + QNetworkConfiguration defaultConfiguration(); + + QNetworkConfigurationManager::Capabilities capFlags; + void registerPlatformCapabilities(); + + void performAsyncConfigurationUpdate(); + + //this table contains an up to date list of all configs at any time. + //it must be updated if configurations change, are added/removed or + //the members of ServiceNetworks change + QHash > accessPointConfigurations; + QHash > snapConfigurations; + QHash > userChoiceConfigurations; +#ifdef BEARER_ENGINE + QHash configurationEngine; +#endif + bool firstUpdate; + +public slots: + void updateConfigurations(); + +Q_SIGNALS: + void configurationAdded(const QNetworkConfiguration& config); + void configurationRemoved(const QNetworkConfiguration& config); + void configurationUpdateComplete(); + void configurationChanged(const QNetworkConfiguration& config); + void onlineStateChanged(bool isOnline); + +private: +#ifdef BEARER_ENGINE + void updateInternetServiceConfiguration(); + + void abort(); +#endif + +#ifdef BEARER_ENGINE + QGenericEngine *generic; +#ifdef Q_OS_WIN + QNlaEngine *nla; +#ifndef Q_OS_WINCE + QNativeWifiEngine *nativeWifi; +#endif +#endif +#ifdef BACKEND_NM + QNmWifiEngine *nmWifi; +#endif +#ifdef Q_OS_DARWIN + QCoreWlanEngine *coreWifi; +#endif + + uint onlineConfigurations; + + enum EngineUpdate { + NotUpdating = 0x00, + Updating = 0x01, + GenericUpdating = 0x02, + NlaUpdating = 0x04, + NativeWifiUpdating = 0x08, + NmUpdating = 0x20, + CoreWifiUpdating = 0x40, + }; + Q_DECLARE_FLAGS(EngineUpdateState, EngineUpdate) + + EngineUpdateState updateState; +#endif + +private Q_SLOTS: +#ifdef BEARER_ENGINE + void configurationAdded(QNetworkConfigurationPrivate *cpPriv, QNetworkSessionEngine *engine); + void configurationRemoved(const QString &id); + void configurationChanged(QNetworkConfigurationPrivate *cpPriv); +#endif +}; + +QTM_END_NAMESPACE + +#endif //QNETWORKCONFIGURATIONMANAGERPRIVATE_H diff --git a/src/network/bearer/qnetworkconfigmanager_s60_p.cpp b/src/network/bearer/qnetworkconfigmanager_s60_p.cpp new file mode 100644 index 0000000..760a194 --- /dev/null +++ b/src/network/bearer/qnetworkconfigmanager_s60_p.cpp @@ -0,0 +1,974 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qnetworkconfigmanager_s60_p.h" + +#include +#include +#include + +#ifdef SNAP_FUNCTIONALITY_AVAILABLE + #include + #include + #include + #include + #include + #include +#else + #include + #include + #include +#endif + +QTM_BEGIN_NAMESPACE + +static const int KValueThatWillBeAddedToSNAPId = 1000; +static const int KUserChoiceIAPId = 0; + +QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate() + : QObject(0), CActive(CActive::EPriorityIdle), capFlags(0), iFirstUpdate(true), iInitOk(true) +{ + CActiveScheduler::Add(this); + + registerPlatformCapabilities(); + TRAPD(error, ipCommsDB = CCommsDatabase::NewL(EDatabaseTypeIAP)); + if (error != KErrNone) { + iInitOk = false; + return; + } + + TRAP_IGNORE(iConnectionMonitor.ConnectL()); + TRAP_IGNORE(iConnectionMonitor.NotifyEventL(*this)); + +#ifdef SNAP_FUNCTIONALITY_AVAILABLE + TRAP(error, iCmManager.OpenL()); + if (error != KErrNone) { + iInitOk = false; + return; + } +#endif + + QNetworkConfigurationPrivate* cpPriv = new QNetworkConfigurationPrivate(); + cpPriv->name = "UserChoice"; + cpPriv->bearer = QNetworkConfigurationPrivate::BearerUnknown; + cpPriv->state = QNetworkConfiguration::Discovered; + cpPriv->isValid = true; + cpPriv->id = QString::number(qHash(KUserChoiceIAPId)); + cpPriv->numericId = KUserChoiceIAPId; + cpPriv->connectionId = 0; + cpPriv->type = QNetworkConfiguration::UserChoice; + cpPriv->purpose = QNetworkConfiguration::UnknownPurpose; + cpPriv->roamingSupported = false; + cpPriv->manager = this; + QExplicitlySharedDataPointer ptr(cpPriv); + userChoiceConfigurations.insert(cpPriv->id, ptr); + + updateConfigurations(); + updateStatesToSnaps(); + + // Start monitoring IAP and/or SNAP changes in Symbian CommsDB + startCommsDatabaseNotifications(); +} + +QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate() +{ + Cancel(); + + QList configIdents = snapConfigurations.keys(); + foreach(QString oldIface, configIdents) { + QExplicitlySharedDataPointer priv = snapConfigurations.take(oldIface); + priv->isValid = false; + priv->id.clear(); + } + + configIdents = accessPointConfigurations.keys(); + foreach(QString oldIface, configIdents) { + QExplicitlySharedDataPointer priv = accessPointConfigurations.take(oldIface); + priv->isValid = false; + priv->id.clear(); + } + + configIdents = userChoiceConfigurations.keys(); + foreach(QString oldIface, configIdents) { + QExplicitlySharedDataPointer priv = userChoiceConfigurations.take(oldIface); + priv->isValid = false; + priv->id.clear(); + priv->manager = 0; + } + + iConnectionMonitor.CancelNotifications(); + iConnectionMonitor.Close(); + +#ifdef SNAP_FUNCTIONALITY_AVAILABLE + iCmManager.Close(); +#endif + + delete ipAccessPointsAvailabilityScanner; + delete ipCommsDB; +} + + +void QNetworkConfigurationManagerPrivate::registerPlatformCapabilities() +{ + capFlags |= QNetworkConfigurationManager::CanStartAndStopInterfaces; + capFlags |= QNetworkConfigurationManager::DirectConnectionRouting; + capFlags |= QNetworkConfigurationManager::SystemSessionSupport; +#ifdef SNAP_FUNCTIONALITY_AVAILABLE + capFlags |= QNetworkConfigurationManager::ApplicationLevelRoaming; + capFlags |= QNetworkConfigurationManager::ForcedRoaming; +#endif + capFlags |= QNetworkConfigurationManager::DataStatistics; +} + +void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate() +{ + if (!iInitOk || iUpdateGoingOn) { + return; + } + iUpdateGoingOn = true; + + stopCommsDatabaseNotifications(); + updateConfigurations(); // Synchronous call + updateAvailableAccessPoints(); // Asynchronous call +} + +void QNetworkConfigurationManagerPrivate::updateConfigurations() +{ + if (!iInitOk) { + return; + } + + TRAP_IGNORE(updateConfigurationsL()); +} + +void QNetworkConfigurationManagerPrivate::updateConfigurationsL() +{ + QList knownConfigs = accessPointConfigurations.keys(); + QList knownSnapConfigs = snapConfigurations.keys(); + +#ifdef SNAP_FUNCTIONALITY_AVAILABLE + // S60 version is >= Series60 3rd Edition Feature Pack 2 + TInt error = KErrNone; + + // Loop through all IAPs + RArray connectionMethods; // IAPs + CleanupClosePushL(connectionMethods); + iCmManager.ConnectionMethodL(connectionMethods); + for(int i = 0; i < connectionMethods.Count(); i++) { + RCmConnectionMethod connectionMethod = iCmManager.ConnectionMethodL(connectionMethods[i]); + CleanupClosePushL(connectionMethod); + TUint32 iapId = connectionMethod.GetIntAttributeL(CMManager::ECmIapId); + QString ident = QString::number(qHash(iapId)); + if (accessPointConfigurations.contains(ident)) { + knownConfigs.removeOne(ident); + } else { + QNetworkConfigurationPrivate* cpPriv = NULL; + TRAP(error, cpPriv = configFromConnectionMethodL(connectionMethod)); + if (error == KErrNone) { + QExplicitlySharedDataPointer ptr(cpPriv); + accessPointConfigurations.insert(cpPriv->id, ptr); + if (!iFirstUpdate) { + QNetworkConfiguration item; + item.d = ptr; + emit configurationAdded(item); + } + } + } + CleanupStack::PopAndDestroy(&connectionMethod); + } + CleanupStack::PopAndDestroy(&connectionMethods); + + // Loop through all SNAPs + RArray destinations; + CleanupClosePushL(destinations); + iCmManager.AllDestinationsL(destinations); + for(int i = 0; i < destinations.Count(); i++) { + RCmDestination destination; + destination = iCmManager.DestinationL(destinations[i]); + CleanupClosePushL(destination); + QString ident = QString::number(qHash(destination.Id()+KValueThatWillBeAddedToSNAPId)); //TODO: Check if it's ok to add 1000 SNAP Id to prevent SNAP ids overlapping IAP ids + if (snapConfigurations.contains(ident)) { + knownSnapConfigs.removeOne(ident); + } else { + QNetworkConfigurationPrivate* cpPriv = new QNetworkConfigurationPrivate(); + CleanupStack::PushL(cpPriv); + + HBufC *pName = destination.NameLC(); + cpPriv->name = QString::fromUtf16(pName->Ptr(),pName->Length()); + CleanupStack::PopAndDestroy(pName); + pName = NULL; + + cpPriv->isValid = true; + cpPriv->id = ident; + cpPriv->numericId = destination.Id(); + cpPriv->connectionId = 0; + cpPriv->state = QNetworkConfiguration::Defined; + cpPriv->type = QNetworkConfiguration::ServiceNetwork; + cpPriv->purpose = QNetworkConfiguration::UnknownPurpose; + cpPriv->roamingSupported = false; + cpPriv->manager = this; + + QExplicitlySharedDataPointer ptr(cpPriv); + snapConfigurations.insert(ident, ptr); + if (!iFirstUpdate) { + QNetworkConfiguration item; + item.d = ptr; + emit configurationAdded(item); + } + + CleanupStack::Pop(cpPriv); + } + QExplicitlySharedDataPointer privSNAP = snapConfigurations.value(ident); + + for (int j=0; j < destination.ConnectionMethodCount(); j++) { + RCmConnectionMethod connectionMethod = destination.ConnectionMethodL(j); + CleanupClosePushL(connectionMethod); + + TUint32 iapId = connectionMethod.GetIntAttributeL(CMManager::ECmIapId); + QString iface = QString::number(qHash(iapId)); + // Check that IAP can be found from accessPointConfigurations list + QExplicitlySharedDataPointer priv = accessPointConfigurations.value(iface); + if (priv.data() == 0) { + QNetworkConfigurationPrivate* cpPriv = NULL; + TRAP(error, cpPriv = configFromConnectionMethodL(connectionMethod)); + if (error == KErrNone) { + QExplicitlySharedDataPointer ptr(cpPriv); + ptr.data()->serviceNetworkPtr = privSNAP; + accessPointConfigurations.insert(cpPriv->id, ptr); + if (!iFirstUpdate) { + QNetworkConfiguration item; + item.d = ptr; + emit configurationAdded(item); + } + privSNAP->serviceNetworkMembers.append(ptr); + } + } else { + knownConfigs.removeOne(iface); + // Check that IAP can be found from related SNAP's configuration list + bool iapFound = false; + for (int i=0; iserviceNetworkMembers.count(); i++) { + if (privSNAP->serviceNetworkMembers[i]->numericId == iapId) { + iapFound = true; + break; + } + } + if (!iapFound) { + priv.data()->serviceNetworkPtr = privSNAP; + privSNAP->serviceNetworkMembers.append(priv); + } + } + + CleanupStack::PopAndDestroy(&connectionMethod); + } + + if (privSNAP->serviceNetworkMembers.count() > 1) { + // Roaming is supported only if SNAP contains more than one IAP + privSNAP->roamingSupported = true; + } + + CleanupStack::PopAndDestroy(&destination); + } + CleanupStack::PopAndDestroy(&destinations); + +#else + // S60 version is < Series60 3rd Edition Feature Pack 2 + CCommsDbTableView* pDbTView = ipCommsDB->OpenTableLC(TPtrC(IAP)); + + // Loop through all IAPs + TUint32 apId = 0; + TInt retVal = pDbTView->GotoFirstRecord(); + while (retVal == KErrNone) { + pDbTView->ReadUintL(TPtrC(COMMDB_ID), apId); + QString ident = QString::number(qHash(apId)); + if (accessPointConfigurations.contains(ident)) { + knownConfigs.removeOne(ident); + } else { + QNetworkConfigurationPrivate* cpPriv = new QNetworkConfigurationPrivate(); + if (readNetworkConfigurationValuesFromCommsDb(apId, cpPriv)) { + QExplicitlySharedDataPointer ptr(cpPriv); + accessPointConfigurations.insert(ident, ptr); + if (!iFirstUpdate) { + QNetworkConfiguration item; + item.d = ptr; + emit configurationAdded(item); + } + } else { + delete cpPriv; + } + } + retVal = pDbTView->GotoNextRecord(); + } + CleanupStack::PopAndDestroy(pDbTView); +#endif + updateActiveAccessPoints(); + + foreach (QString oldIface, knownConfigs) { + //remove non existing IAP + QExplicitlySharedDataPointer priv = accessPointConfigurations.take(oldIface); + priv->isValid = false; + if (!iFirstUpdate) { + QNetworkConfiguration item; + item.d = priv; + emit configurationRemoved(item); + } + // Remove non existing IAP from SNAPs + QList snapConfigIdents = snapConfigurations.keys(); + foreach (QString iface, snapConfigIdents) { + QExplicitlySharedDataPointer priv2 = snapConfigurations.value(iface); + // => Check if one of the IAPs of the SNAP is active + for (int i=0; iserviceNetworkMembers.count(); i++) { + if (priv2->serviceNetworkMembers[i]->numericId == priv->numericId) { + priv2->serviceNetworkMembers.removeAt(i); + break; + } + } + } + } + foreach (QString oldIface, knownSnapConfigs) { + //remove non existing SNAPs + QExplicitlySharedDataPointer priv = snapConfigurations.take(oldIface); + priv->isValid = false; + if (!iFirstUpdate) { + QNetworkConfiguration item; + item.d = priv; + emit configurationRemoved(item); + } + } + + iFirstUpdate = false; +} + +#ifdef SNAP_FUNCTIONALITY_AVAILABLE +QNetworkConfigurationPrivate* QNetworkConfigurationManagerPrivate::configFromConnectionMethodL( + RCmConnectionMethod& connectionMethod) +{ + QNetworkConfigurationPrivate* cpPriv = new QNetworkConfigurationPrivate(); + CleanupStack::PushL(cpPriv); + + TUint32 iapId = connectionMethod.GetIntAttributeL(CMManager::ECmIapId); + QString ident = QString::number(qHash(iapId)); + + HBufC *pName = connectionMethod.GetStringAttributeL(CMManager::ECmName); + CleanupStack::PushL(pName); + cpPriv->name = QString::fromUtf16(pName->Ptr(),pName->Length()); + CleanupStack::PopAndDestroy(pName); + pName = NULL; + + TUint32 bearerId = connectionMethod.GetIntAttributeL(CMManager::ECmCommsDBBearerType); + switch (bearerId) { + case KCommDbBearerCSD: + cpPriv->bearer = QNetworkConfigurationPrivate::Bearer2G; + break; + case KCommDbBearerWcdma: + cpPriv->bearer = QNetworkConfigurationPrivate::BearerWCDMA; + break; + case KCommDbBearerLAN: + cpPriv->bearer = QNetworkConfigurationPrivate::BearerEthernet; + break; + case KCommDbBearerVirtual: + cpPriv->bearer = QNetworkConfigurationPrivate::BearerUnknown; + break; + case KCommDbBearerPAN: + cpPriv->bearer = QNetworkConfigurationPrivate::BearerUnknown; + break; + case KCommDbBearerWLAN: + cpPriv->bearer = QNetworkConfigurationPrivate::BearerWLAN; + break; + default: + cpPriv->bearer = QNetworkConfigurationPrivate::BearerUnknown; + break; + } + + TInt error = KErrNone; + TUint32 bearerType = connectionMethod.GetIntAttributeL(CMManager::ECmBearerType); + switch (bearerType) { + case KUidPacketDataBearerType: + // "Packet data" Bearer => Mapping is done using "Access point name" + TRAP(error, pName = connectionMethod.GetStringAttributeL(CMManager::EPacketDataAPName)); + break; + case KUidWlanBearerType: + // "Wireless LAN" Bearer => Mapping is done using "WLAN network name" = SSID + TRAP(error, pName = connectionMethod.GetStringAttributeL(CMManager::EWlanSSID)); + break; + } + if (!pName) { + // "Data call" Bearer or "High Speed (GSM)" Bearer => Mapping is done using "Dial-up number" + TRAP(error, pName = connectionMethod.GetStringAttributeL(CMManager::EDialDefaultTelNum)); + } + + if (error == KErrNone && pName) { + CleanupStack::PushL(pName); + cpPriv->mappingName = QString::fromUtf16(pName->Ptr(),pName->Length()); + CleanupStack::PopAndDestroy(pName); + pName = NULL; + } + + cpPriv->state = QNetworkConfiguration::Defined; + TBool isConnected = connectionMethod.GetBoolAttributeL(CMManager::ECmConnected); + if (isConnected) { + cpPriv->state = QNetworkConfiguration::Active; + } + + cpPriv->isValid = true; + cpPriv->id = ident; + cpPriv->numericId = iapId; + cpPriv->connectionId = 0; + cpPriv->type = QNetworkConfiguration::InternetAccessPoint; + cpPriv->purpose = QNetworkConfiguration::UnknownPurpose; + cpPriv->roamingSupported = false; + cpPriv->manager = this; + + CleanupStack::Pop(cpPriv); + return cpPriv; +} +#else +bool QNetworkConfigurationManagerPrivate::readNetworkConfigurationValuesFromCommsDb( + TUint32 aApId, QNetworkConfigurationPrivate* apNetworkConfiguration) +{ + TRAPD(error, readNetworkConfigurationValuesFromCommsDbL(aApId,apNetworkConfiguration)); + if (error != KErrNone) { + return false; + } + return true; +} + +void QNetworkConfigurationManagerPrivate::readNetworkConfigurationValuesFromCommsDbL( + TUint32 aApId, QNetworkConfigurationPrivate* apNetworkConfiguration) +{ + CApDataHandler* pDataHandler = CApDataHandler::NewLC(*ipCommsDB); + CApAccessPointItem* pAPItem = CApAccessPointItem::NewLC(); + TBuf name; + + CApUtils* pApUtils = CApUtils::NewLC(*ipCommsDB); + TUint32 apId = pApUtils->WapIdFromIapIdL(aApId); + + pDataHandler->AccessPointDataL(apId,*pAPItem); + pAPItem->ReadTextL(EApIapName, name); + if (name.Compare(_L("Easy WLAN")) == 0) { + // "Easy WLAN" won't be accepted to the Configurations list + User::Leave(KErrNotFound); + } + + QString ident = QString::number(qHash(aApId)); + + apNetworkConfiguration->name = QString::fromUtf16(name.Ptr(),name.Length()); + apNetworkConfiguration->isValid = true; + apNetworkConfiguration->id = ident; + apNetworkConfiguration->numericId = aApId; + apNetworkConfiguration->connectionId = 0; + apNetworkConfiguration->state = (QNetworkConfiguration::Defined); + apNetworkConfiguration->type = QNetworkConfiguration::InternetAccessPoint; + apNetworkConfiguration->purpose = QNetworkConfiguration::UnknownPurpose; + apNetworkConfiguration->roamingSupported = false; + switch (pAPItem->BearerTypeL()) { + case EApBearerTypeCSD: + apNetworkConfiguration->bearer = QNetworkConfigurationPrivate::Bearer2G; + break; + case EApBearerTypeGPRS: + apNetworkConfiguration->bearer = QNetworkConfigurationPrivate::Bearer2G; + break; + case EApBearerTypeHSCSD: + apNetworkConfiguration->bearer = QNetworkConfigurationPrivate::BearerHSPA; + break; + case EApBearerTypeCDMA: + apNetworkConfiguration->bearer = QNetworkConfigurationPrivate::BearerCDMA2000; + break; + case EApBearerTypeWLAN: + apNetworkConfiguration->bearer = QNetworkConfigurationPrivate::BearerWLAN; + break; + case EApBearerTypeLAN: + apNetworkConfiguration->bearer = QNetworkConfigurationPrivate::BearerEthernet; + break; + case EApBearerTypeLANModem: + apNetworkConfiguration->bearer = QNetworkConfigurationPrivate::BearerEthernet; + break; + default: + apNetworkConfiguration->bearer = QNetworkConfigurationPrivate::BearerUnknown; + break; + } + apNetworkConfiguration->manager = this; + + CleanupStack::PopAndDestroy(pApUtils); + CleanupStack::PopAndDestroy(pAPItem); + CleanupStack::PopAndDestroy(pDataHandler); +} +#endif + +QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration() +{ + QNetworkConfiguration config; + + if (iInitOk) { + stopCommsDatabaseNotifications(); + TRAP_IGNORE(config = defaultConfigurationL()); + startCommsDatabaseNotifications(); + } + + return config; +} + +QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfigurationL() +{ + QNetworkConfiguration item; + +#ifdef SNAP_FUNCTIONALITY_AVAILABLE + // Check Default Connection (SNAP or IAP) + TCmDefConnValue defaultConnectionValue; + iCmManager.ReadDefConnL(defaultConnectionValue); + if (defaultConnectionValue.iType == ECmDefConnDestination) { + QString iface = QString::number(qHash(defaultConnectionValue.iId+KValueThatWillBeAddedToSNAPId)); + QExplicitlySharedDataPointer priv = snapConfigurations.value(iface); + if (priv.data() != 0) { + item.d = priv; + } + } else if (defaultConnectionValue.iType == ECmDefConnConnectionMethod) { + QString iface = QString::number(qHash(defaultConnectionValue.iId)); + QExplicitlySharedDataPointer priv = accessPointConfigurations.value(iface); + if (priv.data() != 0) { + item.d = priv; + } + } +#endif + + if (!item.isValid()) { + QString iface = QString::number(qHash(KUserChoiceIAPId)); + QExplicitlySharedDataPointer priv = userChoiceConfigurations.value(iface); + if (priv.data() != 0) { + item.d = priv; + } + } + + return item; +} + +void QNetworkConfigurationManagerPrivate::updateActiveAccessPoints() +{ + bool online = false; + QList inactiveConfigs = accessPointConfigurations.keys(); + + TRequestStatus status; + TUint connectionCount; + iConnectionMonitor.GetConnectionCount(connectionCount, status); + User::WaitForRequest(status); + + // Go through all connections and set state of related IAPs to Active + TUint connectionId; + TUint subConnectionCount; + TUint apId; + if (status.Int() == KErrNone) { + for (TUint i = 1; i <= connectionCount; i++) { + iConnectionMonitor.GetConnectionInfo(i, connectionId, subConnectionCount); + iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status); + User::WaitForRequest(status); + QString ident = QString::number(qHash(apId)); + QExplicitlySharedDataPointer priv = accessPointConfigurations.value(ident); + if (priv.data()) { + online = true; + inactiveConfigs.removeOne(ident); + priv.data()->connectionId = connectionId; + // Configuration is Active + changeConfigurationStateTo(priv, QNetworkConfiguration::Active); + } + } + } + + // Make sure that state of rest of the IAPs won't be Active + foreach (QString iface, inactiveConfigs) { + QExplicitlySharedDataPointer priv = accessPointConfigurations.value(iface); + if (priv.data()) { + // Configuration is either Defined or Discovered + changeConfigurationStateAtMaxTo(priv, QNetworkConfiguration::Discovered); + } + } + + if (iOnline != online) { + iOnline = online; + emit this->onlineStateChanged(iOnline); + } +} + +void QNetworkConfigurationManagerPrivate::updateAvailableAccessPoints() +{ + if (!ipAccessPointsAvailabilityScanner) { + ipAccessPointsAvailabilityScanner = new AccessPointsAvailabilityScanner(*this, iConnectionMonitor); + } + if (ipAccessPointsAvailabilityScanner) { + // Scanning may take a while because WLAN scanning will be done (if device supports WLAN). + ipAccessPointsAvailabilityScanner->StartScanning(); + } +} + +void QNetworkConfigurationManagerPrivate::accessPointScanningReady(TBool scanSuccessful, TConnMonIapInfo iapInfo) +{ + iUpdateGoingOn = false; + if (scanSuccessful) { + QList unavailableConfigs = accessPointConfigurations.keys(); + + // Set state of returned IAPs to Discovered + // if state is not already Active + for(TUint i=0; i priv = accessPointConfigurations.value(ident); + if (priv.data()) { + unavailableConfigs.removeOne(ident); + if (priv.data()->state < QNetworkConfiguration::Active) { + // Configuration is either Discovered or Active + changeConfigurationStateAtMinTo(priv, QNetworkConfiguration::Discovered); + } + } + } + + // Make sure that state of rest of the IAPs won't be Discovered or Active + foreach (QString iface, unavailableConfigs) { + QExplicitlySharedDataPointer priv = accessPointConfigurations.value(iface); + if (priv.data()) { + // Configuration is Defined + changeConfigurationStateAtMaxTo(priv, QNetworkConfiguration::Defined); + } + } + } + + updateStatesToSnaps(); + + startCommsDatabaseNotifications(); + + emit this->configurationUpdateComplete(); +} + +void QNetworkConfigurationManagerPrivate::updateStatesToSnaps() +{ + // Go through SNAPs and set correct state to SNAPs + QList snapConfigIdents = snapConfigurations.keys(); + foreach (QString iface, snapConfigIdents) { + bool discovered = false; + bool active = false; + QExplicitlySharedDataPointer priv = snapConfigurations.value(iface); + // => Check if one of the IAPs of the SNAP is discovered or active + // => If one of IAPs is active, also SNAP is active + // => If one of IAPs is discovered but none of the IAPs is active, SNAP is discovered + for (int i=0; iserviceNetworkMembers.count(); i++) { + QExplicitlySharedDataPointer priv2 = priv->serviceNetworkMembers[i]; + if ((priv->serviceNetworkMembers[i]->state & QNetworkConfiguration::Active) + == QNetworkConfiguration::Active) { + active = true; + break; + } else if ((priv->serviceNetworkMembers[i]->state & QNetworkConfiguration::Discovered) + == QNetworkConfiguration::Discovered) { + discovered = true; + } + } + if (active) { + changeConfigurationStateTo(priv, QNetworkConfiguration::Active); + } else if (discovered) { + changeConfigurationStateTo(priv, QNetworkConfiguration::Discovered); + } else { + changeConfigurationStateTo(priv, QNetworkConfiguration::Defined); + } + } +} + +bool QNetworkConfigurationManagerPrivate::changeConfigurationStateTo(QExplicitlySharedDataPointer& sharedData, + QNetworkConfiguration::StateFlags newState) +{ + if (newState != sharedData.data()->state) { + sharedData.data()->state = newState; + QNetworkConfiguration item; + item.d = sharedData; + if (!iFirstUpdate) { + emit configurationChanged(item); + } + return true; + } + return false; +} + +/* changeConfigurationStateAtMinTo function does not overwrite possible better + * state (e.g. Discovered state does not overwrite Active state) but + * makes sure that state is at minimum given state. +*/ +bool QNetworkConfigurationManagerPrivate::changeConfigurationStateAtMinTo(QExplicitlySharedDataPointer& sharedData, + QNetworkConfiguration::StateFlags newState) +{ + if ((newState | sharedData.data()->state) != sharedData.data()->state) { + sharedData.data()->state = (sharedData.data()->state | newState); + QNetworkConfiguration item; + item.d = sharedData; + if (!iFirstUpdate) { + emit configurationChanged(item); + } + return true; + } + return false; +} + +/* changeConfigurationStateAtMaxTo function overwrites possible better + * state (e.g. Discovered state overwrites Active state) and + * makes sure that state is at maximum given state (e.g. Discovered state + * does not overwrite Defined state). +*/ +bool QNetworkConfigurationManagerPrivate::changeConfigurationStateAtMaxTo(QExplicitlySharedDataPointer& sharedData, + QNetworkConfiguration::StateFlags newState) +{ + if ((newState & sharedData.data()->state) != sharedData.data()->state) { + sharedData.data()->state = (newState & sharedData.data()->state); + QNetworkConfiguration item; + item.d = sharedData; + if (!iFirstUpdate) { + emit configurationChanged(item); + } + return true; + } + return false; +} + +void QNetworkConfigurationManagerPrivate::startCommsDatabaseNotifications() +{ + if (!iWaitingCommsDatabaseNotifications) { + iWaitingCommsDatabaseNotifications = ETrue; + if (!IsActive()) { + SetActive(); + // Start waiting for new notification + ipCommsDB->RequestNotification(iStatus); + } + } +} + +void QNetworkConfigurationManagerPrivate::stopCommsDatabaseNotifications() +{ + if (iWaitingCommsDatabaseNotifications) { + iWaitingCommsDatabaseNotifications = EFalse; + if (!IsActive()) { + SetActive(); + // Make sure that notifier recorded events will not be returned + // as soon as the client issues the next RequestNotification() request. + ipCommsDB->RequestNotification(iStatus); + ipCommsDB->CancelRequestNotification(); + } else { + ipCommsDB->CancelRequestNotification(); + } + } +} + +void QNetworkConfigurationManagerPrivate::RunL() +{ + if (iStatus != KErrCancel) { + RDbNotifier::TEvent event = STATIC_CAST(RDbNotifier::TEvent, iStatus.Int()); + switch (event) { + case RDbNotifier::EUnlock: /** All read locks have been removed. */ + case RDbNotifier::ECommit: /** A transaction has been committed. */ + case RDbNotifier::ERollback: /** A transaction has been rolled back */ + case RDbNotifier::ERecover: /** The database has been recovered */ + // Note that if further database events occur while a client is handling + // a request completion, the notifier records the most significant database + // event and this is signalled as soon as the client issues the next + // RequestNotification() request. + // => Stop recording notifications + stopCommsDatabaseNotifications(); + TRAPD(error, updateConfigurationsL()); + if (error == KErrNone) { + updateStatesToSnaps(); + } + iWaitingCommsDatabaseNotifications = true; + break; + default: + // Do nothing + break; + } + } + + if (iWaitingCommsDatabaseNotifications) { + if (!IsActive()) { + SetActive(); + // Start waiting for new notification + ipCommsDB->RequestNotification(iStatus); + } + } +} + +void QNetworkConfigurationManagerPrivate::DoCancel() +{ + ipCommsDB->CancelRequestNotification(); +} + + +void QNetworkConfigurationManagerPrivate::EventL(const CConnMonEventBase& aEvent) +{ + switch (aEvent.EventType()) { + case EConnMonCreateConnection: + { + CConnMonCreateConnection* realEvent; + realEvent = (CConnMonCreateConnection*) &aEvent; + TUint subConnectionCount = 0; + TUint apId; + TUint connectionId = realEvent->ConnectionId(); + TRequestStatus status; + iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status); + User::WaitForRequest(status); + QString ident = QString::number(qHash(apId)); + QExplicitlySharedDataPointer priv = accessPointConfigurations.value(ident); + if (priv.data()) { + priv.data()->connectionId = connectionId; + // Configuration is Active + if (changeConfigurationStateTo(priv, QNetworkConfiguration::Active)) { + updateStatesToSnaps(); + } + if (!iOnline) { + iOnline = true; + emit this->onlineStateChanged(iOnline); + } + } + } + break; + + case EConnMonDeleteConnection: + { + CConnMonDeleteConnection* realEvent; + realEvent = (CConnMonDeleteConnection*) &aEvent; + TUint connectionId = realEvent->ConnectionId(); + QExplicitlySharedDataPointer priv = dataByConnectionId(connectionId); + if (priv.data()) { + priv.data()->connectionId = 0; + // Configuration is either Defined or Discovered + if (changeConfigurationStateAtMaxTo(priv, QNetworkConfiguration::Discovered)) { + updateStatesToSnaps(); + } + } + + bool online = false; + QList iapConfigs = accessPointConfigurations.keys(); + foreach (QString iface, iapConfigs) { + QExplicitlySharedDataPointer priv = accessPointConfigurations.value(iface); + if (priv.data()->state == QNetworkConfiguration::Active) { + online = true; + break; + } + } + if (iOnline != online) { + iOnline = online; + emit this->onlineStateChanged(iOnline); + } + } + break; + + case EConnMonIapAvailabilityChange: + { + CConnMonIapAvailabilityChange* realEvent; + realEvent = (CConnMonIapAvailabilityChange*) &aEvent; + TConnMonIapInfo iaps = realEvent->IapAvailability(); + QList unDiscoveredConfigs = accessPointConfigurations.keys(); + for ( TUint i = 0; i < iaps.Count(); i++ ) { + QString ident = QString::number(qHash(iaps.iIap[i].iIapId)); + QExplicitlySharedDataPointer priv = accessPointConfigurations.value(ident); + if (priv.data()) { + // Configuration is either Discovered or Active + changeConfigurationStateAtMinTo(priv, QNetworkConfiguration::Discovered); + unDiscoveredConfigs.removeOne(ident); + } + } + foreach (QString iface, unDiscoveredConfigs) { + QExplicitlySharedDataPointer priv = accessPointConfigurations.value(iface); + if (priv.data()) { + // Configuration is Defined + changeConfigurationStateAtMaxTo(priv, QNetworkConfiguration::Defined); + } + } + } + break; + + default: + // For unrecognized events + break; + } +} + +QExplicitlySharedDataPointer QNetworkConfigurationManagerPrivate::dataByConnectionId(TUint aConnectionId) +{ + QNetworkConfiguration item; + + QHash >::const_iterator i = + accessPointConfigurations.constBegin(); + while (i != accessPointConfigurations.constEnd()) { + QExplicitlySharedDataPointer priv = i.value(); + if (priv.data()->connectionId == aConnectionId) { + return priv; + } + ++i; + } + + return QExplicitlySharedDataPointer(); +} + +AccessPointsAvailabilityScanner::AccessPointsAvailabilityScanner(QNetworkConfigurationManagerPrivate& owner, + RConnectionMonitor& connectionMonitor) + : CActive(CActive::EPriorityStandard), iOwner(owner), iConnectionMonitor(connectionMonitor) +{ + CActiveScheduler::Add(this); +} + +AccessPointsAvailabilityScanner::~AccessPointsAvailabilityScanner() +{ + Cancel(); +} + +void AccessPointsAvailabilityScanner::DoCancel() +{ + iConnectionMonitor.CancelAsyncRequest(EConnMonGetPckgAttribute); +} + +void AccessPointsAvailabilityScanner::StartScanning() +{ + iConnectionMonitor.GetPckgAttribute(EBearerIdAll, 0, KIapAvailability, iIapBuf, iStatus); + if (!IsActive()) { + SetActive(); + } +} + +void AccessPointsAvailabilityScanner::RunL() +{ + if (iStatus.Int() != KErrNone) { + iIapBuf().iCount = 0; + iOwner.accessPointScanningReady(false,iIapBuf()); + } else { + iOwner.accessPointScanningReady(true,iIapBuf()); + } +} +#include "moc_qnetworkconfigmanager_s60_p.cpp" +QTM_END_NAMESPACE diff --git a/src/network/bearer/qnetworkconfigmanager_s60_p.h b/src/network/bearer/qnetworkconfigmanager_s60_p.h new file mode 100644 index 0000000..296d67f --- /dev/null +++ b/src/network/bearer/qnetworkconfigmanager_s60_p.h @@ -0,0 +1,182 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNETWORKCONFIGURATIONMANAGERPRIVATE_H +#define QNETWORKCONFIGURATIONMANAGERPRIVATE_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +#include +#include +#ifdef SNAP_FUNCTIONALITY_AVAILABLE + #include +#endif + +class CCommsDatabase; +class QTimer; + +QTM_BEGIN_NAMESPACE + +class QNetworkSessionPrivate; +class AccessPointsAvailabilityScanner; + +class QNetworkConfigurationManagerPrivate : public QObject, public CActive, public MConnectionMonitorObserver +{ + Q_OBJECT + +public: + QNetworkConfigurationManagerPrivate(); + virtual ~QNetworkConfigurationManagerPrivate(); + + QNetworkConfiguration defaultConfiguration(); + void performAsyncConfigurationUpdate(); + +Q_SIGNALS: + void configurationAdded(const QNetworkConfiguration& config); + void configurationRemoved(const QNetworkConfiguration& config); + void configurationUpdateComplete(); + void configurationChanged(const QNetworkConfiguration& config); + void onlineStateChanged(bool isOnline); + +public Q_SLOTS: + void updateConfigurations(); + +private: + void registerPlatformCapabilities(); + void updateStatesToSnaps(); + bool changeConfigurationStateTo(QExplicitlySharedDataPointer& sharedData, + QNetworkConfiguration::StateFlags newState); + bool changeConfigurationStateAtMinTo(QExplicitlySharedDataPointer& sharedData, + QNetworkConfiguration::StateFlags newState); + bool changeConfigurationStateAtMaxTo(QExplicitlySharedDataPointer& sharedData, + QNetworkConfiguration::StateFlags newState); +#ifdef SNAP_FUNCTIONALITY_AVAILABLE + QNetworkConfigurationPrivate* configFromConnectionMethodL(RCmConnectionMethod& connectionMethod); +#else + bool readNetworkConfigurationValuesFromCommsDb( + TUint32 aApId, QNetworkConfigurationPrivate* apNetworkConfiguration); + void readNetworkConfigurationValuesFromCommsDbL( + TUint32 aApId, QNetworkConfigurationPrivate* apNetworkConfiguration); +#endif + + void updateConfigurationsL(); + void updateActiveAccessPoints(); + void updateAvailableAccessPoints(); + void accessPointScanningReady(TBool scanSuccessful, TConnMonIapInfo iapInfo); + void startCommsDatabaseNotifications(); + void stopCommsDatabaseNotifications(); + + QNetworkConfiguration defaultConfigurationL(); + TBool GetS60PlatformVersion(TUint& aMajor, TUint& aMinor) const; + void startMonitoringIAPData(TUint32 aIapId); + QExplicitlySharedDataPointer dataByConnectionId(TUint aConnectionId); + +protected: // From CActive + void RunL(); + void DoCancel(); + +private: // MConnectionMonitorObserver + void EventL(const CConnMonEventBase& aEvent); + +public: // Data + //this table contains an up to date list of all configs at any time. + //it must be updated if configurations change, are added/removed or + //the members of ServiceNetworks change + QHash > accessPointConfigurations; + QHash > snapConfigurations; + QHash > userChoiceConfigurations; + QNetworkConfigurationManager::Capabilities capFlags; + +private: // Data + bool iFirstUpdate; + CCommsDatabase* ipCommsDB; + RConnectionMonitor iConnectionMonitor; + + TBool iWaitingCommsDatabaseNotifications; + TBool iOnline; + TBool iInitOk; + TBool iUpdateGoingOn; + + + AccessPointsAvailabilityScanner* ipAccessPointsAvailabilityScanner; + + friend class QNetworkSessionPrivate; + friend class AccessPointsAvailabilityScanner; + +#ifdef SNAP_FUNCTIONALITY_AVAILABLE + RCmManager iCmManager; +#endif +}; + +class AccessPointsAvailabilityScanner : public CActive +{ +public: + AccessPointsAvailabilityScanner(QNetworkConfigurationManagerPrivate& owner, + RConnectionMonitor& connectionMonitor); + ~AccessPointsAvailabilityScanner(); + + void StartScanning(); + +protected: // From CActive + void RunL(); + void DoCancel(); + +private: // Data + QNetworkConfigurationManagerPrivate& iOwner; + RConnectionMonitor& iConnectionMonitor; + TConnMonIapInfoBuf iIapBuf; +}; + +QTM_END_NAMESPACE + +#endif //QNETWORKCONFIGURATIONMANAGERPRIVATE_H diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp new file mode 100644 index 0000000..c92b356 --- /dev/null +++ b/src/network/bearer/qnetworkconfiguration.cpp @@ -0,0 +1,349 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qnetworkconfiguration.h" + +#ifdef Q_OS_SYMBIAN +#include "qnetworkconfiguration_s60_p.h" +#else +#include "qnetworkconfiguration_p.h" +#endif + +QTM_BEGIN_NAMESPACE + +/*! + \class QNetworkConfiguration + + \brief The QNetworkConfiguration class provides an abstraction of one or more access point configurations. + + \inmodule QtNetwork + \ingroup bearer + + QNetworkConfiguration encapsulates a single access point or service network. + In most cases a single access point configuration can be mapped to one network + interface. However a single network interface may not always map to only one + access point configuration. Multiple configurations for the same + network device may enable multiple access points. An example + device that could exhibit such a configuration might be a + Smartphone which allows the user to manage multiple WLAN + configurations while the device itself has only one WLAN network device. + + The QNetworkConfiguration also supports the concept of service networks. + This concept allows the grouping of multiple access point configurations + into one entity. Such a group is called service network and can be + beneficial in cases whereby a network session to a + particular destination network is required (e.g. a company network). + When using a service network the user doesn't usually care which one of the + connectivity options is chosen (e.g. corporate WLAN or VPN via GPRS) + as long as he can reach the company's target server. Depending + on the current position and time some of the access points that make + up the service network may not even be available. Furthermore + automated access point roaming can be enabled which enables the device + to change the network interface configuration dynamically while maintaining + the applications connection to the target network. It allows adaption + to the changing environment and may enable optimization with regards to + cost, speed or other network parameters. + + Special configurations of type UserChoice provide a placeholder configuration which is + resolved to an actual network configuration by the platform when a + \l {QNetworkSession}{session} is \l {QNetworkSession::open()}{opened}. Not all platforms + support the concept of a user choice configuration. + + \section1 Configuration states + + The list of available configurations can be obtained via + QNetworkConfigurationManager::allConfigurations(). A configuration can have + multiple states. The \l Defined configuration state indicates that the configuration + is stored on the device. However the configuration is not yet ready to be activated + as e.g. a WLAN may not be available at the current time. + + The \l Discovered state implies that the configuration is \l Defined and + the outside conditions are such that the configuration can be used immediately + to open a new network session. An example of such an outside condition may be + that the Ethernet cable is actually connected to the device or that the WLAN + with the specified SSID is in range. + + The \l Active state implies that the configuration is \l Discovered. A configuration + in this state is currently being used by an application. The underlying network + interface has a valid IP configuration and can transfer IP packets between the + device and the target network. + + The \l Undefined state indicates that the system has knowledge of possible target + networks but cannot actually use that knowledge to connect to it. An example + for such a state could be an encrypted WLAN that has been discovered + but the user hasn't actually saved a configuration including the required password + which would allow the device to connect to it. + + Depending on the type of configuration some states are transient in nature. A GPRS/UMTS + connection may almost always be \l Discovered if the GSM/UMTS network is available. + However if the GSM/UMTS network looses the connection the associated configuration may change its state + from \l Discovered to \l Defined as well. A similar use case might be triggered by + WLAN availability. QNetworkConfigurationManager::updateConfigurations() can be used to + manually trigger updates of states. Note that some platforms do not require such updates + as they implicitly change the state once it has been discovered. If the state of a + configuration changes all related QNetworkConfiguration instances change their state automatically. + + \sa QNetworkSession, QNetworkConfigurationManager +*/ + +/*! + \enum QNetworkConfiguration::Type + + This enum describes the type of configuration. + + \value InternetAccessPoint The configuration specifies the details for a single access point. + Note that configurations of type InternetAccessPoint may be part + of other QNetworkConfigurations of type ServiceNetwork. + \value ServiceNetwork The configuration is based on a group of QNetworkConfigurations of + type InternetAccessPoint. All group members can reach the same + target network. This type of configuration is a mandatory + requirement for roaming enabled network sessions. On some + platforms this form of configuration may also be called Service + Network Access Point (SNAP). + \value UserChoice The configuration is a placeholder which will be resolved to an + actual configuration by the platform when a session is opened. Depending + on the platform the selection may generate a popup dialog asking the user + for his preferred choice. + \value Invalid The configuration is invalid. +*/ + +/*! + \enum QNetworkConfiguration::StateFlag + + Specifies the configuration states. + + \value Undefined This state is used for transient configurations such as newly discovered + WLANs for which the user has not actually created a configuration yet. + \value Defined Defined configurations are known to the system but are not immediately + usable (e.g. a configured WLAN is not within range or the Ethernet cable + is currently not plugged into the machine). + \value Discovered A discovered configuration can be immediately used to create a new + QNetworkSession. An example of a discovered configuration could be a WLAN + which is within in range. If the device moves out of range the discovered + flag is dropped. A second example is a GPRS configuration which generally + remains discovered for as long as the phone has network coverage. A + configuration that has this state is also in state + QNetworkConfiguration::Defined. If the configuration is a service network + this flag is set if at least one of the underlying access points + configurations has the Discovered state. + \value Active The configuration is currently used by an open/active network session + (see \l QNetworkSession::isActive()). However this does not mean that the + current process is the entity that created the active session. It merely + indicates that if a new QNetworkSession were to be constructed based on + this configuration \l QNetworkSession::state() would return + \l QNetworkSession::Connected. This state implies the + QNetworkConfiguration::Discovered state. +*/ + +/*! + \enum QNetworkConfiguration::Purpose + + Specifies the purpose of the configuration. + + \value UnknownPurpose The configuration doesn't specify any purpose. This is the default value. + \value PublicPurpose The configuration can be used for general purpose internet access. + \value PrivatePurpose The configuration is suitable to access a private network such as an office Intranet. + \value ServiceSpecificPurpose The configuration can be used for operator specific services (e.g. + receiving MMS messages or content streaming). +*/ + +/*! + Constructs an invalid configuration object. + + \sa isValid() +*/ +QNetworkConfiguration::QNetworkConfiguration() + : d(0) +{ +} + +/*! + Creates a copy of the QNetworkConfiguration object contained in \a other. +*/ +QNetworkConfiguration::QNetworkConfiguration(const QNetworkConfiguration& other) + : d(other.d) +{ +} + +/*! + Copies the content of the QNetworkConfiguration object contained in \a other into this one. +*/ +QNetworkConfiguration& QNetworkConfiguration::operator=(const QNetworkConfiguration& other) +{ + d = other.d; + return *this; +} + +/*! + Frees the resources associated with the QNetworkConfiguration object. +*/ +QNetworkConfiguration::~QNetworkConfiguration() +{ +} + +/*! + Returns true, if this configuration is the same as the \a other + configuration given; otherwise returns false. +*/ +bool QNetworkConfiguration::operator==(const QNetworkConfiguration& other) const +{ + if (!d) + return !other.d; + + if (!other.d) + return false; + + return (d == other.d); +} + +/*! + \fn bool QNetworkConfiguration::operator!=(const QNetworkConfiguration& other) const + + Returns true if this configuration is not the same as the \a other + configuration given; otherwise returns false. +*/ + +/*! + Returns the user visible name of this configuration. + + The name may either be the name of the underlying access point or the + name for service network that this configuration represents. +*/ +QString QNetworkConfiguration::name() const +{ + return d ? d->name : QString(); +} + +/*! + Returns the unique and platform specific identifier for this network configuration; + otherwise an empty string. +*/ +QString QNetworkConfiguration::identifier() const +{ + return d ? d->id : QString(); +} + +/*! + Returns the type of the configuration. + + A configuration can represent a single access point configuration or + a set of access point configurations. Such a set is called service network. + A configuration that is based on a service network can potentially support + roaming of network sessions. +*/ +QNetworkConfiguration::Type QNetworkConfiguration::type() const +{ + return d ? d->type : QNetworkConfiguration::Invalid; +} + +/*! + Returns true if this QNetworkConfiguration object is valid. + A configuration may become invalid if the user deletes the configuration or + the configuration was default-constructed. + + The addition and removal of configurations can be monitored via the + QNetworkConfigurationManager. + + \sa QNetworkConfigurationManager +*/ +bool QNetworkConfiguration::isValid() const +{ + return d ? d->isValid : false; +} + +/*! + Returns the current state of the configuration. +*/ +QNetworkConfiguration::StateFlags QNetworkConfiguration::state() const +{ + return d ? d->state : QNetworkConfiguration::Undefined; +} + +/*! + Returns the purpose of this configuration. + + The purpose field may be used to programmatically determine the + purpose of a configuration. Such information is usually part of the + access point or service network meta data. +*/ +QNetworkConfiguration::Purpose QNetworkConfiguration::purpose() const +{ + return d ? d->purpose : QNetworkConfiguration::UnknownPurpose; +} + +/*! + Returns true if this configuration supports roaming; otherwise false. +*/ +bool QNetworkConfiguration::isRoamingAvailable() const +{ + return d ? d->roamingSupported : false; +} + +/*! + Returns all sub configurations of this network configuration. + Only network configurations of type \l ServiceNetwork can have children. Otherwise + this function returns an empty list. +*/ +QList QNetworkConfiguration::children() const +{ + QList results; + if (type() != QNetworkConfiguration::ServiceNetwork || !isValid() ) + return results; + + QMutableListIterator > iter(d->serviceNetworkMembers); + QExplicitlySharedDataPointer p(0); + while(iter.hasNext()) { + p = iter.next(); + //if we have an invalid member get rid of it -> was deleted earlier on + if (!p->isValid) + iter.remove(); + + QNetworkConfiguration item; + item.d = p; + results << item; + } + + return results; +} + + +QTM_END_NAMESPACE + diff --git a/src/network/bearer/qnetworkconfiguration.h b/src/network/bearer/qnetworkconfiguration.h new file mode 100644 index 0000000..f8c17d5 --- /dev/null +++ b/src/network/bearer/qnetworkconfiguration.h @@ -0,0 +1,113 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNETWORKCONFIGURATION_H +#define QNETWORKCONFIGURATION_H + +#include "qmobilityglobal.h" + +#include +#include +#include + +QT_BEGIN_HEADER + +QTM_BEGIN_NAMESPACE + +class QNetworkConfigurationPrivate; +class Q_BEARER_EXPORT QNetworkConfiguration +{ +public: + QNetworkConfiguration(); + QNetworkConfiguration(const QNetworkConfiguration& other); + QNetworkConfiguration &operator=(const QNetworkConfiguration& other); + ~QNetworkConfiguration(); + + bool operator==(const QNetworkConfiguration& cp) const; + inline bool operator!=(const QNetworkConfiguration& cp) const + { return !operator==(cp); } + + enum Type { + InternetAccessPoint = 0, + ServiceNetwork, + UserChoice, + Invalid + }; + + enum Purpose { + UnknownPurpose = 0, + PublicPurpose, + PrivatePurpose, + ServiceSpecificPurpose + }; + + enum StateFlag { + Undefined = 0x0000001, + Defined = 0x0000002, + Discovered = 0x0000006, + Active = 0x000000e + }; + + Q_DECLARE_FLAGS(StateFlags, StateFlag) + + StateFlags state() const; + Type type() const; + Purpose purpose() const; + QString identifier() const; + bool isRoamingAvailable() const; + QList children() const; + + QString name() const; + bool isValid() const; + +private: + friend class QNetworkConfigurationPrivate; + friend class QNetworkConfigurationManager; + friend class QNetworkConfigurationManagerPrivate; + friend class QNetworkSessionPrivate; + QExplicitlySharedDataPointer d; +}; + +QTM_END_NAMESPACE + +QT_END_HEADER + +#endif //QNETWORKCONFIGURATION_H diff --git a/src/network/bearer/qnetworkconfiguration_maemo_p.h b/src/network/bearer/qnetworkconfiguration_maemo_p.h new file mode 100644 index 0000000..8d786aa --- /dev/null +++ b/src/network/bearer/qnetworkconfiguration_maemo_p.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNETWORKCONFIGURATIONPRIVATE_H +#define QNETWORKCONFIGURATIONPRIVATE_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QTM_BEGIN_NAMESPACE + +class QNetworkConfigurationPrivate : public QSharedData +{ +public: + QNetworkConfigurationPrivate () + : isValid(false), type(QNetworkConfiguration::Invalid), + roamingSupported(false), purpose(QNetworkConfiguration::UnknownPurpose), + network_attrs(0), service_attrs(0), manager(0) + { + } + + ~QNetworkConfigurationPrivate() + { + //release pointers to member configurations + serviceNetworkMembers.clear(); + } + + QString name; + bool isValid; + QString id; + QNetworkConfiguration::StateFlags state; + QNetworkConfiguration::Type type; + bool roamingSupported; + QNetworkConfiguration::Purpose purpose; + + QList > serviceNetworkMembers; + QNetworkInterface serviceInterface; + + /* In Maemo the id field (defined above) is the IAP id (which typically is UUID) */ + QByteArray network_id; /* typically WLAN ssid or similar */ + QString iap_type; /* is this one WLAN or GPRS */ + uint32_t network_attrs; /* network attributes for this IAP, this is the value returned by icd and passed to it when connecting */ + + QString service_type; + QString service_id; + uint32_t service_attrs; + + QNetworkConfigurationManagerPrivate *manager; + +private: + + // disallow detaching + QNetworkConfigurationPrivate &operator=(const QNetworkConfigurationPrivate &other); + QNetworkConfigurationPrivate(const QNetworkConfigurationPrivate &other); +}; + +QTM_END_NAMESPACE + +#endif //QNETWORKCONFIGURATIONPRIVATE_H diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h new file mode 100644 index 0000000..a3bcd9a --- /dev/null +++ b/src/network/bearer/qnetworkconfiguration_p.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNETWORKCONFIGURATIONPRIVATE_H +#define QNETWORKCONFIGURATIONPRIVATE_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qnetworkconfiguration.h" +#include +#include + +QTM_BEGIN_NAMESPACE + +class QNetworkConfigurationPrivate : public QSharedData +{ +public: + QNetworkConfigurationPrivate () + : isValid(false), type(QNetworkConfiguration::Invalid), + roamingSupported(false), purpose(QNetworkConfiguration::UnknownPurpose) + { +#ifdef BEARER_ENGINE + internet = false; +#endif + } + + ~QNetworkConfigurationPrivate() + { + //release pointers to member configurations + serviceNetworkMembers.clear(); + } + + QString name; + bool isValid; + QString id; + QNetworkConfiguration::StateFlags state; + QNetworkConfiguration::Type type; + bool roamingSupported; + QNetworkConfiguration::Purpose purpose; + +#ifdef BEARER_ENGINE + bool internet; +#endif + + QList > serviceNetworkMembers; + QNetworkInterface serviceInterface; + +private: + + // disallow detaching + QNetworkConfigurationPrivate &operator=(const QNetworkConfigurationPrivate &other); + QNetworkConfigurationPrivate(const QNetworkConfigurationPrivate &other); +}; + +QTM_END_NAMESPACE + +#endif //QNETWORKCONFIGURATIONPRIVATE_H diff --git a/src/network/bearer/qnetworkconfiguration_s60_p.cpp b/src/network/bearer/qnetworkconfiguration_s60_p.cpp new file mode 100644 index 0000000..61548ba --- /dev/null +++ b/src/network/bearer/qnetworkconfiguration_s60_p.cpp @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qnetworkconfiguration_s60_p.h" + +QTM_BEGIN_NAMESPACE + +QNetworkConfigurationPrivate::QNetworkConfigurationPrivate() + : isValid(false), type(QNetworkConfiguration::Invalid), + roamingSupported(false), purpose(QNetworkConfiguration::UnknownPurpose), + bearer(QNetworkConfigurationPrivate::BearerUnknown), numericId(0), + connectionId(0), manager(0) +{ +} + +QNetworkConfigurationPrivate::~QNetworkConfigurationPrivate() +{ + //release pointers to member configurations + serviceNetworkMembers.clear(); +} + +QTM_END_NAMESPACE diff --git a/src/network/bearer/qnetworkconfiguration_s60_p.h b/src/network/bearer/qnetworkconfiguration_s60_p.h new file mode 100644 index 0000000..44f8f56 --- /dev/null +++ b/src/network/bearer/qnetworkconfiguration_s60_p.h @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNETWORKCONFIGURATIONPRIVATE_H +#define QNETWORKCONFIGURATIONPRIVATE_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QTM_BEGIN_NAMESPACE + +class QNetworkConfigurationPrivate : public QSharedData +{ +public: + enum Bearer { + BearerEthernet, + BearerWLAN, + Bearer2G, + BearerCDMA2000, + BearerWCDMA, + BearerHSPA, + BearerBluetooth, + BearerWiMAX, + BearerUnknown = -1 + }; + + QNetworkConfigurationPrivate(); + ~QNetworkConfigurationPrivate(); + + QString name; + bool isValid; + QString id; + QNetworkConfiguration::StateFlags state; + QNetworkConfiguration::Type type; + bool roamingSupported; + QNetworkConfiguration::Purpose purpose; + + QList > serviceNetworkMembers; + + QNetworkConfigurationPrivate::Bearer bearer; + TUint32 numericId; + TUint connectionId; + + TAny* manager; + + QString mappingName; + + QExplicitlySharedDataPointer serviceNetworkPtr; + +private: + // disallow detaching + QNetworkConfigurationPrivate &operator=(const QNetworkConfigurationPrivate &other); + QNetworkConfigurationPrivate(const QNetworkConfigurationPrivate &other); +}; + +QTM_END_NAMESPACE + +#endif //QNETWORKCONFIGURATIONPRIVATE_H + diff --git a/src/network/bearer/qnetworkmanagerservice_p.cpp b/src/network/bearer/qnetworkmanagerservice_p.cpp new file mode 100644 index 0000000..2f91af0 --- /dev/null +++ b/src/network/bearer/qnetworkmanagerservice_p.cpp @@ -0,0 +1,1011 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include "qnetworkmanagerservice_p.h" + +//Q_DECLARE_METATYPE(QList) +QTM_BEGIN_NAMESPACE + +static QDBusConnection dbusConnection = QDBusConnection::systemBus(); +//static QDBusInterface iface(NM_DBUS_SERVICE, NM_DBUS_PATH, NM_DBUS_INTERFACE, dbusConnection); + +class QNetworkManagerInterfacePrivate +{ +public: + QDBusInterface *connectionInterface; + bool valid; +}; + +QNetworkManagerInterface::QNetworkManagerInterface(QObject *parent) + : QObject(parent) +{ + d = new QNetworkManagerInterfacePrivate(); + d->connectionInterface = new QDBusInterface(NM_DBUS_SERVICE, + NM_DBUS_PATH, + NM_DBUS_INTERFACE, + dbusConnection); + if (!d->connectionInterface->isValid()) { + qWarning() << "Could not find NetworkManager"; + d->valid = false; + return; + } + d->valid = true; + nmDBusHelper = new QNmDBusHelper; + connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap)), + this,SIGNAL(propertiesChanged( const QString &, QMap))); + connect(nmDBusHelper,SIGNAL(pathForStateChanged(const QString &, quint32)), + this, SIGNAL(stateChanged(const QString&, quint32))); + +} + +QNetworkManagerInterface::~QNetworkManagerInterface() +{ + delete d->connectionInterface; + delete d; +} + +bool QNetworkManagerInterface::isValid() +{ + return d->valid; +} + +bool QNetworkManagerInterface::setConnections() +{ + if(!isValid() ) + return false; + bool allOk = false; + if (!dbusConnection.connect(NM_DBUS_SERVICE, + NM_DBUS_PATH, + NM_DBUS_INTERFACE, + "PropertiesChanged", + nmDBusHelper,SLOT(slotPropertiesChanged( QMap)))) { + allOk = true; + } + if (!dbusConnection.connect(NM_DBUS_SERVICE, + NM_DBUS_PATH, + NM_DBUS_INTERFACE, + "DeviceAdded", + this,SIGNAL(deviceAdded(QDBusObjectPath)))) { + allOk = true; + } + if (!dbusConnection.connect(NM_DBUS_SERVICE, + NM_DBUS_PATH, + NM_DBUS_INTERFACE, + "DeviceRemoved", + this,SIGNAL(deviceRemoved(QDBusObjectPath)))) { + allOk = true; + } + + return allOk; +} + +QDBusInterface *QNetworkManagerInterface::connectionInterface() const +{ + return d->connectionInterface; +} + +QList QNetworkManagerInterface::getDevices() const +{ + QDBusReply > reply = d->connectionInterface->call("GetDevices"); + return reply.value(); +} + +void QNetworkManagerInterface::activateConnection( const QString &serviceName, + QDBusObjectPath connectionPath, + QDBusObjectPath devicePath, + QDBusObjectPath specificObject) +{ + QDBusPendingCall pendingCall = d->connectionInterface->asyncCall("ActivateConnection", + QVariant(serviceName), + QVariant::fromValue(connectionPath), + QVariant::fromValue(devicePath), + QVariant::fromValue(specificObject)); + + QDBusPendingCallWatcher *callWatcher = new QDBusPendingCallWatcher(pendingCall, this); + connect(callWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), + this, SIGNAL(activationFinished(QDBusPendingCallWatcher*))); +} + +void QNetworkManagerInterface::deactivateConnection(QDBusObjectPath connectionPath) const +{ + d->connectionInterface->call("DeactivateConnection", QVariant::fromValue(connectionPath)); +} + +bool QNetworkManagerInterface::wirelessEnabled() const +{ + return d->connectionInterface->property("WirelessEnabled").toBool(); +} + +bool QNetworkManagerInterface::wirelessHardwareEnabled() const +{ + return d->connectionInterface->property("WirelessHardwareEnabled").toBool(); +} + +QList QNetworkManagerInterface::activeConnections() const +{ + QVariant prop = d->connectionInterface->property("ActiveConnections"); + return prop.value >(); +} + +quint32 QNetworkManagerInterface::state() +{ + return d->connectionInterface->property("State").toUInt(); +} + +///////////// +class QNetworkManagerInterfaceAccessPointPrivate +{ +public: + QDBusInterface *connectionInterface; + QString path; + bool valid; +}; + +QNetworkManagerInterfaceAccessPoint::QNetworkManagerInterfaceAccessPoint(const QString &dbusPathName, QObject *parent) + : QObject(parent) +{ + d = new QNetworkManagerInterfaceAccessPointPrivate(); + d->path = dbusPathName; + d->connectionInterface = new QDBusInterface(NM_DBUS_SERVICE, + d->path, + NM_DBUS_INTERFACE_ACCESS_POINT, + dbusConnection); + if (!d->connectionInterface->isValid()) { + d->valid = false; + qWarning() << "Could not find InterfaceAccessPoint"; + return; + } + d->valid = true; + +} + +QNetworkManagerInterfaceAccessPoint::~QNetworkManagerInterfaceAccessPoint() +{ + delete d->connectionInterface; + delete d; +} + +bool QNetworkManagerInterfaceAccessPoint::isValid() +{ + return d->valid; +} + +bool QNetworkManagerInterfaceAccessPoint::setConnections() +{ + if(!isValid() ) + return false; + + bool allOk = false; + nmDBusHelper = new QNmDBusHelper; + connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap)), + this,SIGNAL(propertiesChanged( const QString &, QMap))); + + if(dbusConnection.connect(NM_DBUS_SERVICE, + d->path, + NM_DBUS_INTERFACE_ACCESS_POINT, + "PropertiesChanged", + nmDBusHelper,SLOT(slotPropertiesChanged( QMap))) ) { + allOk = true; + + } + return allOk; +} + +QDBusInterface *QNetworkManagerInterfaceAccessPoint::connectionInterface() const +{ + return d->connectionInterface; +} + +quint32 QNetworkManagerInterfaceAccessPoint::flags() const +{ + return d->connectionInterface->property("Flags").toUInt(); +} + +quint32 QNetworkManagerInterfaceAccessPoint::wpaFlags() const +{ + return d->connectionInterface->property("WpaFlags").toUInt(); +} + +quint32 QNetworkManagerInterfaceAccessPoint::rsnFlags() const +{ + return d->connectionInterface->property("RsnFlags").toUInt(); +} + +QString QNetworkManagerInterfaceAccessPoint::ssid() const +{ + return d->connectionInterface->property("Ssid").toString(); +} + +quint32 QNetworkManagerInterfaceAccessPoint::frequency() const +{ + return d->connectionInterface->property("Frequency").toUInt(); +} + +QString QNetworkManagerInterfaceAccessPoint::hwAddress() const +{ + return d->connectionInterface->property("HwAddress").toString(); +} + +quint32 QNetworkManagerInterfaceAccessPoint::mode() const +{ + return d->connectionInterface->property("Mode").toUInt(); +} + +quint32 QNetworkManagerInterfaceAccessPoint::maxBitrate() const +{ + return d->connectionInterface->property("MaxBitrate").toUInt(); +} + +quint32 QNetworkManagerInterfaceAccessPoint::strength() const +{ + return d->connectionInterface->property("Strength").toUInt(); +} + +///////////// +class QNetworkManagerInterfaceDevicePrivate +{ +public: + QDBusInterface *connectionInterface; + QString path; + bool valid; +}; + +QNetworkManagerInterfaceDevice::QNetworkManagerInterfaceDevice(const QString &deviceObjectPath, QObject *parent) + : QObject(parent) +{ + d = new QNetworkManagerInterfaceDevicePrivate(); + d->path = deviceObjectPath; + d->connectionInterface = new QDBusInterface(NM_DBUS_SERVICE, + d->path, + NM_DBUS_INTERFACE_DEVICE, + dbusConnection); + if (!d->connectionInterface->isValid()) { + d->valid = false; + qWarning() << "Could not find NetworkManager"; + return; + } + d->valid = true; +} + +QNetworkManagerInterfaceDevice::~QNetworkManagerInterfaceDevice() +{ + delete d->connectionInterface; + delete d; +} + +bool QNetworkManagerInterfaceDevice::isValid() +{ + return d->valid; +} + +bool QNetworkManagerInterfaceDevice::setConnections() +{ + if(!isValid() ) + return false; + + bool allOk = false; + nmDBusHelper = new QNmDBusHelper; + connect(nmDBusHelper,SIGNAL(pathForStateChanged(const QString &, quint32)), + this, SIGNAL(stateChanged(const QString&, quint32))); + if(dbusConnection.connect(NM_DBUS_SERVICE, + d->path, + NM_DBUS_INTERFACE_DEVICE, + "StateChanged", + nmDBusHelper,SLOT(deviceStateChanged(quint32)))) { + allOk = true; + } + return allOk; +} + +QDBusInterface *QNetworkManagerInterfaceDevice::connectionInterface() const +{ + return d->connectionInterface; +} + +QString QNetworkManagerInterfaceDevice::udi() const +{ + return d->connectionInterface->property("Udi").toString(); +} + +QNetworkInterface QNetworkManagerInterfaceDevice::interface() const +{ + return QNetworkInterface::interfaceFromName(d->connectionInterface->property("Interface").toString()); +} + +quint32 QNetworkManagerInterfaceDevice::ip4Address() const +{ + return d->connectionInterface->property("Ip4Address").toUInt(); +} + +quint32 QNetworkManagerInterfaceDevice::state() const +{ + return d->connectionInterface->property("State").toUInt(); +} + +quint32 QNetworkManagerInterfaceDevice::deviceType() const +{ + return d->connectionInterface->property("DeviceType").toUInt(); +} + +QDBusObjectPath QNetworkManagerInterfaceDevice::ip4config() const +{ + QVariant prop = d->connectionInterface->property("Ip4Config"); + return prop.value(); +} + +///////////// +class QNetworkManagerInterfaceDeviceWiredPrivate +{ +public: + QDBusInterface *connectionInterface; + QString path; + bool valid; +}; + +QNetworkManagerInterfaceDeviceWired::QNetworkManagerInterfaceDeviceWired(const QString &ifaceDevicePath, QObject *parent) +{ + d = new QNetworkManagerInterfaceDeviceWiredPrivate(); + d->path = ifaceDevicePath; + d->connectionInterface = new QDBusInterface(NM_DBUS_SERVICE, + d->path, + NM_DBUS_INTERFACE_DEVICE_WIRED, + dbusConnection, parent); + if (!d->connectionInterface->isValid()) { + d->valid = false; + qWarning() << "Could not find InterfaceDeviceWired"; + return; + } + d->valid = true; +} + +QNetworkManagerInterfaceDeviceWired::~QNetworkManagerInterfaceDeviceWired() +{ + delete d->connectionInterface; + delete d; +} + +bool QNetworkManagerInterfaceDeviceWired::isValid() +{ + + return d->valid; +} + +bool QNetworkManagerInterfaceDeviceWired::setConnections() +{ + if(!isValid() ) + return false; + + bool allOk = false; + + nmDBusHelper = new QNmDBusHelper; + connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap)), + this,SIGNAL(propertiesChanged( const QString &, QMap))); + if(dbusConnection.connect(NM_DBUS_SERVICE, + d->path, + NM_DBUS_INTERFACE_DEVICE_WIRED, + "PropertiesChanged", + nmDBusHelper,SLOT(slotPropertiesChanged( QMap))) ) { + allOk = true; + } + return allOk; +} + +QDBusInterface *QNetworkManagerInterfaceDeviceWired::connectionInterface() const +{ + return d->connectionInterface; +} + +QString QNetworkManagerInterfaceDeviceWired::hwAddress() const +{ + return d->connectionInterface->property("HwAddress").toString(); +} + +quint32 QNetworkManagerInterfaceDeviceWired::speed() const +{ + return d->connectionInterface->property("Speed").toUInt(); +} + +bool QNetworkManagerInterfaceDeviceWired::carrier() const +{ + return d->connectionInterface->property("Carrier").toBool(); +} + +///////////// +class QNetworkManagerInterfaceDeviceWirelessPrivate +{ +public: + QDBusInterface *connectionInterface; + QString path; + bool valid; +}; + +QNetworkManagerInterfaceDeviceWireless::QNetworkManagerInterfaceDeviceWireless(const QString &ifaceDevicePath, QObject *parent) +{ + d = new QNetworkManagerInterfaceDeviceWirelessPrivate(); + d->path = ifaceDevicePath; + d->connectionInterface = new QDBusInterface(NM_DBUS_SERVICE, + d->path, + NM_DBUS_INTERFACE_DEVICE_WIRELESS, + dbusConnection, parent); + if (!d->connectionInterface->isValid()) { + d->valid = false; + qWarning() << "Could not find InterfaceDeviceWireless"; + return; + } + d->valid = true; +} + +QNetworkManagerInterfaceDeviceWireless::~QNetworkManagerInterfaceDeviceWireless() +{ + delete d->connectionInterface; + delete d; +} + +bool QNetworkManagerInterfaceDeviceWireless::isValid() +{ + return d->valid; +} + +bool QNetworkManagerInterfaceDeviceWireless::setConnections() +{ + if(!isValid() ) + return false; + + bool allOk = false; + nmDBusHelper = new QNmDBusHelper; + connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap)), + this,SIGNAL(propertiesChanged( const QString &, QMap))); + + connect(nmDBusHelper, SIGNAL(pathForAccessPointAdded(const QString &,QDBusObjectPath)), + this,SIGNAL(accessPointAdded(const QString &,QDBusObjectPath))); + + connect(nmDBusHelper, SIGNAL(pathForAccessPointRemoved(const QString &,QDBusObjectPath)), + this,SIGNAL(accessPointRemoved(const QString &,QDBusObjectPath))); + + if(!dbusConnection.connect(NM_DBUS_SERVICE, + d->path, + NM_DBUS_INTERFACE_DEVICE_WIRELESS, + "AccessPointAdded", + nmDBusHelper, SLOT(slotAccessPointAdded( QDBusObjectPath )))) { + allOk = true; + } + + + if(!dbusConnection.connect(NM_DBUS_SERVICE, + d->path, + NM_DBUS_INTERFACE_DEVICE_WIRELESS, + "AccessPointRemoved", + nmDBusHelper, SLOT(slotAccessPointRemoved( QDBusObjectPath )))) { + allOk = true; + } + + + if(!dbusConnection.connect(NM_DBUS_SERVICE, + d->path, + NM_DBUS_INTERFACE_DEVICE_WIRELESS, + "PropertiesChanged", + nmDBusHelper,SLOT(slotPropertiesChanged( QMap)))) { + allOk = true; + } + + return allOk; +} + +QDBusInterface *QNetworkManagerInterfaceDeviceWireless::connectionInterface() const +{ + return d->connectionInterface; +} + +QList QNetworkManagerInterfaceDeviceWireless::getAccessPoints() +{ + QDBusReply > reply = d->connectionInterface->call("GetAccessPoints"); + return reply.value(); +} + +QString QNetworkManagerInterfaceDeviceWireless::hwAddress() const +{ + return d->connectionInterface->property("HwAddress").toString(); +} + +quint32 QNetworkManagerInterfaceDeviceWireless::mode() const +{ + return d->connectionInterface->property("Mode").toUInt(); +} + +quint32 QNetworkManagerInterfaceDeviceWireless::bitrate() const +{ + return d->connectionInterface->property("Bitrate").toUInt(); +} + +QDBusObjectPath QNetworkManagerInterfaceDeviceWireless::activeAccessPoint() const +{ + return d->connectionInterface->property("ActiveAccessPoint").value(); +} + +quint32 QNetworkManagerInterfaceDeviceWireless::wirelessCapabilities() const +{ + return d->connectionInterface->property("WirelelessCapabilities").toUInt(); +} + +///////////// +class QNetworkManagerSettingsPrivate +{ +public: + QDBusInterface *connectionInterface; + QString path; + bool valid; +}; + +QNetworkManagerSettings::QNetworkManagerSettings(const QString &settingsService, QObject *parent) + : QObject(parent) +{ +// qWarning() << __PRETTY_FUNCTION__; + d = new QNetworkManagerSettingsPrivate(); + d->path = settingsService; + d->connectionInterface = new QDBusInterface(settingsService, + NM_DBUS_PATH_SETTINGS, + NM_DBUS_IFACE_SETTINGS, + dbusConnection); + if (!d->connectionInterface->isValid()) { + d->valid = false; + qWarning() << "Could not find NetworkManagerSettings"; + return; + } + d->valid = true; +} + +QNetworkManagerSettings::~QNetworkManagerSettings() +{ + delete d->connectionInterface; + delete d; +} + +bool QNetworkManagerSettings::isValid() +{ + return d->valid; +} + +bool QNetworkManagerSettings::setConnections() +{ + bool allOk = false; + + if (!dbusConnection.connect(d->path, NM_DBUS_PATH_SETTINGS, + NM_DBUS_IFACE_SETTINGS, "NewConnection", + this, SIGNAL(newConnection(QDBusObjectPath)))) { + allOk = true; + } + + return allOk; +} + +QList QNetworkManagerSettings::listConnections() +{ + QDBusReply > reply = d->connectionInterface->call("ListConnections"); + return reply.value(); +} + +QDBusInterface *QNetworkManagerSettings::connectionInterface() const +{ + return d->connectionInterface; +} + + +///////////// +class QNetworkManagerSettingsConnectionPrivate +{ +public: + QDBusInterface *connectionInterface; + QString path; + QString service; + QNmSettingsMap settingsMap; + bool valid; +}; + +QNetworkManagerSettingsConnection::QNetworkManagerSettingsConnection(const QString &settingsService, const QString &connectionObjectPath, QObject *parent) +{ + qDBusRegisterMetaType(); + d = new QNetworkManagerSettingsConnectionPrivate(); + d->path = connectionObjectPath; + d->service = settingsService; + d->connectionInterface = new QDBusInterface(settingsService, + d->path, + NM_DBUS_IFACE_SETTINGS_CONNECTION, + dbusConnection, parent); + if (!d->connectionInterface->isValid()) { + qWarning() << "Could not find NetworkManagerSettingsConnection"; + d->valid = false; + return; + } + d->valid = true; + QDBusReply< QNmSettingsMap > rep = d->connectionInterface->call("GetSettings"); + d->settingsMap = rep.value(); +} + +QNetworkManagerSettingsConnection::~QNetworkManagerSettingsConnection() +{ + delete d->connectionInterface; + delete d; +} + +bool QNetworkManagerSettingsConnection::isValid() +{ + return d->valid; +} + +bool QNetworkManagerSettingsConnection::setConnections() +{ + if(!isValid() ) + return false; + + bool allOk = false; + if(!dbusConnection.connect(d->service, d->path, + NM_DBUS_IFACE_SETTINGS_CONNECTION, "NewConnection", + this, SIGNAL(updated(QNmSettingsMap)))) { + allOk = true; + } + + nmDBusHelper = new QNmDBusHelper; + connect(nmDBusHelper, SIGNAL(pathForSettingsRemoved(const QString &)), + this,SIGNAL(removed( const QString &))); + + if (!dbusConnection.connect(d->service, d->path, + NM_DBUS_IFACE_SETTINGS_CONNECTION, "Removed", + nmDBusHelper, SIGNAL(slotSettingsRemoved()))) { + allOk = true; + } + + return allOk; +} +//QNetworkManagerSettingsConnection::update(QNmSettingsMap map) +//{ +// d->connectionInterface->call("Update", QVariant::fromValue(map)); +//} + +QDBusInterface *QNetworkManagerSettingsConnection::connectionInterface() const +{ + return d->connectionInterface; +} + +QNmSettingsMap QNetworkManagerSettingsConnection::getSettings() +{ + QDBusReply< QNmSettingsMap > rep = d->connectionInterface->call("GetSettings"); + d->settingsMap = rep.value(); + return d->settingsMap; +} + +NMDeviceType QNetworkManagerSettingsConnection::getType() +{ + QNmSettingsMap::const_iterator i = d->settingsMap.find("connection"); + while (i != d->settingsMap.end() && i.key() == "connection") { + QMap innerMap = i.value(); + QMap::const_iterator ii = innerMap.find("type"); + while (ii != innerMap.end() && ii.key() == "type") { + QString devType = ii.value().toString(); + if (devType == "802-3-ethernet") { + return DEVICE_TYPE_802_3_ETHERNET; + } + if (devType == "802-11-wireless") { + return DEVICE_TYPE_802_11_WIRELESS; + } + ii++; + } + i++; + } + return DEVICE_TYPE_UNKNOWN; +} + +bool QNetworkManagerSettingsConnection::isAutoConnect() +{ + QNmSettingsMap::const_iterator i = d->settingsMap.find("connection"); + while (i != d->settingsMap.end() && i.key() == "connection") { + QMap innerMap = i.value(); + QMap::const_iterator ii = innerMap.find("autoconnect"); + while (ii != innerMap.end() && ii.key() == "autoconnect") { + return ii.value().toBool(); + ii++; + } + i++; + } + return true; //default networkmanager is autoconnect +} + +quint64 QNetworkManagerSettingsConnection::getTimestamp() +{ + QNmSettingsMap::const_iterator i = d->settingsMap.find("connection"); + while (i != d->settingsMap.end() && i.key() == "connection") { + QMap innerMap = i.value(); + QMap::const_iterator ii = innerMap.find("timestamp"); + while (ii != innerMap.end() && ii.key() == "timestamp") { + return ii.value().toUInt(); + ii++; + } + i++; + } + return 0; +} + +QString QNetworkManagerSettingsConnection::getId() +{ + QNmSettingsMap::const_iterator i = d->settingsMap.find("connection"); + while (i != d->settingsMap.end() && i.key() == "connection") { + QMap innerMap = i.value(); + QMap::const_iterator ii = innerMap.find("id"); + while (ii != innerMap.end() && ii.key() == "id") { + return ii.value().toString(); + ii++; + } + i++; + } + return QString(); +} + +QString QNetworkManagerSettingsConnection::getUuid() +{ + QNmSettingsMap::const_iterator i = d->settingsMap.find("connection"); + while (i != d->settingsMap.end() && i.key() == "connection") { + QMap innerMap = i.value(); + QMap::const_iterator ii = innerMap.find("uuid"); + while (ii != innerMap.end() && ii.key() == "uuid") { + return ii.value().toString(); + ii++; + } + i++; + } + // is no uuid, return the connection path + return d->connectionInterface->path(); +} + +QString QNetworkManagerSettingsConnection::getSsid() +{ + QNmSettingsMap::const_iterator i = d->settingsMap.find("802-11-wireless"); + while (i != d->settingsMap.end() && i.key() == "802-11-wireless") { + QMap innerMap = i.value(); + QMap::const_iterator ii = innerMap.find("ssid"); + while (ii != innerMap.end() && ii.key() == "ssid") { + return ii.value().toString(); + ii++; + } + i++; + } + return QString(); +} + +QString QNetworkManagerSettingsConnection::getMacAddress() +{ + if(getType() == DEVICE_TYPE_802_3_ETHERNET) { + QNmSettingsMap::const_iterator i = d->settingsMap.find("802-3-ethernet"); + while (i != d->settingsMap.end() && i.key() == "802-3-ethernet") { + QMap innerMap = i.value(); + QMap::const_iterator ii = innerMap.find("mac-address"); + while (ii != innerMap.end() && ii.key() == "mac-address") { + return ii.value().toString(); + ii++; + } + i++; + } + } + + else if(getType() == DEVICE_TYPE_802_11_WIRELESS) { + QNmSettingsMap::const_iterator i = d->settingsMap.find("802-11-wireless"); + while (i != d->settingsMap.end() && i.key() == "802-11-wireless") { + QMap innerMap = i.value(); + QMap::const_iterator ii = innerMap.find("mac-address"); + while (ii != innerMap.end() && ii.key() == "mac-address") { + return ii.value().toString(); + ii++; + } + i++; + } + } + return QString(); +} + +QStringList QNetworkManagerSettingsConnection::getSeenBssids() +{ + if(getType() == DEVICE_TYPE_802_11_WIRELESS) { + QNmSettingsMap::const_iterator i = d->settingsMap.find("802-11-wireless"); + while (i != d->settingsMap.end() && i.key() == "802-11-wireless") { + QMap innerMap = i.value(); + QMap::const_iterator ii = innerMap.find("seen-bssids"); + while (ii != innerMap.end() && ii.key() == "seen-bssids") { + return ii.value().toStringList(); + ii++; + } + i++; + } + } + return QStringList(); +} + +///////////// +class QNetworkManagerConnectionActivePrivate +{ +public: + QDBusInterface *connectionInterface; + QString path; + bool valid; +}; + +QNetworkManagerConnectionActive::QNetworkManagerConnectionActive( const QString &activeConnectionObjectPath, QObject *parent) +{ + d = new QNetworkManagerConnectionActivePrivate(); + d->path = activeConnectionObjectPath; + d->connectionInterface = new QDBusInterface(NM_DBUS_SERVICE, + d->path, + NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + dbusConnection, parent); + if (!d->connectionInterface->isValid()) { + d->valid = false; + qWarning() << "Could not find NetworkManagerSettingsConnection"; + return; + } + d->valid = true; +} + +QNetworkManagerConnectionActive::~QNetworkManagerConnectionActive() +{ + delete d->connectionInterface; + delete d; +} + +bool QNetworkManagerConnectionActive::isValid() +{ + return d->valid; +} + +bool QNetworkManagerConnectionActive::setConnections() +{ + if(!isValid() ) + return false; + + bool allOk = false; + nmDBusHelper = new QNmDBusHelper; + connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap)), + this,SIGNAL(propertiesChanged( const QString &, QMap))); + if(dbusConnection.connect(NM_DBUS_SERVICE, + d->path, + NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + "PropertiesChanged", + nmDBusHelper,SLOT(slotPropertiesChanged( QMap))) ) { + allOk = true; + } + + return allOk; +} + +QDBusInterface *QNetworkManagerConnectionActive::connectionInterface() const +{ + return d->connectionInterface; +} + +QString QNetworkManagerConnectionActive::serviceName() const +{ + return d->connectionInterface->property("ServiceName").toString(); +} + +QDBusObjectPath QNetworkManagerConnectionActive::connection() const +{ + QVariant prop = d->connectionInterface->property("Connection"); + return prop.value(); +} + +QDBusObjectPath QNetworkManagerConnectionActive::specificObject() const +{ + QVariant prop = d->connectionInterface->property("SpecificObject"); + return prop.value(); +} + +QList QNetworkManagerConnectionActive::devices() const +{ + QVariant prop = d->connectionInterface->property("Devices"); + return prop.value >(); +} + +quint32 QNetworkManagerConnectionActive::state() const +{ + return d->connectionInterface->property("State").toUInt(); +} + +bool QNetworkManagerConnectionActive::defaultRoute() const +{ + return d->connectionInterface->property("Default").toBool(); +} + + +//// +class QNetworkManagerIp4ConfigPrivate +{ +public: + QDBusInterface *connectionInterface; + QString path; + bool valid; +}; + +QNetworkManagerIp4Config::QNetworkManagerIp4Config( const QString &deviceObjectPath, QObject *parent) +{ + d = new QNetworkManagerIp4ConfigPrivate(); + d->path = deviceObjectPath; + d->connectionInterface = new QDBusInterface(NM_DBUS_SERVICE, + d->path, + NM_DBUS_INTERFACE_IP4_CONFIG, + dbusConnection, parent); + if (!d->connectionInterface->isValid()) { + d->valid = false; + qWarning() << "Could not find NetworkManagerIp4Config"; + return; + } + d->valid = true; +} + +QNetworkManagerIp4Config::~QNetworkManagerIp4Config() +{ + delete d->connectionInterface; + delete d; +} + +bool QNetworkManagerIp4Config::isValid() +{ + return d->valid; +} + +QStringList QNetworkManagerIp4Config::domains() const +{ + return d->connectionInterface->property("Domains").toStringList(); +} + +#include "moc_qnetworkmanagerservice_p.cpp" + +QTM_END_NAMESPACE diff --git a/src/network/bearer/qnetworkmanagerservice_p.h b/src/network/bearer/qnetworkmanagerservice_p.h new file mode 100644 index 0000000..8569e71 --- /dev/null +++ b/src/network/bearer/qnetworkmanagerservice_p.h @@ -0,0 +1,400 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNETWORKMANAGERSERVICE_H +#define QNETWORKMANAGERSERVICE_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include +#include +#include +#include +#include + + +#include +#include + + +QTM_BEGIN_NAMESPACE +typedef QMap< QString, QMap > QNmSettingsMap; +typedef QList ServerThing; +QTM_END_NAMESPACE + +Q_DECLARE_METATYPE(QTM_PREPEND_NAMESPACE(QNmSettingsMap)) +Q_DECLARE_METATYPE(QTM_PREPEND_NAMESPACE(ServerThing)) + + +QTM_BEGIN_NAMESPACE +class QNetworkManagerInterfacePrivate; +class QNetworkManagerInterface : public QObject +{ + Q_OBJECT + +public: + + QNetworkManagerInterface(QObject *parent = 0); + ~QNetworkManagerInterface(); + + QList getDevices() const; + void activateConnection(const QString &serviceName, QDBusObjectPath connection, QDBusObjectPath device, QDBusObjectPath specificObject); + void deactivateConnection(QDBusObjectPath connectionPath) const; + + QDBusObjectPath path() const; + QDBusInterface *connectionInterface() const; + + bool wirelessEnabled() const; + bool wirelessHardwareEnabled() const; + QList activeConnections() const; + quint32 state(); + bool setConnections(); + bool isValid(); + +Q_SIGNALS: + void deviceAdded(QDBusObjectPath); + void deviceRemoved(QDBusObjectPath); + void propertiesChanged( const QString &, QMap); + void stateChanged(const QString&, quint32); + void activationFinished(QDBusPendingCallWatcher*); + +private Q_SLOTS: +private: +// Q_DISABLE_COPY(QNetworkManagerInterface); ?? + QNetworkManagerInterfacePrivate *d; + QNmDBusHelper *nmDBusHelper; +}; //end QNetworkManagerInterface + +//////// +class QNetworkManagerInterfaceAccessPointPrivate; +class QNetworkManagerInterfaceAccessPoint : public QObject +{ + Q_OBJECT + +public: + + // NM_DEVICE_STATE + enum DeviceState { + Unknown = 0, + Unmanaged, + Unavailable, + Disconnected, + Prepare, + Config, + NeedAuthentication, + IpConfig, + Activated, + Failed + }; + + enum ApFlag { + ApNone = 0x0, + Privacy = 0x1 + }; + + Q_DECLARE_FLAGS(ApFlags, ApFlag); + + enum ApSecurityFlag { + ApSecurityNone = 0x0, + PairWep40 = 0x1, + PairWep104 = 0x2, + PairTkip = 0x4, + PairCcmp = 0x8, + GroupWep40 = 0x10, + GroupWep104 = 0x20, + GroupTkip = 0x40, + GroupCcmp = 0x80, + KeyPsk = 0x100, + Key8021x = 0x200 + }; + + Q_DECLARE_FLAGS(ApSecurityFlags, ApSecurityFlag); + + QNetworkManagerInterfaceAccessPoint(const QString &dbusPathName, QObject *parent = 0); + ~QNetworkManagerInterfaceAccessPoint(); + + QDBusInterface *connectionInterface() const; + + quint32 flags() const; + quint32 wpaFlags() const; + quint32 rsnFlags() const; + QString ssid() const; + quint32 frequency() const; + QString hwAddress() const; + quint32 mode() const; + quint32 maxBitrate() const; + quint32 strength() const; + bool setConnections(); + bool isValid(); + +Q_SIGNALS: + void propertiesChanged(QMap ); + void propertiesChanged( const QString &, QMap); +private: + QNetworkManagerInterfaceAccessPointPrivate *d; + QNmDBusHelper *nmDBusHelper; + +}; //end QNetworkManagerInterfaceAccessPoint + +//////// +class QNetworkManagerInterfaceDevicePrivate; +class QNetworkManagerInterfaceDevice : public QObject +{ + Q_OBJECT + +public: + + QNetworkManagerInterfaceDevice(const QString &deviceObjectPath, QObject *parent = 0); + ~QNetworkManagerInterfaceDevice(); + + QString udi() const; + QNetworkInterface interface() const; + QDBusInterface *connectionInterface() const; + quint32 ip4Address() const; + quint32 state() const; + quint32 deviceType() const; + + QDBusObjectPath ip4config() const; + bool setConnections(); + bool isValid(); + +Q_SIGNALS: + void stateChanged(const QString &, quint32); + +private: + QNetworkManagerInterfaceDevicePrivate *d; + QNmDBusHelper *nmDBusHelper; +}; //end QNetworkManagerInterfaceDevice + +//////// +class QNetworkManagerInterfaceDeviceWiredPrivate; +class QNetworkManagerInterfaceDeviceWired : public QObject +{ + Q_OBJECT + +public: + + QNetworkManagerInterfaceDeviceWired(const QString &ifaceDevicePath, QObject *parent = 0); + ~QNetworkManagerInterfaceDeviceWired(); + + QDBusInterface *connectionInterface() const; + QString hwAddress() const; + quint32 speed() const; + bool carrier() const; + bool setConnections(); + bool isValid(); + +Q_SIGNALS: + void propertiesChanged( const QString &, QMap); +private: + QNetworkManagerInterfaceDeviceWiredPrivate *d; + QNmDBusHelper *nmDBusHelper; +}; // end QNetworkManagerInterfaceDeviceWired + +//// +class QNetworkManagerInterfaceDeviceWirelessPrivate; +class QNetworkManagerInterfaceDeviceWireless : public QObject +{ + Q_OBJECT + +public: + + enum DeviceCapability { + None = 0x0, + Wep40 = 0x1, + Wep104 = 0x2, + Tkip = 0x4, + Ccmp = 0x8, + Wpa = 0x10, + Rsn = 0x20 + }; + + QNetworkManagerInterfaceDeviceWireless(const QString &ifaceDevicePath, QObject *parent = 0); + ~QNetworkManagerInterfaceDeviceWireless(); + + QDBusObjectPath path() const; + QList getAccessPoints(); + QDBusInterface *connectionInterface() const; + + QString hwAddress() const; + quint32 mode() const; + quint32 bitrate() const; + QDBusObjectPath activeAccessPoint() const; + quint32 wirelessCapabilities() const; + bool setConnections(); + bool isValid(); + +Q_SIGNALS: + void propertiesChanged( const QString &, QMap); + void accessPointAdded(const QString &,QDBusObjectPath); + void accessPointRemoved(const QString &,QDBusObjectPath); +private: + QNetworkManagerInterfaceDeviceWirelessPrivate *d; + QNmDBusHelper *nmDBusHelper; +}; // end QNetworkManagerInterfaceDeviceWireless + +//// +class QNetworkManagerSettingsPrivate; +class QNetworkManagerSettings : public QObject +{ + Q_OBJECT + +public: + + QNetworkManagerSettings(const QString &settingsService, QObject *parent = 0); + ~QNetworkManagerSettings(); + + QDBusInterface *connectionInterface() const; + QList listConnections(); + bool setConnections(); + bool isValid(); + +Q_SIGNALS: + void newConnection(QDBusObjectPath); +private: + QNetworkManagerSettingsPrivate *d; +}; //end QNetworkManagerSettings + +//// +class QNetworkManagerSettingsConnectionPrivate; +class QNetworkManagerSettingsConnection : public QObject +{ + Q_OBJECT + +public: + + QNetworkManagerSettingsConnection(const QString &settingsService, const QString &connectionObjectPath, QObject *parent = 0); + ~QNetworkManagerSettingsConnection(); + + QDBusInterface *connectionInterface() const; + QNmSettingsMap getSettings(); + // void update(QNmSettingsMap map); + bool setConnections(); + NMDeviceType getType(); + bool isAutoConnect(); + quint64 getTimestamp(); + QString getId(); + QString getUuid(); + QString getSsid(); + QString getMacAddress(); + QStringList getSeenBssids(); + bool isValid(); + +Q_SIGNALS: + + void updated(QMap< QString, QMap > s); + void removed(const QString &); + +private: + QNmDBusHelper *nmDBusHelper; + QNetworkManagerSettingsConnectionPrivate *d; +}; //end QNetworkManagerSettingsConnection + +//// +class QNetworkManagerConnectionActivePrivate; +class QNetworkManagerConnectionActive : public QObject +{ + Q_OBJECT + +public: + + enum ActiveConnectionState { + Unknown = 0, + Activating = 1, + Activated = 2 + }; + + QNetworkManagerConnectionActive(const QString &dbusPathName, QObject *parent = 0); + ~ QNetworkManagerConnectionActive(); + + QDBusInterface *connectionInterface() const; + QString serviceName() const; + QDBusObjectPath connection() const; + QDBusObjectPath specificObject() const; + QList devices()