QBluetoothZero  2.0
QBtService.h
Go to the documentation of this file.
00001 /*
00002  *
00003  * Licensed under the Apache License, Version 2.0 (the "License");
00004  * you may not use this file except in compliance with the License.
00005  * You may obtain a copy of the License at
00006  *
00007  *      http://www.apache.org/licenses/LICENSE-2.0
00008  *
00009  * Unless required by applicable law or agreed to in writing, software
00010  * distributed under the License is distributed on an "AS IS" BASIS,
00011  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012  * See the License for the specific language governing permissions and
00013  * limitations under the License.
00014  */
00015 
00016 #ifndef QBTSERVICE_H
00017 #define QBTSERVICE_H
00018 
00019 #include <QtCore/QString>
00020 #include <QtCore/QList>
00021 #include <QBtGlobal.h>
00022 #include <QBtConstants.h>
00023 #include <QBtUuid.h>
00024 
00025 QBT_NAMESPACE_BEGIN
00026 
00031 class DLL_EXPORT QBtService : public QObject
00032 {
00033         Q_OBJECT
00034 
00035    public:
00036       typedef QList<QBtService> List;
00037 
00051       typedef QList<QBtUuid> ProtocolList;
00052 
00056       QBtService(QObject* parent = 0);
00057 
00061           QBtService(const QBtService& service, QObject* parent = 0);
00062     
00066       ProtocolList getProtocols() const;
00067 
00071       QBtUuid getClass () const;
00072 
00076       QString getName() const;
00077 
00081       QString getDescription() const;
00082 
00086       uint getPort() const;
00087 
00091       uint getHandle() const;
00092 
00096       void addProtocol(const QBtUuid & uuid);
00097 
00098       bool removeProtocol (const QBtUuid & uuid);
00099 
00100       void setProtocols(const ProtocolList & newUUIDs);
00101 
00102       void setClass(const QBtUuid & newClass);
00103 
00104       void setName(const QString& newName);
00105 
00106       void setDescription(const QString& newDescription);
00107 
00108       void setPort(uint newPort);
00109 
00110       void setHandle (uint newHandle);
00111         
00112           QBtService& operator=(const QBtService& service);
00113 
00114    private:
00115 
00116       // protocol list is mainly used on symbian
00117       // on windows the connections are done using classUUID
00118       QBtUuid       _serviceUuid;
00119       ProtocolList  _protocolList;
00120       QString       _name;
00121       QString       _description;
00122       uint          _handle;
00123 
00124       // used on RFCOMM service as channel number to be used for connection
00125       // to remote device
00126       uint          _port;
00127 
00128 };
00129 
00130 QBT_NAMESPACE_END
00131 
00132 Q_DECLARE_METATYPE(QBT_PREPEND_NAMESPACE(QBtService))
00133 
00134 #endif // QBTSERVICE_H