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 "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 RIMAGEPRINTCLIENT_H |
|
20 #define RIMAGEPRINTCLIENT_H |
|
21 |
|
22 #include <e32std.h> |
|
23 |
|
24 class TPrintCapability; |
|
25 class TIdleGuardData; |
|
26 class TDiscoveryGuardData; |
|
27 class TJobGuardData; |
|
28 |
|
29 class RImagePrintClient : public RSessionBase |
|
30 { |
|
31 public: |
|
32 |
|
33 /** |
|
34 * Constructor |
|
35 */ |
|
36 IMPORT_C RImagePrintClient(); |
|
37 |
|
38 /** |
|
39 * Connect to the ImagePrint server |
|
40 * |
|
41 * @return KErrNone if successful, otherwise another of the system-wide error codes |
|
42 */ |
|
43 IMPORT_C TInt ConnectL(); |
|
44 |
|
45 /** |
|
46 * Close the session |
|
47 */ |
|
48 IMPORT_C void Close(); |
|
49 |
|
50 /** |
|
51 * Count connections to the server ( all clients in all prosesses ) |
|
52 * |
|
53 * @param aConnections holder for connnections count |
|
54 * @return KErrNone if successful, otherwise another of the system-wide error codes |
|
55 */ |
|
56 IMPORT_C TInt CountConnections( TInt& aConnections ) const; |
|
57 |
|
58 /** |
|
59 * Inform server about foreground/background state of the client |
|
60 * |
|
61 * @param aFg foreground/background flag |
|
62 * @return KErrNone if successful, otherwise another of the system-wide error codes |
|
63 */ |
|
64 IMPORT_C TInt SetForeground( TInt aFg ) const; |
|
65 |
|
66 |
|
67 /** |
|
68 * Reserves ImagePrint engine for this client |
|
69 * |
|
70 * @return KErrNone if successful, KErrInUse if used by another client |
|
71 */ |
|
72 IMPORT_C TInt ReserveEngine() const; |
|
73 |
|
74 /** |
|
75 * Releases ImagePrint engine |
|
76 * |
|
77 * @return KErrNone if successful, KErrInUse if used by another client |
|
78 */ |
|
79 IMPORT_C TInt ReleaseEngine() const; |
|
80 |
|
81 /** |
|
82 * Get protocols supported by ImagePrint engine |
|
83 * |
|
84 * @return OR:ed protocols or KErrInUse if used by another client |
|
85 */ |
|
86 IMPORT_C TInt SupportedProtocols() const; |
|
87 |
|
88 /** |
|
89 * Gets the number of pages to be printed |
|
90 * |
|
91 * @return Number of pages to print or KErrInUse if used by another client |
|
92 */ |
|
93 IMPORT_C TInt GetNumPrintPages() const; |
|
94 |
|
95 /** |
|
96 * Gets the status of the printing job created |
|
97 * |
|
98 * @return Printing job status or KErrInUse if used by another client |
|
99 */ |
|
100 IMPORT_C TInt GetJobStatus() const; |
|
101 |
|
102 /** |
|
103 * Gets the status of the printer |
|
104 * |
|
105 * @param aPrinterID The exposed ID of the printer the client wants to know about. |
|
106 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
107 */ |
|
108 IMPORT_C TInt GetPrinterStatus( TInt aPrinterID ) const; |
|
109 |
|
110 /** |
|
111 * Cancel discovery |
|
112 * |
|
113 * @return KErrNone or KErrInUse if used by another client |
|
114 */ |
|
115 IMPORT_C TInt CancelDiscovery() const; |
|
116 |
|
117 /** |
|
118 * Submits a print job already created. The actual job execution is asynchronous so this |
|
119 * function returns immediately. If successful, notification of job status and job |
|
120 * completion is received by the client through the MPrintEventObserver. |
|
121 * |
|
122 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
123 */ |
|
124 IMPORT_C TInt SubmitPrintJob() const; |
|
125 |
|
126 /** |
|
127 * Cancels the print job. This is an asynchronous command. MPrintEventObserver::PrintJobProgressEvent |
|
128 * will be called with the status of TPrintJobProgressEventStatus::EDone when the cancellation |
|
129 * is completed. The notification can potentially be received by the client before |
|
130 * this command returns to the client. |
|
131 * |
|
132 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
133 */ |
|
134 IMPORT_C TInt CancelPrintJob() const; |
|
135 |
|
136 /** |
|
137 * Continues printing and / or submitting a print job. |
|
138 * |
|
139 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
140 */ |
|
141 IMPORT_C TInt ContinuePrintJob() const; |
|
142 |
|
143 /** |
|
144 * Removes a specified cached printer. |
|
145 * |
|
146 * @param aPrinterID The exposed ID of the printer the client wants to remove. |
|
147 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
148 */ |
|
149 IMPORT_C TInt RemoveCachedPrinter( TInt aPrinterID ) const; |
|
150 |
|
151 /** |
|
152 * Gets the icon representing a given layout or template. |
|
153 * |
|
154 * @param aTemplateID ID of the template / layout of interest. |
|
155 * @param aFbsBitmapHandle Handle to the appropriate bitmap. |
|
156 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
157 */ |
|
158 IMPORT_C TInt GetJobTemplateIcon( TInt aTemplateID, TInt& aFbsBitmapHandle ) const; |
|
159 |
|
160 /** |
|
161 * Gets the number of pages in the preview. |
|
162 * |
|
163 * @return Number of pages in the preview. |
|
164 */ |
|
165 IMPORT_C TInt GetNumPreviewPages() const; |
|
166 |
|
167 /** |
|
168 * Sets a print job setting. |
|
169 * |
|
170 * @param aCapabilityID ID of the capability of interest. |
|
171 * @param aValue New capability value. |
|
172 * @param aAffectedCapability ID of any affected capability. |
|
173 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
174 */ |
|
175 IMPORT_C TInt SetJobSetting( TInt aCapabilityID, TInt aValue, TInt& aAffectedCapability ) const; |
|
176 |
|
177 /** |
|
178 * Gets a setting configured for the created print job. |
|
179 * |
|
180 * @param aCapabilityID ID of the capability of interest. |
|
181 * @param aValue Capability value. |
|
182 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
183 */ |
|
184 IMPORT_C TInt GetJobSetting( TInt aCapabilityID, TInt& aValue ) const; |
|
185 |
|
186 /** |
|
187 * Gets the detail of a certain capability of a certain printer. |
|
188 * |
|
189 * @param aPrinterID The exposed ID of the printer the client wants to know about. |
|
190 * @param aCapabilityID ID of the capability of interest. |
|
191 * @param aCapability Capability information. |
|
192 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
193 */ |
|
194 IMPORT_C TInt GetPrinterCapability(TInt aPrinterID, TInt aCapabilityID, TPrintCapability& aCapability) const; |
|
195 |
|
196 /** |
|
197 * Gets the IDs of the capabilities supported by the printer specified. |
|
198 * |
|
199 * @param aPrinterID The exposed ID of the printer the client wants to know about. |
|
200 * @param aCapabilityIDs Array containing the ID's of the capabilities of the specified printer. |
|
201 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
202 */ |
|
203 IMPORT_C TInt GetPrinterCapabilityIDs( TInt aPrinterID, RArray<TInt>& aCapabilityIDs ) const; |
|
204 |
|
205 /** |
|
206 * Registers the IdleObserver to send idle event notifications. Asynchronous function. |
|
207 * |
|
208 * @param aData place holder for idle event. On function completion contains idle event data. |
|
209 * @param aStatus request status |
|
210 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
211 */ |
|
212 IMPORT_C TInt RegisterIdleObserver( TIdleGuardData& aData, TRequestStatus& aStatus ); |
|
213 |
|
214 /** |
|
215 * Cancel registering idle observer |
|
216 * |
|
217 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
218 */ |
|
219 IMPORT_C TInt CancelRegisterIdleObserver() const; |
|
220 |
|
221 /** |
|
222 * Start discovery and set request for discovery event. Asynchronous function. |
|
223 * |
|
224 * @param aData place holder for discovery event. On function completion contains discovery event data. |
|
225 * @param aProtocols OR:ed protocol ids |
|
226 * @param aStatus request status |
|
227 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
228 */ |
|
229 IMPORT_C TInt StartDiscovery( TDiscoveryGuardData& aData, TUint aProtocols, TRequestStatus& aStatus ); |
|
230 |
|
231 /** |
|
232 * Set next request for discovery event. Asynchronous function. |
|
233 * |
|
234 * @param aData place holder for discovery event. On function completion contains discovery event data. |
|
235 * @param aStatus request status |
|
236 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
237 */ |
|
238 IMPORT_C TInt ContinueDiscovery( TDiscoveryGuardData& aData, TRequestStatus& aStatus ); |
|
239 |
|
240 /** |
|
241 * Create print job and set request for print job event. Asynchronous function. |
|
242 * |
|
243 * @param aPrinterID printer id |
|
244 * @param aData place holder for print job event. On function completion contains print job event data. |
|
245 * @param aImages array of image file names |
|
246 * @param aStatus request status |
|
247 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
248 */ |
|
249 IMPORT_C TInt CreateJob( TInt aPrinterID, TJobGuardData& aData, RPointerArray<TDesC>& aImages, TRequestStatus& aStatus ); |
|
250 |
|
251 /** |
|
252 * Set next request for print job event. Asynchronous function. |
|
253 * |
|
254 * @param aData place holder for print job event. On function completion contains print job event data. |
|
255 * @param aStatus request status |
|
256 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
257 */ |
|
258 IMPORT_C TInt ContinueCreateJob( TJobGuardData& aData, TRequestStatus& aStatus ); |
|
259 |
|
260 /** |
|
261 * Cancel starting discovery |
|
262 * |
|
263 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
264 */ |
|
265 IMPORT_C TInt CancelStartDiscovery() const; |
|
266 |
|
267 /** |
|
268 * Cancel creating print job |
|
269 * |
|
270 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
271 */ |
|
272 IMPORT_C TInt CancelCreateJob() const; |
|
273 |
|
274 /** |
|
275 * PictBridge USB mode checker |
|
276 * |
|
277 * @return TInt value more than 0, if PictBridge USB mode is on; 0 if off; negative value if error |
|
278 */ |
|
279 IMPORT_C TInt IsPictBridgeMode() const; |
|
280 |
|
281 /** |
|
282 * Set number of copies |
|
283 * |
|
284 * @param aArray array of number of copies elements. Each array element corresponds to the array |
|
285 * of image file names of created print job |
|
286 * @return Any standard Symbian error code or error codes [ KErrInvalidSequence (-50) / KErrInvalidData (-51) ]. |
|
287 */ |
|
288 IMPORT_C TInt SetNumberOfCopies( const RArray<TInt>& aArray ) const; |
|
289 |
|
290 public: |
|
291 |
|
292 /** |
|
293 * Version getter |
|
294 * |
|
295 * @return version of the client |
|
296 */ |
|
297 TVersion Version() const; |
|
298 |
|
299 private: |
|
300 |
|
301 TPtr8 iDicsoveryDataPtr; |
|
302 TPtr8 iIdleDataPtr; |
|
303 TPtr8 iJobDataPtr; |
|
304 TPrintCapability* iCapability; |
|
305 }; |
|
306 |
|
307 |
|
308 #endif // RIMAGEPRINTCLIENT_H |
|
309 |
|
310 // End of File |
|