stifui/qt/inc/frmmain.h
branchRCL_3
changeset 43 48060abbbeaf
parent 42 d40e813b23c0
child 45 b3cee849fa46
equal deleted inserted replaced
42:d40e813b23c0 43:48060abbbeaf
     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: QT C++ based Class.
       
    15 *              frmMain is a QT based Window.
       
    16 *              Used to display STF executor main GUI.
       
    17 *
       
    18 */
       
    19 #ifndef FRMMAIN_H
       
    20 #define FRMMAIN_H
       
    21 
       
    22 #include <QMainWindow>
       
    23 #include <QtGui>
       
    24 #include "istfqtuicontroller.h"
       
    25 #include "istfqtuimodel.h"
       
    26 #include "dlgoutput.h"
       
    27 #include "uisetting.h"
       
    28 #include "dlgsetting.h"
       
    29 #include "dlgsetselector.h"
       
    30 #include "uiversion.h"
       
    31 #include "dlgrepeatrun.h"
       
    32 
       
    33 QT_BEGIN_NAMESPACE
       
    34 class QAction;
       
    35 class QLabel;
       
    36 class QMenu;
       
    37 class QTabWidget;
       
    38 class QWidget;
       
    39 class QPushButton;
       
    40 class QComboBox;
       
    41 class QPlainTextEdit;
       
    42 class QTreeWidget;
       
    43 class QTreeWidgetItem;
       
    44 class QListWidget;
       
    45 class QCheckBox;
       
    46 class QMessageBox;
       
    47 class QFileDialog;
       
    48 QT_END_NAMESPACE
       
    49 
       
    50 
       
    51 
       
    52 class FrmMain : public QMainWindow, public IStfEventListener, public IStifModelEventListener
       
    53 {
       
    54     Q_OBJECT
       
    55 
       
    56 public:
       
    57     FrmMain();
       
    58     ~FrmMain();
       
    59     
       
    60     
       
    61 public: //Implement IStfEventListener
       
    62     void OnGetMessage(const QString& aMessage);
       
    63     void OnSetListChanged();
       
    64     void OnCaseOutputChanged(const IStfEventListener::CaseOutputCommand& cmd, const QString& index, const QString& msg);
       
    65 
       
    66     
       
    67 public: //Implement IStifModelEventListener
       
    68     void OnCaseStatisticChanged() ;
       
    69     void OnRunningCaseChanged() ;
       
    70     
       
    71 protected:
       
    72     void paintEvent(QPaintEvent *event);
       
    73     
       
    74 protected slots:
       
    75     void onTabWidgetSelectIndexChanged();
       
    76 
       
    77 
       
    78 private:
       
    79     void createMenus();
       
    80     void LoadSubMenu();
       
    81     void load();
       
    82     void loadContent();
       
    83     void loadModuleList();
       
    84     void loadSetList();
       
    85     void loadStatistic();
       
    86     QList<CSTFCase> getSelectedCases();
       
    87     void reloadStatisticItem(QString name, QTreeWidgetItem* item, TSTFCaseStatusType type);
       
    88     void setSetting();
       
    89     void startRunning();
       
    90     void setItemClicked(QTreeWidgetItem* item);
       
    91     
       
    92 private:
       
    93     IStfQtUIController* controller;
       
    94     IStfQtUIModel* model;
       
    95     DlgOutput* dlgOutput;
       
    96     UiSetting* uiSetting; 
       
    97     bool layoutType;
       
    98     QTreeWidgetItem* lastItemSelected;
       
    99     QString currentFilter;
       
   100     QString currentFilterCaseSens;
       
   101 
       
   102 private: //UI Components
       
   103     QWidget* centerWidget;
       
   104     QGridLayout *mainLayout;
       
   105     QGroupBox *groupBox;
       
   106     
       
   107     //menus and actions
       
   108     QMenu *operateMenu;
       
   109     //output panel
       
   110     QPlainTextEdit *txtOutput;
       
   111     //tab control.
       
   112     QTabWidget *tabWidget;
       
   113     QWidget *tabCase;
       
   114     QWidget *tabSet;
       
   115     QWidget *tabStarted;
       
   116     QWidget *tabStatistic;
       
   117 
       
   118     //Cases Tab
       
   119     QTreeWidget *treeModuleList;
       
   120     
       
   121     //Statistic Tab
       
   122     QTreeWidget *treeStatistic;
       
   123     QTreeWidgetItem *executedItems;
       
   124     QTreeWidgetItem *passedItems;
       
   125     QTreeWidgetItem *failedItems;
       
   126     QTreeWidgetItem *abortedItems;
       
   127     QTreeWidgetItem *crashedItems;
       
   128         
       
   129     
       
   130     //Set Tab
       
   131     QComboBox *cboSetList;
       
   132     QListWidget *lstSetCases;
       
   133 
       
   134     //Started Tab
       
   135     QListWidget *lstStartedCases;
       
   136     QPushButton *btnPauseCase;
       
   137     QPushButton *btnAbortCase;
       
   138     QPushButton *btnShowOutput;
       
   139 
       
   140     //menu actions
       
   141     QAction *actExit;
       
   142     QAction *actAbout;
       
   143 
       
   144     //cases actoins
       
   145     QAction *actOpenFile;
       
   146     QAction *actRunCaseSeq;
       
   147     QAction *actRunCasePar;
       
   148     QAction *actReapeatRunSeq;
       
   149     QAction *actAddtoSet;
       
   150     QAction *actSelectAll;
       
   151     QAction *actExpandAll;
       
   152     QAction *actCollapseAll;
       
   153     QAction *actSetting;
       
   154     QMenu *menuRunCase; 
       
   155     //sets actions
       
   156     QAction *actRunSetSeq;
       
   157     QAction *actRunSetPar;
       
   158     QAction *actNewSet;
       
   159     QAction *actDelSet;
       
   160     QMenu *menuRunSet;
       
   161     //running actions.
       
   162     QAction *actPause;
       
   163     QAction *actAbort;
       
   164     QAction *actOutput;
       
   165     
       
   166     //statistics actions
       
   167     QAction *actClearStatistics;
       
   168 
       
   169 private slots:
       
   170     void on_cboSetList_currentIndexChanged(QString );
       
   171     
       
   172     void on_actAbout_triggered();    
       
   173     void on_actOpenFile_triggered();
       
   174     void on_actRunCaseSeq_triggered();
       
   175     void on_actRunCasePar_triggered();
       
   176     void on_actReapeatRunSeq_triggered();
       
   177     void on_actAddtoSet_triggered();
       
   178     void on_actSelectAll_triggered();
       
   179     void on_actExpandAll_triggered();
       
   180     void on_actCollapseAll_triggered();
       
   181     void on_actExpand_triggered();
       
   182     void on_actCollapse_triggered();
       
   183     void on_actSetting_triggered();
       
   184         
       
   185     void on_actRunSetSeq_triggered();
       
   186     void on_actRunSetPar_triggered();
       
   187     void on_actNewSet_triggered();
       
   188     void on_actDelSet_triggered();
       
   189     void on_actPause_triggered();
       
   190     void on_actAbort_triggered();
       
   191     void on_actOutput_triggered();
       
   192     void on_actClearStatistics_triggered();
       
   193     void on_treeModuleList_itemClicked(QTreeWidgetItem* item, int column);
       
   194 
       
   195     
       
   196         
       
   197     
       
   198 
       
   199 
       
   200 
       
   201 };
       
   202 
       
   203 #endif // FrmMain_H
       
   204 
       
   205 // End of File