|
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 RepeatRunCases(const QList<CSTFCase>& aCaseList, const bool aIsLoopInfinitely, const int aLoopTimes = 1); |
|
39 bool AddCaseToSet(const QList<CSTFCase>& aCase, const QString& setName); |
|
40 |
|
41 //for set |
|
42 QList<QString> GetSetList(); |
|
43 QList<QString> GetCaseListBySet(const QString& setName); |
|
44 bool CreateSet(QString& setName); |
|
45 bool DeleteSet(const QString& setName); |
|
46 void RunSets(const QString& setName, const TSTFCaseRunningType& type); |
|
47 |
|
48 //for Started |
|
49 void PauseCase(); |
|
50 void ResumeCase(); |
|
51 void AbortCase(); |
|
52 bool ShowOutput(); |
|
53 CSTFCase GetRunningCase(int index); |
|
54 void SetShowOutput(bool isShow); |
|
55 |
|
56 //for staticstic |
|
57 QList<CSTFCase> GetCasesByStatus(const TSTFCaseStatusType& type); |
|
58 |
|
59 //listener |
|
60 void AddStfEventListener(IStfEventListener* listener); |
|
61 void RemoveStfEventListener(IStfEventListener* listener); |
|
62 |
|
63 //for repeat execution setting |
|
64 void InitRepeatSetting(const bool aIsLoopInfinitely, const int aLoopTimes); |
|
65 void ResetRepeatSetting(); |
|
66 |
|
67 public://implement IStifCaseUpdateListener |
|
68 void OnGetCaseUpdated(CStartedTestCase* aCase, CSTFCase& stfcase, int flags); |
|
69 void OnGetCaseOutput(CStartedTestCase* aCase, QString& msg); |
|
70 |
|
71 private: //Fire event |
|
72 void FireOnGetOutput(QString message); |
|
73 void FireOnSetListChanged(); |
|
74 void FireOnCaseOutputChanged(IStfEventListener::CaseOutputCommand cmd, int index, QString msg); |
|
75 |
|
76 private: |
|
77 // help methods |
|
78 CSTFModule GetModuleByName(const QString& moduleName); |
|
79 // Repeat execution cases |
|
80 void Execution(); |
|
81 |
|
82 private: |
|
83 CStifExecutor* executor; |
|
84 IStfQtUIModel* model; |
|
85 QList<IStfEventListener*> listenerList; |
|
86 bool isShowOutput; |
|
87 |
|
88 // repeat run case related member |
|
89 // repeat execution case list |
|
90 QList<CSTFCase> repeatRunCaseList; |
|
91 // current position of the case list |
|
92 int iCurrentRunPos; |
|
93 // is loop infinitely |
|
94 bool isLoopInfinitely; |
|
95 // loop times |
|
96 int loopTimes; |
|
97 |
|
98 }; |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 #endif /* STFQTUICONTROLLER_H_ */ |
|
104 |
|
105 // End of File |