controlpanelui/src/cpprofilewrapper/src/cpprofilemonitor_p.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 15:15:28 +0300
branchRCL_3
changeset 13 90fe62538f66
permissions -rw-r--r--
Revision: 201029 Kit: 201035

/*
 * Copyright (c) 2009 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:  
 *   
 */

#include "cpprofilemonitor_p.h"
#include "cpprofilemonitor.h"

#include <CProfileChangeNotifyHandler.h>

/*
 * Construtor
 */
CpProfileMonitorPrivate::CpProfileMonitorPrivate():
                                mProfileNotifier(0)
{
    
}

/*
 * Desconstructor
 */
CpProfileMonitorPrivate::~CpProfileMonitorPrivate()
{
    delete mProfileNotifier;
}

/*
 * Initializing for the monitoring profile event
 */
void CpProfileMonitorPrivate::initialize(CpProfileMonitor *parent)
{
    q_ptr = parent;
    TRAP_IGNORE(mProfileNotifier = CProfileChangeNotifyHandler::NewL(this));   
}

/*
 * From MProfileChangeObserver, monitor the profile event
 */
void CpProfileMonitorPrivate::HandleActiveProfileEventL(TProfileEvent aProfileEvent, TInt aProfileId)
{
    switch (aProfileEvent) {
        case EProfileNewActiveProfile:
        {
            q_ptr->profileActivated(aProfileId);
            break;
        }
        case EProfileActiveProfileModified:
        {
            q_ptr->activeProfileModified(aProfileId);
            break;
        }
        default:
            break;
    }
}