diff -r a3a1ae9acec6 -r da5135c61bad meetingrequest/mrgui/src/cesmrtitlepane.cpp --- a/meetingrequest/mrgui/src/cesmrtitlepane.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrtitlepane.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,14 +22,14 @@ // #include "esmrdef.h" // -#include +#include #include -#include -#include +#include +#include #include -#include +#include #include -#include +#include #include "emailtrace.h" @@ -50,30 +50,6 @@ */ _LIT( KReplaceWhitespaceChars, "\x0009\x000A\x000B\x000C\x000D\x2028\x2029" ); -#ifdef _DEBUG - -// Definition for panic text -_LIT( KESMRPanicTxt, "CESMRTitlePane" ); - -/** - * ES MR Entry panic codes - */ -enum TESMRPanicCodes - { - EESMREntryTypeNotSet = 1, // Entry does not exist - }; - -/** - * Raises panic. - * @param aPanic Panic code - */ -void Panic(TESMRPanicCodes aPanic) - { - User::Panic( KESMRPanicTxt, aPanic); - } - -#endif // _DEBUG - } // namespace // ======== MEMBER FUNCTIONS ======== @@ -111,7 +87,6 @@ { FUNC_LOG; delete iTitle; - delete iIcon; } // --------------------------------------------------------------------------- @@ -147,31 +122,21 @@ FUNC_LOG; TRect rect = Rect(); - TAknTextComponentLayout labelLayout = - NMRLayoutManager::GetTextComponentLayout( + TAknTextComponentLayout labelLayout = + NMRLayoutManager::GetTextComponentLayout( NMRLayoutManager::EMRLayoutCtrlBarTitle ); AknLayoutUtils::LayoutLabel( iTitle, rect, labelLayout ); - - iTitle->SetAlignment(EHCenterVCenter); - + TRgb color; AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG2 ); // If this leaves we'll have to use the default color - TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( - *iTitle, + TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( + *iTitle, EColorLabelText, - color ) ); - - if( iIcon ) - { - TAknWindowComponentLayout iconLayout = - NMRLayoutManager::GetWindowComponentLayout( - NMRLayoutManager::EMRLayoutCtrlBarGraphics ); - AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); - } + color ) ); } // --------------------------------------------------------------------------- @@ -186,9 +151,6 @@ if ( iTitle ) ++count; - if ( iIcon ) - ++count; - return count; } @@ -205,113 +167,12 @@ { return iTitle; } - case 1: - { - return iIcon; - } default: return NULL; } } // --------------------------------------------------------------------------- -// CESMRTitlePane::HandleSetPriorityCmdL() -// --------------------------------------------------------------------------- -// -void CESMRTitlePane::HandleSetPriorityCmdL( TInt aPriority ) - { - FUNC_LOG; - - __ASSERT_DEBUG( iEntryType != MESMRCalEntry::EESMRCalEntryNotSupported, - Panic(EESMREntryTypeNotSet ) ); - - switch ( aPriority ) - { - case EESMRCmdPriorityHigh: - { - if ( iEntryType == MESMRCalEntry::EESMRCalEntryTodo ) - { - SetPriorityL(EFSCalenTodoPriorityHigh); - } - else - { - SetPriorityL(EFSCalenMRPriorityHigh); - } - break; - } - case EESMRCmdPriorityLow: - { - if ( iEntryType == MESMRCalEntry::EESMRCalEntryTodo ) - { - SetPriorityL(EFSCalenTodoPriorityLow); - } - else - { - SetPriorityL(EFSCalenMRPriorityLow); - } - break; - } - case EESMRCmdPriorityNormal: - { - if ( iEntryType == MESMRCalEntry::EESMRCalEntryTodo ) - { - SetPriorityL(EFSCalenTodoPriorityNormal); - } - else - { - SetPriorityL(EFSCalenMRPriorityNormal); - } - break; - } - default: - break; - } - } - -// --------------------------------------------------------------------------- -// CESMRTitlePane::SetPriorityL() -// --------------------------------------------------------------------------- -// -void CESMRTitlePane::SetPriorityL(TUint aPriority ) - { - FUNC_LOG; - __ASSERT_DEBUG( iEntryType != MESMRCalEntry::EESMRCalEntryNotSupported, - Panic(EESMREntryTypeNotSet ) ); - - iPriority = aPriority; - - // icon added to MR-title only if the default icon is set and - // the priority is neither high or low (the possible high/low - // importance icons are currently only shown in navi pane). - delete iIcon; - iIcon = NULL; - if ( iDefaultIcon && - iEntryType != MESMRCalEntry::EESMRCalEntryTodo && - aPriority != EFSCalenMRPriorityHigh && - aPriority != EFSCalenMRPriorityLow ) - { - CreateIconL( KAknsIIDQgnFscalIndiSubject ); - } - - SizeChanged(); - DrawDeferred(); - } - -// --------------------------------------------------------------------------- -// CESMRTitlePane::CreateIconL() -// --------------------------------------------------------------------------- -// -void CESMRTitlePane::CreateIconL( TAknsItemID aIconID ) - { - FUNC_LOG; - delete iIcon; - iIcon = NULL; - - iIcon = CMRImage::NewL( aIconID ); - iIcon->SetParent( this ); - } - -// --------------------------------------------------------------------------- // CESMRTitlePane::SetTextL() // --------------------------------------------------------------------------- // @@ -344,31 +205,7 @@ { FUNC_LOG; iEntryType = aEntry.Type(); - SetPriorityL( aEntry.GetPriorityL() ); - } - -// --------------------------------------------------------------------------- -// CESMRTitlePane::SetDefaultIcon() -// --------------------------------------------------------------------------- -// -void CESMRTitlePane::SetDefaultIcon( TBool aDefault ) - { - FUNC_LOG; - iDefaultIcon = aDefault; } -// --------------------------------------------------------------------------- -// CESMRTitlePane::ExternalizeL() -// --------------------------------------------------------------------------- -// -void CESMRTitlePane::ExternalizeL( MESMRCalEntry& aEntry ) - { - FUNC_LOG; - if ( aEntry.Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest || - aEntry.Type() == MESMRCalEntry::EESMRCalEntryMeeting ) - { - aEntry.SetPriorityL( iPriority ); - } - } // EOF