|
1 /* |
|
2 * Copyright (c) 2003-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: Implementation for header information of history file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CCALOGGERMESSAGEHEADER_H |
|
20 #define CCALOGGERMESSAGEHEADER_H |
|
21 |
|
22 #include <e32std.h> |
|
23 |
|
24 #include "MCALoggerMessageHeader.h" |
|
25 #include "PublicEngineDefinitions.h" |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * Message header for history data |
|
31 * |
|
32 * @lib CALogger.dll |
|
33 * @since 2.1 |
|
34 */ |
|
35 class CCALoggerMessageHeader : public CBase, public MCALoggerMessageHeader |
|
36 { |
|
37 public: // Constructors and destructors |
|
38 |
|
39 /** |
|
40 * NewL for CCALoggerMessageHeader |
|
41 * Two-phase constructor |
|
42 * @param aName Virtual log file name. Used in header of history file. |
|
43 * @param aId Identification information for header of history file. |
|
44 * This is resolved by client of CCAHFMessage. |
|
45 * If Group chat -> Groups name |
|
46 * If i-messages -> identification of conversation party. |
|
47 * @param aChatType I-message or group chat. EPTOPChat or EGroupChat |
|
48 * @return Instance of CCALoggerMessageHeader with header information. |
|
49 */ |
|
50 static CCALoggerMessageHeader* NewL( const TDesC& aName, |
|
51 const TDesC& aId, |
|
52 TChatType aChatType ); |
|
53 |
|
54 /** |
|
55 * NewL for CCALoggerMessageHeader |
|
56 * Two-phase constructor. For empty header creation |
|
57 * This does not call ConstructL |
|
58 * @return Instance of CCALoggerMessageHeader with header information. |
|
59 */ |
|
60 static CCALoggerMessageHeader* NewL(); |
|
61 |
|
62 /** |
|
63 * Virtual destructor |
|
64 */ |
|
65 virtual ~CCALoggerMessageHeader(); |
|
66 |
|
67 private: // Constructors |
|
68 |
|
69 /** |
|
70 * Default constructor |
|
71 */ |
|
72 CCALoggerMessageHeader(); |
|
73 |
|
74 /** |
|
75 * ConstructL for CCALoggerMessageHeader |
|
76 * Part of Two-phase construction |
|
77 * @see CCALoggerMessageHeader::NewL for parameters |
|
78 * Last parameter is default EPTOPChat because empty |
|
79 * NewL creation. Default value can be anything so |
|
80 * there is not higher reason for choosing EPTOPChat |
|
81 */ |
|
82 void ConstructL( const TDesC& aName, |
|
83 const TDesC& aId, |
|
84 TChatType aChatType = EPTOPChat ); |
|
85 |
|
86 public: // inherited from MCALoggerMessageHeader |
|
87 |
|
88 /** |
|
89 * Internalize the contact instance data. |
|
90 * Used by MCALoggerFactory. |
|
91 * @since 2.1 |
|
92 * @see MCALoggerMessageHeader::InternalizeL |
|
93 */ |
|
94 void InternalizeL( RReadStream& aStream ); |
|
95 |
|
96 /** |
|
97 * Externalize the contact instance data. |
|
98 * Used by CCALoggerWriter |
|
99 * @since 2.1 |
|
100 * @see MCALoggerMessageHeader::ExternalizeL |
|
101 */ |
|
102 void ExternalizeL( RWriteStream& aStream ) const; |
|
103 |
|
104 /** |
|
105 * Disk space needed for saving message in externalize. |
|
106 * @see MCALoggerMessageHeader::MessageSizeInBytesL |
|
107 */ |
|
108 TInt MessageSizeInBytesL() const; |
|
109 |
|
110 /** |
|
111 * Get filename |
|
112 * @since 2.1 |
|
113 * @return Real filename of history file. |
|
114 */ |
|
115 const TDesC& FilenameL(); |
|
116 |
|
117 /** |
|
118 * Set filename |
|
119 * @since 2.1 |
|
120 * @param aFilename Setter of real filename of history file |
|
121 */ |
|
122 void SetFilenameL( const TDesC& aFilename ); |
|
123 |
|
124 /** |
|
125 * Triggers endtime of logging. |
|
126 * @since 2.5 |
|
127 */ |
|
128 void EndLogging(); |
|
129 |
|
130 public: //new methods |
|
131 |
|
132 /** |
|
133 * Name of history data |
|
134 * @return Name of history data |
|
135 */ |
|
136 const TDesC& Name() const; |
|
137 |
|
138 /** |
|
139 * Start time of history data |
|
140 * @return start time of history data |
|
141 */ |
|
142 const TTime& StartTime() const; |
|
143 |
|
144 /** |
|
145 * ChatType of history data |
|
146 * @return chattype of history data |
|
147 */ |
|
148 TChatType ChatType() const; |
|
149 |
|
150 /** |
|
151 * End time of history data |
|
152 * @return time when history logging is off |
|
153 */ |
|
154 const TTime& EndTime() const; |
|
155 |
|
156 /** |
|
157 * Idenfication of history data |
|
158 * @return identification information of history data. |
|
159 */ |
|
160 const TDesC& Identification() const; |
|
161 |
|
162 |
|
163 private: // Data |
|
164 |
|
165 //Real file name of history file. Owns. |
|
166 HBufC* iFilename; |
|
167 |
|
168 //Group id for header information. Owns. |
|
169 HBufC* iGroupId; |
|
170 |
|
171 //Name of history file Owns. |
|
172 HBufC* iName; |
|
173 |
|
174 //Start time |
|
175 TTime iStartTime; |
|
176 |
|
177 //End time |
|
178 TTime iEndTime; |
|
179 |
|
180 //Chat type. I-message or group EPTOPChat or EGroupChat |
|
181 TChatType iChatType; |
|
182 }; |
|
183 |
|
184 #endif // CCALOGGERMESSAGEHEADER_H |
|
185 |
|
186 // End of File |