|
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 ENGINEWRAPPER_H |
|
20 #define ENGINEWRAPPER_H |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 #include <badesca.h> |
|
25 #include <engine.h> |
|
26 |
|
27 #include <QObject> // for iProgressNote signal connect |
|
28 |
|
29 |
|
30 class MainView; |
|
31 class MemoryDetails; |
|
32 class HbProgressDialog; |
|
33 class HbPopup; |
|
34 class HbCommonNote; |
|
35 class HbAction; |
|
36 |
|
37 |
|
38 /** |
|
39 * class that is used for communicating between Symbian and Qt code. |
|
40 */ |
|
41 class EngineWrapper : public QObject |
|
42 { |
|
43 Q_OBJECT |
|
44 |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Constructor |
|
49 */ |
|
50 EngineWrapper(); |
|
51 |
|
52 /** |
|
53 * Destructor |
|
54 */ |
|
55 ~EngineWrapper(); |
|
56 |
|
57 /** |
|
58 * Initializes Engine Wrapper |
|
59 * @return true if engine was started successfully |
|
60 */ |
|
61 bool init(); |
|
62 |
|
63 /** |
|
64 * Get memory details |
|
65 */ |
|
66 MemoryDetails GetMemoryDetails(); |
|
67 |
|
68 /** |
|
69 * Get memory details list |
|
70 */ |
|
71 QList<MemoryDetails> GetMemoryDetailsList(); |
|
72 |
|
73 public: |
|
74 |
|
75 /* Functions that are called from UI */ |
|
76 bool ExecuteOptionsMenuCommand(int commandId); |
|
77 |
|
78 |
|
79 public: |
|
80 |
|
81 /* Functions that are called from engine: */ |
|
82 |
|
83 /** |
|
84 * uses Notifications class to show error message |
|
85 */ |
|
86 void ShowErrorMessage(const TDesC& aErrorMessage); |
|
87 |
|
88 /** |
|
89 * uses Notifications class to show progressbar |
|
90 */ |
|
91 void ShowProgressBar(const TDesC& aPrompt, int aMax); |
|
92 |
|
93 /** |
|
94 * uses Notifications class to show user note |
|
95 */ |
|
96 void ShowNote(const TDesC& aNoteMessage, TInt aResourceId = 0); |
|
97 |
|
98 /** |
|
99 * increments shown progressbar's value |
|
100 */ |
|
101 void IncrementProgressbarValue(); |
|
102 |
|
103 /** |
|
104 * closes progressbar |
|
105 */ |
|
106 void CloseProgressbar(); |
|
107 |
|
108 /** |
|
109 * Create entries query dialog |
|
110 */ |
|
111 TBool EntriesQueryDialog(TInt* aNumberOfEntries, const TDesC& aPrompt, TBool aAcceptsZero, MUIObserver* aObserver, TInt aUserData); |
|
112 |
|
113 /** |
|
114 * Create time query dialog |
|
115 */ |
|
116 TBool TimeQueryDialog(TTime* aTime, const TDesC& aPrompt, MUIObserver* aObserver, TInt aUserData); |
|
117 |
|
118 /** |
|
119 * Create yes or no query dialog |
|
120 */ |
|
121 TBool YesNoQueryDialog(const TDesC& aPrompt, MUIObserver* aObserver, int userData); |
|
122 |
|
123 /** |
|
124 * Popup list dialog for selecting item from dialog list |
|
125 */ |
|
126 TBool PopupListDialog(const TDesC& aPrompt, const CDesCArray* aFileNameArray, TInt* aIndex, MUIObserver* aObserver, TInt aUserData); |
|
127 |
|
128 /** |
|
129 * Directory query dialog |
|
130 */ |
|
131 TBool DirectoryQueryDialog(const TDesC& aPrompt, TDes& aDirectory, MUIObserver* aObserver, TInt aUserData); |
|
132 |
|
133 /** |
|
134 * Create list query single-selection dialog |
|
135 */ |
|
136 TBool ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, TInt* aSeletedItem, MUIObserver* aObserver, TInt aUserData); |
|
137 |
|
138 /** |
|
139 * Create list query multi-selection dialog |
|
140 */ |
|
141 TBool ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, CArrayFixFlat<TInt>* aSelectedItems, MUIObserver* aObserver, TInt aUserData); |
|
142 |
|
143 |
|
144 /** |
|
145 * Close application when started from command line for script run. |
|
146 */ |
|
147 void CloseCreatorApp(); |
|
148 |
|
149 private slots: |
|
150 |
|
151 /** |
|
152 * progress dialog cancelled |
|
153 */ |
|
154 void ProgressDialogCancelled(); |
|
155 |
|
156 private: |
|
157 |
|
158 |
|
159 /* Creator engine */ |
|
160 CCreatorEngine* iEngine; |
|
161 |
|
162 /* progress dialog that is shown */ |
|
163 HbProgressDialog* iProgressDialog; |
|
164 |
|
165 MCreatorModuleBase *iModule; |
|
166 }; |
|
167 |
|
168 #endif //ENGINEWRAPPER_H |