|
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 #ifndef ENGINEWRAPPER_H |
|
19 #define ENGINEWRAPPER_H |
|
20 |
|
21 #include <s32file.h> |
|
22 #include <hbapplication.h> |
|
23 |
|
24 |
|
25 class SGEngine; |
|
26 class GrabSettings; |
|
27 class MainView; |
|
28 class TWsEvent; |
|
29 class HbDeviceProgressDialog; |
|
30 |
|
31 /** |
|
32 * class that is used for communicating between Symbian and Qt code. |
|
33 */ |
|
34 class EngineWrapper{ |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Constructor |
|
39 */ |
|
40 EngineWrapper(); |
|
41 |
|
42 /** |
|
43 * Destructor |
|
44 */ |
|
45 ~EngineWrapper(); |
|
46 |
|
47 /** |
|
48 * Initializes Engine Wrapper |
|
49 * @return true if engine was started successfully |
|
50 */ |
|
51 bool init(); |
|
52 |
|
53 public: |
|
54 |
|
55 /* Functions that are called from UI */ |
|
56 |
|
57 /** |
|
58 * Fetches settings from engine and converts Symbian data types to Qt's types. |
|
59 */ |
|
60 GrabSettings getGrabSettings(); |
|
61 |
|
62 /** |
|
63 * Converts given parameters into Symbian data types and saves them into ScreenGrabber engine |
|
64 * @param settings new settings |
|
65 */ |
|
66 bool saveSettings(const GrabSettings& settings); |
|
67 |
|
68 |
|
69 /* |
|
70 * Sends received s60 event to engine |
|
71 */ |
|
72 #if defined(HB_QT_S60_EVENT_FILTER) |
|
73 bool handleCaptureCommands(const TWsEvent* aEvent); |
|
74 #else |
|
75 bool handleCaptureCommands(const QSymbianEvent *aEvent); |
|
76 #endif |
|
77 |
|
78 |
|
79 /** |
|
80 * Sends UI to background |
|
81 */ |
|
82 void sendUIToBackground(); |
|
83 void EnableRcpOfFoc(TBool aState); |
|
84 void LoadSettings(void); |
|
85 public: |
|
86 |
|
87 /* Functions that are called from engine: */ |
|
88 |
|
89 /** |
|
90 * uses Notifications class to show image captured note |
|
91 */ |
|
92 void ShowImageCapturedNote(); |
|
93 |
|
94 /** |
|
95 * uses Notifications class to show video captured note |
|
96 */ |
|
97 void ShowVideoCapturedNote(); |
|
98 |
|
99 /** |
|
100 * uses Notifications class to show seguantial images captured note |
|
101 */ |
|
102 void ShowSequantialImagesCapturedNote(TInt amount); |
|
103 |
|
104 /** |
|
105 * uses Notifications class to show error message |
|
106 */ |
|
107 void ShowErrorMessage(const TDesC16& aErrorMessage); |
|
108 |
|
109 /** |
|
110 * uses Notifications class to show progressbar |
|
111 */ |
|
112 void ShowProgressBar(int max); |
|
113 |
|
114 /** |
|
115 * increments shown progressbar's value |
|
116 */ |
|
117 void IncrementProgressbarValue(); |
|
118 |
|
119 /** |
|
120 * closes progressbar |
|
121 */ |
|
122 void CloseProgressbar(); |
|
123 |
|
124 |
|
125 private: |
|
126 |
|
127 bool convertTBoolToBool(TBool value); |
|
128 |
|
129 private: |
|
130 |
|
131 |
|
132 /* Screen grabber engine */ |
|
133 SGEngine *iSGEngine; |
|
134 |
|
135 /* progressnote that is shown */ |
|
136 HbDeviceProgressDialog *iProgressNote; |
|
137 |
|
138 }; |
|
139 |
|
140 #endif; |
|
141 |