|
1 /* |
|
2 * Copyright (c) 2005-2006 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 * Encapsulates the data which populates the fields in the message |
|
16 * info dialogs (email, sms, bios, mms), also holds the text for the |
|
17 * labels and fields in the message info dialog and displays a message |
|
18 * info dialog for particular message types |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 #if !defined(__MUIU_LOGDATA_H__) |
|
25 #define __MUIU_LOGDATA_H__ |
|
26 |
|
27 |
|
28 // INCLUDES |
|
29 |
|
30 // DATA TYPES |
|
31 |
|
32 |
|
33 ///////////////////////////////////////////////////////////// |
|
34 |
|
35 #include <e32base.h> |
|
36 #include "MMmsMtmDeliveryDataContainer.h" |
|
37 #include <mmsmsventry.h> |
|
38 #include <logwrap.h> |
|
39 /** |
|
40 * Class which displays a message info dialog for particular message types |
|
41 */ |
|
42 class CLogViewEvent; |
|
43 class CLogClient; |
|
44 class CLogFilterList; |
|
45 class CMsgDeliveryItem; |
|
46 class CLogEvent; |
|
47 class TMmsMsvEntry; |
|
48 class CMmsClientMtm; |
|
49 |
|
50 |
|
51 class CMmsMTMLogData : public CActive |
|
52 { |
|
53 public: |
|
54 |
|
55 enum TExecutionState |
|
56 { |
|
57 ENone, |
|
58 EInit, |
|
59 EReading, |
|
60 EFinalize, |
|
61 EFinished |
|
62 }; |
|
63 |
|
64 /** |
|
65 * Starts the active object. Creates the necessary log filters and starts the query |
|
66 * @param aMmsClient Constains information about the message, is used to ask message recipients |
|
67 * @return ETrue if log events found |
|
68 */ |
|
69 TBool DeliveryDataL(const CMmsClientMtm* aMmsClient); |
|
70 |
|
71 public: |
|
72 |
|
73 /** |
|
74 * Two-phased constructor. |
|
75 */ |
|
76 static CMmsMTMLogData* NewL(MMmsMtmDeliveryDataContainer* aContainer, const TMmsMsvEntry& aEntry); |
|
77 |
|
78 /** |
|
79 * Destructor. |
|
80 */ |
|
81 ~CMmsMTMLogData(); |
|
82 |
|
83 private: |
|
84 |
|
85 /** |
|
86 * |
|
87 */ |
|
88 CMmsMTMLogData(); |
|
89 |
|
90 /** |
|
91 * Symbian OS constructor. |
|
92 */ |
|
93 void ConstructL(MMmsMtmDeliveryDataContainer* aContainer, const TMmsMsvEntry& aEntry ); |
|
94 |
|
95 |
|
96 /** |
|
97 * Starts to fetch the next CLogEvent from the CLogViewEvent |
|
98 * @param none |
|
99 * @return void. |
|
100 */ |
|
101 void FetchItemL(); |
|
102 |
|
103 /** |
|
104 * Copies the next CLogEvent from the CLogViewEvent. Calls AddToArray |
|
105 * @param none |
|
106 * @return void. |
|
107 */ |
|
108 void CopyItemL(); |
|
109 |
|
110 /** |
|
111 * Callback method. After finished with filling the data array, |
|
112 * sends it back to the MMmsMtmDeliveryDataContainer (implemented in laucher class) |
|
113 * @param none |
|
114 * @return void. |
|
115 */ |
|
116 void SendDataL(); |
|
117 |
|
118 /** |
|
119 * If log hasn't every recipient, this function copies them to the resulting |
|
120 * iDataArray |
|
121 */ |
|
122 void MtmRecipientsToArrayL( const CMmsClientMtm& aMmsClient ); |
|
123 |
|
124 /** |
|
125 * Checks whether recipient is already in the iDataArray and removes it |
|
126 * @param aRecipient recipient's email address or phone number to check |
|
127 * @param aType type of recipient address: ETrue phone number |
|
128 * EFalse email address |
|
129 * @param aInitialIndex Log engine returns recipients, which are added into |
|
130 * iDataArray. Items returned from log engine nooed not to be checked. |
|
131 */ |
|
132 void DeleteRecipent(TDesC& aRecipient, |
|
133 TBool aType, |
|
134 TInt aInitialIndex ); |
|
135 |
|
136 /** |
|
137 * Converts the CLogEvent to CMsgDeliveryItem and adds it to the data array |
|
138 * @param aEvent: The event to be stored and forwarded. |
|
139 * @return void. |
|
140 */ |
|
141 void AddToArrayL(CLogEvent* aEvent); |
|
142 |
|
143 |
|
144 private: /// from CActive |
|
145 void DoCancel(); |
|
146 protected: /// from CActive |
|
147 void RunL(); |
|
148 TInt RunError(TInt aError); |
|
149 private: |
|
150 // For log db handling |
|
151 CLogClient* iLogClient; |
|
152 CLogViewEvent* iEventView; |
|
153 CLogFilterList* iFilterList; |
|
154 // callback |
|
155 MMmsMtmDeliveryDataContainer* iParent; |
|
156 // data array to be used |
|
157 CArrayPtrFlat< CMsgDeliveryItem >* iDataArray; |
|
158 RFs* iFs; |
|
159 // used to detect the first event on the list |
|
160 TInt iLoopCounter; |
|
161 // active objects state |
|
162 TExecutionState iState; |
|
163 TMmsMsvEntry iEntry; |
|
164 // localised strings to be used when comparing the entries delivery statuses |
|
165 TLogString iEventStatusPendingTxt; |
|
166 TLogString iEventStatusSentTxt; |
|
167 TLogString iEventStatusFailedTxt; |
|
168 TLogString iEventStatusNoDeliveryTxt; |
|
169 TLogString iEventStatusDeliveredTxt; |
|
170 TLogString iEventStatusNotSentTxt; |
|
171 TLogString iEventStatusRead; |
|
172 // count of items, which log returns and have been appended into iDataArray |
|
173 TBool iInsertedCount; |
|
174 }; |
|
175 |
|
176 #endif // __MUIU_LOGDATA_H__ |
|
177 // End of file |