stifui/qt/inc/stfqtuicontroller.h
branchRCL_3
changeset 14 404ad6c9bc20
child 19 4b22a598b890
equal deleted inserted replaced
13:87e9ebfbe96a 14:404ad6c9bc20
       
     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 *              Application's controller.
       
    16 *
       
    17 */
       
    18 #ifndef STFQTUICONTROLLER_H_
       
    19 #define STFQTUICONTROLLER_H_
       
    20 
       
    21 #include "istfqtuicontroller.h"
       
    22 #include "istfqtuimodel.h"
       
    23 #include "stifexecutor.h"
       
    24 
       
    25 class StfQtUIController : public IStfQtUIController, public IStifCaseUpdateListener
       
    26     {
       
    27 public:
       
    28     StfQtUIController(IStfQtUIModel* aModel);
       
    29     ~StfQtUIController();
       
    30 public: //Implement IStfQtUIController.
       
    31     //for cases
       
    32 
       
    33     bool OpenEngineIniFile(const QString& fileName);
       
    34     QList<QString> GetModuleList();
       
    35     QList<QString> GetCaseListByModule(const QString& moduleName);
       
    36     CSTFCase GetCase(const QString& moduleName, const int index);
       
    37     void RunCases(const QList<CSTFCase>& caseList, const TSTFCaseRunningType& type);
       
    38     void AddCaseToSet(const QList<CSTFCase>& aCase, const QString& setName);
       
    39     
       
    40     //for set
       
    41     QList<QString> GetSetList();
       
    42     QList<QString> GetCaseListBySet(const QString& setName);
       
    43     void CreateSet(const QString& setName);
       
    44     void DeleteSet(const QString& setName);
       
    45     void RunSets(const QString& setName, const TSTFCaseRunningType& type);
       
    46     
       
    47     //for Started
       
    48     void PauseCase();
       
    49     void ResumeCase();
       
    50     void AbortCase();
       
    51     bool ShowOutput();
       
    52     void SetShowOutput(bool isShow);
       
    53     
       
    54     //for staticstic
       
    55     QList<CSTFCase> GetCasesByStatus(const TSTFCaseStatusType& type);
       
    56     
       
    57     //listener
       
    58     void AddStfEventListener(IStfEventListener* listener);
       
    59     void RemoveStfEventListener(IStfEventListener* listener);
       
    60 
       
    61 public://implement IStifCaseUpdateListener
       
    62     void OnGetCaseUpdated(CStartedTestCase* aCase, CSTFCase& stfcase, int flags);
       
    63     void OnGetCaseOutput(CStartedTestCase* aCase, QString& msg);
       
    64     
       
    65 private: //Fire event
       
    66     void FireOnGetOutput(QString message);
       
    67     void FireOnSetListChanged();
       
    68     void FireOnCaseOutputChanged(IStfEventListener::CaseOutputCommand cmd, int index, QString msg);
       
    69     
       
    70 private://help methods
       
    71     CSTFModule GetModuleByName(const QString& moduleName);
       
    72     
       
    73 private:
       
    74     CStifExecutor* executor;
       
    75     IStfQtUIModel* model;
       
    76     QList<IStfEventListener*> listenerList;
       
    77     bool isShowOutput;
       
    78     
       
    79     
       
    80         
       
    81     };
       
    82 
       
    83 
       
    84 
       
    85 
       
    86 #endif /* STFQTUICONTROLLER_H_ */