35
|
1 |
/*
|
|
2 |
* Copyright (c) 2006, 2007 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: Header file for imageprintuiappui
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef C_CIMAGEPRINTUIAPPUI_H
|
|
20 |
#define C_CIMAGEPRINTUIAPPUI_H
|
|
21 |
|
|
22 |
#include <aknViewAppUi.h>
|
|
23 |
#include <AknProgressDialog.h>
|
|
24 |
#include <AknWaitDialog.h>
|
|
25 |
#include <badesca.h>
|
|
26 |
#include "connectionmanager.h"
|
|
27 |
#include "capabilitymanager.h"
|
|
28 |
#include "eventmanager.h"
|
|
29 |
#include "requestmanager.h"
|
|
30 |
|
|
31 |
#include <AiwServiceIfMenu.h>
|
|
32 |
#include <GenericParamConsumer.h>
|
|
33 |
#include <eikenv.h>
|
|
34 |
|
|
35 |
#include <pictbridge.h>
|
|
36 |
|
|
37 |
class CNotes;
|
|
38 |
class CNoteTimer;
|
|
39 |
class CAknNavigationDecorator;
|
|
40 |
class DRMCommon;
|
|
41 |
|
|
42 |
|
|
43 |
const TInt KNumberOfUnsupportedFiles = 1;
|
|
44 |
const TInt KPrintFinishValue = 100;
|
|
45 |
const TInt KMaxPrinterName = 64;
|
|
46 |
const TInt KRetryInterval = 1 * 1000 * 1000; // 1 s
|
|
47 |
const TInt KRetryClose = 1 * 1000 * 1000; // 1 s
|
|
48 |
const TInt KImageDefaultArray = 2;
|
|
49 |
const TInt KRemoveValue = 5;
|
|
50 |
const TInt KImageNumber = 1;
|
|
51 |
|
|
52 |
// CONSTANTS
|
|
53 |
_LIT( KConfigInfoFile, "config.DPS");
|
|
54 |
_LIT( KParamFile, "system\\data\\T_AIW_PRINT.DAT");
|
|
55 |
_LIT( KUnSuppFile, "system\\data\\T_AIW_UNSUPP.DAT");
|
|
56 |
const TInt KResource = 40;
|
|
57 |
const TInt KDriver = 3;
|
|
58 |
const TInt KConfigLength = 16;
|
|
59 |
|
|
60 |
|
|
61 |
/**
|
|
62 |
* S60 application UI class
|
|
63 |
*/
|
|
64 |
class CImagePrintUiAppUi : public CAknViewAppUi
|
|
65 |
{
|
|
66 |
|
|
67 |
public:
|
|
68 |
|
|
69 |
/**
|
|
70 |
* Destructor
|
|
71 |
*/
|
|
72 |
virtual ~CImagePrintUiAppUi();
|
|
73 |
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Second phase constructor. Operations which might leave should
|
|
77 |
* be called here
|
|
78 |
*/
|
|
79 |
void ConstructL();
|
|
80 |
|
|
81 |
/**
|
|
82 |
* Returns instance of Capability Manager.
|
|
83 |
* @return CCapabilityManager.
|
|
84 |
*/
|
|
85 |
CCapabilityManager* CapabilityManager();
|
|
86 |
|
|
87 |
|
|
88 |
/**
|
|
89 |
* Returns instance of Notes
|
|
90 |
* @return CNotes.
|
|
91 |
*/
|
|
92 |
CNotes* Notes();
|
|
93 |
|
|
94 |
|
|
95 |
public: // Methods derived from CAknViewAppUi base class
|
|
96 |
|
|
97 |
void HandleCommandL( TInt aCommand );
|
|
98 |
|
|
99 |
|
|
100 |
public: //own methods
|
|
101 |
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Starts printing process when user select print
|
|
105 |
* @return none
|
|
106 |
*/
|
|
107 |
void StartPrinting();
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Cancel print when user select cancel
|
|
111 |
* @return none
|
|
112 |
*/
|
|
113 |
void CancelPrinting();
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Returns print state to other instances
|
|
117 |
* @return print state
|
|
118 |
*/
|
|
119 |
TBool PrintActive();
|
|
120 |
|
|
121 |
/**
|
|
122 |
* Provide array of images to be printed
|
|
123 |
* @return CDesCArrayFlat
|
|
124 |
*/
|
|
125 |
CDesCArrayFlat* ImagesToPrint();
|
|
126 |
|
|
127 |
/**
|
|
128 |
* Tells if cable is connected or not
|
|
129 |
* @return TBool .
|
|
130 |
*/
|
|
131 |
TBool IsCableConnected();
|
|
132 |
|
|
133 |
/**
|
|
134 |
* Shows note if there is unsupported files
|
|
135 |
* @return none.
|
|
136 |
*/
|
|
137 |
void ShowNoteL();
|
|
138 |
|
|
139 |
/**
|
|
140 |
* Closes application after showing error note
|
|
141 |
* @return none.
|
|
142 |
*/
|
|
143 |
void CloseAfterNoteL();
|
|
144 |
|
|
145 |
|
|
146 |
/**
|
|
147 |
* Request Manager notifies result of DoDps Request
|
|
148 |
* @return none.
|
|
149 |
*/
|
|
150 |
void NotifyRequestL( TInt aNotifyType);
|
|
151 |
|
|
152 |
/**
|
|
153 |
* Request Manager informs about number of images to be printed
|
|
154 |
* @return none.
|
|
155 |
*/
|
|
156 |
void NumberOfImages(TInt aNumberOfImages);
|
|
157 |
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Event Manager notifies DpsEvent
|
|
161 |
* @return none.
|
|
162 |
*/
|
|
163 |
void NotifyEventL(TInt aEventNotifyType);
|
|
164 |
|
|
165 |
/**
|
|
166 |
* Event Manager notifies about Print Progress
|
|
167 |
* @return none.
|
|
168 |
*/
|
|
169 |
void NotifyPrintProgress(TInt aNumberOfImages, TInt aProgress);
|
|
170 |
|
|
171 |
/**
|
|
172 |
* Event Manager notifies about Print Status
|
|
173 |
* @return none.
|
|
174 |
*/
|
|
175 |
void NotifyPrintStatus(TInt aStatus);
|
|
176 |
|
|
177 |
|
|
178 |
/**
|
|
179 |
* Connection Manager closes application if cable is disconnect
|
|
180 |
* or personaluty changes different as PTP
|
|
181 |
* @return none.
|
|
182 |
*/
|
|
183 |
void CloseApplication(TBool aDisconnect);
|
|
184 |
|
|
185 |
/**
|
|
186 |
* Connection Manager informs PTP printer is found
|
|
187 |
* @return none.
|
|
188 |
*/
|
|
189 |
void CableConnectedL();
|
|
190 |
|
|
191 |
/**
|
|
192 |
* Connection Manager informs about cable disconnection
|
|
193 |
* @return none.
|
|
194 |
*/
|
|
195 |
void CableDisConnected();
|
|
196 |
|
|
197 |
|
|
198 |
/**
|
|
199 |
* Capability Manager informs about capabilities has
|
|
200 |
* retrieved from printer
|
|
201 |
* @return none.
|
|
202 |
*/
|
|
203 |
void CapabilitiesReady();
|
|
204 |
|
|
205 |
/**
|
|
206 |
* Capability Manager informs about error when retrieving
|
|
207 |
* capabilities from printer
|
|
208 |
* @return none.
|
|
209 |
*/
|
|
210 |
void NotifyError();
|
|
211 |
|
|
212 |
/**
|
|
213 |
* Handles situation after timer timeout
|
|
214 |
* @return none.
|
|
215 |
*/
|
|
216 |
void HandleTimeOutL();
|
|
217 |
|
|
218 |
/**
|
|
219 |
* Handles requesting DPS request again
|
|
220 |
* @return none.
|
|
221 |
*/
|
|
222 |
void HandleRequestTime(TInt aTime);
|
|
223 |
|
|
224 |
/**
|
|
225 |
* Handles requsting capabilities again
|
|
226 |
* @return none.
|
|
227 |
*/
|
|
228 |
void HandleCapabilityTime(TInt aTime);
|
|
229 |
|
|
230 |
|
|
231 |
/**
|
|
232 |
* Handles situation after RunError in timer
|
|
233 |
* @return none.
|
|
234 |
*/
|
|
235 |
void HandleTimeErrorL(TInt aError);
|
|
236 |
|
|
237 |
|
|
238 |
private: //own methods
|
|
239 |
|
|
240 |
|
|
241 |
/**
|
|
242 |
* Set printer and vendor info to navipane
|
|
243 |
* @return none.
|
|
244 |
*/
|
|
245 |
void SetNavipaneTextL();
|
|
246 |
|
|
247 |
/**
|
|
248 |
* Read images to be printed to array
|
|
249 |
* @return none.
|
|
250 |
*/
|
|
251 |
void LoadImagesL();
|
|
252 |
|
|
253 |
/**
|
|
254 |
* Reads number of unsupported files
|
|
255 |
* @return none.
|
|
256 |
*/
|
|
257 |
void ReadNumberOfUnSuppL();
|
|
258 |
|
|
259 |
public:
|
|
260 |
|
|
261 |
/**
|
|
262 |
* Show all notes
|
|
263 |
* Own this pointer
|
|
264 |
*/
|
|
265 |
CNotes* iNotes;
|
|
266 |
|
|
267 |
|
|
268 |
private: // data
|
|
269 |
|
|
270 |
|
|
271 |
/** A singleton DPS engine object */
|
|
272 |
CDpsEngine* iEngine;
|
|
273 |
|
|
274 |
/**
|
|
275 |
* Connection manager to check connection status
|
|
276 |
* Owns this pointer
|
|
277 |
*/
|
|
278 |
CConnectionManager* iConnectionManager;
|
|
279 |
|
|
280 |
/**
|
|
281 |
* Retrieve, restore and change capabilities if needed
|
|
282 |
* Own this pointer
|
|
283 |
*/
|
|
284 |
CCapabilityManager* iCapabilityManager;
|
|
285 |
|
|
286 |
|
|
287 |
/**
|
|
288 |
* Needed when creating navipane text
|
|
289 |
* Own this pointer
|
|
290 |
*/
|
|
291 |
CAknNavigationDecorator* iNaviDecorator;
|
|
292 |
|
|
293 |
|
|
294 |
/**
|
|
295 |
* Performs DPS request towards PictBridge engine
|
|
296 |
* Own this pointer
|
|
297 |
*/
|
|
298 |
CRequestManager* iRequestManager;
|
|
299 |
|
|
300 |
|
|
301 |
/**
|
|
302 |
* Notifies Device- and JobEvent coming from PictBridge engine
|
|
303 |
* Own this pointer
|
|
304 |
*/
|
|
305 |
CEventManager* iEventManager;
|
|
306 |
|
|
307 |
|
|
308 |
// images to be printed
|
|
309 |
CDesCArrayFlat* iImageFiles;
|
|
310 |
|
|
311 |
// timer for unsupported file note
|
|
312 |
CNoteTimer* iNoteTimer;
|
|
313 |
|
|
314 |
HBufC* iCongFileName;
|
|
315 |
|
|
316 |
TBool iPrintActive;
|
|
317 |
TBool iCableConnected;
|
|
318 |
TBool iActiveNote;
|
|
319 |
TBool iCapabilityChanged;
|
|
320 |
TBool iUnsupportedFiles;
|
|
321 |
TBool iNoteShowed;
|
|
322 |
TInt iNumberOfImages;
|
|
323 |
TInt iNumberOfUnSuppFiles;
|
|
324 |
TBool iErrorState;
|
|
325 |
TBool iStartJobOK;
|
|
326 |
TBool iPaperEmpty;
|
|
327 |
TBool iNoteTimeOut;
|
|
328 |
TBool iCloseTimeOut;
|
|
329 |
TBool iCapabilityTimeOut;
|
|
330 |
TBool iRequestTimeOut;
|
|
331 |
|
|
332 |
TFileName iLogFilePath;
|
|
333 |
|
|
334 |
};
|
|
335 |
|
|
336 |
#endif // C_CIMAGEPRINTUIAPPUI_H
|