omadm/lawmo/lawmoplugins/contactsplugin/src/contactsplugin.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 19 Aug 2010 09:42:30 +0300
branchRCL_3
changeset 55 c4687ff85147
permissions -rw-r--r--
Revision: 201031 Kit: 201033

/*
* 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: Contacts plug-in for LAWMO.
*
*/ 

#include <f32file.h>
#include <data_caging_path_literals.hrh>
#include <centralrepository.h>
#include "contactsplugin.h"
#include "fdebug.h"
#include "lawmocontactsasyncwipe.h"
// Construction and destruction functions

// ----------------------------------------------------------------------------------------
// CLAWMOContactsPlugin::NewL
// ----------------------------------------------------------------------------------------
CLAWMOContactsPlugin* CLAWMOContactsPlugin::NewL(MLawmoPluginWipeObserver* aObserver)
	{
        FLOG(_L(" CLAWMOContactsPlugin* CLAWMOContactsPlugin::NewL(MLawmoPluginWipeObserver* aObserver) >>"));
 
        CLAWMOContactsPlugin* self=new(ELeave) CLAWMOContactsPlugin();  
		CleanupStack::PushL(self);
		self->ConstructL(aObserver); 
		CleanupStack::Pop();
	    FLOG(_L(" CLAWMOContactsPlugin* CLAWMOContactsPlugin::NewL(MLawmoPluginWipeObserver* aObserver) <<"));	 
		return self;
	}

// ----------------------------------------------------------------------------------------
// CLAWMOContactsPlugin::~CLAWMOContactsPlugin
// ----------------------------------------------------------------------------------------
CLAWMOContactsPlugin::~CLAWMOContactsPlugin()
	{
        FLOG(_L(" CLAWMOContactsPlugin::~CLAWMOContactsPlugin() >>"));
        if(asyncOp)
        {
            FLOG(_L("  delete asyncOp; "));
            delete asyncOp;
        }
        FLOG(_L(" CLAWMOContactsPlugin::~CLAWMOContactsPlugin() <<"));
	}

// ----------------------------------------------------------------------------------------
// CLAWMOContactsPlugin::CLAWMOContactsPlugin
// ----------------------------------------------------------------------------------------
CLAWMOContactsPlugin::CLAWMOContactsPlugin() 
	{
        FLOG(_L(" CLAWMOContactsPlugin::CLAWMOContactsPlugin() >>"));
        // See ConstructL() for initialisation completion.
        FLOG(_L(" CLAWMOContactsPlugin::CLAWMOContactsPlugin() <<"));
	}

// ----------------------------------------------------------------------------------------
// CLAWMOContactsPlugin::ConstructL
// ----------------------------------------------------------------------------------------
void CLAWMOContactsPlugin::ConstructL(MLawmoPluginWipeObserver* aObserver)
{	
    FLOG(_L(" void CLAWMOContactsPlugin::ConstructL(MLawmoPluginWipeObserver* aObserver) >>"));
    FLOG(_L("  asyncOp = CActiveWipeObject::NewL(aObserver);"));
    asyncOp = CActiveWipeObject::NewL(aObserver);
    FLOG(_L(" void CLAWMOContactsPlugin::ConstructL(MLawmoPluginWipeObserver* aObserver) <<"));
}

// Implementation of CLAWMOPluginInterface

// ----------------------------------------------------------------------------------------
// CLAWMOContactsPlugin::WipeL
// Wipes the Contacts.
// ----------------------------------------------------------------------------------------

void CLAWMOContactsPlugin::WipeL ()
{
    FLOG(_L(" void CLAWMOContactsPlugin::WipeL () >>"));

    FLOG(_L("  asyncOp->WipeAsyncL();   "));
    asyncOp->WipeAsyncL();    
    /*
    TRequestStatus* status = &iStatus;
    User::RequestComplete(status, KErrNone);
    */
    FLOG(_L(" void CLAWMOContactsPlugin::WipeL () <<"));
}