|
1 /* |
|
2 * Copyright (c) 2007-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_VOIPEVENTLOGENGINE_H |
|
20 #define C_VOIPEVENTLOGENGINE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class CRepository; |
|
25 class CVoipErrorEntry; |
|
26 |
|
27 /** |
|
28 * Engine class for VoIP event log API. |
|
29 * CVoipEventLogEngine do the real work for reading and |
|
30 * writing error from/to central repository |
|
31 * |
|
32 * @lib voipeventlog.lib |
|
33 * @since S60 v3.2 |
|
34 */ |
|
35 NONSHARABLE_CLASS(CVoipEventLogEngine) : public CBase |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 */ |
|
42 static CVoipEventLogEngine* NewL(); |
|
43 static CVoipEventLogEngine* NewLC(); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 ~CVoipEventLogEngine(); |
|
49 |
|
50 /** |
|
51 * Writes an error data to event log |
|
52 * |
|
53 * @since S60 v3.2 |
|
54 * @param aErrorEntry Error information |
|
55 */ |
|
56 void WriteErrorL( const CVoipErrorEntry& aErrorEntry ); |
|
57 |
|
58 /** |
|
59 * Reads an error informaiton from the log |
|
60 * |
|
61 * @since S60 v3.2 |
|
62 * @param aIndex the index of error to be read |
|
63 * @param aErrorEntry in return, error information corresponding to aIndex |
|
64 */ |
|
65 void ReadErrorL( TInt aIndex, CVoipErrorEntry& aErrorEntry ); |
|
66 |
|
67 /** |
|
68 * Reads error count from the log |
|
69 * |
|
70 * @since S60 v3.2 |
|
71 * @param on return, error count |
|
72 */ |
|
73 void ErrorCountL( TInt& aCount ); |
|
74 |
|
75 /** |
|
76 * Reset all erros from the central repository. |
|
77 * |
|
78 * @since S60 v3.2 |
|
79 * @return Operation code. |
|
80 */ |
|
81 TInt ResetLogHistory (); |
|
82 |
|
83 /** |
|
84 * Starts transaction in central repository |
|
85 * |
|
86 * @since S60 v3.2 |
|
87 */ |
|
88 void BeginTransactionLC(); |
|
89 |
|
90 /** |
|
91 * Commits changes in repository |
|
92 * |
|
93 * @since S60 v3.2 |
|
94 */ |
|
95 void CommitTransactionL(); |
|
96 |
|
97 private: |
|
98 |
|
99 /** |
|
100 * C++ default constructor. |
|
101 */ |
|
102 CVoipEventLogEngine(); |
|
103 |
|
104 /** |
|
105 * By default Symbian 2nd phase constructor is private. |
|
106 */ |
|
107 void ConstructL(); |
|
108 |
|
109 /** |
|
110 * Generate time stamp with current time |
|
111 * |
|
112 * @since S60 v3.2 |
|
113 * @param on return, current time stamp, e.g. 11/09/2007 14:19:40 |
|
114 */ |
|
115 void GenerateTimeStampL( TDes& aTimeStamp ) const; |
|
116 |
|
117 /** |
|
118 * Get latest index number |
|
119 * |
|
120 * @since S60 v3.2 |
|
121 * @return latest index number |
|
122 */ |
|
123 TInt GetLatestIndexL(); |
|
124 |
|
125 /** |
|
126 * Get new index number |
|
127 * |
|
128 * @since S60 v3.2 |
|
129 * @return new index number |
|
130 */ |
|
131 TInt GetNewIndexL(); |
|
132 |
|
133 /** |
|
134 * Get maximum error count |
|
135 * |
|
136 * @since S60 v3.2 |
|
137 * @return maximu error count |
|
138 */ |
|
139 TInt GetMaxErrorCountL(); |
|
140 |
|
141 /** |
|
142 * release semaphore, this function is used in custom cleanup |
|
143 * |
|
144 * @since S60 v3.2 |
|
145 * @param aEngine pointer to an object which is the target of the cleanup operation |
|
146 */ |
|
147 static void ReleaseSemaphore( TAny* aEngine ); |
|
148 |
|
149 /** |
|
150 * release semaphore |
|
151 * |
|
152 * @since S60 v3.2 |
|
153 */ |
|
154 void DoReleaseSemaphore(); |
|
155 |
|
156 private: // data |
|
157 /** |
|
158 * Central Repository object. |
|
159 * Own. |
|
160 */ |
|
161 CRepository* iRepository; |
|
162 |
|
163 /** |
|
164 * RSemaphore object. |
|
165 * Own. |
|
166 */ |
|
167 RSemaphore iSemaphore; |
|
168 |
|
169 }; |
|
170 |
|
171 #endif // C_VOIPEVENTLOGENGINE_H |
|
172 |
|
173 |