| Start/ | End/ | |||
| True | False | - | Line | Source |
| 1 | /* | |||
| 2 | * Copyright (c) 2007 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 | * This class handles the received indications from the PubSub. | |||
| 16 | * | |||
| 17 | */ | |||
| 18 | ||||
| 19 | ||||
| 20 | // SYSTEM INCLUDES | |||
| 21 | ||||
| 22 | // USER INCLUDES | |||
| 23 | #include "outofdiskmonitor.h" | |||
| 24 | #include "outofdisksubscriber.h" | |||
| 25 | #include "outofdiskpsobserver.h" | |||
| 26 | #include "OodTraces.h" | |||
| 27 | ||||
| 28 | // ================= MEMBER FUNCTIONS ======================= | |||
| 29 | ||||
| 30 | // ---------------------------------------------------- | |||
| 31 | // COutOfDiskPSObserver::COutOfDiskPSObserver( COutOfDiskMonitor* aOutOfDiskMonitor ) | |||
| 32 | // C++ default constructor can NOT contain any code, that | |||
| 33 | // might leave. | |||
| 34 | // ---------------------------------------------------- | |||
| Top | ||||
| 6 | 6 | 35 | COutOfDiskPSObserver::COutOfDiskPSObserver( COutOfDiskMonitor* aOutOfDiskMonitor ) : | |
| 36 | iOutOfDiskMonitor( aOutOfDiskMonitor ) | |||
| 37 | { | |||
| 38 | } | |||
| 39 | ||||
| 40 | // ---------------------------------------------------- | |||
| 41 | // COutOfDiskPSObserver::ConstructL() | |||
| 42 | // ---------------------------------------------------- | |||
| Top | ||||
| 6 | 6 | 43 | void COutOfDiskPSObserver::ConstructL() | |
| 44 | { | |||
| 45 | TRACES("COutOfDiskPSObserver::ConstructL()"); | |||
| 46 | ||||
| 47 | iUikGlobalNotesAllowedSubscriber = COutOfDiskSubscriber::NewL( *this, | |||
| 48 | KPSUidUikon, | |||
| 49 | KUikGlobalNotesAllowed ); | |||
| 50 | iUikGlobalNotesAllowedSubscriber->Subscribe(); | |||
| 51 | ||||
| 52 | TInt state(0); | |||
| 53 | RProperty::Get( KPSUidUikon, KUikGlobalNotesAllowed, state ); | |||
| 54 | iOutOfDiskMonitor->SetGlobalNotesAllowed(state); | |||
| 55 | ||||
| 56 | iAutolockStatusSubscriber = COutOfDiskSubscriber::NewL( *this, | |||
| 57 | KPSUidCoreApplicationUIs, | |||
| 58 | KCoreAppUIsAutolockStatus ); | |||
| 59 | iAutolockStatusSubscriber->Subscribe(); | |||
| 60 | RProperty::Get( KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, iAutolockStatus ); | |||
| 61 | ||||
| 62 | TRACES("COutOfDiskPSObserver::ConstructL(): End"); | |||
| 63 | } | |||
| 64 | ||||
| 65 | // ---------------------------------------------------------------------------- | |||
| 66 | // COutOfDiskPSObserver::HandlePropertyChangedL() | |||
| 67 | // ---------------------------------------------------------------------------- | |||
| Top | ||||
| 2 | 2 | 68 | void COutOfDiskPSObserver::HandlePropertyChangedL( const TUid& aCategory, TUint aKey ) | |
| 69 | { | |||
| 70 | TRACES("COutOfDiskPSObserver::HandlePropertyChangedL()+++++++++++++++++++++++++++++"); | |||
| 71 | TRACES1("COutOfDiskPSObserver::HandlePropertyChangedL(): aKey: %d",aKey ); | |||
| 72 | ||||
| 73 | if ( aCategory == KPSUidUikon && aKey == KUikGlobalNotesAllowed ) | |||
| 74 | { | |||
| 75 | TRACES("COutOfDiskPSObserver::HandlePropertyChangedL(): Key: KUikGlobalNotesAllowed"); | |||
| 76 | TInt state(0); | |||
| 77 | RProperty::Get( KPSUidUikon, KUikGlobalNotesAllowed, state ); | |||
| 78 | iOutOfDiskMonitor->SetGlobalNotesAllowed(state); | |||
| 79 | if (state) | |||
| 80 | { | |||
| 81 | TRACES("COutOfDiskPSObserver::HandlePropertyChangedL: Reset all displayed fields for all drives"); | |||
| 82 | iOutOfDiskMonitor->ResetDisplayedStatus(NULL, ETrue); | |||
| 83 | iOutOfDiskMonitor->ShowGlobalQueryIfNeededL(); | |||
| 84 | } | |||
| 85 | } | |||
| 86 | else if ( aCategory == KPSUidCoreApplicationUIs && aKey == KCoreAppUIsAutolockStatus ) | |||
| 87 | { | |||
| 88 | TRACES("COutOfDiskPSObserver::HandlePropertyChangedL(): Key: KCoreAppUIsAutolockStatus"); | |||
| 89 | TInt status(0); | |||
| 90 | RProperty::Get( KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, status ); | |||
| 91 | if (status == EAutolockOff && iAutolockStatus > EAutolockOff) | |||
| 92 | { | |||
| 93 | TRACES("COutOfDiskPSObserver::HandlePropertyChangedL: Reset all displayed fields for all drives"); | |||
| 94 | iOutOfDiskMonitor->ResetDisplayedStatus(NULL, ETrue); | |||
| 95 | iOutOfDiskMonitor->ShowGlobalQueryIfNeededL(); | |||
| 96 | } | |||
| 97 | iAutolockStatus = status; | |||
| 98 | } | |||
| 99 | TRACES("COutOfDiskPSObserver::HandlePropertyChangedL(): End ------------------------------ "); | |||
| 100 | } | |||
| 101 | ||||
| 102 | // ---------------------------------------------------- | |||
| 103 | // COutOfDiskPSObserver::NewL( COutOfDiskMonitor** aOutOfDiskMonitor ) | |||
| 104 | // ---------------------------------------------------- | |||
| Top | ||||
| 6 | 0 | 105 | COutOfDiskPSObserver* COutOfDiskPSObserver::NewL( COutOfDiskMonitor* aOutOfDiskMonitor ) | |
| 106 | { | |||
| 107 | TRACES("COutOfDiskPSObserver::NewL()"); | |||
| 108 | COutOfDiskPSObserver* self = new (ELeave) COutOfDiskPSObserver( aOutOfDiskMonitor ); | |||
| 109 | ||||
| 110 | CleanupStack::PushL( self ); | |||
| 111 | self->ConstructL(); | |||
| 112 | CleanupStack::Pop( self ); | |||
| 113 | ||||
| 114 | TRACES("COutOfDiskPSObserver::NewL(): End"); | |||
| 115 | return self; | |||
| 116 | } | |||
| 117 | ||||
| 118 | // ---------------------------------------------------- | |||
| 119 | // COutOfDiskPSObserver::~COutOfDiskPSObserver() | |||
| 120 | // ---------------------------------------------------- | |||
| Top | ||||
| 1 | 1 | 121 | COutOfDiskPSObserver::~COutOfDiskPSObserver() | |
| 122 | { | |||
| 123 | TRACES("COutOfDiskPSObserver::~COutOfDiskPSObserver()"); | |||
| 124 | delete iAutolockStatusSubscriber; | |||
| 125 | delete iUikGlobalNotesAllowedSubscriber; | |||
| 126 | TRACES("COutOfDiskPSObserver::~COutOfDiskPSObserver(): End"); | |||
| 127 | } | |||
| 128 | ||||
| 129 | // End of File | |||
| ***TER 100% (5/5) of SOURCE FILE outofdiskpsobserver.cpp | ||||