|
1 /* |
|
2 * Copyright (c) 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: Contains general data definitions for AspSyncUtil. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef ASPLOGDIALOG_H |
|
20 #define ASPLOGDIALOG_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <SyncMLHistory.h> |
|
26 |
|
27 #include "AspDefines.h" |
|
28 #include "AspProfile.h" |
|
29 #include "AspResHandler.h" |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 /** |
|
35 * CAspLogDialog |
|
36 * |
|
37 * CAspLogDialog shows sync log information. |
|
38 */ |
|
39 NONSHARABLE_CLASS (CAspLogDialog) : public CBase |
|
40 { |
|
41 |
|
42 enum TLogItemType |
|
43 { |
|
44 ELogAddedPhone, |
|
45 ELogUpdatedPhone, |
|
46 ELogDeletedPhone, |
|
47 ELogDiscardedPhone, |
|
48 ELogMovedPhone, |
|
49 ELogAddedServer, |
|
50 ELogUpdatedServer, |
|
51 ELogDeletedServer, |
|
52 ELogDiscardedServer, |
|
53 ELogMovedServer |
|
54 }; |
|
55 |
|
56 public: |
|
57 /** |
|
58 * Launches log dialog. |
|
59 * @param None. |
|
60 * @return None. |
|
61 */ |
|
62 void ShowDialogL(); |
|
63 |
|
64 |
|
65 public:// Constructors and destructor |
|
66 |
|
67 /** |
|
68 * Two-phased constructor. |
|
69 */ |
|
70 static CAspLogDialog* NewL(const TAspParam& aParam); |
|
71 |
|
72 /** |
|
73 * Destructor. |
|
74 */ |
|
75 virtual ~CAspLogDialog(); |
|
76 |
|
77 private: |
|
78 |
|
79 /** |
|
80 * C++ default constructor. |
|
81 */ |
|
82 CAspLogDialog(const TAspParam& aParam); |
|
83 |
|
84 /** |
|
85 * By default Symbian OS constructor is private. |
|
86 */ |
|
87 void ConstructL(); |
|
88 |
|
89 private: |
|
90 |
|
91 /** |
|
92 * Creates text lines that are shown in log dialog. |
|
93 * @param aList. |
|
94 * @param aProfile. |
|
95 * @param aTaskList. |
|
96 * @return None. |
|
97 */ |
|
98 void CreateListL(CDesCArray* aList, CAspProfile* aProfile, CAspContentList* aTaskList); |
|
99 |
|
100 /** |
|
101 * Adds one line into listbox array. |
|
102 * @param aList. |
|
103 * @param aHistoryJob. |
|
104 * @param aTaskList. |
|
105 * @param aType. |
|
106 * @return None. |
|
107 */ |
|
108 void AddLogItemsL(CDesCArray* aList, const CSyncMLHistoryJob* aHistoryJob, |
|
109 CAspContentList* aTaskList, TInt aType); |
|
110 |
|
111 /** |
|
112 * Adds one line into listbox array. |
|
113 * @param aList. |
|
114 * @param aHistoryJob. |
|
115 * @param aTaskList. |
|
116 * @return None. |
|
117 */ |
|
118 void AddTaskErrorsL(CDesCArray* aList, const CSyncMLHistoryJob* aHistoryJob, |
|
119 CAspContentList* aTaskList); |
|
120 |
|
121 /** |
|
122 * Gets number of synced items. |
|
123 * @param aTaskInfo. |
|
124 * @param aType. |
|
125 * @return Item count. |
|
126 */ |
|
127 TInt SyncedItemCount(const CSyncMLHistoryJob::TTaskInfo& aTaskInfo, TInt aType); |
|
128 |
|
129 /** |
|
130 * Get log item text. |
|
131 * @param aType. |
|
132 * @param aDataProviderId |
|
133 * @param aDisplayName |
|
134 * @return None. |
|
135 */ |
|
136 HBufC* LogItemTextLC(TInt aType, TInt aDataProviderId, const TDesC& aDisplayName); |
|
137 |
|
138 /** |
|
139 * Add one line into log item list. |
|
140 * @param aList. |
|
141 * @param aText |
|
142 * @return None. |
|
143 */ |
|
144 void AddLineL(CDesCArray* aList, TDes& aText); |
|
145 |
|
146 /** |
|
147 * Gets latest history (sync) job. |
|
148 * @param aHistoryLog. |
|
149 * @return History job. |
|
150 */ |
|
151 CSyncMLHistoryJob* LatestHistoryJob(RSyncMLHistoryLog& aHistoryLog); |
|
152 |
|
153 /** |
|
154 * Has server been modified during sync. |
|
155 * @param aHistoryJob. |
|
156 * @return TBool. |
|
157 */ |
|
158 TBool ServerModified(const CSyncMLHistoryJob* aHistoryJob); |
|
159 |
|
160 /** |
|
161 * Has phone been modified during sync. |
|
162 * @param aHistoryJob. |
|
163 * @return TBool. |
|
164 */ |
|
165 TBool PhoneModified(const CSyncMLHistoryJob* aHistoryJob); |
|
166 |
|
167 /** |
|
168 * Has there been task errors during sync. |
|
169 * @param aHistoryJob. |
|
170 * @return TBool. |
|
171 */ |
|
172 TBool HasTaskErrors(const CSyncMLHistoryJob* aHistoryJob); |
|
173 |
|
174 |
|
175 private: |
|
176 // profile id |
|
177 TInt iProfileId; |
|
178 |
|
179 // session with sync server - only used in ConstructL |
|
180 RSyncMLSession* iSyncSession; |
|
181 |
|
182 // resource handler |
|
183 CAspResHandler* iResHandler; |
|
184 |
|
185 // for string handling |
|
186 TBuf<KBufSize255> iBuf; |
|
187 |
|
188 // for string handling |
|
189 TBuf<KBufSize255> iBuf2; |
|
190 |
|
191 // list of text lines that are shown in log dialog |
|
192 CDesCArrayFlat* iList; |
|
193 }; |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 #endif // ASPLOGDIALOG_H |
|
200 |
|
201 // End of File |