bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicesearchdialogwidget.h
branchRCL_3
changeset 22 613943a21004
equal deleted inserted replaced
21:0ba996a9b75d 22:613943a21004
       
     1 /*
       
     2  * Copyright (c) 2009 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 
       
    19 #ifndef BTDEVICESEARCHDIALOGWIDGET_H
       
    20 #define BTDEVICESEARCHDIALOGWIDGET_H
       
    21 
       
    22 #include <QObject>
       
    23 #include <QVariantMap>
       
    24 #include <hbdialog.h>
       
    25 #include <hbdevicedialoginterface.h>
       
    26 #include <hbpopup.h>
       
    27 #include <hbdocumentloader.h>
       
    28 #include <qstandarditemmodel.h>
       
    29 #include <hbradiobuttonlist.h>
       
    30 #include <hblistwidget.h>
       
    31 #include <hblabel.h>
       
    32 #include <hbaction.h>
       
    33 #include <hbselectiondialog.h>
       
    34 #include "btdevicedialogutils.h"
       
    35 
       
    36 
       
    37 
       
    38 /*struct device
       
    39     {
       
    40     QString mDeviceName;
       
    41     QString mDeviceType;
       
    42     int     mDeviceIdx;
       
    43     };*/
       
    44 
       
    45 
       
    46 class BTDeviceSearchDialogWidget : public QObject,
       
    47                                 public HbDeviceDialogInterface
       
    48     {
       
    49     Q_OBJECT
       
    50     
       
    51 public:
       
    52     BTDeviceSearchDialogWidget(const QVariantMap &parameters);
       
    53     ~BTDeviceSearchDialogWidget();
       
    54     
       
    55 public: // from HbDeviceDialogInterface
       
    56     bool setDeviceDialogParameters(const QVariantMap &parameters);
       
    57     int deviceDialogError() const;
       
    58     void closeDeviceDialog(bool byClient);
       
    59     HbPopup *deviceDialogWidget() const;
       
    60     virtual QObject *signalSender() const;
       
    61     
       
    62 public slots:
       
    63     void stopRetryClicked();
       
    64     void retryClicked();
       
    65     void viewByClicked();
       
    66     void deviceSelected(const QModelIndex& modelIndex);
       
    67 //    void viewByItemSelected(int index);
       
    68     void selectionDialogClosed(HbAction *action);
       
    69     void searchDialogClosed(); 
       
    70     
       
    71 private:
       
    72     bool constructDialog(const QVariantMap &parameters);
       
    73     
       
    74 private:
       
    75     enum devTypeSelectionList {
       
    76         BtUiDevAudioDevice = 0,
       
    77         BtUiDevComputer,
       
    78         BtUiDevInputDevice,
       
    79         BtUiDevPhone,
       
    80         BtUiDevOtherDevice
       
    81     };    
       
    82     
       
    83 signals:
       
    84     void deviceDialogClosed();
       
    85     void deviceDialogData(QVariantMap  data);
       
    86     
       
    87 private:
       
    88     HbDocumentLoader *mLoader;
       
    89     
       
    90     /**
       
    91      * 
       
    92      * item model for content list view.
       
    93      */
       
    94     
       
    95     QStandardItemModel* mContentItemModel;
       
    96     
       
    97     HbSelectionDialog *mQuery;
       
    98 //    QList<QString>      mDeviceTypeList;
       
    99     QStringList mDevTypeList;
       
   100 //    QList<device>       mDeviceList;
       
   101     HbListView*         mListView;
       
   102     HbLabel*            mSearchLabel; 
       
   103     HbLabel*            mSearchIconLabel;
       
   104     HbLabel*            mSearchDoneLabel;
       
   105 //    bool                mViewByChosen;
       
   106 //    QList<device>       mDeviceLstOfType;
       
   107 //    int                 mDeviceLstIdx;
       
   108     int                 mSelectedDeviceType;
       
   109 //    int                 mDeviceDialogData;
       
   110     HbDialog *mSearchDevicesDialog;
       
   111     HbAction *mStopRetryAction;
       
   112     HbAction *mShowAction;
       
   113     HbAction *mCancelAction;
       
   114 
       
   115     int mStopRetryFlag;
       
   116     
       
   117     BtSendDataSource mData;
       
   118     BtSendDataSource mSelectedData;
       
   119     
       
   120     Q_DISABLE_COPY(BTDeviceSearchDialogWidget)
       
   121     };
       
   122 
       
   123 #endif /* BTDEVICESEARCHDIALOGWIDGET_H */