|
1 /* |
|
2 * Copyright (c) 2004-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 the License "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: Client include file for the ImagePrint server. Contains the |
|
15 * CImagePrint class definition, and the following interfaces: |
|
16 * MIdleObserver, MPrinterDiscoveryObserver and MPrintEventObserver |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 // Protection against nested includes |
|
22 #ifndef IMAGEPRINT_H |
|
23 #define IMAGEPRINT_H |
|
24 |
|
25 // System includes |
|
26 #include <e32base.h> |
|
27 |
|
28 class TPrinter; |
|
29 class TEvent; |
|
30 |
|
31 _LIT( KTabChar, "\t" ); |
|
32 _LIT( KParamFile, "\\system\\data\\T_AIW_TEMP.DAT"); |
|
33 |
|
34 /// Error constant defined to indicate Invalid Sequence. |
|
35 const TInt KErrInvalidSequence = -50; |
|
36 /// Error constant defined to indicate Invalid Data. |
|
37 const TInt KErrInvalidData = -51; |
|
38 /// Error constant defined to indicate that a printer has been connected |
|
39 const TInt KErrConnected = -500; |
|
40 |
|
41 /// BPP Protocol Identifier. |
|
42 const TUint KImagePrint_PrinterProtocol_BPP = 1; |
|
43 /// BIP Protocol Identifier. |
|
44 const TUint KImagePrint_PrinterProtocol_BIP = 2; |
|
45 /// OPP Protocol Identifier (Printer). |
|
46 const TUint KImagePrint_PrinterProtocol_OPP_Printer = 4; |
|
47 /// DPOF Protocol Identifier. |
|
48 const TUint KImagePrint_PrinterProtocol_DPOF = 8; |
|
49 /// PictBridge Protocol Identifier. |
|
50 const TUint KImagePrint_PrinterProtocol_PictBridge = 16; |
|
51 /// OPP Protocol Identifier (PC). |
|
52 const TUint KImagePrint_PrinterProtocol_OPP_PC = 32; |
|
53 /// UPnP Protocol Identifier |
|
54 const TUint KImagePrint_PrinterProtocol_UPnP = 64; |
|
55 /// LPR Protocol Identifier |
|
56 const TUint KImagePrint_PrinterProtocol_LPR = 128; |
|
57 |
|
58 /// Enums used to specify the current state in the DiscoveryStatusL callback. |
|
59 enum TDiscoveryStatus |
|
60 { |
|
61 EDiscoverying = 0, |
|
62 EDiscoveryFinished = 1, |
|
63 EDiscoveryCancelling = 2 |
|
64 }; |
|
65 |
|
66 /// Enums used to specify the current state in the PrintJobProgressEvent callback. |
|
67 enum TPrintJobProgressEventStatus |
|
68 { |
|
69 EActive = 0, |
|
70 EDone = 1 |
|
71 }; |
|
72 |
|
73 /** |
|
74 * @brief Interface to be implemented by the class using CImagePrint. It is used by CImagePrint to report anything related |
|
75 * to the discovery process. |
|
76 */ |
|
77 class MPrinterDiscoveryObserver |
|
78 { |
|
79 public: |
|
80 /** |
|
81 * Called by Image Printer Server to notify the client application that a printer was discovered. |
|
82 * @param aPrinterInfo Contains printer information of the discovered device. |
|
83 */ |
|
84 virtual void FoundPrinterL( const TPrinter& aPrinterInfo ) = 0; |
|
85 /** |
|
86 * Called by Image Printer Server to notify the client application that an operation |
|
87 * has completed, either successfully or with an error. |
|
88 * @param aStatus Indicate the status of the discovery process. One of the values of \c ::TDiscoveryStatus |
|
89 * @param aErrorCode \c KErrNone if there was no error, otherwise another of the system-wide error codes. |
|
90 * @param aErrorStringCode StringCode - Descriptive text that can be used to further explain error. |
|
91 */ |
|
92 virtual void DiscoveryStatusL( TInt aStatus, |
|
93 TInt aErrorCode, |
|
94 TInt aErrorStringCode ) = 0; |
|
95 /** |
|
96 * Called by Image Printer Server to notify the client application that a printer |
|
97 * returned from the cache was not discovered during the discovery phase, |
|
98 * and should be removed from the UI. If this call is needed, it will be made |
|
99 * after all BPP printers have been returned, but before the discovery completes. |
|
100 * @param aPrinterInfo Contains printer information of the printer that was not found during discovery |
|
101 */ |
|
102 virtual void RemovePrinterL( const TPrinter& aPrinterInfo ) = 0; |
|
103 }; |
|
104 |
|
105 /** |
|
106 * @brief Interface to be implemented by the class using CImagePrint. It is used by CImagePrint to report anything related |
|
107 * to the printing process, once it is started. |
|
108 */ |
|
109 class MPrintEventObserver |
|
110 { |
|
111 public: |
|
112 virtual void PrintJobProgressEvent( TInt aStatus, |
|
113 TInt aPercentCompletion, |
|
114 TInt aJobStateCode ) = 0; |
|
115 |
|
116 virtual void PrintJobErrorEvent( TInt aError, |
|
117 TInt aErrorStringCode ) = 0; |
|
118 |
|
119 virtual void PrinterStatusEvent( TInt aError, |
|
120 TInt aErrorStringCode ) = 0; |
|
121 |
|
122 virtual void PreviewImageEvent( TInt aFsBitmapHandle ) = 0; |
|
123 |
|
124 virtual void ShowMessageL( TInt aMsgLine1Code, |
|
125 TInt aMsgLine2Code ) = 0; |
|
126 |
|
127 virtual TBool AskYesNoQuestionL( TInt aMsgLine1Code, |
|
128 TInt aMsgLine2Code ) = 0; |
|
129 |
|
130 virtual const TDesC& AskForInputL( TInt aMsgLine1Code, |
|
131 TInt aMsgLine2Code ) = 0; |
|
132 }; |
|
133 |
|
134 /** |
|
135 * @brief Interface to be implemented by the class using CImagePrint. It is used by CImagePrint to report |
|
136 * anything related to status changes in the handling protocol. |
|
137 * @sa CImagePrint::RegisterIdleObserver |
|
138 */ |
|
139 class MIdleObserver |
|
140 { |
|
141 public: |
|
142 /** Called by CImagePrint to notify of events. The meaning of the event and associated error and mesage codes |
|
143 * is protocol dependant. |
|
144 */ |
|
145 virtual void StatusEvent( const TEvent &aEvent, |
|
146 TInt aError, |
|
147 TInt aMsgCode ) = 0; |
|
148 }; |
|
149 |
|
150 |
|
151 #endif // IMAGEPRINT_H |
|
152 |
|
153 // End of File |