![]() |
QBluetoothZero
2.0
|
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 QBTADDRESS_H 00017 #define QBTADDRESS_H 00018 00019 #include <QtCore/QString.h> 00020 #include <QtCore/QByteArray.h> 00021 #include <QBtGlobal.h> 00022 00023 #ifdef Q_OS_SYMBIAN 00024 #include <bttypes.h> 00025 #endif 00026 00027 QBT_NAMESPACE_BEGIN 00028 00033 class DLL_EXPORT QBtAddress : public QObject 00034 { 00035 Q_OBJECT 00036 Q_PROPERTY(QString _address READ toString)// WRITE setName) 00037 00038 public: 00039 00044 QBtAddress(); 00045 00050 QBtAddress (const QBtAddress& other); 00051 00052 QBtAddress (const QByteArray& byteArray); 00053 QBtAddress (const QString& addr); 00054 00055 #ifdef Q_OS_SYMBIAN 00056 QBtAddress (const TBTDevAddr& addr); 00057 #endif 00058 00065 static QBtAddress& getAddressFromReversedArray (const QByteArray & reversedArray); 00066 00067 ~QBtAddress (); 00068 00073 bool isValid () const; 00074 00078 QString toString() const; 00079 00083 QByteArray toByteArray() const; // Symbian representation 00084 00090 QByteArray toReversedByteArray() const; // windows representation 00091 00092 QBtAddress& operator= (const QBtAddress & other ); 00093 bool operator!= (const QBtAddress & other ); 00094 bool operator== (const QBtAddress & other ); 00095 bool operator< (const QBtAddress & other ); 00096 00097 #ifdef Q_OS_SYMBIAN 00098 TBTDevAddr convertToSymbianBtDevAddr() const; 00099 #endif 00100 00101 private: 00102 QString _address; 00103 bool _valid; 00104 }; 00105 00106 QBT_NAMESPACE_END 00107 00108 Q_DECLARE_METATYPE(QBT_PREPEND_NAMESPACE(QBtAddress)) 00109 00110 #endif // QBTADDRESS_H