bluetoothengine/btui/btuimodel/btsettingmodel_p.h
branchRCL_3
changeset 56 9386f31cc85b
parent 55 613943a21004
child 61 269724087bed
equal deleted inserted replaced
55:613943a21004 56:9386f31cc85b
     1 /*
       
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0""
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  
       
    15  *   
       
    16  */
       
    17 
       
    18 #ifndef BTSETTINGMODEL_P_H
       
    19 #define BTSETTINGMODEL_P_H
       
    20 
       
    21 #include <btsettingmodel.h>
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <e32property.h>
       
    25 #include <btengsettings.h>
       
    26 #include <btservices/btsimpleactive.h>
       
    27 
       
    28 /*!
       
    29     \class BtuimSettings
       
    30     \brief class for handling local Bluetooth setting updates.
       
    31 
       
    32     BtLocalSetting class is responsible for providing the latest information
       
    33     regarding the local Bluetooth settings such as device name and power state.
       
    34 
       
    35     \\sa bluetoothuimodel
       
    36  */
       
    37 class BtSettingModelPrivate : public QObject,
       
    38                       public MBTEngSettingsObserver,
       
    39                       public MBtSimpleActiveObserver
       
    40 {
       
    41     Q_OBJECT
       
    42 
       
    43 public:
       
    44     explicit BtSettingModelPrivate( BtSettingModel& model, QObject *parent = 0 );
       
    45     
       
    46     virtual ~BtSettingModelPrivate();
       
    47     
       
    48     bool isValid( int row, int col ) const;
       
    49     
       
    50     int rowCount() const;
       
    51     
       
    52     int columnCount() const;
       
    53         
       
    54     void data(QVariant& val, int row, int col, int role ) const;
       
    55     
       
    56     BtuiModelDataItem itemData( int row, int col ) const;
       
    57 signals:
       
    58 
       
    59     void settingDataChanged( int row, void *parent );
       
    60     
       
    61     void settingDataChanged( int first, int last, void *parent );
       
    62     
       
    63 private:
       
    64     // from MBTEngSettingsObserver
       
    65     
       
    66     void PowerStateChanged( TBTPowerStateValue state );
       
    67     
       
    68     void VisibilityModeChanged( TBTVisibilityMode state );
       
    69     
       
    70     // from MBtSimpleActiveObserver
       
    71     
       
    72     void RequestCompletedL( CBtSimpleActive* active, TInt status );
       
    73 
       
    74     void CancelRequest( TInt requestId );
       
    75 
       
    76     void HandleError( CBtSimpleActive* active, TInt error );
       
    77 
       
    78 private:
       
    79 
       
    80     void setVisibilityMode( TBTVisibilityMode state );
       
    81     void updateDeviceName( const QString &name );
       
    82     
       
    83     void setPowerSetting( TBTPowerStateValue state );
       
    84     
       
    85     //void setOfflineSetting( bool state );
       
    86     //void setBtConnectionsSetting( int connections );
       
    87     
       
    88     void getNameFromRegistry( QString &name );
       
    89 
       
    90 private:
       
    91     
       
    92     BtuiModelDataSource mData;
       
    93     
       
    94     BtSettingModel& mModel;
       
    95     
       
    96     CBTEngSettings *mBtengSetting;
       
    97     
       
    98     // For monitoring local device name change
       
    99     RProperty mLocalDeviceKey;
       
   100     CBtSimpleActive *mLocalDeviceWatcher;
       
   101     
       
   102     //RProperty mBtLinkCountKey;
       
   103     //CBTEngActive *mBtLinkCountWatcher;
       
   104     Q_DISABLE_COPY(BtSettingModelPrivate)
       
   105 
       
   106 };
       
   107 
       
   108 #endif // BTSETTINGMODEL_P_H