sysresmonitoring/oodmonitor/src/lafshut.cpp
branchRCL_3
changeset 19 924385140d98
parent 0 2e3d3ce01487
child 20 c2c61fdca848
equal deleted inserted replaced
18:0818dd463d41 19:924385140d98
     1 /*
     1 /*
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2006-2010 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>
       
    31 #include <data_caging_path_literals.hrh>
    27 #include <data_caging_path_literals.hrh>
    32 #include <coreapplicationuisdomainpskeys.h>
    28 #include <coreapplicationuisdomainpskeys.h>
    33 
    29 
    34 // USER INCLUDES
    30 // USER INCLUDES
    35 #include "UiklafInternalCRKeys.h"
    31 #include "UiklafInternalCRKeys.h"
   724 // ---------------------------------------------------------
   720 // ---------------------------------------------------------
   725 //
   721 //
   726 CLafShutdownManager::CGlobalQueryActive::~CGlobalQueryActive()
   722 CLafShutdownManager::CGlobalQueryActive::~CGlobalQueryActive()
   727     {
   723     {
   728     TRACES("CLafShutdownManager::CGlobalQueryActive::~CGlobalQueryActive");        
   724     TRACES("CLafShutdownManager::CGlobalQueryActive::~CGlobalQueryActive");        
   729     delete iQuery;
       
   730     delete iMessageInfo[ECritical];
   725     delete iMessageInfo[ECritical];
   731     delete iMessageInfo[EWarning];
   726     delete iMessageInfo[EWarning];
   732     delete iMessageInfo[EWarningMMC];
   727     delete iMessageInfo[EWarningMMC];
   733     delete iMessageInfo[ECriticalMMC];
   728     delete iMessageInfo[ECriticalMMC];
   734     TRACES("CLafShutdownManager::CGlobalQueryActive::~CGlobalQueryActive: End");
   729     TRACES("CLafShutdownManager::CGlobalQueryActive::~CGlobalQueryActive: End");
   799             iMessageInfo[index-ii]->iNoteId = KErrNotFound;
   794             iMessageInfo[index-ii]->iNoteId = KErrNotFound;
   800             }
   795             }
   801         return;
   796         return;
   802         }
   797         }
   803 
   798 
   804     if (!iQuery)
   799       if (aType != ECallBack)
   805         {
       
   806         iQuery = CAknGlobalNote::NewL();
       
   807         iQuery->SetSoftkeys(R_AVKON_SOFTKEYS_OK_EMPTY);        
       
   808         }
       
   809 
       
   810     if (aType != ECallBack)
       
   811         {
   800         {
   812         iMessageType = aType;
   801         iMessageType = aType;
   813         }
   802         }
   814 
   803 
   815     CleanupL();
   804     CleanupL();
   816 
   805 
   817     if (iMessageType != ENone && (iMessageInfo[iMessageType]->iNoteId == KErrNotFound || aForcedNote))
   806           
   818         {
   807         CHbDeviceMessageBoxSymbian* globalNote = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EWarning);
   819         TInt dialogId = 0;
   808         CleanupStack::PushL(globalNote);
   820         switch(iMessageType)
   809         globalNote->SetTextL((iMessageInfo[iMessageType]->iMessage)->Des());
   821             {
   810         globalNote->SetTimeoutL(0);
   822         case EWarning:
   811         globalNote->ExecL();
   823             dialogId = EAknDiskWarnignNote;
   812         CleanupStack::PopAndDestroy(globalNote);
   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             }
       
   835         
   813         
   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 
       
   848     iMessageType = ENone;
   814     iMessageType = ENone;
   849     TRACES("CLafShutdownManager::CGlobalQueryActive::DisplayL: End");
   815     TRACES("CLafShutdownManager::CGlobalQueryActive::DisplayL: End");
   850     }
   816     }
   851 
   817 
   852 // ---------------------------------------------------------
   818 // ---------------------------------------------------------
   875             }
   841             }
   876         default:
   842         default:
   877             break;
   843             break;
   878             }
   844             }
   879 
   845 
   880         if (cancelNoteId != KErrNotFound && aCancel)
   846          }
   881             {
       
   882             iQuery->CancelNoteL(cancelNoteId);
       
   883             }
       
   884         }
       
   885     TRACES("CLafShutdownManager::CGlobalQueryActive::CleanupL: End");
   847     TRACES("CLafShutdownManager::CGlobalQueryActive::CleanupL: End");
   886     }
   848     }
   887 
   849 
   888 // ---------------------------------------------------------
   850 // ---------------------------------------------------------
   889 //
   851 //