sysresmonitoring/oodmonitor/src/lafshut.cpp
branchRCL_3
changeset 63 c2c61fdca848
parent 62 924385140d98
equal deleted inserted replaced
62:924385140d98 63:c2c61fdca848
     1 /*
     1 /*
     2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    22 #include <coemain.h>
    22 #include <coemain.h>
    23 #include <lafmemorywatcher.rsg>
    23 #include <lafmemorywatcher.rsg>
    24 #include <bautils.h>
    24 #include <bautils.h>
    25 #include <e32property.h>
    25 #include <e32property.h>
    26 #include <UikonInternalPSKeys.h>
    26 #include <UikonInternalPSKeys.h>
       
    27 #include <aknglobalnote.h>
       
    28 #include <secondarydisplay/aknsecondarydisplaydefs.h>
       
    29 #include <aknsddata.h>
       
    30 #include <avkon.rsg>
    27 #include <data_caging_path_literals.hrh>
    31 #include <data_caging_path_literals.hrh>
    28 #include <coreapplicationuisdomainpskeys.h>
    32 #include <coreapplicationuisdomainpskeys.h>
    29 
    33 
    30 // USER INCLUDES
    34 // USER INCLUDES
    31 #include "UiklafInternalCRKeys.h"
    35 #include "UiklafInternalCRKeys.h"
   720 // ---------------------------------------------------------
   724 // ---------------------------------------------------------
   721 //
   725 //
   722 CLafShutdownManager::CGlobalQueryActive::~CGlobalQueryActive()
   726 CLafShutdownManager::CGlobalQueryActive::~CGlobalQueryActive()
   723     {
   727     {
   724     TRACES("CLafShutdownManager::CGlobalQueryActive::~CGlobalQueryActive");        
   728     TRACES("CLafShutdownManager::CGlobalQueryActive::~CGlobalQueryActive");        
       
   729     delete iQuery;
   725     delete iMessageInfo[ECritical];
   730     delete iMessageInfo[ECritical];
   726     delete iMessageInfo[EWarning];
   731     delete iMessageInfo[EWarning];
   727     delete iMessageInfo[EWarningMMC];
   732     delete iMessageInfo[EWarningMMC];
   728     delete iMessageInfo[ECriticalMMC];
   733     delete iMessageInfo[ECriticalMMC];
   729     TRACES("CLafShutdownManager::CGlobalQueryActive::~CGlobalQueryActive: End");
   734     TRACES("CLafShutdownManager::CGlobalQueryActive::~CGlobalQueryActive: End");
   794             iMessageInfo[index-ii]->iNoteId = KErrNotFound;
   799             iMessageInfo[index-ii]->iNoteId = KErrNotFound;
   795             }
   800             }
   796         return;
   801         return;
   797         }
   802         }
   798 
   803 
   799       if (aType != ECallBack)
   804     if (!iQuery)
       
   805         {
       
   806         iQuery = CAknGlobalNote::NewL();
       
   807         iQuery->SetSoftkeys(R_AVKON_SOFTKEYS_OK_EMPTY);        
       
   808         }
       
   809 
       
   810     if (aType != ECallBack)
   800         {
   811         {
   801         iMessageType = aType;
   812         iMessageType = aType;
   802         }
   813         }
   803 
   814 
   804     CleanupL();
   815     CleanupL();
   805 
   816 
   806           
   817     if (iMessageType != ENone && (iMessageInfo[iMessageType]->iNoteId == KErrNotFound || aForcedNote))
   807         CHbDeviceMessageBoxSymbian* globalNote = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EWarning);
   818         {
   808         CleanupStack::PushL(globalNote);
   819         TInt dialogId = 0;
   809         globalNote->SetTextL((iMessageInfo[iMessageType]->iMessage)->Des());
   820         switch(iMessageType)
   810         globalNote->SetTimeoutL(0);
   821             {
   811         globalNote->ExecL();
   822         case EWarning:
   812         CleanupStack::PopAndDestroy(globalNote);
   823             dialogId = EAknDiskWarnignNote;
       
   824             break;
       
   825         case ECritical:
       
   826             dialogId = EAknDiskFullNote;
       
   827             break;
       
   828         case ECriticalMMC:    
       
   829             dialogId = EAknMMCFullNote;
       
   830             break;
       
   831         default:
       
   832             dialogId = EAknMMCWarningNote;
       
   833             break;            
       
   834             }
   813         
   835         
       
   836         CAknSDData* sd = CAknSDData::NewL(KAknSecondaryDisplayCategory, dialogId, KNullDesC8);
       
   837         iQuery->SetSecondaryDisplayData(sd);
       
   838         
       
   839         TInt noteid = iQuery->ShowNoteL(EAknGlobalWarningNote,
       
   840                                         (iMessageInfo[iMessageType]->iMessage)->Des());
       
   841                                         
       
   842         if (noteid != KErrNotFound) // Note was added to queue successfully.
       
   843             {
       
   844             iMessageInfo[iMessageType]->iNoteId = noteid;
       
   845             }
       
   846         }
       
   847 
   814     iMessageType = ENone;
   848     iMessageType = ENone;
   815     TRACES("CLafShutdownManager::CGlobalQueryActive::DisplayL: End");
   849     TRACES("CLafShutdownManager::CGlobalQueryActive::DisplayL: End");
   816     }
   850     }
   817 
   851 
   818 // ---------------------------------------------------------
   852 // ---------------------------------------------------------
   841             }
   875             }
   842         default:
   876         default:
   843             break;
   877             break;
   844             }
   878             }
   845 
   879 
   846          }
   880         if (cancelNoteId != KErrNotFound && aCancel)
       
   881             {
       
   882             iQuery->CancelNoteL(cancelNoteId);
       
   883             }
       
   884         }
   847     TRACES("CLafShutdownManager::CGlobalQueryActive::CleanupL: End");
   885     TRACES("CLafShutdownManager::CGlobalQueryActive::CleanupL: End");
   848     }
   886     }
   849 
   887 
   850 // ---------------------------------------------------------
   888 // ---------------------------------------------------------
   851 //
   889 //