loadgen/ui/hb/inc/mainview.h
branchRCL_3
changeset 21 b3cee849fa46
equal deleted inserted replaced
20:48060abbbeaf 21:b3cee849fa46
       
     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 
       
    19 #ifndef MAINVIEW_H
       
    20 #define MAINVIEW_H
       
    21 
       
    22 #include <hbview.h>
       
    23 
       
    24 class EngineWrapper;
       
    25 class HbMainWindow;
       
    26 class HbApplication;
       
    27 class HbAction;
       
    28 class HbLabel;
       
    29 class HbProgressNote;
       
    30 class HbListView;
       
    31 class HbAbstractViewItem;
       
    32 
       
    33 class QStandardItemModel;
       
    34 class QSignalMapper;
       
    35 class QPointF;
       
    36 
       
    37 class MainView : public HbView
       
    38 {
       
    39     Q_OBJECT
       
    40     
       
    41 public:
       
    42 
       
    43     MainView(HbMainWindow &mainWindow);
       
    44 	~MainView();
       
    45 	void init(HbApplication &app);
       
    46 	int currentItemIndex();
       
    47 	void setCurrentItemIndex(int index);
       
    48 	void clearListSelection();
       
    49 	void setLoadListData(QStringList& items);
       
    50 	QList<int> listSelectionIndexes();
       
    51 	
       
    52 private:
       
    53     void createMenu(HbApplication &app);
       
    54 	void loadListIinit();
       
    55 	bool showItemActionPopup(int &index);
       
    56 	void loadListDelete();
       
    57 	bool stopLoad(bool stopAll /*, int selectedLoad = 0*/);
       
    58    
       
    59 private slots:
       
    60     void handleLoadListEvent(HbAbstractViewItem */*listViewItem*/, const QPointF &/*coords*/);
       
    61     void ItemActionPopupClosed(HbAction* action );
       
    62 	void showAboutPopup();
       
    63 	void stopAllLoads();
       
    64 	void updateMenu();
       
    65 	void launchPerfMon();
       
    66 	void suspendAllLoads();
       
    67 	void resumeAllLoads();
       
    68 	
       
    69 	/**
       
    70 	* calls engine wrapper to complete service request, specified by cmd.
       
    71 	*/
       
    72 	void executeMenuCommand(int cmd);
       
    73     
       
    74 private:
       
    75     HbMainWindow &mMainWindow;
       
    76     EngineWrapper *mEngineWrapper;
       
    77 	HbListView *mListView;
       
    78 	QStandardItemModel *mListModel;
       
    79 	QSignalMapper *mSm;
       
    80 	bool mIsLoadListEmpty;
       
    81 	
       
    82 	HbAction *mActionAbout;
       
    83 	HbMenu   *mLoadSubMenu1;
       
    84 	HbMenu   *mLoadSubMenu2;
       
    85 	HbAction *mActionExit;
       
    86 	HbAction *mStopAll;
       
    87 	HbAction *mSuspendAll;	
       
    88 	HbAction *mResumeAll;	
       
    89 	HbAction *mActionPerfMon;
       
    90 	HbAction *mCpuLoadAction;
       
    91 	HbAction *mMemoryEatLoadAction;
       
    92 	HbAction *mPhoneCallLoadAction;
       
    93 	HbAction *mMessagesLoadAction;
       
    94 	HbAction *mNetConnLoadAction;
       
    95 	HbAction *mAppsLoadAction;
       
    96 	HbAction *mKeyPressLoadAction;
       
    97 	HbAction *mPhotoCapturesLoadAction;
       
    98 	HbAction *mBtActionsLoadAction;
       
    99 	HbAction *mPointerEventsLoadAction;
       
   100 	
       
   101 };
       
   102 
       
   103 #endif // MAINVIEW_H