bluetoothengine/btui/btuidelegate/btabstractdelegate.h
changeset 31 a0ea99b6fa53
parent 29 48ae3789ce00
child 40 997690c3397a
equal deleted inserted replaced
30:df7a93ede42e 31:a0ea99b6fa53
    18 #ifndef BTABSTRACTDELEGATE_H
    18 #ifndef BTABSTRACTDELEGATE_H
    19 #define BTABSTRACTDELEGATE_H
    19 #define BTABSTRACTDELEGATE_H
    20 
    20 
    21 #include <QObject>
    21 #include <QObject>
    22 #include <QVariant>
    22 #include <QVariant>
       
    23 #include <QModelIndex>
    23 
    24 
    24 class BtuiModel;
    25 class BtSettingModel;
       
    26 class BtDeviceModel;
    25 
    27 
    26 #ifdef BUILD_BTUIDELEGATE
    28 #ifdef BUILD_BTUIDELEGATE
    27 #define BTUIDELEGATE_IMEXPORT Q_DECL_EXPORT
    29 #define BTUIDELEGATE_IMEXPORT Q_DECL_EXPORT
    28 #else
    30 #else
    29 #define BTUIDELEGATE_IMEXPORT Q_DECL_IMPORT
    31 #define BTUIDELEGATE_IMEXPORT Q_DECL_IMPORT
    40 class BTUIDELEGATE_IMEXPORT BtAbstractDelegate : public QObject
    42 class BTUIDELEGATE_IMEXPORT BtAbstractDelegate : public QObject
    41 {
    43 {
    42     Q_OBJECT
    44     Q_OBJECT
    43 
    45 
    44 public:
    46 public:
    45     explicit BtAbstractDelegate( BtuiModel& model, QObject *parent = 0 );
    47     explicit BtAbstractDelegate( BtSettingModel* settingModel, 
       
    48             BtDeviceModel* deviceModel, QObject *parent = 0 );
    46     
    49     
    47     virtual ~BtAbstractDelegate();
    50     virtual ~BtAbstractDelegate();
    48 
    51 
    49     virtual void exec( const QVariant &params ) = 0;
    52     virtual void exec( const QVariant &params ) = 0;
    50 
    53 
       
    54     virtual void cancel();
       
    55     
    51 signals:
    56 signals:
    52     void commandCompleted(int status, QVariant params = QVariant() );
    57     void commandCompleted(int status, QVariant params = QVariant() );
    53     
    58     
    54 protected:
    59 protected:
    55     
    60     
    56     BtuiModel &model();
    61     BtSettingModel *getSettingModel();
       
    62     BtDeviceModel *getDeviceModel();
    57     
    63     
    58 public slots:
    64 public slots:
    59 
    65 
    60 private:
    66 private:
    61     
    67     
    62     BtuiModel& mModel;
    68     // pointer to models. do not own. 
    63 
    69     BtSettingModel *mSettingModel;
       
    70     BtDeviceModel *mDeviceModel;
       
    71     
    64     Q_DISABLE_COPY(BtAbstractDelegate)
    72     Q_DISABLE_COPY(BtAbstractDelegate)
    65 
    73 
    66 };
    74 };
    67 
    75 
       
    76 Q_DECLARE_METATYPE(QModelIndex)
       
    77 
    68 #endif // BTABSTRACTDELEGATE_H
    78 #endif // BTABSTRACTDELEGATE_H