| 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: COutOfDiskSubscriber implementation. | |||
| 15 | * | |||
| 16 | */ | |||
| 17 | ||||
| 18 | ||||
| 19 | // INCLUDES | |||
| 20 | #include "outofdisksubscriber.h" | |||
| 21 | #include "OodTraces.h" | |||
| 22 | ||||
| 23 | // CONSTANTS | |||
| 24 | ||||
| 25 | // ============================= MEMBER FUNCTIONS ============================= | |||
| 26 | ||||
| 27 | // ---------------------------------------------------------------------------- | |||
| 28 | // COutOfDiskSubscriber::NewL() | |||
| 29 | // ---------------------------------------------------------------------------- | |||
| Top | ||||
| 1 | 0 | 30 | COutOfDiskSubscriber* COutOfDiskSubscriber::NewL( | |
| 31 | MOutOfDiskPropertyResponder& aOutOfDiskPropertyResponder, | |||
| 32 | const TUid& aCategory, | |||
| 33 | TUint aKey ) | |||
| 34 | { | |||
| 35 | COutOfDiskSubscriber* self = new (ELeave) COutOfDiskSubscriber( aOutOfDiskPropertyResponder, | |||
| 36 | aCategory, | |||
| 37 | aKey ); | |||
| 38 | CleanupStack::PushL( self ); | |||
| 39 | self->ConstructL(); | |||
| 40 | CleanupStack::Pop( self ); | |||
| 41 | return self; | |||
| 42 | } | |||
| 43 | ||||
| 44 | // ---------------------------------------------------------------------------- | |||
| 45 | // COutOfDiskSubscriber::ConstructL() | |||
| 46 | // ---------------------------------------------------------------------------- | |||
| Top | ||||
| 1 | 1 | 47 | void COutOfDiskSubscriber::ConstructL() | |
| 48 | { | |||
| 49 | CActiveScheduler::Add( this ); | |||
| 50 | iProperty.Attach( iCategory, iKey ); | |||
| 51 | } | |||
| 52 | ||||
| 53 | // ---------------------------------------------------------------------------- | |||
| 54 | // COutOfDiskSubscriber::Subscribe() | |||
| 55 | // ---------------------------------------------------------------------------- | |||
| Top | ||||
| 2 | 2 | 56 | void COutOfDiskSubscriber::Subscribe() | |
| 57 | { | |||
| 58 | iProperty.Subscribe( iStatus ); | |||
| 59 | SetActive(); | |||
| 60 | } | |||
| 61 | ||||
| 62 | // ---------------------------------------------------------------------------- | |||
| 63 | // COutOfDiskSubscriber::COutOfDiskSubscriber() | |||
| 64 | // ---------------------------------------------------------------------------- | |||
| Top | ||||
| 1 | 1 | 65 | COutOfDiskSubscriber::COutOfDiskSubscriber( MOutOfDiskPropertyResponder& | |
| 66 | aOutOfDiskPropertyResponder, | |||
| 67 | const TUid& aCategory, | |||
| 68 | TUint aKey ) : | |||
| 69 | CActive( EPriorityStandard ), | |||
| 70 | iOutOfDiskPropertyResponder( aOutOfDiskPropertyResponder ), | |||
| 71 | iCategory( aCategory), | |||
| 72 | iKey( aKey ) | |||
| 73 | { | |||
| 74 | } | |||
| 75 | ||||
| 76 | // ---------------------------------------------------------------------------- | |||
| 77 | // COutOfDiskSubscriber::RunL() | |||
| 78 | // ---------------------------------------------------------------------------- | |||
| Top | ||||
| 1 | 1 | 79 | void COutOfDiskSubscriber::RunL() | |
| 80 | { | |||
| 81 | Subscribe(); | |||
| 82 | iOutOfDiskPropertyResponder.HandlePropertyChangedL( iCategory, iKey ); | |||
| 83 | } | |||
| 84 | ||||
| 85 | // ---------------------------------------------------------------------------- | |||
| 86 | // COutOfDiskSubscriber::DoCancel() | |||
| 87 | // ---------------------------------------------------------------------------- | |||
| Top | ||||
| 1 | 1 | 88 | void COutOfDiskSubscriber::DoCancel() | |
| 89 | { | |||
| 90 | iProperty.Cancel(); | |||
| 91 | } | |||
| 92 | ||||
| 93 | // ---------------------------------------------------------------------------- | |||
| 94 | // COutOfDiskSubscriber::RunError() | |||
| 95 | // ---------------------------------------------------------------------------- | |||
| Top | ||||
| 1 | 0 | 96 | TInt COutOfDiskSubscriber::RunError( TInt aError ) | |
| 97 | { | |||
| 98 | return aError; | |||
| 99 | } | |||
| 100 | ||||
| 101 | // ---------------------------------------------------------------------------- | |||
| 102 | // COutOfDiskSubscriber::~COutOfDiskSubscriber() | |||
| 103 | // ---------------------------------------------------------------------------- | |||
| Top | ||||
| 1 | 1 | 104 | COutOfDiskSubscriber::~COutOfDiskSubscriber() | |
| 105 | { | |||
| 106 | Cancel(); | |||
| 107 | iProperty.Close(); | |||
| 108 | } | |||
| 109 | ||||
| 110 | // End of File | |||
| ***TER 100% (8/8) of SOURCE FILE outofdisksubscriber.cpp | ||||