![]() |
QBluetoothZero
2.0
|
00001 /* 00002 * QBtServiceAdvertiser.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 QBTSERVICEADVERTISER_H_ 00021 #define QBTSERVICEADVERTISER_H_ 00022 00023 #include <QBtGlobal.h> 00024 #include <QtCore/QObject> 00025 #include <QBtTypes.h> 00026 00027 QBT_NAMESPACE_BEGIN 00028 00029 //forward declaration 00030 class QBtServiceAdvertiserPrivate; 00031 00056 class DLL_EXPORT QBtServiceAdvertiser : public QObject 00057 { 00058 Q_OBJECT 00059 00060 public: 00061 enum ErrorCodes 00062 { 00063 FeatureNotSupported 00064 }; 00065 00066 public: 00067 QBtServiceAdvertiser(QObject* parent); 00068 ~QBtServiceAdvertiser(); 00069 00076 void startAdvertising(const QBtService& service); 00077 00081 void stopAdvertising(); 00082 00087 void updateAvailability(bool aAvailable); 00088 00089 signals: 00094 void advertisingStarted(const QBtService& service); 00095 00099 void advertisingStopped(); 00100 00105 void error (QBtServiceAdvertiser::ErrorCodes code); 00106 00107 private: 00108 // The service to advertise 00109 QBtService* _localService; 00110 00111 //pointer to implementation 00112 QBtServiceAdvertiserPrivate *_implPtr; 00113 00114 00115 friend class QBtServiceAdvertiserPrivate; 00116 00117 }; 00118 00119 QBT_NAMESPACE_END 00120 00121 //Q_DECLARE_METATYPE(QBT_PREPEND_NAMESPACE(QBtServiceAdvertiser)) 00122 00123 #endif /* QBTSERVICEADVERTISER_H_ */