profilesservices/ProfileEngine/WrapperSrc/CProEngCenRepObserverBase.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 18 Jan 2010 20:31:08 +0200
changeset 2 051d34a3f367
parent 0 8c5d936e5675
child 8 f62c3a3d66b8
child 18 e3554c9069b6
permissions -rw-r--r--
Revision: 201001 Kit: 201003

/*
* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Implementation of CProEngCenRepObserverBase.
*
*/



// INCLUDE FILES
#include    "CProEngCenRepObserverBase.h"
#include    <centralrepository.h>
#include    "ProfileEnginePrivatePSKeys.h"
#include    "ProfileEngineSDKCRKeys.h"

// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// CProEngCenRepObserverBase::CProEngCenRepObserverBase
// -----------------------------------------------------------------------------
//
CProEngCenRepObserverBase::CProEngCenRepObserverBase( TUint32 aPartialCenRepKey,
                                                      TUint32 aKeyMask )
    : CProEngObserverBase( aPartialCenRepKey ), iKeyMask( aKeyMask )
    {
    }

// Destructor
CProEngCenRepObserverBase::~CProEngCenRepObserverBase()
    {
    Cancel();
    delete iRepository;
    }

// -----------------------------------------------------------------------------
// CProEngCenRepObserverBase::ConstructL
// -----------------------------------------------------------------------------
//
void CProEngCenRepObserverBase::ConstructL()
    {
    iRepository = CRepository::NewL( KCRUidProfileEngine );
    }

// -----------------------------------------------------------------------------
// CProEngCenRepObserverBase::RequestNotification
// -----------------------------------------------------------------------------
//
TInt CProEngCenRepObserverBase::RequestNotification()
    {
    TInt result( iRepository->NotifyRequest( iKey, iKeyMask, iStatus ) );
    if( result == KErrNone )
        {
        SetActive();
        }

    return result;
    }

// -----------------------------------------------------------------------------
// CProEngCenRepObserverBase::DoCancel
// -----------------------------------------------------------------------------
//
void CProEngCenRepObserverBase::DoCancel()
    {
    iRepository->NotifyCancel( iKey, iKeyMask );
    }

//  End of File