meetingrequest/mrcasplugin/src/cesmrcascontactaction.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 21:08:33 +0300
branchRCL_3
changeset 12 4ce476e64c59
parent 0 8466d47a6819
child 16 b5fbb9b25d57
permissions -rw-r--r--
Revision: 201011 Kit: 201013

/*
* Copyright (c) 2007-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:  Implementation of the class CESMRCasContactAction.
 *
*/


#include "emailtrace.h"
#include "cesmrcascontactaction.h"
#include <stringloader.h>
#include <gulicon.h>

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

// ---------------------------------------------------------------------------
// CESMRCasContactAction::NewL
// ---------------------------------------------------------------------------
//
CESMRCasContactAction* CESMRCasContactAction::NewL(
        MFscReasonCallback& aReasonCallback,
        TUid aContactActionUid,
        TUint64 aActionType, TInt aActionMenuTextResourceId, CGulIcon* aIcon )
    {
    FUNC_LOG;

    CESMRCasContactAction* self =new ( ELeave ) CESMRCasContactAction(
            aReasonCallback,
            aContactActionUid,
            aActionType,
            aIcon);

    CleanupStack::PushL ( self );
    self->ConstructL (aActionMenuTextResourceId);
    CleanupStack::Pop ( self );


    return self;
    }

// ---------------------------------------------------------------------------
// CESMRCasContactAction::~CESMRCasContactAction
// ---------------------------------------------------------------------------
//
CESMRCasContactAction::~CESMRCasContactAction( )
    {
    FUNC_LOG;

    delete iIcon;
    delete iActionMenuText;

    }

// ---------------------------------------------------------------------------
// CESMRCasContactAction::Uid
// ---------------------------------------------------------------------------
//
TUid CESMRCasContactAction::Uid( ) const
    {
    FUNC_LOG;

    return iContactActionUid;
    }

// ---------------------------------------------------------------------------
// CESMRCasContactAction::Type
// ---------------------------------------------------------------------------
//
TUint64 CESMRCasContactAction::Type( ) const
    {
    FUNC_LOG;

    return iActionType;
    }

// ---------------------------------------------------------------------------
// CESMRCasContactAction::Icon
// ---------------------------------------------------------------------------
//
const CGulIcon* CESMRCasContactAction::Icon( ) const
    {
    FUNC_LOG;

    return iIcon;
    }

// ---------------------------------------------------------------------------
// CESMRCasContactAction::ActionMenuText
// ---------------------------------------------------------------------------
//
const TDesC& CESMRCasContactAction::ActionMenuText( ) const
    {
    FUNC_LOG;

    return *iActionMenuText;
    }

// ---------------------------------------------------------------------------
// CESMRCasContactAction::ReasonL
// ---------------------------------------------------------------------------
//
void CESMRCasContactAction::ReasonL(TInt aReasonId, HBufC*& aReason ) const
    {
    FUNC_LOG;

    iReasonCallback.GetReasonL( iContactActionUid, aReasonId, aReason );

    }

// ---------------------------------------------------------------------------
// CESMRCasContactAction::CESMRCasContactAction
// ---------------------------------------------------------------------------
//
CESMRCasContactAction::CESMRCasContactAction(
        MFscReasonCallback& aReasonCallback,
        TUid aContactActionUid,
        TUint64 aActionType,
        CGulIcon* aIcon )
:   iContactActionUid(aContactActionUid),
    iActionType(aActionType),
    iIcon(aIcon),
    iReasonCallback(aReasonCallback)
    {
    FUNC_LOG;
    //do nothing
    }

// ---------------------------------------------------------------------------
// CESMRCasContactAction::ConstructL
// ---------------------------------------------------------------------------
//
void CESMRCasContactAction::ConstructL(TInt aActionMenuTextResourceId)
    {
    FUNC_LOG;

    iActionMenuText = StringLoader::LoadL ( aActionMenuTextResourceId );


    }

// ======== GLOBAL FUNCTIONS ========