locationpickerservice/inc/locationpickersearchview.h
branchRCL_3
changeset 17 1fc85118c3ae
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
       
     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: LocationPickerSearchView declaration
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef LOCATIONPICKERSEARCHVIEW_H
       
    19 #define LOCATIONPICKERSEARCHVIEW_H
       
    20 
       
    21 
       
    22 #include <HbView>
       
    23 
       
    24 class HbListView;
       
    25 class QStandardItemModel;
       
    26 class HbSearchPanel;
       
    27 class LocationPickerDataManager;
       
    28 class LocationPickerProxyModel;
       
    29 class HbDocumentLoader;
       
    30 class HbTextItem;
       
    31 class QGraphicsLinearLayout;
       
    32 class HbAbstractViewItem;
       
    33 class QPoint;
       
    34 class HbMenu;
       
    35 
       
    36 /**  
       
    37  * Class defines the search view of location picker
       
    38  */
       
    39 class LocationPickerSearchView : public HbView
       
    40 {
       
    41     Q_OBJECT
       
    42 public:
       
    43     // constructor
       
    44     LocationPickerSearchView( HbDocumentLoader &aLoader );
       
    45     // destructor
       
    46     ~LocationPickerSearchView();
       
    47     //initialize the action items and connect to slots
       
    48     void init( QStandardItemModel *aModel );
       
    49 private:
       
    50     void getData( QModelIndex aIndex, quint32& aValue );
       
    51 #ifdef LOCPICKER_UNIT_TEST
       
    52 public slots:
       
    53 #else    
       
    54 private slots:
       
    55 #endif
       
    56     // slot to perform search
       
    57     void doSearch( QString aCriteria );
       
    58     // slot to handle select event on a list item
       
    59     void handleActivated(const QModelIndex &aIndex);
       
    60     // slot to handle backbutton on search panel
       
    61     void handleExit();
       
    62 	//launch context menu
       
    63     void launchPopUpMenu(HbAbstractViewItem *aItem, const QPointF &aPoint);
       
    64 	//handle long press
       
    65     void handleLongPress();
       
    66     //delete context menu
       
    67     void deleteMenu();
       
    68 signals:
       
    69     //signals to switch current view
       
    70     void switchView();
       
    71     //signals when any item is selected
       
    72     void selectItem( quint32 aLm );
       
    73 #ifdef LOCPICKER_UNIT_TEST
       
    74 public:
       
    75 #else    
       
    76 private:
       
    77 #endif
       
    78     //proxymodel used for sort and filter
       
    79     LocationPickerProxyModel *mProxyModel;
       
    80     // model for the view
       
    81     QStandardItemModel *mModel;
       
    82     // list view
       
    83     HbListView  *mListView;
       
    84     // search panel
       
    85     HbSearchPanel *mSearchPanel;
       
    86     //TextItem
       
    87     HbTextItem* mEmptyLabel;
       
    88     //Graphicslayout
       
    89     QGraphicsLinearLayout* mVerticalLayout;
       
    90     //Documentloader
       
    91     HbDocumentLoader &mDocumentLoader;
       
    92     QModelIndex mIndex;
       
    93     //context menu
       
    94     HbMenu* mLongPressMenu;
       
    95     //select action
       
    96     HbAction* mSelectAction;
       
    97 };
       
    98 
       
    99 
       
   100 #endif // LOCATIONPICKERSEARCHVIEW_H