QBluetoothZero  2.0
QBtServiceDiscoverer.h
Go to the documentation of this file.
00001 /*
00002  * QBtServiceDiscoverer.h
00003  *
00004  *
00005  *      Author: Ftylitakis Nikolaos
00006  *
00007  * Licensed under the Apache License, Version 2.0 (the "License");
00008  * you may not use this file except in compliance with the License.
00009  * You may obtain a copy of the License at
00010  *
00011  *      http://www.apache.org/licenses/LICENSE-2.0
00012  *
00013  * Unless required by applicable law or agreed to in writing, software
00014  * distributed under the License is distributed on an "AS IS" BASIS,
00015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016  * See the License for the specific language governing permissions and
00017  * limitations under the License.
00018  */
00019 
00020 #ifndef QBTSERVICEDISCOVERER_H_
00021 #define QBTSERVICEDISCOVERER_H_
00022 
00023 #include <QBtGlobal.h>
00024 #include <QtCore/QObject>
00025 #include <QBtTypes.h>
00026 #include <QtCore/QList>
00027 
00028 QBT_NAMESPACE_BEGIN
00029 
00030 //forward declaration
00031 class QBtServiceDiscovererPrivate;
00032 
00057 class DLL_EXPORT QBtServiceDiscoverer : public QObject
00058 {
00059     Q_OBJECT
00060 
00061 public:
00062     enum ServiceDiscoveryError
00063     {
00064         ServiceDiscoveryNotAbleToComplete,
00065         UnableToRetrieveServiceAttributes,
00066         ProblemRequestingNextServiceRecord,
00067         ProblemAcquiringNextServiceAttributes,
00068         NotSupported,
00069         NoDeviceSelected,
00070         UnknownError
00071     };
00072 
00073 public:
00074     QBtServiceDiscoverer(QObject* parent = 0);
00075     virtual ~QBtServiceDiscoverer();
00076 
00082     QBtService::List getInquiredServices();
00083 
00092     const QBtDevice & getTargetDevice() const;
00093     
00097     bool isBusy () const;
00098 
00099 public slots:
00100 
00101 
00108    void startDiscovery (const QBtDevice & targetDevice);
00109 
00110 
00117    void startObexDiscovery (const QBtDevice & targetDevice);
00118 
00125    void startRfcommDiscovery (const QBtDevice & targetDevice);
00126 
00127 
00128 
00136    void startDiscovery (const QBtDevice & targetDevice, const QBtUuid & uuid);
00137 
00138 
00146    void startDiscovery (const QBtDevice& targetDevice, const QList <QBtUuid> & uuids);
00147 
00148 
00153    void stopDiscovery();
00154 
00155 
00156 signals:
00157 
00161     void discoveryStarted();
00162 
00166     void discoveryStopped ();
00167 
00176     void newServiceFound (const QBtDevice& targetDevice, const QBtService & service);
00177 
00182     void error (QBtServiceDiscoverer::ServiceDiscoveryError error);
00183 
00184 private:
00185     QBtDevice                                   _remoteDevice;    
00186     QBtServiceDiscovererPrivate *_implPtr;  
00187     
00188     friend class QBtServiceDiscovererPrivate;
00189 };
00190 
00191 QBT_NAMESPACE_END
00192 
00193 //Q_DECLARE_METATYPE(QBT_PREPEND_NAMESPACE(QBtServiceDiscoverer))
00194 
00195 #endif /* QBTSERVICEDISCOVERER_H_ */