|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Declaration of CCatalogsBaseMessageImpl |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CATALOGS_BASE_MESSAGE_IMPL_H |
|
20 #define C_CATALOGS_BASE_MESSAGE_IMPL_H |
|
21 |
|
22 #include "catalogsbasemessage.h" |
|
23 |
|
24 class RMessage2; |
|
25 class CCatalogsClientServerServerSession; |
|
26 |
|
27 /** |
|
28 * Catalogs base message implementation |
|
29 * |
|
30 * @see MCatalogsBaseMessage |
|
31 * The implementation is based on encapsulation of |
|
32 * an RMessage2 object and delegation of methods to this instance. |
|
33 * |
|
34 * @lib ?library |
|
35 * @since S60 ?S60_version *** for example, S60 v3.0 |
|
36 */ |
|
37 class CCatalogsBaseMessageImpl : public CBase, public MCatalogsBaseMessage |
|
38 { |
|
39 |
|
40 public: |
|
41 |
|
42 static CCatalogsBaseMessageImpl* NewL( |
|
43 const RMessage2& aMessage, |
|
44 CCatalogsClientServerServerSession& aSession, |
|
45 TInt aHandle ); |
|
46 |
|
47 static CCatalogsBaseMessageImpl* NewLC( |
|
48 const RMessage2& aMessage, |
|
49 CCatalogsClientServerServerSession& aSession, |
|
50 TInt aHandle ); |
|
51 |
|
52 |
|
53 // from base class MCatalogsBaseMessage |
|
54 |
|
55 /** |
|
56 * From MCatalogsBaseMessage. |
|
57 * @see MCatalogsBaseMessage::InputLength |
|
58 * |
|
59 * @since S60 ?S60_version |
|
60 * @param ?arg1 ?description |
|
61 */ |
|
62 TInt InputLength() const; |
|
63 |
|
64 /** |
|
65 * From MCatalogsBaseMessage. |
|
66 * @see MCatalogsBaseMessage::ReadInput |
|
67 * |
|
68 * @since S60 ?S60_version |
|
69 * @param ?arg1 ?description |
|
70 */ |
|
71 TInt ReadInput( TDes8& aInputData ) const; |
|
72 |
|
73 /** |
|
74 * From MCatalogsBaseMessage. |
|
75 * @see MCatalogsBaseMessage::ReadInput |
|
76 * |
|
77 * @since S60 ?S60_version |
|
78 * @param ?arg1 ?description |
|
79 */ |
|
80 TInt ReadInput( TDes16& aInputData ) const; |
|
81 |
|
82 /** |
|
83 * From MCatalogsBaseMessage. |
|
84 * @see MCatalogsBaseMessage::Handle |
|
85 * |
|
86 * @since S60 ?S60_version |
|
87 * @param ?arg1 ?description |
|
88 */ |
|
89 TInt Handle() const; |
|
90 |
|
91 /** |
|
92 * From MCatalogsBaseMessage. |
|
93 * @see MCatalogsBaseMessage::CompleteAndRelease |
|
94 * |
|
95 * @since S60 ?S60_version |
|
96 * @param ?arg1 ?description |
|
97 */ |
|
98 void CompleteAndRelease( TInt aStatus ) const; |
|
99 |
|
100 /** |
|
101 * From MCatalogsBaseMessage. |
|
102 * @see MCatalogsBaseMessage::CompleteAndReleaseL |
|
103 * |
|
104 * @since S60 ?S60_version |
|
105 * @param ?arg1 ?description |
|
106 */ |
|
107 void CompleteAndReleaseL( const TDesC8& aOutputData, |
|
108 TInt aStatus ); |
|
109 |
|
110 /** |
|
111 * From MCatalogsBaseMessage. |
|
112 * @see MCatalogsBaseMessage::CompleteAndReleaseL |
|
113 * |
|
114 * @since S60 ?S60_version |
|
115 * @param ?arg1 ?description |
|
116 */ |
|
117 void CompleteAndReleaseL( TInt aOutputData, |
|
118 TInt aStatus ); |
|
119 |
|
120 /** |
|
121 * From MCatalogsBaseMessage. |
|
122 * @see MCatalogsBaseMessage::CompleteAndReleaseL |
|
123 * |
|
124 * @since S60 ?S60_version |
|
125 * @param ?arg1 ?description |
|
126 */ |
|
127 void CompleteAndReleaseL( const TDesC16& aOutputData, |
|
128 TInt aStatus ); |
|
129 |
|
130 /** |
|
131 * From MCatalogsBaseMessage. |
|
132 * @see MCatalogsBaseMessage::CompleteAndReleaseL |
|
133 */ |
|
134 void CompleteAndReleaseL( RFs& aFs, |
|
135 RFile& aFile ); |
|
136 /** |
|
137 * From MCatalogsBaseMessage. |
|
138 * @see MCatalogsBaseMessage::Release |
|
139 * |
|
140 * @since S60 ?S60_version |
|
141 */ |
|
142 void Release(); |
|
143 |
|
144 /** |
|
145 * From MCatalogsBaseMessage. |
|
146 * @see MCatalogsBaseMessage::CheckSecurityPolicy |
|
147 * |
|
148 * @since S60 ?S60_version |
|
149 * @param ?arg1 ?description |
|
150 */ |
|
151 TBool CheckSecurityPolicy( const TSecurityPolicy& aSecurityPolicy ); |
|
152 |
|
153 /** |
|
154 * From MCatalogsBaseMessage. |
|
155 * @see MCatalogsBaseMessage::Session |
|
156 * |
|
157 * @since S60 ?S60_version |
|
158 * @param ?arg1 ?description |
|
159 */ |
|
160 MCatalogsSession& Session() const; |
|
161 |
|
162 /** |
|
163 * From MCatalogsBaseMessage. |
|
164 * @see MCatalogsBaseMessage::CounterPartLost |
|
165 * |
|
166 * @since S60 ?S60_version |
|
167 * @param ?arg1 ?description |
|
168 */ |
|
169 TBool CounterPartLost( const MCatalogsSession& aSession ); |
|
170 |
|
171 protected: |
|
172 |
|
173 virtual ~CCatalogsBaseMessageImpl(); |
|
174 |
|
175 private: |
|
176 |
|
177 /** |
|
178 * Constructor |
|
179 * |
|
180 * @param aMessage the message. |
|
181 * @param aSession a reference to an object |
|
182 * which is the session in which this message is used |
|
183 * |
|
184 */ |
|
185 CCatalogsBaseMessageImpl( const RMessage2& aMessage, |
|
186 CCatalogsClientServerServerSession& aSession, |
|
187 TInt aHandle ); |
|
188 |
|
189 void ConstructL(); |
|
190 |
|
191 private: // data |
|
192 |
|
193 /** |
|
194 * the encapsulated message object that does |
|
195 * the real message handling |
|
196 * NOTICE: This has to be a copy. Otherwise the current |
|
197 * message of the session or server seems to be used |
|
198 * which is not desired. |
|
199 */ |
|
200 const RMessage2 iMessage; |
|
201 /** |
|
202 * session in which this message is used |
|
203 */ |
|
204 CCatalogsClientServerServerSession& iSession; |
|
205 /** |
|
206 * handle to the receiver of this message |
|
207 */ |
|
208 TInt iHandle; |
|
209 /** |
|
210 * boolean value which tells whether the sender of this message |
|
211 * has died or not and if completion messages can act normally |
|
212 * or not. If ETrue, no messages are sent to client-side anymore. |
|
213 */ |
|
214 TBool iSenderLost; |
|
215 }; |
|
216 |
|
217 #endif // C_CATALOGS_BASE_MESSAGE_IMPL |