|
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: Offers information regarding a given header to the UI. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CCALOGGERHEADERSINTERFACE_H |
|
20 #define CCALOGGERHEADERSINTERFACE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "PublicEngineDefinitions.h" |
|
24 #include "MCALoggerHeadersInterface.h" |
|
25 |
|
26 #include <e32std.h> |
|
27 #include <e32base.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MCALoggerReadInterface; |
|
31 class MCALoggerMessageHeader; |
|
32 class MCALoggerMessage; |
|
33 class RWriteStream; |
|
34 class CCALoggerMessageHeader; |
|
35 class MCAMessage; |
|
36 class MCAChatInterface; |
|
37 class MCASettings; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * Interface class for UI->Engine communication ( UI retrieves information ). |
|
43 * Offers information regarding a given header to the UI. |
|
44 * |
|
45 * @lib CAEngine.lib |
|
46 * @since 2.5 |
|
47 */ |
|
48 class CCALoggerHeadersInterface : public CBase, |
|
49 public MCALoggerHeadersInterface |
|
50 // public MCAMessagesInterface |
|
51 { |
|
52 public: // Constructors and destructor |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 * @return Instance to created CCALoggerHeadersInterface |
|
57 */ |
|
58 static CCALoggerHeadersInterface* NewL( |
|
59 MCAChatInterface& aChatInterface, |
|
60 MCASettings* aSettingsAPI ); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 virtual ~CCALoggerHeadersInterface(); |
|
66 |
|
67 private: |
|
68 |
|
69 /** |
|
70 * Part of two-phased construction. |
|
71 * Leaves with KErrNotFound, if iHeaderArray is not filled with valid |
|
72 * pointer. |
|
73 */ |
|
74 void ConstructL(); |
|
75 |
|
76 /** |
|
77 * C++ default constructor. |
|
78 */ |
|
79 CCALoggerHeadersInterface( MCAChatInterface& aChatInterface, |
|
80 MCASettings* aSettingsAPI ); |
|
81 |
|
82 private: // New helper methods |
|
83 |
|
84 /** |
|
85 * Get recorded chats header. |
|
86 * @param aIndex. Returned headers index in array. |
|
87 * @return Pointer to header in index. |
|
88 * @since 2.5 |
|
89 */ |
|
90 CCALoggerMessageHeader* LoggerMessageHeader( TInt aIndex ) const; |
|
91 |
|
92 /** |
|
93 * TCleanupItem callback function for message array |
|
94 * used in MessagesInterfaceL |
|
95 * @since 3.1 |
|
96 */ |
|
97 static void ResetAndDestroyMessages( TAny* aObject ); |
|
98 |
|
99 public: //Inherited from MCALoggerHeadersInterface |
|
100 |
|
101 /** |
|
102 * @see MCALoggerHeadersInterface.h |
|
103 * Returns the number data items ( headers count ). |
|
104 * @since 2.5 |
|
105 * @return Number of data items. |
|
106 */ |
|
107 TInt HeaderCount() const; |
|
108 |
|
109 /** |
|
110 * @see MCALoggerHeadersInterface.h |
|
111 * Returns pointer to the message identified by the parameter. |
|
112 * @param aIndex is the wanted data item index. |
|
113 * @return Reference to the IM message. |
|
114 * @since 2.5 |
|
115 */ |
|
116 const TDesC& Name( TInt aIndex ) const; |
|
117 |
|
118 /** |
|
119 * @see MCALoggerHeadersInterface.h |
|
120 * Returns the type of the chat data. |
|
121 * @param aIndex is the index to the header array. |
|
122 * @return Message type. |
|
123 * @since 2.5 |
|
124 */ |
|
125 TChatType ChatType( TInt aIndex ) const; |
|
126 |
|
127 /** |
|
128 * @see MCALoggerHeadersInterface.h |
|
129 * Returns time when history save started. |
|
130 * @param aIndex is the index to the header array. |
|
131 * @return Start time |
|
132 * @since 2.5 |
|
133 */ |
|
134 TTime StartTime( TInt aIndex ) const; |
|
135 |
|
136 /** |
|
137 * @see MCALoggerHeadersInterface.h |
|
138 * Returns time when history save ended. |
|
139 * @param aIndex is the header index. |
|
140 * @return End time. |
|
141 * @since 2.5 |
|
142 */ |
|
143 TTime EndTime( TInt aIndex ) const; |
|
144 |
|
145 /** |
|
146 * @see MCALoggerHeadersInterface.h |
|
147 * Returns idenfification string for history data. |
|
148 * @since 2.5 |
|
149 */ |
|
150 const TDesC& Identification( TInt aIndex ) const; |
|
151 |
|
152 /** |
|
153 * Delete one history file recognized by index |
|
154 * @see MCALoggerHeadersInterface |
|
155 * Leaves if file from index does not exists with KErrNotFound |
|
156 * @param aIndex Index of recorded chat to delete. |
|
157 * @since 2.5 |
|
158 */ |
|
159 void DeleteHistoryFileL( TInt aIndex ); |
|
160 |
|
161 /** |
|
162 * Read message for sending it via different MTMs. |
|
163 * @see MCALoggerHeadersInterface |
|
164 * @since 2.5 |
|
165 */ |
|
166 void GetMessageForSendingViaMTML( TInt aIndex, RWriteStream& aStream ); |
|
167 |
|
168 /** |
|
169 * Get interface to access messages in one recorded chat. |
|
170 * @see MCALoggerHeadersInterface |
|
171 * @since 2.5 |
|
172 */ |
|
173 MCAMessagesReadInterface& MessagesInterfaceL( TInt aIndex ); |
|
174 |
|
175 /** |
|
176 * @see MCALoggerHeadersInterface |
|
177 * @since 3.1 |
|
178 */ |
|
179 void DeleteRecordedChatContainerL(); |
|
180 |
|
181 /** |
|
182 * @see MCALoggerHeadersInterface |
|
183 * @since S60 v3.2 |
|
184 */ |
|
185 TInt Index( const TDesC& aName ) const; |
|
186 |
|
187 |
|
188 //fix - refer Ui Spec Approved Version 1.0 |
|
189 //(Instant Messaging NG 001 151006.pdf) |
|
190 //Section 10.2.10 Pg 131 - |
|
191 //"In case user has saved the image already or sent it |
|
192 //by himself, this option(save) is not available." |
|
193 |
|
194 /** |
|
195 * Added newly - Plz dont remove while merging |
|
196 * @see MCALoggerHeadersInterface |
|
197 * @since S60 v3.2 |
|
198 */ |
|
199 void ReLoggingL( TInt aIndex ); |
|
200 |
|
201 private: // Member variables |
|
202 |
|
203 /// Access to containers. |
|
204 MCAChatInterface& iChatInterface; |
|
205 |
|
206 // Not own. Read interface to access history data |
|
207 MCALoggerReadInterface* iLogger; |
|
208 |
|
209 // Not own. Array of headers. |
|
210 RPointerArray<MCALoggerMessageHeader> *iHeaderArray; |
|
211 |
|
212 // Not own. Setting interface |
|
213 MCASettings* iSettingsAPI; |
|
214 }; |
|
215 |
|
216 #endif // CCALOGGERHEADERSINTERFACE_H |
|
217 |
|
218 // End of File |