bluetoothengine/btui/btcpplugin/btcpuisearchview.h
changeset 42 b72428996822
parent 31 a0ea99b6fa53
child 47 9e2a905b887f
equal deleted inserted replaced
32:19bd632b5100 42:b72428996822
     1 /*
     1 /*
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3  * All rights reserved.
     3  * All rights reserved.
     4  * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5  * under the terms of "Eclipse Public License v1.0""
     5  * under the terms of "Eclipse Public License v1.0""
     6  * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    28 class HbPushButton;
    28 class HbPushButton;
    29 class HbIcon;
    29 class HbIcon;
    30 class HbDocumentLoader;
    30 class HbDocumentLoader;
    31 class HbListView;
    31 class HbListView;
    32 class BtAbstractDelegate;
    32 class BtAbstractDelegate;
       
    33 class HbSelectionDialog;
    33 
    34 
    34 class BtCpUiSearchView : public BtCpUiBaseView
    35 class BtCpUiSearchView : public BtCpUiBaseView
    35 {
    36 {
    36     Q_OBJECT
    37     Q_OBJECT
    37     
    38     
    38 public:
    39 public:
       
    40 
    39     explicit BtCpUiSearchView(
    41     explicit BtCpUiSearchView(
    40             BtSettingModel &settingModel, 
    42             BtSettingModel &settingModel, 
    41             BtDeviceModel &deviceModel, 
    43             BtDeviceModel &deviceModel, 
    42             QGraphicsItem *parent = 0);
    44             QGraphicsItem *parent = 0);
    43     virtual ~BtCpUiSearchView();
    45     virtual ~BtCpUiSearchView();
    44     virtual void activateView( const QVariant& value, int cmdId );
    46     virtual void activateView( const QVariant& value, bool fromBackButton );
    45     virtual void deactivateView();
    47     virtual void deactivateView();
    46     virtual void setSoftkeyBack();
    48     virtual void setSoftkeyBack();
    47     
    49     
    48 public slots:
    50 public slots:
    49     virtual void switchToPreviousView();
    51     virtual void switchToPreviousView();
    50     void changeOrientation( Qt::Orientation orientation );
    52     void changeOrientation( Qt::Orientation orientation );
    51     void stopSearching();
    53     void stopSearching();
    52     void retrySearch();
    54     void retrySearch();
       
    55     void viewByDeviceTypeDialog();
       
    56     void viewByDialogClosed(HbAction* action);
    53     void searchDelegateCompleted(int error);
    57     void searchDelegateCompleted(int error);
    54     void deviceSearchCompleted(int error);
    58     void deviceSearchCompleted(int error);
    55     void deviceSelected(const QModelIndex& modelIndex);
    59     void deviceSelected(const QModelIndex& modelIndex);
    56 
    60     
       
    61 private:
       
    62     void startSearchDelegate();
       
    63     
       
    64 private:
       
    65     enum devTypeSelectionList {
       
    66         BtUiDevAudioDevice = 0,
       
    67         BtUiDevComputer,
       
    68         BtUiDevInputDevice,
       
    69         BtUiDevPhone,
       
    70         BtUiDevOtherDevice
       
    71     };
    57 private:
    72 private:
    58     HbDocumentLoader *mLoader;
    73     HbDocumentLoader *mLoader;
    59     HbLabel *mDeviceIcon;
    74     HbLabel *mDeviceIcon;
    60     HbLabel *mLabelFoundDevices;
    75     HbLabel *mLabelFoundDevices;
    61     HbLabel *mLabelSearching;        
    76     HbLabel *mLabelSearching;        
    62     HbListView *mDeviceList;
    77     HbListView *mDeviceList;
       
    78     QStringList mDevTypeList;
       
    79     HbSelectionDialog *mQuery;
    63     
    80     
    64     // data structures for switching between views
       
    65     bool mEventFilterInstalled;
       
    66     int mAutoCmdId;
       
    67     Qt::Orientation mOrientation;
    81     Qt::Orientation mOrientation;
    68     
    82     
    69     HbMainWindow*           mMainWindow;
    83     HbMainWindow*           mMainWindow;
    70     BtCpUiBaseView*         mMainView;
    84     BtCpUiBaseView*         mMainView;
    71     BtCpUiBaseView*         mDeviceView;
       
    72     HbAction *              mSoftKeyBackAction;
    85     HbAction *              mSoftKeyBackAction;
    73     HbToolBar*              mToolBar;
       
    74     HbAction*               mViewBy;
    86     HbAction*               mViewBy;
    75     HbAction*               mStop;
    87     HbAction*               mStop;
    76     HbAction*               mRetry;
    88     HbAction*               mRetry;
    77     HbAction*               mExit;
    89     HbAction*               mExit;
    78     HbAction*               mConnect;
    90     HbAction*               mConnect;
    79 
    91 
    80     //pointer to abstract delegate, and it is instantiated at runtime
    92     //pointer to abstract delegate, and it is instantiated at runtime
    81     BtAbstractDelegate*     mAbstractDelegate;
    93     BtAbstractDelegate*     mAbstractDelegate;
    82     QModelIndex*            mParentIndex;
       
    83     int                     mNumOfRows;
       
    84     BtuiModelSortFilter*    mBtuiModelSortFilter;
    94     BtuiModelSortFilter*    mBtuiModelSortFilter;
    85 };
    95 };
    86 
    96 
    87 #endif//	BTCPUISEARCHVIEW_H
    97 #endif//	BTCPUISEARCHVIEW_H