author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:11:15 +0300 | |
branch | RCL_3 |
changeset 80 | 726fba06891a |
parent 64 | 3533d4323edc |
permissions | -rw-r--r-- |
64 | 1 |
/* |
2 |
* Copyright (c) 2009 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: ESMR Conflict popup implementation |
|
15 |
* |
|
16 |
*/ |
|
17 |
#include "cesmrconflictpopup.h" |
|
18 |
#include "mesmrcalentry.h" |
|
19 |
#include "mesmrmeetingrequestentry.h" |
|
20 |
||
21 |
#include <AknInfoPopupNoteController.h> |
|
22 |
#include <StringLoader.h> |
|
23 |
#include <eikenv.h> |
|
24 |
#include <esmrgui.rsg> |
|
25 |
#include <avkon.rsg> |
|
26 |
#include <ct/rcpointerarray.h> |
|
27 |
#include <AknUtils.h> |
|
28 |
#include <aknlayoutscalable_avkon.cdl.h> |
|
29 |
#include <layoutmetadata.cdl.h> |
|
30 |
||
31 |
#include "emailtrace.h" |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
32 |
#include "cesmrcaluserutil.h" |
64 | 33 |
|
34 |
// Unnamed namespace for local definitions |
|
35 |
namespace{ |
|
36 |
||
37 |
const TInt KTimeDelayBeforeShow(0); // 0 Seconds |
|
38 |
const TInt KTimeForView(5000); // 5 Seconds |
|
39 |
const TInt KTimeStringLength(20); |
|
40 |
const TInt KArrayGranularity( 4 ); |
|
41 |
||
42 |
const TInt KPortraitWindowVariety( 4 ); |
|
43 |
const TInt KLandscapeWindowVariety( 7 ); |
|
44 |
const TInt KTextLineVariety( 5 ); |
|
45 |
||
46 |
const TInt KNumTitleLines( 1 ); |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
47 |
const TInt KNumLocationLines( 1 ); |
64 | 48 |
|
49 |
/** |
|
50 |
* Clips given text and allocates new buffer if needed. |
|
51 |
* @param aSource text to clip |
|
52 |
* @param aNumLines number of popup note lines available for visual text. |
|
53 |
* @return new buffer or NULL if aSource must not be clipped |
|
54 |
*/ |
|
55 |
||
56 |
HBufC* ClipTextL( const TDesC& aSource, TInt aNumLines ) |
|
57 |
{ |
|
58 |
TRect mainPane; |
|
59 |
AknLayoutUtils::LayoutMetricsRect( |
|
60 |
AknLayoutUtils::EMainPane, |
|
61 |
mainPane ); |
|
62 |
||
63 |
// Get the correct popup window text line layout |
|
64 |
TInt windowVariety( KPortraitWindowVariety ); |
|
65 |
if ( Layout_Meta_Data::IsLandscapeOrientation() ) |
|
66 |
{ |
|
67 |
windowVariety = KLandscapeWindowVariety; |
|
68 |
} |
|
69 |
||
70 |
TAknWindowComponentLayout popupNoteWindow = |
|
71 |
AknLayoutScalable_Avkon::popup_preview_text_window( windowVariety ); |
|
72 |
TAknLayoutRect popupNoteRect; |
|
73 |
popupNoteRect.LayoutRect( mainPane, popupNoteWindow ); |
|
74 |
||
75 |
TAknTextComponentLayout popupNoteTextLine = |
|
76 |
AknLayoutScalable_Avkon::popup_preview_text_window_t3( KTextLineVariety ); |
|
77 |
TAknLayoutText textLayout; |
|
78 |
textLayout.LayoutText( popupNoteRect.Rect(), popupNoteTextLine ); |
|
79 |
||
80 |
TInt lineWidth( textLayout.TextRect().Width() ); |
|
81 |
const CFont* font = textLayout.Font(); |
|
82 |
||
83 |
HBufC* text = NULL; |
|
84 |
||
85 |
if ( font->TextWidthInPixels( aSource ) > lineWidth ) |
|
86 |
{ |
|
87 |
// Text must be clipped to fit |
|
88 |
// Allocate result buffer and reserve space for line feeds |
|
89 |
text = HBufC::NewLC( |
|
90 |
aSource.Length() + aNumLines ); |
|
91 |
||
92 |
CArrayFix<TInt>* lineWidthArray = |
|
93 |
new( ELeave ) CArrayFixFlat<TInt>( aNumLines ); |
|
94 |
CleanupStack::PushL( lineWidthArray ); |
|
95 |
for ( TInt i = 0; i < aNumLines; ++i ) |
|
96 |
{ |
|
97 |
lineWidthArray->AppendL( lineWidth ); |
|
98 |
} |
|
99 |
||
100 |
CPtrC16Array* strings = new( ELeave ) CPtrC16Array( aNumLines ); |
|
101 |
CleanupStack::PushL( strings ); |
|
102 |
TPtr des( text->Des() ); |
|
103 |
||
104 |
// Wrap string |
|
105 |
AknTextUtils::WrapToStringAndClipL( |
|
106 |
aSource, |
|
107 |
*lineWidthArray, |
|
108 |
*font, |
|
109 |
des ); |
|
110 |
||
111 |
// Trim trailing line feeds |
|
112 |
des.TrimRight(); |
|
113 |
||
114 |
CleanupStack::PopAndDestroy( 2, lineWidthArray ); |
|
115 |
CleanupStack::Pop( text ); |
|
116 |
} |
|
117 |
||
118 |
return text; |
|
119 |
} |
|
120 |
||
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
121 |
/** |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
122 |
* Judge is one CCalEntry is a all day event |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
123 |
* @param aEntry the entry be checked |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
124 |
* @return ETure if it is a all day event |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
125 |
*/ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
126 |
TBool IsAllDayEventL( CCalEntry& aEntry ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
127 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
128 |
FUNC_LOG; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
129 |
CESMRCalUserUtil* entryUtil = CESMRCalUserUtil::NewLC( aEntry ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
130 |
TBool allDayEvent( entryUtil->IsAlldayEventL() ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
131 |
CleanupStack::PopAndDestroy( entryUtil ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
132 |
return allDayEvent; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
133 |
} |
64 | 134 |
}//namespace |
135 |
||
136 |
// ======== MEMBER FUNCTIONS ======== |
|
137 |
||
138 |
// --------------------------------------------------------------------------- |
|
139 |
// CESMRConflictPopup::NewL |
|
140 |
// --------------------------------------------------------------------------- |
|
141 |
// |
|
142 |
CESMRConflictPopup* CESMRConflictPopup::NewL( MESMRCalEntry& aEntry) |
|
143 |
{ |
|
144 |
FUNC_LOG; |
|
145 |
CESMRConflictPopup* self = new (ELeave) CESMRConflictPopup(); |
|
146 |
CleanupStack::PushL( self ); |
|
147 |
self->ConstructL(aEntry); |
|
148 |
CleanupStack::Pop( self ); |
|
149 |
return self; |
|
150 |
} |
|
151 |
||
152 |
// --------------------------------------------------------------------------- |
|
153 |
// CESMRConflictPopup::CESMRConflictPopup |
|
154 |
// --------------------------------------------------------------------------- |
|
155 |
// |
|
156 |
CESMRConflictPopup::CESMRConflictPopup() |
|
157 |
{ |
|
158 |
FUNC_LOG; |
|
159 |
//do nothing |
|
160 |
} |
|
161 |
||
162 |
// --------------------------------------------------------------------------- |
|
163 |
// CESMRConflictPopup::~CESMRConflictPopup |
|
164 |
// --------------------------------------------------------------------------- |
|
165 |
// |
|
166 |
CESMRConflictPopup::~CESMRConflictPopup() |
|
167 |
{ |
|
168 |
FUNC_LOG; |
|
169 |
delete iNote; |
|
170 |
} |
|
171 |
||
172 |
// --------------------------------------------------------------------------- |
|
173 |
// CESMRConflictPopup::ConstructL |
|
174 |
// --------------------------------------------------------------------------- |
|
175 |
// |
|
176 |
void CESMRConflictPopup::ConstructL(MESMRCalEntry& aEntry) |
|
177 |
{ |
|
178 |
FUNC_LOG; |
|
179 |
if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == aEntry.Type() ) |
|
180 |
{ |
|
181 |
iEntry = static_cast<MESMRMeetingRequestEntry*>(&aEntry); |
|
182 |
} |
|
183 |
else |
|
184 |
{ |
|
185 |
User::Leave( KErrNotSupported ); |
|
186 |
} |
|
187 |
||
188 |
iNote = CAknInfoPopupNoteController::NewL(); |
|
189 |
||
190 |
InitializeL(); |
|
191 |
||
192 |
} |
|
193 |
||
194 |
// --------------------------------------------------------------------------- |
|
195 |
// CESMRConflictPopup::PrepareDisplayStringL |
|
196 |
// --------------------------------------------------------------------------- |
|
197 |
// |
|
198 |
void CESMRConflictPopup::PrepareDisplayStringL() |
|
199 |
{ |
|
200 |
FUNC_LOG; |
|
201 |
RCPointerArray<CCalEntry> entryArray; |
|
202 |
CleanupClosePushL( entryArray ); |
|
203 |
||
204 |
TInt ret = iEntry->FetchConflictingEntriesL( entryArray ); |
|
205 |
if( ret == KErrNotFound ) |
|
206 |
{ |
|
207 |
User::Leave( KErrNotFound ); |
|
208 |
} |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
209 |
// Record the blank rows. |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
210 |
TInt blankRow = 0; |
64 | 211 |
// Pointer descriptor for R_QTN_MEET_REQ_CONFLICT_UNNAMED |
212 |
TPtrC unnamedTitle( KNullDesC ); |
|
213 |
||
214 |
// Actual title to shown in popup |
|
215 |
TPtrC meetingTitle( KNullDesC ); |
|
216 |
||
217 |
// Location to show in popup |
|
218 |
TPtrC meetingLocation( KNullDesC ); |
|
219 |
||
220 |
TTime startTime; |
|
221 |
TTime endTime; |
|
222 |
||
223 |
CCoeEnv* env = CCoeEnv::Static(); |
|
224 |
||
225 |
if ( entryArray.Count() > 0 ) |
|
226 |
{// there is atleast one entry |
|
227 |
// get the first conflicting entry and set the string for display |
|
228 |
meetingTitle.Set( entryArray[ 0 ]->SummaryL() ); |
|
229 |
meetingLocation.Set( entryArray[ 0 ]->LocationL() ); |
|
230 |
||
231 |
if ( ( meetingLocation.Length() == 0 ) && ( meetingTitle.Length() == 0 ) ) |
|
232 |
{ |
|
233 |
// if no title, set unnamed text: |
|
234 |
HBufC* title = StringLoader::LoadLC( |
|
235 |
R_QTN_MEET_REQ_CONFLICT_UNNAMED, |
|
236 |
env ); |
|
237 |
unnamedTitle.Set( *title ); |
|
238 |
meetingTitle.Set( unnamedTitle ); |
|
239 |
} |
|
240 |
||
241 |
startTime = entryArray[ 0 ]->StartTimeL().TimeLocalL(); |
|
242 |
endTime = entryArray[ 0 ]->EndTimeL().TimeLocalL(); |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
243 |
|
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
244 |
//If the first entry is a all day event, it should be show as |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
245 |
//12:00Am - 11:59Pm, so we should subtract one min from end time. |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
246 |
if ( IsAllDayEventL( *entryArray[ 0 ] ) ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
247 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
248 |
endTime -= TTimeIntervalMinutes( 1 ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
249 |
} |
64 | 250 |
} |
251 |
||
252 |
HBufC* conflictLabel = StringLoader::LoadLC( |
|
253 |
R_QTN_MEET_REQ_CONFLICTS_WITH_LABEL, |
|
254 |
env ); |
|
255 |
||
256 |
HBufC* timeFormatString = StringLoader::LoadLC( |
|
257 |
R_QTN_TIME_USUAL_WITH_ZERO, |
|
258 |
env ); |
|
259 |
||
260 |
TBuf<KTimeStringLength> startBuf; |
|
261 |
TBuf<KTimeStringLength> endBuf; |
|
262 |
||
263 |
startTime.FormatL( startBuf, *timeFormatString ); |
|
264 |
endTime.FormatL( endBuf, *timeFormatString ); |
|
265 |
||
266 |
CPtrC16Array* strings = new( ELeave ) CPtrC16Array( KArrayGranularity ); |
|
267 |
CleanupStack::PushL( strings ); |
|
268 |
strings->AppendL( startBuf ); //start time string |
|
269 |
strings->AppendL( endBuf ); //end time string |
|
270 |
||
271 |
HBufC* finalTimeBuf = |
|
272 |
StringLoader::LoadLC( |
|
273 |
R_QTN_MEET_REQ_TIME_SEPARATOR, |
|
274 |
*strings, |
|
275 |
env ); |
|
276 |
||
277 |
if ( meetingLocation.Length() > 0 ) |
|
278 |
{ |
|
279 |
// format Meeting location |
|
280 |
HBufC* formatText = StringLoader::LoadLC( |
|
281 |
R_MEET_REQ_CONFLICT_LOCATION_FORMAT, |
|
282 |
meetingLocation, |
|
283 |
env ); |
|
284 |
meetingLocation.Set( *formatText ); |
|
285 |
} |
|
286 |
||
287 |
// Format final display string |
|
288 |
strings->Reset(); |
|
289 |
strings->AppendL( *conflictLabel ); |
|
290 |
strings->AppendL( *finalTimeBuf ); |
|
291 |
||
292 |
HBufC* titleBuf = NULL; |
|
293 |
HBufC* locationBuf = NULL; |
|
294 |
||
295 |
if ( meetingTitle.Length() > 0 ) |
|
296 |
{ |
|
297 |
// Prepare title |
|
298 |
titleBuf = ClipTextL( meetingTitle, KNumTitleLines ); |
|
299 |
if ( titleBuf ) |
|
300 |
{ |
|
301 |
CleanupStack::PushL( titleBuf ); |
|
302 |
meetingTitle.Set( *titleBuf ); |
|
303 |
} |
|
304 |
strings->AppendL( meetingTitle ); |
|
305 |
||
306 |
// Prepare location |
|
307 |
locationBuf = ClipTextL( meetingLocation, KNumLocationLines ); |
|
308 |
if ( locationBuf ) |
|
309 |
{ |
|
310 |
CleanupStack::PushL( locationBuf ); |
|
311 |
meetingLocation.Set( *locationBuf ); |
|
312 |
} |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
313 |
if ( meetingLocation.Length() > 0 ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
314 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
315 |
strings->AppendL( meetingLocation ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
316 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
317 |
else |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
318 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
319 |
blankRow++ ; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
320 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
321 |
|
64 | 322 |
} |
323 |
else |
|
324 |
{ |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
325 |
blankRow++; |
64 | 326 |
// Prepare location |
327 |
locationBuf = ClipTextL( |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
328 |
meetingLocation, KNumLocationLines ); |
64 | 329 |
if ( locationBuf ) |
330 |
{ |
|
331 |
CleanupStack::PushL( locationBuf ); |
|
332 |
meetingLocation.Set( *locationBuf ); |
|
333 |
} |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
334 |
if ( meetingLocation.Length() > 0 ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
335 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
336 |
strings->AppendL( meetingLocation ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
337 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
338 |
else |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
339 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
340 |
blankRow++; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
341 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
342 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
343 |
HBufC* otherconflictBuf = NULL ; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
344 |
if( entryArray.Count() == 2) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
345 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
346 |
otherconflictBuf = StringLoader::LoadLC( |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
347 |
R_MEET_REQ_CONFLICT_OTHERCONFLICT_SINGULAR_FORMAT, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
348 |
entryArray.Count()-1, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
349 |
env ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
350 |
strings->AppendL( *otherconflictBuf ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
351 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
352 |
else if ( entryArray.Count() > 2 ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
353 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
354 |
otherconflictBuf = StringLoader::LoadLC( |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
355 |
R_MEET_REQ_CONFLICT_OTHERCONFLICT_FORMAT, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
356 |
entryArray.Count()-1, |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
357 |
env ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
358 |
strings->AppendL( *otherconflictBuf ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
359 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
360 |
else |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
361 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
362 |
blankRow++; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
363 |
} |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
364 |
|
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
365 |
while( blankRow ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
366 |
{ |
64 | 367 |
strings->AppendL( KNullDesC() ); |
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
368 |
blankRow-- ; |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
369 |
} |
64 | 370 |
HBufC* displayString = StringLoader::LoadLC( |
371 |
R_MEET_REQ_CONFLICT_TEXT_FORMAT, |
|
372 |
*strings, |
|
373 |
env ); |
|
374 |
||
375 |
// Trim trailing white space |
|
376 |
displayString->Des().TrimRight(); |
|
377 |
||
378 |
// Set display string to popup note |
|
379 |
iNote->SetTextL( *displayString ); |
|
380 |
||
381 |
// Clean allocated buffers |
|
382 |
CleanupStack::PopAndDestroy( displayString ); |
|
80
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
383 |
if ( otherconflictBuf ) |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
384 |
{ |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
385 |
CleanupStack::PopAndDestroy( otherconflictBuf ); |
726fba06891a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
386 |
} |
64 | 387 |
if ( locationBuf ) |
388 |
{ |
|
389 |
CleanupStack::PopAndDestroy( locationBuf ); |
|
390 |
} |
|
391 |
if ( titleBuf ) |
|
392 |
{ |
|
393 |
CleanupStack::PopAndDestroy( titleBuf ); |
|
394 |
} |
|
395 |
if ( meetingLocation.Length() > 0 ) |
|
396 |
{ |
|
397 |
CleanupStack::PopAndDestroy(); // R_MEET_REQ_CONFLICT_LOCATION_FORMAT |
|
398 |
} |
|
399 |
CleanupStack::PopAndDestroy( finalTimeBuf ); |
|
400 |
CleanupStack::PopAndDestroy( strings ); |
|
401 |
CleanupStack::PopAndDestroy( timeFormatString ); |
|
402 |
CleanupStack::PopAndDestroy( conflictLabel ); |
|
403 |
if ( unnamedTitle.Length() > 0 ) |
|
404 |
{ |
|
405 |
CleanupStack::PopAndDestroy(); // R_QTN_MEET_REQ_CONFLICT_UNNAMED |
|
406 |
} |
|
407 |
CleanupStack::PopAndDestroy( &entryArray ); |
|
408 |
} |
|
409 |
||
410 |
||
411 |
// --------------------------------------------------------------------------- |
|
412 |
// CESMRConflictPopup::ShowPopup |
|
413 |
// --------------------------------------------------------------------------- |
|
414 |
// |
|
415 |
void CESMRConflictPopup::ShowPopup() |
|
416 |
{ |
|
417 |
FUNC_LOG; |
|
418 |
TRAPD( error, PrepareDisplayStringL()); |
|
419 |
if ( error != KErrNone ) |
|
420 |
{ |
|
421 |
CEikonEnv::Static()-> // codescanner::eikonenvstatic |
|
422 |
HandleError(error); |
|
423 |
} |
|
424 |
iNote->ShowInfoPopupNote(); |
|
425 |
} |
|
426 |
||
427 |
||
428 |
// --------------------------------------------------------------------------- |
|
429 |
// CESMRConflictPopup::InitializeL |
|
430 |
// --------------------------------------------------------------------------- |
|
431 |
// |
|
432 |
void CESMRConflictPopup::InitializeL() |
|
433 |
{ |
|
434 |
FUNC_LOG; |
|
435 |
iNote->SetTimeDelayBeforeShow(KTimeDelayBeforeShow); // 2 Seconds |
|
436 |
iNote->SetTimePopupInView(KTimeForView); // 5 Seconds |
|
437 |
} |
|
438 |
||
439 |
// EOF |
|
440 |