15
|
1 |
/*
|
|
2 |
* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include <e32cmn.h>
|
|
20 |
|
|
21 |
#include "directprintmessage.h"
|
|
22 |
#include "clog.h"
|
|
23 |
|
|
24 |
TDpMessage::TDpMessage( const RMessage2& aMessage,
|
|
25 |
const TBool& aConnected ) :
|
|
26 |
iConnected( aConnected ),
|
|
27 |
iDisposable( EFalse )
|
|
28 |
|
|
29 |
{
|
|
30 |
iMessage = aMessage;
|
|
31 |
}
|
|
32 |
|
|
33 |
void TDpMessage::WriteL(TInt aParam, const TDesC8 &aDes, TInt aOffset) const
|
|
34 |
{
|
|
35 |
LOG("TDpMessage::WriteL begin");
|
|
36 |
LOG1("TDpMessage::WriteL iConnected: %d", iConnected);
|
|
37 |
if( !iMessage.IsNull() && iConnected )
|
|
38 |
{
|
|
39 |
LOG1("TDpMessage::WriteL iMessage.Function(): %d", iMessage.Function());
|
|
40 |
iMessage.WriteL( aParam, aDes, aOffset );
|
|
41 |
}
|
|
42 |
LOG("TDpMessage::WriteL end");
|
|
43 |
}
|
|
44 |
|
|
45 |
void TDpMessage::Complete(TInt aReason) const
|
|
46 |
{
|
|
47 |
LOG("TDpMessage::Complete begin");
|
|
48 |
LOG1("TDpMessage::Complete iConnected: %d", iConnected);
|
|
49 |
if( !iMessage.IsNull() && iConnected )
|
|
50 |
{
|
|
51 |
LOG1("TDpMessage::Complete iMessage.Function(): %d", iMessage.Function());
|
|
52 |
iMessage.Complete( aReason );
|
|
53 |
}
|
|
54 |
LOG("TDpMessage::Complete end");
|
|
55 |
}
|
|
56 |
|
|
57 |
TInt TDpMessage::Int0() const
|
|
58 |
{
|
|
59 |
LOG("TDpMessage::Int0 begin");
|
|
60 |
LOG1("TDpMessage::Int0 iConnected: %d", iConnected);
|
|
61 |
TInt value( 0 );
|
|
62 |
if( !iMessage.IsNull() && iConnected )
|
|
63 |
{
|
|
64 |
LOG1("TDpMessage::Int0 iMessage.Function(): %d", iMessage.Function());
|
|
65 |
value = iMessage.Int0();
|
|
66 |
}
|
|
67 |
LOG("TDpMessage::Int0 end");
|
|
68 |
return value;
|
|
69 |
}
|
|
70 |
|
|
71 |
TInt TDpMessage::Int1() const
|
|
72 |
{
|
|
73 |
LOG("TDpMessage::Int1 begin");
|
|
74 |
LOG1("TDpMessage::Int1 iConnected: %d", iConnected);
|
|
75 |
TInt value( 0 );
|
|
76 |
if( !iMessage.IsNull() && iConnected )
|
|
77 |
{
|
|
78 |
LOG1("TDpMessage::Int1 iMessage.Function(): %d", iMessage.Function());
|
|
79 |
value = iMessage.Int1();
|
|
80 |
}
|
|
81 |
LOG("TDpMessage::Int1 end");
|
|
82 |
return value;
|
|
83 |
}
|
|
84 |
|
|
85 |
TInt TDpMessage::GetDesLength(TInt aParam) const
|
|
86 |
{
|
|
87 |
LOG("TDpMessage::GetDesLength begin");
|
|
88 |
LOG1("TDpMessage::GetDesLength iConnected: %d", iConnected);
|
|
89 |
TInt value( 0 );
|
|
90 |
if( !iMessage.IsNull() && iConnected )
|
|
91 |
{
|
|
92 |
LOG1("TDpMessage::GetDesLength iMessage.Function(): %d", iMessage.Function());
|
|
93 |
value = iMessage.GetDesLength( aParam );
|
|
94 |
}
|
|
95 |
LOG("TDpMessage::GetDesLength end");
|
|
96 |
return value;
|
|
97 |
}
|
|
98 |
|
|
99 |
void TDpMessage::ReadL(TInt aParam, TDes8 &aDes, TInt aOffset) const
|
|
100 |
{
|
|
101 |
LOG("TDpMessage::ReadL TDes8 begin");
|
|
102 |
LOG1("TDpMessage::ReadL TDes8 iConnected: %d", iConnected);
|
|
103 |
if( !iMessage.IsNull() && iConnected )
|
|
104 |
{
|
|
105 |
LOG1("TDpMessage::ReadL TDes8 iMessage.Function(): %d", iMessage.Function());
|
|
106 |
iMessage.ReadL( aParam, aDes, aOffset );
|
|
107 |
}
|
|
108 |
LOG("TDpMessage::ReadL TDes8 end");
|
|
109 |
}
|
|
110 |
|
|
111 |
void TDpMessage::ReadL(TInt aParam, TDes16 &aDes, TInt aOffset) const
|
|
112 |
{
|
|
113 |
LOG("TDpMessage::ReadL TDes16 begin");
|
|
114 |
LOG1("TDpMessage::ReadL TDes16 iConnected: %d", iConnected);
|
|
115 |
if( !iMessage.IsNull() && iConnected )
|
|
116 |
{
|
|
117 |
LOG1("TDpMessage::ReadL TDes16 iMessage.Function(): %d", iMessage.Function());
|
|
118 |
iMessage.ReadL( aParam, aDes, aOffset );
|
|
119 |
}
|
|
120 |
LOG("TDpMessage::ReadL TDes16 end");
|
|
121 |
}
|
|
122 |
|
|
123 |
TInt TDpMessage::Function() const
|
|
124 |
{
|
|
125 |
return iMessage.Function();
|
|
126 |
}
|
|
127 |
|
|
128 |
void TDpMessage::SetDisposable( TBool aDisposable )
|
|
129 |
{
|
|
130 |
iDisposable = aDisposable;
|
|
131 |
}
|
|
132 |
|
|
133 |
TBool TDpMessage::Disposable() const
|
|
134 |
{
|
|
135 |
return iDisposable;
|
|
136 |
}
|
|
137 |
|
|
138 |
void TDpMessage::Panic(const TDesC &aCategory, TInt aReason) const
|
|
139 |
{
|
|
140 |
iMessage.Panic( aCategory, aReason );
|
|
141 |
}
|
|
142 |
|
|
143 |
// End of File
|