1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @publishedPartner |
|
19 */ |
|
20 |
|
21 #if !defined(__FaxStd_H__) |
|
22 #define __FaxStd_H__ |
|
23 |
|
24 // we start off with data constants |
|
25 |
|
26 // error codes |
|
27 |
|
28 /** |
|
29 Could not connect to the fax machine. The fax modem has failed. |
|
30 @publishedPartner |
|
31 @released |
|
32 */ |
|
33 const TInt KFaxErrModemNotWorking = -101; |
|
34 |
|
35 /** |
|
36 Could not connect to the fax machine. |
|
37 @publishedPartner |
|
38 @released |
|
39 */ |
|
40 const TInt KFaxErrCannotConnect = -102; |
|
41 |
|
42 /** |
|
43 Could not connect to the fax machine. |
|
44 @publishedPartner |
|
45 @released |
|
46 */ |
|
47 const TInt KFaxErrCSIorCIG = -103; |
|
48 |
|
49 /** |
|
50 Could not connect to the fax machine. |
|
51 @publishedPartner |
|
52 @released |
|
53 */ |
|
54 const TInt KFaxErrDISorDTC = -104; |
|
55 |
|
56 /** |
|
57 The connection to the fax machine has been broken. |
|
58 @publishedPartner |
|
59 @released |
|
60 */ |
|
61 const TInt KFaxErrFrameFail = -105; |
|
62 |
|
63 /** |
|
64 Could not connect to the fax machine. |
|
65 @publishedPartner |
|
66 @released |
|
67 */ |
|
68 const TInt KFaxErrAtNegotiatedSpeed = -106; |
|
69 |
|
70 /** |
|
71 Could not connect to the fax machine. |
|
72 @publishedPartner |
|
73 @released |
|
74 */ |
|
75 const TInt KFaxErrCFR = -107; |
|
76 |
|
77 /** |
|
78 Could not connect to the fax machine. |
|
79 @publishedPartner |
|
80 @released |
|
81 */ |
|
82 const TInt KFaxErrMCF = -108; |
|
83 |
|
84 /** |
|
85 Could not connect to the fax machine. |
|
86 @publishedPartner |
|
87 @released |
|
88 */ |
|
89 const TInt KFaxErrCRP = -109; |
|
90 |
|
91 /** |
|
92 Could not connect to the fax machine. Could not dial fax number. |
|
93 @publishedPartner |
|
94 @released |
|
95 */ |
|
96 const TInt KFaxErrNoDial = -110; |
|
97 |
|
98 /** |
|
99 Could not connect to the fax machine. No dial tone was detected. |
|
100 @publishedPartner |
|
101 @released |
|
102 */ |
|
103 const TInt KFaxErrNoDialTone = -111; |
|
104 |
|
105 /** |
|
106 Could not connect to the fax machine. The line is busy. |
|
107 @publishedPartner |
|
108 @released |
|
109 */ |
|
110 const TInt KFaxErrBusy = -112; |
|
111 |
|
112 /** |
|
113 Could not connect to the fax machine. The call was not answered. |
|
114 @publishedPartner |
|
115 @released |
|
116 */ |
|
117 const TInt KFaxErrNoAnswer = -113; |
|
118 |
|
119 /** |
|
120 Could not connect to the fax machine. The call was not answered by a fax machine. |
|
121 @publishedPartner |
|
122 @released |
|
123 */ |
|
124 const TInt KFaxErrNoCarrier = -114; |
|
125 |
|
126 /** |
|
127 Could not send to the fax machine. The fax machine is unable to receive faxes. |
|
128 @publishedPartner |
|
129 @released |
|
130 */ |
|
131 const TInt KFaxErrRemoteCannotReceive = -115; |
|
132 |
|
133 /** |
|
134 Panic. |
|
135 @publishedPartner |
|
136 @released |
|
137 */ |
|
138 const TInt KFaxErrCompression = -116; |
|
139 |
|
140 /** |
|
141 Panic. |
|
142 @publishedPartner |
|
143 @released |
|
144 */ |
|
145 const TInt KFaxErrPageTooLong = -117; |
|
146 |
|
147 /** |
|
148 Could not connect to the fax machine. |
|
149 @publishedPartner |
|
150 @released |
|
151 */ |
|
152 const TInt KFaxErrDCN = -118; |
|
153 |
|
154 /** |
|
155 Could not connect to the fax machine. |
|
156 @publishedPartner |
|
157 @released |
|
158 */ |
|
159 const TInt KFaxErrRemoteDCN = -119; |
|
160 |
|
161 /** |
|
162 Could not connect to the fax machine. |
|
163 @publishedPartner |
|
164 @released |
|
165 */ |
|
166 const TInt KFaxErrHDLC = -120; |
|
167 |
|
168 /** |
|
169 Panic. |
|
170 @publishedPartner |
|
171 @released |
|
172 */ |
|
173 const TInt KFaxErrStopAndWait = -121; |
|
174 |
|
175 /** |
|
176 Could not connect to the fax machine. |
|
177 @publishedPartner |
|
178 @released |
|
179 */ |
|
180 const TInt KFaxErrTrainStop = -122; |
|
181 |
|
182 /** |
|
183 Could not send to the fax machine. The connection has timed out. |
|
184 @publishedPartner |
|
185 @released |
|
186 */ |
|
187 const TInt KFaxErrReceiveTimeout = -123; |
|
188 |
|
189 /** |
|
190 The connection to the fax machine has been broken. |
|
191 @publishedPartner |
|
192 @released |
|
193 */ |
|
194 const TInt KFaxErrCannotEndData = -124; |
|
195 |
|
196 /** |
|
197 Could not connect to the fax machine. |
|
198 @publishedPartner |
|
199 @released |
|
200 */ |
|
201 const TInt KFaxErrEOP = -125; |
|
202 |
|
203 /** |
|
204 Could not connect to the fax machine. |
|
205 @publishedPartner |
|
206 @released |
|
207 */ |
|
208 const TInt KFaxErrMPS = -126; |
|
209 |
|
210 /** |
|
211 Could not connect to the fax machine. |
|
212 @publishedPartner |
|
213 @released |
|
214 */ |
|
215 const TInt KFaxErrNoReceiveMode = -127; |
|
216 |
|
217 /** |
|
218 Could not connect to the fax machine. |
|
219 @publishedPartner |
|
220 @released |
|
221 */ |
|
222 const TInt KFaxErrCannotAnswer = -128; |
|
223 |
|
224 /** |
|
225 Could not receive fax. The fax machine ended the call. |
|
226 @publishedPartner |
|
227 @released |
|
228 */ |
|
229 const TInt KFaxErrPrematureHangup = -129; |
|
230 |
|
231 /** |
|
232 Could not connect to the fax machine. |
|
233 @publishedPartner |
|
234 @released |
|
235 */ |
|
236 const TInt KFaxErrModemResponse = -130; |
|
237 |
|
238 /** |
|
239 Could not connect to the fax machine. |
|
240 @publishedPartner |
|
241 @released |
|
242 */ |
|
243 const TInt KFaxErrPrematureOK = -131; |
|
244 |
|
245 /** |
|
246 Could not connect to the fax machine. |
|
247 @publishedPartner |
|
248 @released |
|
249 */ |
|
250 const TInt KFaxErrNoFinalOK = -132; |
|
251 |
|
252 /** |
|
253 Could not connect to the fax machine. |
|
254 @publishedPartner |
|
255 @released |
|
256 */ |
|
257 const TInt KFaxErrUnknownPageCode = -133; |
|
258 |
|
259 /** |
|
260 Could not connect to the fax machine. |
|
261 @publishedPartner |
|
262 @released |
|
263 */ |
|
264 const TInt KFaxErrNoHangup = -134; |
|
265 |
|
266 /** |
|
267 Could not connect to the fax machine. |
|
268 @publishedPartner |
|
269 @released |
|
270 */ |
|
271 const TInt KFaxErrNoNegotiate = -135; |
|
272 |
|
273 /** |
|
274 Could not connect to the fax machine. |
|
275 @publishedPartner |
|
276 @released |
|
277 */ |
|
278 const TInt KFaxErrModemDisconnect = -136; |
|
279 |
|
280 /** |
|
281 Could not connect to the fax machine. |
|
282 @publishedPartner |
|
283 @released |
|
284 */ |
|
285 const TInt KFaxErrWrongModemType = -137; |
|
286 |
|
287 /** |
|
288 Could not connect to the fax machine. |
|
289 @publishedPartner |
|
290 @released |
|
291 */ |
|
292 const TInt KFaxErrTrainFail = -138; |
|
293 |
|
294 /** |
|
295 Could not connect to the fax machine. |
|
296 @publishedPartner |
|
297 @released |
|
298 */ |
|
299 const TInt KFaxTransmitterStalled = -139; |
|
300 |
|
301 /** |
|
302 Could not connect to the fax machine. |
|
303 @publishedPartner |
|
304 @released |
|
305 */ |
|
306 const TInt KFaxReceiverOverflow = -140; |
|
307 |
|
308 /** |
|
309 Could not connect to the fax machine. |
|
310 @publishedPartner |
|
311 @released |
|
312 */ |
|
313 const TInt KFaxCannotOpenPort = -141; |
|
314 |
|
315 /** |
|
316 Could not connect to the fax machine. |
|
317 @publishedPartner |
|
318 @released |
|
319 */ |
|
320 const TInt KFaxCannotCloseStore = -142; |
|
321 |
|
322 /** |
|
323 Could not connect to the fax machine. |
|
324 @publishedPartner |
|
325 @released |
|
326 */ |
|
327 const TInt KFaxCannotOpenStore = -143; |
|
328 |
|
329 /** |
|
330 Could not connect to the fax machine. |
|
331 @publishedPartner |
|
332 @released |
|
333 */ |
|
334 const TInt KFaxThreadError = -144; |
|
335 |
|
336 /** |
|
337 Could not connect to the fax machine. |
|
338 @publishedPartner |
|
339 @released |
|
340 */ |
|
341 const TInt KFaxFileSessionError = -145; |
|
342 |
|
343 /** |
|
344 Could not connect to the fax machine. Was KFaxFileCreateError till 7/10/97. |
|
345 @publishedPartner |
|
346 @released |
|
347 */ |
|
348 const TInt KFaxLogCreateError = -146; |
|
349 |
|
350 /** |
|
351 Could not connect to the fax machine. |
|
352 @publishedPartner |
|
353 @released |
|
354 */ |
|
355 const TInt KFaxFileSeekError = -147; |
|
356 |
|
357 /** |
|
358 Could not connect to the fax machine. |
|
359 @publishedPartner |
|
360 @released |
|
361 */ |
|
362 const TInt KFaxPDDError = -148; |
|
363 |
|
364 /** |
|
365 Could not connect to the fax machine. |
|
366 @publishedPartner |
|
367 @released |
|
368 */ |
|
369 const TInt KFaxLDDError = -149; |
|
370 |
|
371 /** |
|
372 Could not connect to the fax machine. |
|
373 @publishedPartner |
|
374 @released |
|
375 */ |
|
376 const TInt KFaxC32Error = -150; |
|
377 |
|
378 /** |
|
379 Could not connect to the fax machine. |
|
380 @publishedPartner |
|
381 @released |
|
382 */ |
|
383 const TInt KFaxCommsServerError = -151; |
|
384 |
|
385 /** |
|
386 Could not connect to the fax machine. |
|
387 @publishedPartner |
|
388 @released |
|
389 */ |
|
390 const TInt KFaxCommsPortError = -152; |
|
391 |
|
392 /** |
|
393 Could not connect to the fax machine. |
|
394 @publishedPartner |
|
395 @released |
|
396 */ |
|
397 const TInt KFaxCancelRequested = -153; |
|
398 |
|
399 /** |
|
400 Could not connect to the fax machine. |
|
401 @publishedPartner |
|
402 @released |
|
403 */ |
|
404 const TInt KFaxNoClass2Xon = -154; |
|
405 |
|
406 /** |
|
407 Could not connect to the fax machine. |
|
408 @publishedPartner |
|
409 @released |
|
410 */ |
|
411 const TInt KFaxConfigError = -155; |
|
412 |
|
413 /** |
|
414 Could not connect to the fax machine. |
|
415 @publishedPartner |
|
416 @released |
|
417 */ |
|
418 const TInt KFaxCannotAutodetect = -156; |
|
419 |
|
420 /** |
|
421 Could not connect to the fax machine. |
|
422 @publishedPartner |
|
423 @released |
|
424 */ |
|
425 const TInt KCannotFindFirstPage = -157; |
|
426 |
|
427 /** |
|
428 Could not connect to the fax machine. |
|
429 @publishedPartner |
|
430 @released |
|
431 */ |
|
432 const TInt KFaxBadInitialization = -158; |
|
433 |
|
434 /** |
|
435 Could not connect to the fax machine. |
|
436 @publishedPartner |
|
437 @released |
|
438 */ |
|
439 const TInt KFaxOnlyJustAutoDetected = -159; |
|
440 |
|
441 /** |
|
442 Could not connect to the fax machine. |
|
443 @publishedPartner |
|
444 @released |
|
445 */ |
|
446 const TInt KFaxBelowMinSpeed = -160; |
|
447 |
|
448 /** |
|
449 Could not connect to the fax machine. |
|
450 @publishedPartner |
|
451 @released |
|
452 */ |
|
453 const TInt KFaxPollingUnsupported = -161; |
|
454 |
|
455 /** |
|
456 Could not connect to the fax machine. |
|
457 @publishedPartner |
|
458 @released |
|
459 */ |
|
460 const TInt KFaxNothingToPoll = -162; |
|
461 |
|
462 /** |
|
463 Could not connect to the fax machine. |
|
464 @publishedPartner |
|
465 @released |
|
466 */ |
|
467 const TInt KFaxEtelServerError = -163; |
|
468 |
|
469 /** |
|
470 standard communication bytes |
|
471 */ |
|
472 const TUint8 Knul = 0x00; |
|
473 const TUint8 Kdle = 0x10; |
|
474 const TUint8 Ketx = 0x03; |
|
475 const TUint8 Kbackspace = 0x08; |
|
476 const TUint8 Kreturn = 0x0d; |
|
477 const TUint8 Klinefeed = 0x0a; |
|
478 const TUint8 Kxon = 0x11; |
|
479 const TUint8 Kxoff = 0x13; |
|
480 const TUint8 Kdc2 = 0x12; |
|
481 const TUint8 Kcan = 0x18; |
|
482 |
|
483 /** |
|
484 apparent clock granularity |
|
485 */ |
|
486 const TInt CLK_TCK = 1000000; |
|
487 |
|
488 // maximum size of a descriptor for reading and writing T4 scan lines |
|
489 |
|
490 // the longest possible encoded scan line is alternating black and white dots |
|
491 // that's 8 bits, as single white dot = 00111 single black dot = 010 |
|
492 // there's a maximum of 864 such pairs in a 1728 dot scan line |
|
493 // let's be generous and allow for eols and padding - 896 |
|
494 // this is sufficient for faxes we generate ourselves |
|
495 |
|
496 // On the other hand, a scan line can take up to 5 seconds to transmit |
|
497 // At 14400 bps, it could contain 72000 bits = 9000 bytes |
|
498 // There could be internal line padding = alternate run lengths of zero) |
|
499 // So this bigger figure is needed for faxes which we receive via the line |
|
500 |
|
501 // we also use this when sending phase C data to the modem |
|
502 // we also use this when receiving phase C data from the modem |
|
503 const TInt KMaxT4Des = 896; |
|
504 const TInt KMaxFaxBuf ((KMaxT4Des + sizeof (TInt)) * 2); |
|
505 |
|
506 // base for sizing buffers |
|
507 //-- LYN-593JT3 defect fix by Dmitry Lyokhin. 16.04.02 |
|
508 const TInt KBufSize = 2048; |
|
509 |
|
510 /** |
|
511 Major version number. |
|
512 A version must be specified when creating a session with the server. |
|
513 */ |
|
514 const TUint KEtelFaxMajorVersionNumber = 1; |
|
515 /** Minor version number. |
|
516 A version must be specified when creating a session with the server. |
|
517 @publishedPartner |
|
518 */ |
|
519 const TUint KEtelFaxMinorVersionNumber = 0; |
|
520 /** Build version number. |
|
521 A version must be specified when creating a session with the server. |
|
522 */ |
|
523 const TUint KEtelFaxVersionNumber = 601; |
|
524 |
|
525 IMPORT_C TInt StartThread (); |
|
526 |
|
527 |
|
528 /********************************************************************/ |
|
529 |
|
530 // fax structures |
|
531 /********************************************************************/ |
|
532 |
|
533 //The next enumerations are bitmapped, giving useful TFaxMode masks. |
|
534 const TUint KFaxReceive = 0x01; |
|
535 const TUint KFaxOffHook = 0x02; |
|
536 const TUint KFaxWaitForRing = 0x04; |
|
537 const TUint KFaxNoDial = 0x06; |
|
538 const TUint KFaxPoll = 0x08; |
|
539 |
|
540 /** |
|
541 Defines the seven fax session modes supported by the fax client. |
|
542 |
|
543 The enumerations do not progress from 0 to 6, as might be expected, but rather |
|
544 as 0, 1, 2, 3, 4, 5, 9. |
|
545 */ |
|
546 enum TFaxMode |
|
547 { |
|
548 /** Normal fax machine type send mode. */ |
|
549 EDialAndTransmit=0, // this is a normal fax machine type send |
|
550 /** Dial and receive fax back mode calling a fax on demand service. */ |
|
551 EDialAndReceiveFaxBack=1, // this dials a fax on demand service |
|
552 /** Immediate transmit mode for switching from voice to send. */ |
|
553 EImmediateTransmit=2, // for switching from voice to send |
|
554 /** Immediate receive mode for switching from voice to receive. */ |
|
555 EImmediateReceive=3, // for switching from voice to receive |
|
556 /** Ring and transmit mode for providing fax on demand. */ |
|
557 EWaitForRingAndTransmit=4, // this make us into a fax on demand |
|
558 /** Normal fax machine type receive mode. */ |
|
559 EWaitForRingAndReceive=5, // this is a normal fax machine type receive |
|
560 /** Fax polling mode */ |
|
561 EDialAndReceivePoll=9 // this is for fax polling |
|
562 }; |
|
563 |
|
564 #endif |
|