phonebookui/Phonebook2/CommonUI/src/CPbk2PresenceIconInfo.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 10:12:17 +0200
changeset 0 e686773b3f54
permissions -rw-r--r--
Revision: 201003 Kit: 201005

/*
* Copyright (c) 2005-2007 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:  Phonebook 2 presence icon information.
*
*/


#include "CPbk2PresenceIconInfo.h"

// System includes
#include <fbs.h>

EXPORT_C CPbk2PresenceIconInfo* CPbk2PresenceIconInfo::NewL( 
    const TDesC8& aBrandId,
    const TDesC8& aElementId,
    const TDesC16& aServiceName )
    {
    CPbk2PresenceIconInfo* self =
        new ( ELeave ) CPbk2PresenceIconInfo();
    CleanupStack::PushL( self );
    self->ConstructL( aBrandId, aElementId, aServiceName );
    CleanupStack::Pop( self );
    return self;
    }
                            
CPbk2PresenceIconInfo::~CPbk2PresenceIconInfo()
    {
    delete iBrandId;
    delete iElementId;
    delete iServiceName;
    delete iBitmap;
    delete iBitmapMask;    
    }
            
CPbk2PresenceIconInfo::CPbk2PresenceIconInfo()
    {
    }

void CPbk2PresenceIconInfo::ConstructL(
    const TDesC8& aBrandId,
    const TDesC8& aElementId,
    const TDesC16& aServiceName )
    {
    iBrandId = aBrandId.AllocL();
    iElementId = aElementId.AllocL();
    iServiceName = aServiceName.AllocL();
    }
            
EXPORT_C void CPbk2PresenceIconInfo::SetBitmap(
    CFbsBitmap* aBitmap,
    CFbsBitmap* aBitmapMask )
    {
    if ( iBitmap != NULL )
        {
        delete iBitmap;
        }
    iBitmap = aBitmap;
    
    if ( iBitmapMask != NULL )
        {
        delete iBitmapMask;
        }
    iBitmapMask = aBitmapMask;
    }

EXPORT_C const TDesC8& CPbk2PresenceIconInfo::BrandId()
    {
    return *iBrandId;
    }
                
EXPORT_C const TDesC8& CPbk2PresenceIconInfo::ElementId()
    {
    return *iElementId;
    }
                
EXPORT_C const TDesC16& CPbk2PresenceIconInfo::ServiceName()
    {
    return *iServiceName;
    }

EXPORT_C const CFbsBitmap* CPbk2PresenceIconInfo::IconBitmap()
    {
    return iBitmap;
    }

EXPORT_C const CFbsBitmap* CPbk2PresenceIconInfo::IconBitmapMask()
    {
    return iBitmapMask;
    }
    
// End of File