DNSSD
servicemodel.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef DNSSDSERVICEMODEL_H
00022 #define DNSSDSERVICEMODEL_H
00023
00024 #include <QtCore/QAbstractItemModel>
00025 #include <dnssd/dnssd_export.h>
00026 #include <dnssd/remoteservice.h>
00027
00028 namespace DNSSD
00029 {
00030
00031 struct ServiceModelPrivate;
00032 class ServiceBrowser;
00033
00034
00066 class KDNSSD_EXPORT ServiceModel : public QAbstractItemModel
00067 {
00068 Q_OBJECT
00069
00070 public:
00071
00073 enum AdditionalRoles {
00074 ServicePtrRole = 0xA06519DE
00075 };
00076
00083 enum ModelColumns {
00084 ServiceName = 0,
00085 Host = 1,
00086 Port = 2
00087 };
00088
00099 explicit ServiceModel(ServiceBrowser* browser, QObject* parent = 0);
00100
00101 virtual ~ServiceModel();
00102
00104 virtual int columnCount(const QModelIndex& parent = QModelIndex() ) const;
00106 virtual int rowCount(const QModelIndex& parent = QModelIndex() ) const;
00108 virtual QModelIndex parent(const QModelIndex& index ) const;
00110 virtual QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex() ) const;
00112 virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole ) const;
00114 virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
00116 virtual bool hasIndex(int row, int column, const QModelIndex &parent) const;
00117
00118 private:
00119 ServiceModelPrivate* const d;
00120 friend struct ServiceModelPrivate;
00121
00122 };
00123
00124 }
00125
00126 #endif