|
1 /* |
|
2 * Copyright (c) 2005-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 "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: Phonebook 2 UI Service server application connection. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2SERVERAPPCONNECTION_H |
|
20 #define CPBK2SERVERAPPCONNECTION_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "RPbk2UIService.h" |
|
24 #include <AknServerApp.h> |
|
25 #include <Pbk2ServerAppIPC.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CApaServerAppExitMonitor; |
|
29 class CPbk2ExitServiceMonitor; |
|
30 class CPbk2AcceptServiceMonitor; |
|
31 class MPbk2ConnectionObserver; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * Phonebook 2 UI Service server application connection. |
|
37 * Responsible for managing the connection to Phonebook 2 Application Server. |
|
38 */ |
|
39 class CPbk2ServerAppConnection : public CActive, |
|
40 private MAknServerAppExitObserver |
|
41 { |
|
42 public: // Construction and destruction |
|
43 |
|
44 /** |
|
45 * Creates a new instance of this class. |
|
46 * |
|
47 * @param aObserver Connection observer. |
|
48 * @return A new instance of this clas. |
|
49 */ |
|
50 static CPbk2ServerAppConnection* NewL( |
|
51 MPbk2ConnectionObserver& aObserver ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CPbk2ServerAppConnection(); |
|
57 |
|
58 public: // Interface |
|
59 |
|
60 /** |
|
61 * Launches assign service. |
|
62 * |
|
63 * @param aConfigurationPackage Buffer containing |
|
64 * configuration data. |
|
65 * @param aDataPackage Buffer containing the |
|
66 * data to assign. |
|
67 * @param aAssignInstructions Buffer for assign instructions. |
|
68 */ |
|
69 void LaunchAssignL( |
|
70 HBufC8* aConfigurationPackage, |
|
71 HBufC8* aDataPackage, |
|
72 HBufC8* aAssignInstructions ); |
|
73 |
|
74 /** |
|
75 * Launches attribute assign service. |
|
76 * |
|
77 * @param aConfigurationPackage Buffer containing |
|
78 * configuration data. |
|
79 * @param aAttributePackage The attribute to assign. |
|
80 * @param aAssignInstructions Assign instructions. |
|
81 */ |
|
82 void LaunchAttributeAssignL( |
|
83 HBufC8* aConfigurationPackage, |
|
84 TPbk2AttributeAssignData& aAttributePackage, |
|
85 HBufC8* aAssignInstructions ); |
|
86 |
|
87 /** |
|
88 * Launches attribute unassign service. |
|
89 * |
|
90 * @param aConfigurationPackage Buffer containing |
|
91 * configuration data. |
|
92 * @param aAttributePackage The attribute to unassign. |
|
93 * @param aAssignInstructions Assign instructions. |
|
94 */ |
|
95 void LaunchAttributeUnassignL( |
|
96 HBufC8* aConfigurationPackage, |
|
97 TPbk2AttributeAssignData aAttributePackage, |
|
98 HBufC8* aAssignInstructions ); |
|
99 |
|
100 /** |
|
101 * Cancels assign service. |
|
102 */ |
|
103 void CancelAssign(); |
|
104 |
|
105 /** |
|
106 * Launches fetch service. |
|
107 * |
|
108 * @param aConfigurationPackage Buffer containing |
|
109 * configuration data. |
|
110 * @param aFetchInstructions Buffer for fetch instructions. |
|
111 */ |
|
112 void LaunchFetchL( |
|
113 HBufC8* aConfigurationPackage, |
|
114 HBufC8* aFetchInstructions ); |
|
115 |
|
116 /** |
|
117 * Cancels fetch service. |
|
118 */ |
|
119 void CancelFetch(); |
|
120 |
|
121 private: // From CActive |
|
122 void RunL(); |
|
123 TInt RunError( |
|
124 TInt aError ); |
|
125 void DoCancel(); |
|
126 |
|
127 private: // From MAknServerAppExitObserver |
|
128 void HandleServerAppExit( |
|
129 TInt aReason ); |
|
130 |
|
131 private: // Implementation |
|
132 CPbk2ServerAppConnection( |
|
133 MPbk2ConnectionObserver& aObserver ); |
|
134 void ConnectL(); |
|
135 void GetResultsL(); |
|
136 void DisconnectMonitors(); |
|
137 void DisconnectServerApplication(); |
|
138 |
|
139 private: // Data |
|
140 /// Own: Cancel information |
|
141 TBool iCanceled; |
|
142 /// Ref: Connection observer |
|
143 MPbk2ConnectionObserver& iObserver; |
|
144 /// Own: Application server service |
|
145 RPbk2UIService iPbk2AppService; |
|
146 /// Own: Exit application server monitor |
|
147 CApaServerAppExitMonitor* iExitAppServerMonitor; |
|
148 /// Own: Exit service monitor |
|
149 CPbk2ExitServiceMonitor* iExitServiceMonitor; |
|
150 /// Own: Accept service monitor |
|
151 CPbk2AcceptServiceMonitor* iAcceptServiceMonitor; |
|
152 /// Own: Results buffer for contact link array |
|
153 HBufC8* iArrayResults; |
|
154 /// Own: Results buffer for field content |
|
155 HBufC* iFieldResults; |
|
156 /// Own: Extra result data |
|
157 TInt iExtraResultData; |
|
158 }; |
|
159 |
|
160 #endif // CPBK2SERVERAPPCONNECTION_H |
|
161 |
|
162 // End of File |