bluetoothengine/btui/btcpplugin/btcpuideviceview.h
branchRCL_3
changeset 22 613943a21004
equal deleted inserted replaced
21:0ba996a9b75d 22:613943a21004
       
     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	BTCPUIDEVICEVIEW_H
       
    19 #define	BTCPUIDEVICEVIEW_H
       
    20 
       
    21 #include <cpbasesettingview.h>
       
    22 #include <hbaction.h>
       
    23 #include <hbtoolbar.h>
       
    24 #include "btcpuibaseview.h"
       
    25 
       
    26 class HbGroupBox;
       
    27 class HbLabel;
       
    28 class HbLineEdit;
       
    29 class HbPushButton;
       
    30 class HbIcon;
       
    31 class HbDocumentLoader;
       
    32 class HbDataForm;
       
    33 
       
    34 class HbDataFormModel;
       
    35 //class HbDataFormModelItem;
       
    36 class CpSettingFormItemData;
       
    37 class BtAbstractDelegate;
       
    38 class BtCpUiDeviceDetail;
       
    39 
       
    40 class BtCpUiDeviceView : public BtCpUiBaseView
       
    41 {
       
    42     Q_OBJECT
       
    43     
       
    44 public:
       
    45     explicit BtCpUiDeviceView(
       
    46             BtSettingModel &settingModel, 
       
    47             BtDeviceModel &deviceModel,            
       
    48             QGraphicsItem *parent = 0);
       
    49     virtual ~BtCpUiDeviceView();
       
    50     virtual void activateView( const QVariant& value, bool fromBackButton );
       
    51     virtual void deactivateView();
       
    52     virtual void setSoftkeyBack();
       
    53         
       
    54 public slots:
       
    55     
       
    56     virtual void switchToPreviousView();
       
    57     void changeOrientation( Qt::Orientation orientation );
       
    58     void updateDeviceData();
       
    59     void changeBtDeviceName();
       
    60     void pairUnpair();
       
    61     void connectDisconnect();
       
    62     void pairDelegateCompleted(int status);
       
    63     void unpairDelegateCompleted(int status);
       
    64     void connectDelegateCompleted(int status);
       
    65     void disconnectDelegateCompleted(int status);
       
    66     void changeDevNameDelegateCompleted(int status, QVariant param);
       
    67     void handleDeviceSetting();
       
    68     void handleDeviceSettingsChange(bool status);
       
    69     
       
    70 private:
       
    71     void clearViewData();
       
    72     void pairDevice();
       
    73     void unpairDevice();
       
    74     void connectDevice();
       
    75     void disconnectDevice();
       
    76     void setDeviceCategory(int cod, int majorRole);//cod:class of device
       
    77     void setDeviceStatus(int majorRole);
       
    78     void setConnectionCombobox();
       
    79     void setTextAndVisibilityOfButtons();
       
    80     void updateStatusVariables(int majorRole);
       
    81     void loadDeviceDetails();
       
    82     void unloadDeviceDetails();
       
    83     void setPrevBtDeviceName();
       
    84     
       
    85 private:
       
    86     HbDocumentLoader *mLoader;
       
    87     //HbGroupBox *mGroupBox;
       
    88     HbLabel *mDeviceIcon;
       
    89     HbLineEdit *mDeviceName;
       
    90     HbLabel *mDeviceCategory;
       
    91     HbLabel *mDeviceStatus;
       
    92     
       
    93     HbDataForm *mConnectionCombobox;
       
    94     HbDataFormModel *mConnectionComboboxModel;
       
    95     
       
    96     HbPushButton *mPair_Unpair;
       
    97     HbPushButton *mConnect_Disconnect;
       
    98     HbPushButton *mDeviceSetting;
       
    99     
       
   100     
       
   101     // data structures for switching between views
       
   102     bool mEventFilterInstalled;
       
   103     int mAutoCmdId;
       
   104     Qt::Orientation mOrientation;
       
   105     
       
   106     HbMainWindow* mMainWindow;
       
   107     BtCpUiBaseView* mMainView;
       
   108     //BtCpUiBaseView* mDeviceView;
       
   109     HbAction *mSoftKeyBackAction;
       
   110     
       
   111     QModelIndex mDeviceIndex;
       
   112     QVariant mDeviceBdAddr;
       
   113     
       
   114     //true -> device is paired; false -> device is unpaired
       
   115     bool mPairedStatus;
       
   116     
       
   117     //true-> device is connected; false -> device is disconnected
       
   118     bool mConnectedStatus;
       
   119     bool mPreviousConnectedStatus;
       
   120     bool mTrustedStatus;
       
   121     bool mBlockedStatus;
       
   122 
       
   123     //true -> device is connectable
       
   124     //e.g. not possible to connect to a phone, but possible to connect to a headset
       
   125     bool mConnectable;
       
   126     
       
   127     BtAbstractDelegate* mAbstractDelegate;
       
   128 
       
   129     BtCpUiDeviceDetail* mDeviceDetail;
       
   130     
       
   131 };
       
   132 
       
   133 #endif