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
00061 class KDNSSD_EXPORT ServiceModel : public QAbstractItemModel
00062 {
00063 Q_OBJECT
00064
00065 public:
00066
00067 enum AdditionalRoles {
00068 ServicePtrRole = 0xA06519DE
00069 };
00070
00075 enum ModelColumns {
00076 ServiceName = 0,
00077 Host = 1,
00078 Port = 2
00079 };
00080
00085 explicit ServiceModel(ServiceBrowser* browser, QObject* parent=0);
00086 virtual ~ServiceModel();
00087
00088 virtual int columnCount(const QModelIndex& parent = QModelIndex() ) const;
00089 virtual int rowCount(const QModelIndex& parent = QModelIndex() ) const;
00090 virtual QModelIndex parent(const QModelIndex& index ) const;
00091 virtual QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex() ) const;
00092 virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole ) const;
00093 virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
00094 virtual bool hasIndex(int row, int column, const QModelIndex &parent) const;
00095
00096
00097 private:
00098 ServiceModelPrivate* const d;
00099 friend struct ServiceModelPrivate;
00100
00101 };
00102
00103 }
00104
00105 #endif