|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include <cntdbobs.h> |
|
17 #include "CCntIpcCodes.h" |
|
18 #include <cntviewbase.h> |
|
19 |
|
20 #if defined(__VERBOSE_DEBUG__) |
|
21 |
|
22 #define NM_CASE(x) case x: enumStr = _S(#x); break; |
|
23 |
|
24 void DebugLogViewNotification(const TDesC& aMethod, const TContactViewEvent& aEvent) |
|
25 { |
|
26 const TText* enumStr; |
|
27 switch (aEvent.iEventType) |
|
28 { |
|
29 NM_CASE(TContactViewEvent::EUnavailable); |
|
30 NM_CASE(TContactViewEvent::EReady); |
|
31 NM_CASE(TContactViewEvent::ESortOrderChanged); |
|
32 NM_CASE(TContactViewEvent::ESortError); |
|
33 NM_CASE(TContactViewEvent::EServerError); |
|
34 NM_CASE(TContactViewEvent::EIndexingError); |
|
35 NM_CASE(TContactViewEvent::EItemAdded); |
|
36 NM_CASE(TContactViewEvent::EItemRemoved); |
|
37 NM_CASE(TContactViewEvent::EGroupChanged); |
|
38 default: enumStr = _S("UnsupportedEvent"); |
|
39 } |
|
40 RDebug::Print(_L("%S: %s, ContactID: %d, IndexCode: %d \n"), |
|
41 &aMethod, |
|
42 enumStr, |
|
43 aEvent.iContactId, |
|
44 aEvent.iInt); |
|
45 } |
|
46 |
|
47 |
|
48 |
|
49 void DebugLogNotification(const TDesC& aMethod, const TContactDbObserverEvent &aEvent) |
|
50 { |
|
51 const TText* enumStr; |
|
52 |
|
53 switch (aEvent.iType) |
|
54 {//case EContactDbObserverEventContactChanged: eventTypeStr = _S("EContactDbObserverEventContactChanged"); |
|
55 NM_CASE( EContactDbObserverEventNull); |
|
56 NM_CASE( EContactDbObserverEventUnused); |
|
57 NM_CASE( EContactDbObserverEventContactChanged); |
|
58 NM_CASE( EContactDbObserverEventContactDeleted); |
|
59 NM_CASE( EContactDbObserverEventContactAdded); |
|
60 NM_CASE( EContactDbObserverEventUnknownChanges); |
|
61 NM_CASE( EContactDbObserverEventRecover); |
|
62 NM_CASE( EContactDbObserverEventRollback); |
|
63 NM_CASE( EContactDbObserverEventTablesClosed); |
|
64 NM_CASE( EContactDbObserverEventTablesOpened); |
|
65 NM_CASE( EContactDbObserverEventTemplateChanged); |
|
66 NM_CASE( EContactDbObserverEventTemplateDeleted); |
|
67 NM_CASE( EContactDbObserverEventTemplateAdded); |
|
68 NM_CASE( EContactDbObserverEventCurrentItemDeleted); |
|
69 NM_CASE( EContactDbObserverEventCurrentItemChanged); |
|
70 NM_CASE( EContactDbObserverEventOwnCardChanged); |
|
71 NM_CASE( EContactDbObserverEventPreferredTemplateChanged); |
|
72 NM_CASE( EContactDbObserverEventOwnCardDeleted); |
|
73 NM_CASE( EContactDbObserverEventGroupAdded); |
|
74 NM_CASE( EContactDbObserverEventGroupChanged); |
|
75 NM_CASE( EContactDbObserverEventGroupDeleted); |
|
76 NM_CASE( EContactDbObserverEventCurrentDatabaseChanged); |
|
77 NM_CASE( EContactDbObserverEventSpeedDialsChanged); |
|
78 NM_CASE( EContactDbObserverEventSortOrderChanged); |
|
79 NM_CASE( EContactDbObserverEventBackupBeginning); |
|
80 NM_CASE( EContactDbObserverEventRestoreBeginning); |
|
81 NM_CASE( EContactDbObserverEventBackupRestoreCompleted); |
|
82 NM_CASE( EContactDbObserverEventRestoreBadDatabase); |
|
83 default: enumStr = _S("UnsupportedEvent"); |
|
84 } |
|
85 |
|
86 RDebug::Print(_L("%S: Message: %s, ContactID: %d, ConnectionId: %d \n"), |
|
87 &aMethod, |
|
88 enumStr, |
|
89 aEvent.iContactId, |
|
90 aEvent.iConnectionId); |
|
91 } |
|
92 |
|
93 void DebugLogIPC(const TDesC& aMethod, TInt aOpCode, TUint aSessionId, TInt aErrCode) |
|
94 { |
|
95 const TText* enumStr; |
|
96 |
|
97 switch (aOpCode) |
|
98 {//case ECntCloseView: enumStr = _S("ECntCloseView"); |
|
99 NM_CASE( ECntCloseView); |
|
100 NM_CASE( ECntSendPluginUidToServer); |
|
101 NM_CASE( ECntContactMatchingCriteriaExternalizedSize); |
|
102 NM_CASE( ECntViewAt); |
|
103 NM_CASE( ECntViewCount); |
|
104 NM_CASE( ECntViewFind); |
|
105 NM_CASE( ECntAllFieldsLength); |
|
106 NM_CASE( ECntGetViewSortOrder); |
|
107 NM_CASE( ECntRequestViewEvent); |
|
108 NM_CASE( ECntCancelRequestViewEvent); |
|
109 NM_CASE( ECntGetIncludedTypes); |
|
110 NM_CASE( ECntGetContactIds); |
|
111 NM_CASE( ECntGetSortPluginUidFromServer); |
|
112 NM_CASE( ECntGetCurrentItem); |
|
113 NM_CASE( ECntSetOwnCard); |
|
114 NM_CASE( ECntGetOwnCard); |
|
115 NM_CASE( ECntSetHeapFailure); |
|
116 NM_CASE( ECntResourceCount); |
|
117 NM_CASE( ECntFetchTemplateIds); |
|
118 NM_CASE( ECntFetchGroupIdLists); |
|
119 NM_CASE( ECntDbContactCount); |
|
120 NM_CASE( ECntGetDbViewContactType); |
|
121 NM_CASE( ECntSetDbViewContactType); |
|
122 NM_CASE( ECntOpenDataBase); |
|
123 NM_CASE( ECntCloseDataBase); |
|
124 NM_CASE( ECntCloseDbTables); |
|
125 NM_CASE( ECntReOpenDbTables); |
|
126 NM_CASE( EBeginDbTransaction); |
|
127 NM_CASE( EEndDbTransaction); |
|
128 NM_CASE( ERollbackDbTransaction); |
|
129 NM_CASE( ECntCancelAsyncOpenDatabase); |
|
130 NM_CASE( ECntGetDefaultDatabaseName); |
|
131 NM_CASE( ECntDatabaseDrive); |
|
132 NM_CASE( ECntDatabaseExists); |
|
133 NM_CASE( ECntListDatabases); |
|
134 NM_CASE( ECntMachineID); |
|
135 NM_CASE( ECntOverrideMachineID); |
|
136 NM_CASE( ECntItemAtL); |
|
137 NM_CASE( ECntGetCurrentDb); |
|
138 NM_CASE( ECntGetSpeedDialContactIdAndPhoneNumber); |
|
139 NM_CASE( ECntGetPrefTemplateId); |
|
140 NM_CASE( ECntSetPrefTemplateId); |
|
141 NM_CASE( ECntGetCollection); |
|
142 NM_CASE( ECntGetSortPrefs); |
|
143 NM_CASE( ECntReadContactTextDef); |
|
144 NM_CASE( ECntCreateView); |
|
145 NM_CASE( ECntCreateNamedView); |
|
146 NM_CASE( ECntViewContactAt); |
|
147 NM_CASE( ECntViewContactAtLength); |
|
148 NM_CASE( ECntAllFieldsText); |
|
149 NM_CASE( ECntGetContactsMatchingFilter); |
|
150 NM_CASE( ECntGetContactMatchingCriteria); |
|
151 NM_CASE( ECntRequestEvent); |
|
152 NM_CASE( ECntCancelEventRequest); |
|
153 NM_CASE( ECntConnectionId); |
|
154 NM_CASE( ECntReplaceDatabase); |
|
155 NM_CASE( ECntReCreateTemplate); |
|
156 NM_CASE( ECntFileUniqueId); |
|
157 NM_CASE( ECntCreateDatabase); |
|
158 NM_CASE( ECntDeleteDatabase); |
|
159 NM_CASE( ECntItemCreate); |
|
160 NM_CASE( ECntItemUpdate); |
|
161 NM_CASE( ECntItemCommit); |
|
162 NM_CASE( ECntItemDelete); |
|
163 NM_CASE( ECntItemRead); |
|
164 NM_CASE( ECntItemOpen); |
|
165 NM_CASE( ECntItemClose); |
|
166 NM_CASE( ECntChangeViewDef); |
|
167 NM_CASE( ECntFilesSize); |
|
168 NM_CASE( ECntSetDatabaseDrive); |
|
169 NM_CASE( ECntSetSortPrefs); |
|
170 NM_CASE( ECntSetCurrentItem); |
|
171 NM_CASE( ECntRemoveCurrentItem); |
|
172 NM_CASE( ECntSetCurrentDb); |
|
173 NM_CASE( ECntSetSpeedDialIdForPosition); |
|
174 NM_CASE( ECntChangeViewSortOrder); |
|
175 NM_CASE( ECntTextField); |
|
176 NM_CASE( ECntICCTemplateId); |
|
177 NM_CASE( ECntPhonebookGroupId); |
|
178 NM_CASE( ECntFind); |
|
179 NM_CASE( ECntFindAsyncInit); |
|
180 NM_CASE( ECntFindAsyncTextDefInit); |
|
181 NM_CASE( ECntFindAsync); |
|
182 NM_CASE( ECntSetAsyncActivity); |
|
183 NM_CASE( ECntGetDatabaseReady); |
|
184 NM_CASE( ECntOpenViewSession); |
|
185 NM_CASE( ECntCloseViewSession); |
|
186 NM_CASE( ECntViewChangeSortOrderL); |
|
187 NM_CASE( ECntViewBeginIterate); |
|
188 NM_CASE( ECntViewEndIterate); |
|
189 NM_CASE( ECntViewNextItemL); |
|
190 default: enumStr = _S("UnsupportedIPC"); |
|
191 } |
|
192 |
|
193 RDebug::Print(_L("%S: %s, SessId: %d, ErrCode: %d\n"), |
|
194 &aMethod, enumStr, aSessionId, aErrCode); |
|
195 } |
|
196 |
|
197 #endif |