bluetoothengine/btui/inc/btdevicemodel.h
changeset 41 0b2439c3e397
parent 40 997690c3397a
child 63 bcf742120177
equal deleted inserted replaced
40:997690c3397a 41:0b2439c3e397
    21 #include <qglobal.h>
    21 #include <qglobal.h>
    22 #include <QAbstractItemModel>
    22 #include <QAbstractItemModel>
    23 #include <QSharedPointer>
    23 #include <QSharedPointer>
    24 #include <btuimodeltypes.h>
    24 #include <btuimodeltypes.h>
    25 
    25 
    26 class BtDeviceData;
    26 class BtDeviceModelPrivate;
    27 
    27 
    28 /*!
    28 /*!
    29     \class BtDeviceModel
    29     \class BtDeviceModel
    30     \brief The data model provided to Bluetooth UIs in QT
    30     \brief The data model provided to Bluetooth UIs in QT
    31 
    31 
    67         LastUsedTimeRole, // QDateTime
    67         LastUsedTimeRole, // QDateTime
    68         RssiRole,         // QVariant::Int
    68         RssiRole,         // QVariant::Int
    69         MajorPropertyRole,  // QVariant::Int, bits of DevMajorProperty
    69         MajorPropertyRole,  // QVariant::Int, bits of DevMajorProperty
    70         MinorPropertyRole,  // QVariant::Int, bits of DevMinorProperty
    70         MinorPropertyRole,  // QVariant::Int, bits of DevMinorProperty
    71         CoDRole,  // QVariant::Int, the value of Class of Device
    71         CoDRole,  // QVariant::Int, the value of Class of Device
       
    72         SeqNumRole    // sequence number indicating order in which device was found
    72     };
    73     };
    73     
    74     
    74 public:
    75 public:
    75     
    76     
    76     explicit BtDeviceModel( QObject *parent = 0 );
    77     explicit BtDeviceModel( QObject *parent = 0 );
    99     virtual QMap<int, QVariant> itemData( const QModelIndex & index ) const;
   100     virtual QMap<int, QVariant> itemData( const QModelIndex & index ) const;
   100     
   101     
   101 signals:
   102 signals:
   102 
   103 
   103     void deviceSearchCompleted(int error);
   104     void deviceSearchCompleted(int error);
       
   105 
       
   106 private slots:
       
   107 
       
   108     void deviceDataChanged( int row, void *parent );
       
   109     
       
   110     void deviceDataChanged( int first, int last, void *parent );
       
   111     
       
   112     void beginInsertDevices(int first, int last, void *parent);
       
   113     void endInsertDevices();
       
   114     
       
   115     void beginRemoveDevices(int first, int last, void *parent);
       
   116     void endRemoveDevices();
       
   117 
       
   118     void emitDeviceSearchCompleted( int error );
       
   119 
       
   120 private:
       
   121     
       
   122     void connectModelSignals();
   104     
   123     
   105 private:
   124 private:
   106     
   125     QSharedPointer<BtDeviceModelPrivate> d;
   107     void emitDataChanged(int row, int column, void *parent );
       
   108     
       
   109     void emitDataChanged(const QModelIndex &top, const QModelIndex &bottom );
       
   110     
       
   111     void emitdeviceSearchCompleted(int error);
       
   112     
       
   113 private:
       
   114     QSharedPointer<BtDeviceData> mDeviceData;
       
   115 
       
   116     friend class BtDeviceData;
       
   117 };
   126 };
   118 
   127 
   119 #endif // BTUIMODEL_H
   128 #endif // BTUIMODEL_H