diff options
author | alex <alex.blasche@nokia.com> | 2012-06-25 13:53:08 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-27 02:36:37 +0200 |
commit | bc9bc3400ccecd9d7bcbbe5eee1fc49070874b4c (patch) | |
tree | 4a7ec2697a2adc1ed2e8c4394fe3f1bd321cccc7 /src/bluetooth/qbluetoothhostinfo.cpp | |
parent | 2cf4fc7c63622326780646375cf4c7c2fd014345 (diff) |
Split QBluetoothHostInfo from QBluetoothLocalDevice
Change-Id: I8bd9de956c62f93b509e877128b1822ebfef69bd
Reviewed-by: Michael Zanetti <michael.zanetti@nokia.com>
Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothhostinfo.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothhostinfo.cpp | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothhostinfo.cpp b/src/bluetooth/qbluetoothhostinfo.cpp new file mode 100644 index 00000000..d85f87c3 --- /dev/null +++ b/src/bluetooth/qbluetoothhostinfo.cpp @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtBluetooth module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qbluetoothhostinfo.h" +#include "qbluetoothhostinfo_p.h" + +QTBLUETOOTH_BEGIN_NAMESPACE + +/*! + \class QBluetoothHostInfo + \brief The QBluetoothHostInfo class encapsulates the details of a local + QBluetooth device. + + \ingroup connectivity-bluetooth + \inmodule QtBluetooth + + This class holds the name and address of a local Bluetooth device. +*/ + +/*! + Constrcuts a null QBluetoothHostInfo object. +*/ +QBluetoothHostInfo::QBluetoothHostInfo() + : d_ptr(new QBluetoothHostInfoPrivate) +{ +} + +/*! + Constrcuts a new QBluetoothHostInfo which is a copy of \a other. +*/ +QBluetoothHostInfo::QBluetoothHostInfo(const QBluetoothHostInfo &other) + : d_ptr(new QBluetoothHostInfoPrivate) +{ + Q_D(QBluetoothHostInfo); + + d->m_address = other.d_func()->m_address; + d->m_name = other.d_func()->m_name; +} + +/*! + Destroys the QBluetoothHostInfo. +*/ +QBluetoothHostInfo::~QBluetoothHostInfo() +{ + delete d_ptr; +} + +/*! + Returns the Bluetooth address as a QBluetoothAddress. +*/ +QBluetoothAddress QBluetoothHostInfo::getAddress() const +{ + Q_D(const QBluetoothHostInfo); + return d->m_address; +} + +/*! + Sets the Bluetooth \a address for this Bluetooth host info object. +*/ +void QBluetoothHostInfo::setAddress(const QBluetoothAddress &address) +{ + Q_D(QBluetoothHostInfo); + d->m_address = address; +} + +/*! + Returns the name of the host info object. +*/ +QString QBluetoothHostInfo::getName() const +{ + Q_D(const QBluetoothHostInfo); + return d->m_name; +} + +/*! + Sets the name of the host info object. +*/ +void QBluetoothHostInfo::setName(const QString &name) +{ + Q_D(QBluetoothHostInfo); + d->m_name = name; +} + +QTBLUETOOTH_END_NAMESPACE |