fep/frontendprocessor/source/FEPBPRIV.CPP
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "FEPBPRIV.H"
       
    17 #include <fepbconfig.h>
       
    18 #include <fepbpanic.h>
       
    19 #include <centralrepository.h>
       
    20 
       
    21 
       
    22 #ifdef _DEBUG
       
    23 LOCAL_C void Panic(TFepBasePanic aPanic)
       
    24 	{
       
    25 	User::Panic(KLitFepBasePanicText, aPanic);
       
    26 	}
       
    27 #endif
       
    28 
       
    29 //
       
    30 // CFepSettingsTracker
       
    31 //
       
    32 
       
    33 CFepSettingsTracker* CFepSettingsTracker::NewL(CCoeEnv& aConeEnvironment, MFepAttributeStorer& aFepAttributeStorer)
       
    34 	{ // static
       
    35 	CFepSettingsTracker* const self=new(ELeave) CFepSettingsTracker(aConeEnvironment, aFepAttributeStorer);
       
    36 	CleanupStack::PushL(self);
       
    37 	self->ConstructL();
       
    38 	CleanupStack::Pop(self);
       
    39 	return self;
       
    40 	}
       
    41 
       
    42 CFepSettingsTracker::~CFepSettingsTracker()
       
    43 	{
       
    44 	Cancel();
       
    45 	delete iRepository;
       
    46 	}
       
    47 
       
    48 CFepSettingsTracker::CFepSettingsTracker(CCoeEnv& aConeEnvironment, MFepAttributeStorer& aFepAttributeStorer)
       
    49 	:CActive(EActivePriorityWsEvents+25),
       
    50 	 iConeEnvironment(aConeEnvironment),
       
    51 	 iFepAttributeStorer(aFepAttributeStorer)
       
    52 	{
       
    53 	CActiveScheduler::Add(this);
       
    54 	}
       
    55 
       
    56 void CFepSettingsTracker::ConstructL()
       
    57 	{
       
    58 	iRepository=CRepository::NewL(TUid::Uid(KUidFepSpecificSettingsRepository));
       
    59 	Queue();
       
    60 	// we don't call ReadAllAttributesL here - the CCoeFep-derived class has the responsibility to call this when it has been fully constructed; this obligation is documented
       
    61 	}
       
    62 
       
    63 void CFepSettingsTracker::Queue()
       
    64 	{
       
    65 #if defined(_DEBUG)
       
    66 	const TInt error=
       
    67 #endif
       
    68 	iRepository->NotifyRequest(0, 0, iStatus);
       
    69 	__ASSERT_DEBUG(error==KErrNone, Panic(EPanicUnexpectedError1));
       
    70 	SetActive();
       
    71 	}
       
    72 
       
    73 void CFepSettingsTracker::DoCancel()
       
    74 	{
       
    75 	iRepository->NotifyCancel(0, 0);
       
    76 	}
       
    77 
       
    78 void CFepSettingsTracker::RunL()
       
    79 	{
       
    80 	const TInt error=iStatus.Int();
       
    81 	Queue();
       
    82 	User::LeaveIfError(error);
       
    83 	iFepAttributeStorer.ReadAllAttributesL(iConeEnvironment);
       
    84 	}
       
    85 
       
    86 
       
    87 
       
    88 
       
    89