author | msekine <m.sekine@kthree.co.jp> |
Wed, 31 Mar 2010 00:04:55 +0900 | |
branch | RCL_3 |
changeset 12 | 613a5ff70823 |
child 15 | 2275db202402 |
permissions | -rw-r--r-- |
12
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
1 |
/* |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd. |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
3 |
* All rights reserved. |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
8 |
* |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
10 |
* Kanrikogaku Kenkyusho, Ltd. - Initial contribution |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
11 |
* |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
12 |
* Contributors: |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
13 |
* |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
14 |
* Description: |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
15 |
* {Description of the file} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
16 |
* |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
17 |
*/ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
18 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
19 |
#include <pdrport.h> // CFilePrinterPort |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
20 |
#include <TXTETEXT.H> // CEditableText |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
21 |
#include <TXTRICH.H> // CRichText |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
22 |
#include <FLDBLTIN.H> // CPageNumField |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
23 |
#include <flddef.h> // KPageNumberFieldUid, KNumPagesFieldUid |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
24 |
#include <stringloader.h> // StringLoader |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
25 |
#include <xmlengdocument.h> // RXmlEngDocument |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
26 |
#include <xmlengelement.h> // TXmlEngElement |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
27 |
#include <xmlengattr.h> // TXmlEngAttr |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
28 |
#include <xmlengnodelist.h> // RXmlEngNodeList |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
29 |
#include <bautils.h> // BaflUtils |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
30 |
#include <eikenv.h> // CEikonEnv |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
31 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
32 |
#include "clog.h" |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
33 |
#include <directprintapp.rsg> |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
34 |
#include "directprintengine.h" |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
35 |
#include "directprintband.h" |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
36 |
#include "directprintengineobserver.h" |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
37 |
#include "directprintmodel.h" |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
38 |
#include "directprintbanduid.h" |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
39 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
40 |
//! Default Page spec in Twips |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
41 |
#define KDefaultPageSpecInTwips TPageSpec(TPageSpec::EPortrait,TSize(11906,16838)) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
42 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
43 |
CDirectPrintEngine::CDirectPrintEngine(CDirectPrintModel& aModel) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
44 |
: iModel(aModel) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
45 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
46 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
47 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
48 |
CDirectPrintEngine::~CDirectPrintEngine() |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
49 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
50 |
if (iProgressDialog) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
51 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
52 |
TRAP_IGNORE(iProgressDialog->ProcessFinishedL()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
53 |
delete iProgressDialog; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
54 |
iProgressDialog = NULL; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
55 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
56 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
57 |
if (iPrintBand) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
58 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
59 |
delete iPrintBand; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
60 |
iPrintBand = NULL; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
61 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
62 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
63 |
iPrintSetup->FreeModelList(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
64 |
delete iPrintSetup; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
65 |
delete iProgressMessage; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
66 |
iFs.Close(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
67 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
68 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
69 |
CDirectPrintEngine* CDirectPrintEngine::NewL(CDirectPrintModel& aModel) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
70 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
71 |
CDirectPrintEngine* self = CDirectPrintEngine::NewLC(aModel); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
72 |
CleanupStack::Pop(self); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
73 |
return self; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
74 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
75 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
76 |
CDirectPrintEngine* CDirectPrintEngine::NewLC(CDirectPrintModel& aModel) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
77 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
78 |
CDirectPrintEngine* self = new(ELeave) CDirectPrintEngine(aModel); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
79 |
CleanupStack::PushL(self); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
80 |
self->ConstructL(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
81 |
return self; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
82 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
83 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
84 |
void CDirectPrintEngine::ConstructL() |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
85 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
86 |
LOG("CDirectPrintEngine::ConstructL BEGIN"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
87 |
iFs.Connect(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
88 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
89 |
iPrintSetup = CPrintSetup::NewL(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
90 |
iPrintSetup->AddPrinterDriverDirL(KDefaultPrinterDriverPath); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
91 |
iModelList = iPrintSetup->ModelNameListL(iFs); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
92 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
93 |
#ifdef _DEBUG |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
94 |
LOG1("ModelCount=[%d]", ModelCount()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
95 |
for (TInt i=0; i < ModelCount(); i++) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
96 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
97 |
TPrinterModelEntry entry = (*iModelList)[i]; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
98 |
RDebug::Print(_L("[%d][%S][%d] "), i, &(entry.iModelName), entry.iRequiresPrinterPort); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
99 |
LOG1("ModelName=[%S]", &(entry.iModelName)); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
100 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
101 |
#endif |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
102 |
// read progress message |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
103 |
iProgressMessage = StringLoader::LoadL( R_DIRECTPRINT_MSG_PRINTING_PROGRESS ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
104 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
105 |
LOG("CDirectPrintEngine::ConstructL END"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
106 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
107 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
108 |
void CDirectPrintEngine::SetObserver(MDirectPrintEngineObserver* aObserver) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
109 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
110 |
iObserver = aObserver; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
111 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
112 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
113 |
/** |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
114 |
Override of base class virtual. |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
115 |
Notifies that a print or print preview operation is about to begin. |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
116 |
*/ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
117 |
void CDirectPrintEngine::NotifyPrintStarted(TPrintParameters /*aPrintParams*/) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
118 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
119 |
iPageCounter = 0; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
120 |
TRAPD(err, StartPrintProgressNoteL()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
121 |
iLastError = err; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
122 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
123 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
124 |
/** |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
125 |
Override of base class virtual.\n |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
126 |
Notifies that a band is about to be printed used to display print progress information, |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
127 |
including the current page number.\n |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
128 |
It is called immediately before each band is printed.\n |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
129 |
*/ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
130 |
void CDirectPrintEngine::NotifyBandPrinted(TInt /*aPercent*/, TInt aCurrentPageNum, TInt /*aCurrentCopyNum*/) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
131 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
132 |
if (iPageCounter==0) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
133 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
134 |
// start print |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
135 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
136 |
if (iPageCounter<aCurrentPageNum) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
137 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
138 |
// next page |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
139 |
iPageCounter = aCurrentPageNum; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
140 |
TRAPD(err, UpdatePrintProgressNoteL(iPageCounter)); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
141 |
iLastError = err; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
142 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
143 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
144 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
145 |
/** |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
146 |
Override of base class virtual.\n |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
147 |
Notifies that the print or print preview operation has completed.\n |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
148 |
used to display information about how the operation completed, |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
149 |
for example any errors that occurred.\n |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
150 |
*/ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
151 |
void CDirectPrintEngine::NotifyPrintEnded(TInt aErr) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
152 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
153 |
CActiveScheduler::Stop(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
154 |
TInt err = KErrNone; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
155 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
156 |
if (aErr == KErrNone) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
157 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
158 |
if (iObserver) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
159 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
160 |
TRAP(err, iObserver->HandlePrintEventL(MDirectPrintEngineObserver::EDirectPrintEngineEventFinishCreatePrintData, 0, KNullDesC)); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
161 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
162 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
163 |
else |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
164 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
165 |
switch (aErr) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
166 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
167 |
case KErrCancel: |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
168 |
if (iObserver) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
169 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
170 |
TRAP(err, iObserver->HandlePrintEventL(MDirectPrintEngineObserver::EDirectPrintEngineEventCancelCreatePrintData, aErr, KNullDesC)); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
171 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
172 |
break; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
173 |
default: |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
174 |
if (iObserver) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
175 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
176 |
TRAP(err, iObserver->HandlePrintEventL(MDirectPrintEngineObserver::EDirectPrintEngineEventErrorCreatePrintData, aErr, KNullDesC)); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
177 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
178 |
break; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
179 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
180 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
181 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
182 |
TRAP(err, EndPrintProgressNoteL()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
183 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
184 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
185 |
/** |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
186 |
Override of base class virtual.\n |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
187 |
Returns the number of pages in the current document.\n |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
188 |
@return - TInt (Number of pages).\n |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
189 |
*/ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
190 |
TInt CDirectPrintEngine::UpdateFieldNumPages()const |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
191 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
192 |
return iMaxPageNum; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
193 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
194 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
195 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
196 |
void CDirectPrintEngine::PrintL() |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
197 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
198 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
199 |
// set the total page |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
200 |
iMaxPageNum = 1; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
201 |
iPrintSetup->Header()->SetNumPagesInfo(*this); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
202 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
203 |
TInt modelNum = iModelList->UidToNum(ModelUid(iModelIndex)); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
204 |
iPrintSetup->CreatePrinterDeviceL(modelNum); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
205 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
206 |
// create a port if necessary |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
207 |
CPrinterPort* port=NULL; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
208 |
if ((*iModelList)[modelNum].iRequiresPrinterPort) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
209 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
210 |
#ifdef __WINSCW__ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
211 |
port = CFilePrinterPort::NewL(_L("c:\\fpr.pcl")); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
212 |
#else |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
213 |
// port = CFilePrinterPort::NewL(_L("e:\\fpr.pcl")); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
214 |
port = CFilePrinterPort::NewL(_L("c:\\fpr.pcl")); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
215 |
#endif |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
216 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
217 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
218 |
iPrintSetup->PrinterDevice()->SelectPageSpecInTwips(KDefaultPageSpecInTwips); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
219 |
iPrintSetup->iPageMarginsInTwips.iHeaderOffset = 720; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
220 |
iPrintSetup->iPageMarginsInTwips.iFooterOffset = 0; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
221 |
iPrintSetup->iPageMarginsInTwips.iMargins.iLeft = 1440; // 1 inch |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
222 |
iPrintSetup->iPageMarginsInTwips.iMargins.iRight = 1440; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
223 |
iPrintSetup->iPageMarginsInTwips.iMargins.iTop = 1440; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
224 |
iPrintSetup->iPageMarginsInTwips.iMargins.iBottom = 1440; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
225 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
226 |
if (iObserver) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
227 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
228 |
iObserver->HandlePrintEventL(MDirectPrintEngineObserver::EDirectPrintEngineEventStartCreatePrintData, 0, KNullDesC); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
229 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
230 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
231 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
232 |
TRAPD(err, DoPrintL(port)); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
233 |
if (err == KErrNone) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
234 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
235 |
CActiveScheduler::Start(); // stopped by killing it - subtle... |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
236 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
237 |
else |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
238 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
239 |
if (iObserver) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
240 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
241 |
iObserver->HandlePrintEventL(MDirectPrintEngineObserver::EDirectPrintEngineEventErrorCreatePrintData, err, KNullDesC); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
242 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
243 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
244 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
245 |
// if (iPrintBand) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
246 |
// { |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
247 |
// delete iPrintBand; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
248 |
// iPrintBand = NULL; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
249 |
// } |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
250 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
251 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
252 |
void CDirectPrintEngine::DoPrintL(CPrinterPort* aPort) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
253 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
254 |
// create a header |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
255 |
iPrintSetup->Header()->CreateTextL(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
256 |
TBuf<40> buf(_L("This is the header on page out of ")); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
257 |
buf.Append(CEditableText::EParagraphDelimiter); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
258 |
iPrintSetup->Header()->Text()->InsertL(0,buf); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
259 |
CTextField* pNumberfield=iPrintSetup->Header()->Text()->NewTextFieldL(KPageNumberFieldUid); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
260 |
iPrintSetup->Header()->Text()->InsertFieldL(27,pNumberfield,KPageNumberFieldUid); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
261 |
CNumPagesField* numPagesField=(CNumPagesField*)iPrintSetup->Header()->Text()->NewTextFieldL(KNumPagesFieldUid); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
262 |
iPrintSetup->Header()->Text()->InsertFieldL(35,numPagesField,KNumPagesFieldUid); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
263 |
iPrintSetup->Header()->Text()->UpdateFieldL(27); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
264 |
iPrintSetup->Header()->Text()->UpdateFieldL(35); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
265 |
iPrintSetup->Header()->SetFirstPageToPrintTo(1); // no header on first 3 pages |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
266 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
267 |
iPrintSetup->Footer()->CreateTextL(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
268 |
TBuf<40> buf2(_L("This is the footer on page ")); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
269 |
buf2.Append(CEditableText::EParagraphDelimiter); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
270 |
iPrintSetup->Footer()->Text()->InsertL(0,buf2); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
271 |
CTextField* pNumberfield2=iPrintSetup->Footer()->Text()->NewTextFieldL(KPageNumberFieldUid); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
272 |
iPrintSetup->Footer()->Text()->InsertFieldL(27,pNumberfield2,KPageNumberFieldUid); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
273 |
iPrintSetup->Footer()->Text()->UpdateFieldL(27); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
274 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
275 |
// start print to file |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
276 |
iPrintSetup->iNumOfFirstPage = 1; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
277 |
TPrintParameters params; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
278 |
params.iFirstPage = 1; // don't print the first page at all, ie print page no's 3-6 |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
279 |
params.iLastPage = 1; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
280 |
params.iNumCopies = 1; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
281 |
TPageSpec spec; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
282 |
spec.iPortraitPageSize = KA4PaperSizeInTwips; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
283 |
spec.iOrientation = TPageSpec::EPortrait; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
284 |
iPrintSetup->PrinterDevice()->SelectPageSpecInTwips(spec); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
285 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
286 |
//=========================== |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
287 |
// start printing |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
288 |
//=========================== |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
289 |
iPrintSetup->StartPrintL(params, *(PageRegionPrinter()), aPort, this); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
290 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
291 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
292 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
293 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
294 |
TInt CDirectPrintEngine::ModelCount() |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
295 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
296 |
return iModelList->ModelCount(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
297 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
298 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
299 |
void CDirectPrintEngine::ModelName(TInt aIndex, TDes& aDes) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
300 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
301 |
TPtrC name((*iModelList)[aIndex].iModelName); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
302 |
if (name.Length() <= aDes.MaxLength()) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
303 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
304 |
aDes.Copy(name); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
305 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
306 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
307 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
308 |
TUid CDirectPrintEngine::ModelUid(TInt aIndex) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
309 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
310 |
return (*iModelList)[aIndex].iUid; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
311 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
312 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
313 |
void CDirectPrintEngine::SetUseModel(TInt aIndex) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
314 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
315 |
iModelIndex = aIndex; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
316 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
317 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
318 |
void CDirectPrintEngine::StartPrintProgressNoteL() |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
319 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
320 |
// Delete possible previous CAknProgressDialog. |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
321 |
delete iProgressDialog; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
322 |
iProgressDialog = NULL; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
323 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
324 |
// Create new CAknProgressDialog. |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
325 |
iProgressDialog = new ( ELeave ) CAknProgressDialog( reinterpret_cast |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
326 |
<CEikDialog**> |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
327 |
( &iProgressDialog ) ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
328 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
329 |
iProgressDialog->SetCallback( this ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
330 |
iProgressDialog->PrepareLC( R_DIRECTPRINT_PRINT_PROGRESS_NOTE ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
331 |
iProgressInfo = iProgressDialog->GetProgressInfoL(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
332 |
iProgressInfo->SetFinalValue( iMaxPageNum ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
333 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
334 |
TBuf<32> msg; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
335 |
msg.AppendFormat(*iProgressMessage, iPageCounter, iMaxPageNum); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
336 |
iProgressDialog->SetTextL(msg); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
337 |
iProgressDialog->RunLD(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
338 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
339 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
340 |
void CDirectPrintEngine::EndPrintProgressNoteL() |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
341 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
342 |
if (iProgressDialog) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
343 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
344 |
iProgressDialog->ProcessFinishedL(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
345 |
delete iProgressDialog; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
346 |
iProgressDialog = NULL; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
347 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
348 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
349 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
350 |
void CDirectPrintEngine::UpdatePrintProgressNoteL(TInt aPage) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
351 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
352 |
if (iProgressInfo) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
353 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
354 |
TBuf<32> msg; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
355 |
msg.AppendFormat(*iProgressMessage, aPage, iMaxPageNum); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
356 |
iProgressDialog->SetTextL(msg); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
357 |
iProgressInfo->SetAndDraw(aPage); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
358 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
359 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
360 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
361 |
void CDirectPrintEngine::DialogDismissedL( TInt /*aButtonId*/ ) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
362 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
363 |
if (iPrintSetup) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
364 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
365 |
iPrintSetup->EndPrint(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
366 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
367 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
368 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
369 |
void CDirectPrintEngine::StartPrintPreviewL() |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
370 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
371 |
// Clear previous object |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
372 |
EndPrintPreview(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
373 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
374 |
// set the total page |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
375 |
iMaxPageNum = 1; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
376 |
iPrintSetup->Header()->SetNumPagesInfo(*this); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
377 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
378 |
TInt modelNum = iModelList->UidToNum(ModelUid(iModelIndex)); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
379 |
iPrintSetup->CreatePrinterDeviceL(modelNum); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
380 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
381 |
// create a port if necessary |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
382 |
//CPrinterPort* port=NULL; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
383 |
//if ((*iModelList)[modelNum].iRequiresPrinterPort) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
384 |
// { |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
385 |
// port = CFilePrinterPort::NewL(_L("e:\\fpr.pcl")); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
386 |
// } |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
387 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
388 |
iPrintSetup->PrinterDevice()->SelectPageSpecInTwips(KDefaultPageSpecInTwips); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
389 |
iPrintSetup->iPageMarginsInTwips.iHeaderOffset = 720; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
390 |
iPrintSetup->iPageMarginsInTwips.iFooterOffset = 0; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
391 |
iPrintSetup->iPageMarginsInTwips.iMargins.iLeft = 1440; // 1 inch |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
392 |
iPrintSetup->iPageMarginsInTwips.iMargins.iRight = 1440; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
393 |
iPrintSetup->iPageMarginsInTwips.iMargins.iTop = 1440; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
394 |
iPrintSetup->iPageMarginsInTwips.iMargins.iBottom = 1440; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
395 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
396 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
397 |
void CDirectPrintEngine::EndPrintPreview() |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
398 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
399 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
400 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
401 |
void CDirectPrintEngine::SetParamL(RXmlEngDocument* aParam) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
402 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
403 |
LOG("CDirectPrintEngine::SetParamL BEGIN"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
404 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
405 |
iParam = aParam; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
406 |
if ( iPrintBand ) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
407 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
408 |
delete iPrintBand; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
409 |
iPrintBand = NULL; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
410 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
411 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
412 |
_LIT8(KElementRecogMode, "RecognizeMode"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
413 |
_LIT8(KElementRecogModeAttr, "mode"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
414 |
_LIT8(KElementRecogModeValueFile, "PrintRecognizeModeFile"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
415 |
_LIT8(KElementRecogModeValuePlugin, "PrintRecognizeModePlugin"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
416 |
_LIT8(KElementFile, "PrintFile"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
417 |
_LIT8(KElementFileAttr, "file"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
418 |
_LIT8(KElementPluginUid, "PluginUid"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
419 |
_LIT8(KElementPluginUidAttr, "uid"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
420 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
421 |
TXmlEngElement element = iParam->DocumentElement().FirstChild().AsElement(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
422 |
HBufC* filename = NULL; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
423 |
TUint uidValue = 0; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
424 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
425 |
enum { |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
426 |
EParamModeFile = 0x0001, |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
427 |
EParamModePlugin = 0x0002, |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
428 |
EParamFileExist = 0x0008, |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
429 |
EParamPluginExist = 0x0010 |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
430 |
}; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
431 |
TUint paramFlag = 0; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
432 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
433 |
while (element.NotNull()) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
434 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
435 |
if (element.Name().CompareF(KElementRecogMode()) == 0) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
436 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
437 |
TXmlEngAttr attr = element.AttributeNodeL(KElementRecogModeAttr,KNullDesC8); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
438 |
if(attr.Value().CompareF(KElementRecogModeValueFile) == 0) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
439 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
440 |
paramFlag |= EParamModeFile; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
441 |
LOG("Param:Mode=File"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
442 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
443 |
else if(attr.Value().CompareF(KElementRecogModeValuePlugin) == 0) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
444 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
445 |
paramFlag |= EParamModePlugin; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
446 |
LOG("Param:Mode=Plugin"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
447 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
448 |
else |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
449 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
450 |
LOG("[Error] Param:Mode=Not set"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
451 |
break; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
452 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
453 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
454 |
else if (element.Name().CompareF(KElementFile()) == 0) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
455 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
456 |
TXmlEngAttr attr = element.AttributeNodeL(KElementFileAttr,KNullDesC8); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
457 |
filename = HBufC::NewLC(attr.Value().Length()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
458 |
TPtr ptr(filename->Des()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
459 |
ptr.Copy(attr.Value()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
460 |
if (ptr.Length() > 0) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
461 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
462 |
LOG1("Param:FileName UID=[%S]", &ptr); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
463 |
if (BaflUtils::FileExists(CEikonEnv::Static()->FsSession(), ptr)) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
464 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
465 |
paramFlag |= EParamFileExist; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
466 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
467 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
468 |
if (!(paramFlag & EParamFileExist)) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
469 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
470 |
LOG("[Error] File not exist"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
471 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
472 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
473 |
else if (element.Name().CompareF(KElementPluginUid()) == 0) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
474 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
475 |
TXmlEngAttr attr = element.AttributeNodeL(KElementPluginUidAttr,KNullDesC8); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
476 |
//HBufC8* bufUid = HBufC8::NewLC(attr.Value().Length()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
477 |
//TPtr8 ptr(bufUid->Des()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
478 |
HBufC* bufUid = HBufC::NewLC(attr.Value().Length()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
479 |
TPtr ptr(bufUid->Des()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
480 |
ptr.Copy(attr.Value()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
481 |
//_LIT8(KHeadOfHexString, "0x"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
482 |
_LIT(KHeadOfHexString, "0x"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
483 |
const TInt KUidStingLength = 8; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
484 |
if (ptr.Left(KHeadOfHexString().Length()).CompareF(KHeadOfHexString()) == 0) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
485 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
486 |
ptr.Delete(0, KHeadOfHexString().Length()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
487 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
488 |
if (ptr.Length() == KUidStingLength) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
489 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
490 |
//TBuf<8> bufUid; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
491 |
//bufUid.Copy(ptr); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
492 |
//TLex lex(bufUid); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
493 |
TLex lex(ptr); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
494 |
if (lex.Val(uidValue,EHex) == KErrNone) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
495 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
496 |
LOG1("Param:Plugin UID=[0x%X]", uidValue); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
497 |
paramFlag |= EParamPluginExist; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
498 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
499 |
else |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
500 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
501 |
LOG("[Error] Convert from HEX string to int"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
502 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
503 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
504 |
if (!(paramFlag & EParamPluginExist)) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
505 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
506 |
LOG("[Error] File not exist"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
507 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
508 |
CleanupStack::PopAndDestroy(bufUid); //bufUid |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
509 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
510 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
511 |
if (paramFlag == (EParamFileExist|EParamModeFile) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
512 |
|| paramFlag == (EParamPluginExist|EParamModePlugin)) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
513 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
514 |
break; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
515 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
516 |
element = element.NextSibling().AsElement(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
517 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
518 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
519 |
if (paramFlag == (EParamFileExist|EParamModeFile) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
520 |
&& filename) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
521 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
522 |
TPtrC ptr(filename->Des()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
523 |
SearchPluginFromFilenameL(ptr); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
524 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
525 |
if (paramFlag == (EParamPluginExist|EParamModePlugin) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
526 |
&& uidValue) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
527 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
528 |
TUid uid = TUid::Uid(uidValue); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
529 |
LoadPluginFromUidL(uid); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
530 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
531 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
532 |
if (filename) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
533 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
534 |
CleanupStack::PopAndDestroy(filename); //filename |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
535 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
536 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
537 |
if ( !iPrintBand ) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
538 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
539 |
// error xml parameter |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
540 |
User::Leave(KErrArgument); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
541 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
542 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
543 |
LOG("CDirectPrintEngine::SetParamL END"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
544 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
545 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
546 |
void CDirectPrintEngine::SearchPluginFromFilenameL(const TDesC& aFileName) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
547 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
548 |
LOG("CDirectPrintEngine::SearchPluginFromFilenameL START"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
549 |
RImplInfoPtrArray infoArray; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
550 |
TUid interface = TUid::Uid(KDirectPrintBandInterfaceUid); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
551 |
REComSession::ListImplementationsL( interface, infoArray ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
552 |
CleanupClosePushL( infoArray ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
553 |
LOG1("CDirectPrintEngine::SearchPluginFromFilenameL infoArray.Count(): %d", infoArray.Count()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
554 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
555 |
TParsePtrC parse(aFileName); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
556 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
557 |
TPtrC8 dataType; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
558 |
TPtrC16 dispName; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
559 |
TPtrC8 opaqueData; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
560 |
HBufC* dataTypeBuf = NULL; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
561 |
TBool bFound = EFalse; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
562 |
TInt findLen; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
563 |
const TChar KDataTypeSeparator = '|'; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
564 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
565 |
for( TInt i = 0; i < infoArray.Count(); i++ ) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
566 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
567 |
LOG1("[InfoArray] i=%d", i); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
568 |
CImplementationInformation* info = infoArray[i]; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
569 |
dataType.Set( info->DataType() ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
570 |
dispName.Set( info->DisplayName() ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
571 |
opaqueData.Set( info->OpaqueData() ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
572 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
573 |
dataTypeBuf = HBufC::NewLC( dataType.Length() ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
574 |
TPtr dataTypePtr(dataTypeBuf->Des()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
575 |
dataTypePtr.Copy( dataType ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
576 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
577 |
LOG1("[DataType]=[%S]", &dataTypePtr); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
578 |
FOREVER |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
579 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
580 |
findLen = dataTypePtr.Locate( KDataTypeSeparator ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
581 |
if (findLen < 0) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
582 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
583 |
// the separator is not found |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
584 |
if (dataTypePtr.Length() > 0) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
585 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
586 |
findLen = dataTypePtr.Length(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
587 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
588 |
else |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
589 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
590 |
break; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
591 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
592 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
593 |
// LOG1("[Compare]=[%S]", &(dataTypePtr.Left( findLen ))); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
594 |
// LOG1("[Ext]=[%S]", &(parse.Ext())); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
595 |
// LOG1("[Comp]=[%S]", &(dataTypePtr.Left( findLen ))); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
596 |
if ( parse.Ext().CompareF( dataTypePtr.Left( findLen ) ) == 0 ) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
597 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
598 |
bFound = ETrue; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
599 |
break; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
600 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
601 |
dataTypePtr.Delete( 0, findLen+1 ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
602 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
603 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
604 |
CleanupStack::PopAndDestroy(dataTypeBuf); // dataTypeBuf |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
605 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
606 |
if ( bFound ) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
607 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
608 |
LOG("Match!!!"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
609 |
LoadPluginFromUidL(info->ImplementationUid()); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
610 |
break; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
611 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
612 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
613 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
614 |
infoArray.ResetAndDestroy(); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
615 |
CleanupStack::PopAndDestroy(&infoArray); // infoArray |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
616 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
617 |
LOG("CDirectPrintEngine::SearchPluginFromFilenameL End"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
618 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
619 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
620 |
void CDirectPrintEngine::LoadPluginFromUidL(const TUid aUid) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
621 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
622 |
LOG1("CDirectPrintEngine::LoadPluginFromUidL(0x%X) Start", aUid.iUid); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
623 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
624 |
CDirectPrintBand* band = NULL; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
625 |
band = CDirectPrintBand::NewL(aUid); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
626 |
TCleanupItem clItem( CleanupBand, band ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
627 |
CleanupStack::PushL( clItem ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
628 |
band->InitPrintBandL( iPrintSetup, |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
629 |
iParam, |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
630 |
KNullDesC ); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
631 |
CleanupStack::Pop(); // band |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
632 |
iPrintBand = band; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
633 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
634 |
LOG("CDirectPrintEngine::LoadPluginFromUidL End"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
635 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
636 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
637 |
void CDirectPrintEngine::CleanupBand( TAny* aData ) |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
638 |
{ |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
639 |
LOG("[CDirectPrintEngine::CleanupBand]\t Begin"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
640 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
641 |
CDirectPrintBand* band = (CDirectPrintBand*)aData; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
642 |
delete band; |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
643 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
644 |
LOG("[CDirectPrintEngine::CleanupBand]\t End"); |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
645 |
} |
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
646 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
647 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
648 |
|
613a5ff70823
transfer from SFL repo (sfl/FCL/sf/app/printing/DirectPrint)
msekine <m.sekine@kthree.co.jp>
parents:
diff
changeset
|
649 |
// End of file |