locationpickerservice/inc/locationpickerview.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: LocationPickerView declaration
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef LOCATIONPICKERVIEW_H
       
    19 #define LOCATIONPICKERVIEW_H
       
    20 
       
    21 
       
    22 #include <HbView>
       
    23 #include <hbdocumentloader.h>
       
    24 #include "locationpickertypes.h"
       
    25 #include <QGraphicsLinearLayout>
       
    26 #include <hgwidgets/hgmediawall.h>
       
    27 
       
    28 #include <HbLabel>
       
    29 #include <HbTextItem>
       
    30 //forward declarations
       
    31 class HbListView;
       
    32 class QStandardItemModel;
       
    33 class LocationPickerProxyModel;
       
    34 class LocationPickerCollectionListContent;
       
    35 class LocationPickerCollectionContent;
       
    36 class HgWidgetDataModel;
       
    37 class HbListViewItem;
       
    38 class HbAction;
       
    39 class HbAbstractViewItem;
       
    40 class QPoint;
       
    41 class HbDialog;
       
    42 class HbLabel;
       
    43 /**  
       
    44  * Class defines the location picker view
       
    45  */
       
    46 class LocationPickerView : public HbView
       
    47 {
       
    48     Q_OBJECT
       
    49 public:
       
    50     // constructor
       
    51     LocationPickerView( HbDocumentLoader* aLoader );
       
    52     // destructor
       
    53     ~LocationPickerView();
       
    54 public:
       
    55     //disable the tabs
       
    56     void disableTabs();
       
    57     //get the items from docml and connect to respective slots
       
    58     void init( Qt::Orientation aOrientation, QStandardItemModel *aModel );
       
    59     //Set the appropriate model on list view
       
    60     void manageListView();
       
    61     //create hurriganes widget
       
    62     void createHurriganesWidget();
       
    63     //manage hurriganes view
       
    64     void manageHgWidget();
       
    65     //Create collection list and sets to list view
       
    66     void setCollectionData( quint32 acategoryId );
       
    67     //Get the view type
       
    68     TViewType getViewType();
       
    69     //set the view type
       
    70     void setViewType( TViewType aViewType );
       
    71     //clear collection Model
       
    72     void clearContentModel();
       
    73     void removeDetailsLabel();
       
    74     //close the popupdialog
       
    75     void closeDetailsDialog();
       
    76 #ifdef LOCPICKER_UNIT_TEST
       
    77 public:
       
    78 #else    
       
    79 private:
       
    80 #endif
       
    81     void displayNoEntries();
       
    82 #ifdef LOCPICKER_UNIT_TEST
       
    83 public slots:
       
    84 #else    
       
    85 private slots:
       
    86 #endif
       
    87     //slot to handle list item actions     
       
    88     void handleActivated( const QModelIndex &aIndex );
       
    89     //slots to handle menu action items     
       
    90     void sortDescending();
       
    91     void sortAscending();
       
    92     //handle secondary back action
       
    93     void backTriggered();
       
    94     //slot to handle search tab
       
    95     void searchTabTriggered();
       
    96     //context menu
       
    97     void launchPopUpMenu( HbAbstractViewItem *aItem, const QPointF &aPoint );
       
    98     //launch context menu
       
    99     void launchPopUpMenu( const QModelIndex &aIndex, const QPointF &aPoint );
       
   100     //handle select event
       
   101     void handleSelect();
       
   102     //handle details event
       
   103     void handleDetails();
       
   104     //slot to handle all tab
       
   105     void allTabTriggered();
       
   106     //slot to handle collection tab
       
   107     void colectionTabTriggered();
       
   108     //delete context menu
       
   109     void deleteMenu();
       
   110 signals:
       
   111     void switchToSearchView();
       
   112     void selectItem( quint32 aLm );
       
   113     void completeService();
       
   114 #ifdef LOCPICKER_UNIT_TEST
       
   115 public:
       
   116 #else    
       
   117 private:
       
   118 #endif
       
   119     //document loader
       
   120     HbDocumentLoader* mDocumentLoader;
       
   121     // collection list content
       
   122     LocationPickerCollectionListContent* mLocationPickerCollectionListContent;
       
   123     //locationPickerProxyModel
       
   124     LocationPickerProxyModel *mProxyModel;
       
   125 	//standard model
       
   126     QStandardItemModel *mModel;
       
   127     //actions
       
   128     HbAction *mAllAction;
       
   129     HbAction *mCollectionAction;
       
   130     HbAction *mSearchAction;
       
   131     HbAction *mAscendingAction;
       
   132     HbAction *mDescendingAction;
       
   133     //secondary back action
       
   134     HbAction *mBackAction;
       
   135     // list view
       
   136     HbListView  *mListView;
       
   137     //list item
       
   138     HbListViewItem *mListItem;
       
   139     //collection content 
       
   140     LocationPickerCollectionContent *mCollectionContent;
       
   141     //ViewType
       
   142     TViewType mViewType ;
       
   143     // get the collection/category id
       
   144     quint32 mCategoryId;
       
   145     //label to show current view
       
   146     QModelIndex mIndex;
       
   147     //linear Layout
       
   148     QGraphicsLinearLayout *mLinerLayout;
       
   149     //model for hurriganes
       
   150     HgWidgetDataModel       *mHgModel;
       
   151     //hurriganes 
       
   152     HgWidget                *mWidget;
       
   153     // label to show view details
       
   154     HbLabel *mColllabel;
       
   155     //text item to show no entries
       
   156     HbTextItem*             mEmptyLabel;
       
   157     //pop up dialog to show details
       
   158     HbDialog* mDialog;
       
   159     HbLabel* mMapIconLabel;
       
   160     HbLabel* mTitleLabel;
       
   161     HbLabel* mAddressMiddle;
       
   162     HbLabel* mAddressBottom;
       
   163     HbAction* mDone;
       
   164     HbMenu* mLongPressMenu;
       
   165     HbAction* mSelectAction; 
       
   166     HbAction* mDetailsAction; 
       
   167     bool mPopulated;
       
   168 };
       
   169 
       
   170 
       
   171 #endif // LOCATIONPICKERVIEW_H