|
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 SETTINGS_H |
|
20 #define SETTINGS_H |
|
21 |
|
22 #include <f32file.h> |
|
23 #include <hbmainwindow.h> |
|
24 #include <hbview.h> |
|
25 |
|
26 class EngineWrapper; |
|
27 class HbDataFormModelItem; |
|
28 class HbDataFormModel; |
|
29 class HbDataForm; |
|
30 class HbDataFormViewItem; |
|
31 |
|
32 const QStringList CAPTUREMODES = (QStringList() << "Single capture" << "Sequential capture" << "Video capture"); |
|
33 const QStringList KEYS = (QStringList() << "Send key" << "Power key" << "Side key" << "Camera key"); |
|
34 const QStringList VIDEOFORMATS = (QStringList() << "Animated GIF"); |
|
35 const QStringList IMAGEFORMATS = (QStringList() << "PNG" << "JPEG high qual." << "JPEG low qual." << "BMP" << "GIF"); |
|
36 const QStringList MEMORYMODES = (QStringList() << "Phone memory" << "Memory card"); |
|
37 |
|
38 |
|
39 /** |
|
40 * Settings class that is used for |
|
41 */ |
|
42 class GrabSettings |
|
43 { |
|
44 public: |
|
45 int mCaptureMode; |
|
46 |
|
47 int mSingleCaptureHotkey; |
|
48 int mSingleCaptureImageFormat; |
|
49 int mSingleCaptureMemoryInUseMultiDrive; |
|
50 QString mSingleCaptureFileName; |
|
51 |
|
52 int mSequantialCaptureHotkey; |
|
53 int mSequantialCaptureImageFormat; |
|
54 int mSequantialCaptureDelay; |
|
55 int mSequantialCaptureMemoryInUseMultiDrive; |
|
56 QString mSequantialCaptureFileName; |
|
57 |
|
58 int mVideoCaptureHotkey; |
|
59 int mVideoCaptureVideoFormat; |
|
60 int mVideoCaptureMemoryInUseMultiDrive; |
|
61 QString mVideoCaptureFileName; |
|
62 }; |
|
63 |
|
64 /** |
|
65 * Class that creates settings view of Screen Grabber |
|
66 */ |
|
67 class SettingsView : public HbView |
|
68 { |
|
69 Q_OBJECT |
|
70 |
|
71 enum CaptureMode{ SINGLE, SEQUENTIAL, VIDEO }; |
|
72 |
|
73 public: |
|
74 /** |
|
75 * Constuctor |
|
76 * @param mainView pointer to main view |
|
77 * @param mainWindow pointer to main window |
|
78 */ |
|
79 SettingsView(HbView &mainView, HbMainWindow &mainWindow, EngineWrapper &engineWrapper); |
|
80 |
|
81 /** |
|
82 * destructor |
|
83 */ |
|
84 ~SettingsView(); |
|
85 |
|
86 |
|
87 /** |
|
88 * Loads settings from engine and formats those settings into form items |
|
89 */ |
|
90 void loadSettings(); |
|
91 |
|
92 |
|
93 private slots: |
|
94 |
|
95 /** |
|
96 * saves settings and closes view. |
|
97 */ |
|
98 void saveAndClose(); |
|
99 |
|
100 /** |
|
101 * closes setting view |
|
102 */ |
|
103 void close(); |
|
104 |
|
105 /** |
|
106 * Slot that is called each time capture mode is changed |
|
107 */ |
|
108 // void updateShownItems(); |
|
109 private: |
|
110 |
|
111 /** |
|
112 * Creates single capture related components |
|
113 */ |
|
114 void createSingleCaptureComponents(HbDataFormModel *model, HbDataFormModelItem *parent); |
|
115 |
|
116 /* |
|
117 * Creates sequential capture related components. |
|
118 */ |
|
119 void createSequentialCaptureComponents(HbDataFormModel *model, HbDataFormModelItem *parent); |
|
120 |
|
121 /** |
|
122 * creates video capture related components |
|
123 */ |
|
124 void createVideoCaptureComponents(HbDataFormModel *model, HbDataFormModelItem *parent); |
|
125 |
|
126 |
|
127 |
|
128 /** |
|
129 * Reads form items and saves them into member variable mSettings |
|
130 */ |
|
131 void readFormItems(); |
|
132 |
|
133 private: |
|
134 |
|
135 /* Settings */ |
|
136 GrabSettings mSettings; |
|
137 |
|
138 /* EngineWrapper */ |
|
139 EngineWrapper &mEngineWrapper; |
|
140 |
|
141 /* Main Window of Screen Grabber */ |
|
142 HbMainWindow &mMainWindow; |
|
143 |
|
144 /* Main View of Screen Grabber */ |
|
145 HbView &mMainView; |
|
146 |
|
147 /* settingform */ |
|
148 HbDataForm *mSettingForm; |
|
149 |
|
150 /* model for settingform */ |
|
151 HbDataFormModel *mModel; |
|
152 |
|
153 /* model's components: */ |
|
154 |
|
155 /* mode selection item */ |
|
156 HbDataFormModelItem *mModeItem; |
|
157 |
|
158 /* groups that contain mode specific settings */ |
|
159 HbDataFormModelItem *mGroupImageCapture; |
|
160 HbDataFormModelItem *mGroupSeguantialCapture; |
|
161 HbDataFormModelItem *mGroupVideoCapture; |
|
162 |
|
163 /* Still image components */ |
|
164 HbDataFormModelItem *mImageHotKeyItem; |
|
165 HbDataFormModelItem *mImageFormatItem; |
|
166 HbDataFormModelItem *mImageMemoryInUseItem; |
|
167 HbDataFormModelItem *mImageFileNameItem; |
|
168 |
|
169 /* Sequential image components */ |
|
170 HbDataFormModelItem *mSequantialHotKeyItem; |
|
171 HbDataFormModelItem *mSequantialFormatItem; |
|
172 HbDataFormModelItem *mSequantialDelayItem; |
|
173 HbDataFormModelItem *mSequantialMemoryInUseItem; |
|
174 HbDataFormModelItem *mSequantialFileNameItem; |
|
175 |
|
176 /* Video capture components */ |
|
177 HbDataFormModelItem *mVideoHotKeyItem; |
|
178 HbDataFormModelItem *mVideoFormatItem; |
|
179 HbDataFormModelItem *mVideoMemoryInUseItem; |
|
180 HbDataFormModelItem *mVideoFileNameItem; |
|
181 |
|
182 |
|
183 |
|
184 |
|
185 }; |
|
186 |
|
187 |
|
188 |
|
189 #endif; |