15
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
|
|
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 |
* Kanrikogaku Kenkyusho, Ltd. - Initial contribution
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef DIRECTPRINTSERVERJOBGUARD_H
|
|
20 |
#define DIRECTPRINTSERVERJOBGUARD_H
|
|
21 |
|
|
22 |
#include <e32base.h>
|
|
23 |
|
|
24 |
#include "imageprint.h"
|
|
25 |
#include "directprintjobguarddata.h"
|
|
26 |
|
|
27 |
class CDirectPrintBody;
|
|
28 |
class TDpMessage;
|
|
29 |
|
|
30 |
class CDirectPrintServerJobGuard : public CBase, public MPrintEventObserver
|
|
31 |
{
|
|
32 |
public:
|
|
33 |
|
|
34 |
/**
|
|
35 |
* 2-phase constructor
|
|
36 |
*
|
|
37 |
* @param aEngine printing engine
|
|
38 |
* @return new object
|
|
39 |
*/
|
|
40 |
static CDirectPrintServerJobGuard* NewL( CDirectPrintBody& aEngine );
|
|
41 |
|
|
42 |
/**
|
|
43 |
* Destructor
|
|
44 |
*/
|
|
45 |
~CDirectPrintServerJobGuard();
|
|
46 |
|
|
47 |
private: // from MPrintEventObserver
|
|
48 |
|
|
49 |
void PrintJobProgressEvent(TInt aStatus, TInt aPercentCompletion, TInt aJobStateCode);
|
|
50 |
void PrintJobErrorEvent(TInt aError, TInt aErrorStringCode);
|
|
51 |
void PrinterStatusEvent(TInt aError, TInt aErrorStringCode);
|
|
52 |
void PreviewImageEvent(TInt aFsBitmapHandle);
|
|
53 |
void ShowMessageL(TInt aMsgLine1Code, TInt aMsgLine2Code);
|
|
54 |
TBool AskYesNoQuestionL(TInt aMsgLine1Code, TInt aMsgLine2Code);
|
|
55 |
const TDesC& AskForInputL(TInt aMsgLine1Code, TInt aMsgLine2Code);
|
|
56 |
|
|
57 |
public:
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Prepare print job by copying image file name into internal buffer
|
|
61 |
*
|
|
62 |
* @param aMessage message contains file name of one image.
|
|
63 |
*/
|
|
64 |
void PrepareL( TDpMessage& aMessage );
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Create print job and set this object as print job events observer
|
|
68 |
*
|
|
69 |
* @param aMessage message contains printer id
|
|
70 |
*/
|
|
71 |
TInt CreateL( TDpMessage& aMessage );
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Continue waiting for print job events
|
|
75 |
*
|
|
76 |
* @param aMessage message completed upon event arrival
|
|
77 |
*/
|
|
78 |
void ContinueCreateL( TDpMessage& aMessage );
|
|
79 |
|
|
80 |
/**
|
|
81 |
* Stop waiting for print job events. Cancel waiting message
|
|
82 |
*/
|
|
83 |
void Stop();
|
|
84 |
|
|
85 |
private:
|
|
86 |
|
|
87 |
CDirectPrintServerJobGuard( CDirectPrintBody& aEngine );
|
|
88 |
void ConstructL();
|
|
89 |
void Process( TInt aErr = KErrNone );
|
|
90 |
void DoProcessL();
|
|
91 |
void DoPreProcessL( const TDirectPrintJobGuardData& aData );
|
|
92 |
|
|
93 |
private: // data
|
|
94 |
|
|
95 |
CDirectPrintBody& iEngine;
|
|
96 |
TDpMessage* iMessage;
|
|
97 |
RArray<TDirectPrintJobGuardData> iBuffer;
|
|
98 |
RPointerArray<TDesC> iImages;
|
|
99 |
TBool iRequestActive;
|
|
100 |
};
|
|
101 |
|
|
102 |
|
|
103 |
#endif // DIRECTPRINTSERVERJOBGUARD_H
|
|
104 |
|
|
105 |
// End of File
|