|
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 CPRINTEVENTCATCHER_H |
|
20 #define CPRINTEVENTCATCHER_H |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 |
|
25 #include "imageprint.h" |
|
26 #include "mprinteventregisterif.h" |
|
27 |
|
28 class CIFFactory; |
|
29 class CImagePrintEngine; |
|
30 class MPrintPreviewObserver; |
|
31 class MPrintJobStatus; |
|
32 |
|
33 // CLASS DEFINITION |
|
34 /** |
|
35 * |
|
36 * Image Print Server passes the notifications via single interface, |
|
37 * which is implemented by CPrintEventCatcher. It receives the events |
|
38 * and forwards them to the correct instances inside ImagePrintEngine. |
|
39 * |
|
40 */ |
|
41 class CPrintEventCatcher : |
|
42 public CBase, |
|
43 public MPrintEventObserver, |
|
44 public MPrintEventRegisterIF |
|
45 { |
|
46 public: // Construction and destruction |
|
47 |
|
48 /** |
|
49 * Two phase constructor |
|
50 * |
|
51 * @param aFactory The factory |
|
52 * @param aEngine The image print engine |
|
53 * @return Initialized instance of the engine |
|
54 */ |
|
55 static CPrintEventCatcher* NewL( |
|
56 CIFFactory* aFactory, CImagePrintEngine* aEngine ); |
|
57 static CPrintEventCatcher* NewLC( |
|
58 CIFFactory* aFactory, CImagePrintEngine* aEngine ); |
|
59 |
|
60 /** |
|
61 * Destructor |
|
62 */ |
|
63 virtual ~CPrintEventCatcher(); |
|
64 |
|
65 private: // Construction and destruction |
|
66 |
|
67 /** |
|
68 * Constructor |
|
69 * |
|
70 * @param aFactory The factory |
|
71 * @param aEngine The image print engine |
|
72 */ |
|
73 CPrintEventCatcher( CIFFactory* aFactory, CImagePrintEngine* aEngine ); |
|
74 |
|
75 /** |
|
76 * 2nd phase constructor |
|
77 */ |
|
78 void ConstructL(); |
|
79 |
|
80 public: // Methods derived from MPrintEventObserver |
|
81 |
|
82 void PrintJobProgressEvent( TInt aStatus, TInt aPercentCompletion, |
|
83 TInt aJobStateCode ); |
|
84 void PrintJobErrorEvent( TInt aError, TInt aErrorStringCode ); |
|
85 void PrinterStatusEvent( TInt aError, TInt aErrorStringCode ); |
|
86 void PreviewImageEvent( TInt aFsBitmapHandle ); |
|
87 void ShowMessageL( TInt aMsgLine1Code, TInt aMsgLine2Code ); |
|
88 TBool AskYesNoQuestionL( TInt aMsgLine1Code, TInt aMsgLine2Code ); |
|
89 const TDesC& AskForInputL( TInt aMsgLine1Code, TInt aMsgLine2Code ); |
|
90 |
|
91 public: // from MPrintEventRegisterIF |
|
92 |
|
93 void RegisterObserver( MPrintJobStatus* aObserver ); |
|
94 void UnRegisterObserver( MPrintJobStatus* aObserver ); |
|
95 |
|
96 public: // New methods |
|
97 |
|
98 /** |
|
99 * Sets the new preview observer, which will receive the |
|
100 * print preview rendering events |
|
101 * |
|
102 * @param aObserver Print preview observer |
|
103 */ |
|
104 void SetPreviewObserver( MPrintPreviewObserver* aObserver ); |
|
105 |
|
106 private: // Data |
|
107 |
|
108 CIFFactory* iFactory; |
|
109 CImagePrintEngine* iEngine; |
|
110 |
|
111 // Preview observer |
|
112 MPrintPreviewObserver* iPreviewObserver; |
|
113 |
|
114 // Print job observer |
|
115 RPointerArray<MPrintJobStatus> iObservers; |
|
116 }; |
|
117 |
|
118 |
|
119 #endif // CPRINTEVENTCATCHER_H |
|
120 |
|
121 // End of File |