|
1 /* |
|
2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * WV engine pure data command. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CIMPSPURECOMMAND_H |
|
22 #define CIMPSPURECOMMAND_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include "impsconst.h" |
|
27 #include "impsservercommon.h" |
|
28 #include "impsdataaccessorapi.h" |
|
29 #include "impsclientsrv.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CImpsFields; |
|
33 class CImpsKey; |
|
34 class CImpsDataAccessor; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 class CImpsPureCommand2 :public CActive |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 * @param aClient a client session |
|
45 */ |
|
46 static CImpsPureCommand2* NewL( RImpsPureClient2& aClient ); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 virtual ~CImpsPureCommand2(); |
|
52 |
|
53 public: // New functions |
|
54 |
|
55 /** |
|
56 * Start the execution. |
|
57 * @param aOpId operation-id |
|
58 * @param aType message type |
|
59 * @param aMessage message |
|
60 */ |
|
61 void StartRunL( |
|
62 TInt aOpId, |
|
63 TImpsServRequest aType ); |
|
64 |
|
65 /** |
|
66 * Reset all the member |
|
67 */ |
|
68 void ResetMembers( ); |
|
69 |
|
70 /** |
|
71 * Initialize the command with type and array size and the array address |
|
72 * @param aElementArray Key array releated to the command |
|
73 * @param aArraySize size of the array |
|
74 */ |
|
75 void InitialiseL( const TImpsContent* aElementArray, |
|
76 const TUint aArraySize ); |
|
77 |
|
78 /** |
|
79 * Insert string element to the command |
|
80 * @param aElementValue to be inserted |
|
81 * @param aElementName name of the key |
|
82 */ |
|
83 void InsertElementL( const TDesC8& aElementValue, |
|
84 const TImpsContent aElementName ); |
|
85 /** |
|
86 * Set message type to the command |
|
87 * @param aMsgType Messagetype of the command |
|
88 */ |
|
89 void SetMessageType( TImpsMessageType aMsgType ); |
|
90 |
|
91 /** |
|
92 * Pack the command |
|
93 * @return KErrNone if ok, error otherwise |
|
94 */ |
|
95 TInt PackMessageL( ); |
|
96 |
|
97 /** |
|
98 * Send the packed data to the server |
|
99 * @param messagetype |
|
100 * @param operatioid |
|
101 * @return KErrNone if ok, error otherwise |
|
102 */ |
|
103 TInt PackAndSendL( TImpsMessageType aMsgType, TInt aOpId ); |
|
104 |
|
105 private: |
|
106 |
|
107 /** |
|
108 * C++ default constructor. |
|
109 */ |
|
110 CImpsPureCommand2( TInt aPriority, RImpsPureClient2& aClient ); |
|
111 |
|
112 /** |
|
113 * From CActive |
|
114 */ |
|
115 void RunL(); |
|
116 |
|
117 /** |
|
118 * From CActive |
|
119 */ |
|
120 void DoCancel(); |
|
121 |
|
122 /** |
|
123 * By default Symbian constructor is private. |
|
124 */ |
|
125 void ConstructL(); |
|
126 |
|
127 private: // Data |
|
128 |
|
129 RImpsPureClient2& iClient; |
|
130 TInt iOpId; |
|
131 TImpsServRequest iType; |
|
132 TImpsMessageType iMessageType; |
|
133 HBufC8* iMessage; |
|
134 CImpsFields* iImpsFields; |
|
135 CImpsDataAccessor* iAccessor; |
|
136 MImpsKey* iKey; |
|
137 TPtrC8 iMessagePtr; |
|
138 |
|
139 private: // Friend classes |
|
140 |
|
141 friend class RImpsPureClient2; |
|
142 |
|
143 }; |
|
144 |
|
145 #endif // CIMPSPURECOMMAND_H |
|
146 |
|
147 // End of File |