imservices/searchfeatureplugin/srcsearchdatamodel/search/searchkeysubscriptionitem.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 17 Dec 2009 08:54:49 +0200
changeset 0 e6b17d312c8b
permissions -rw-r--r--
Revision: 200949 Kit: 200951

/*
* Copyright (c) 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:  Search Keys  subscription implementation.
*
*/


#include <badesca.h>
#include "ximpitemparentbase.h"
#include "ximppanics.h"
#include "ximppsccontext.h"
#include "ximpobjecthelpers.h"

#include "ximpidentityimp.h"
#include "searchkeyssubscriptionitem.h"

#include "searchitemparent.h"
#include "searchkeyseventimp.h"
// ---------------------------------------------------------------------------
// CSearchKeysSubscriptionItem::CSearchKeysSubscriptionItem()
// ---------------------------------------------------------------------------
//
CSearchKeysSubscriptionItem::CSearchKeysSubscriptionItem( MXIMPItemParentBase& aParent )
: CXIMPSubscriptionItemBase( aParent )
    {
    }


// ---------------------------------------------------------------------------
// CSearchKeysSubscriptionItem::ConstructL()
// ---------------------------------------------------------------------------
//
void CSearchKeysSubscriptionItem::ConstructL()
    {
    }


// ---------------------------------------------------------------------------
// CSearchKeysSubscriptionItem::NewL()
// ---------------------------------------------------------------------------
//
CSearchKeysSubscriptionItem* CSearchKeysSubscriptionItem::NewLC( MXIMPItemParentBase& aParent )
    {
    CSearchKeysSubscriptionItem* self = new( ELeave ) CSearchKeysSubscriptionItem( aParent );
    CleanupClosePushL( *self );
    self->ConstructL();
    return self;
    }


// ---------------------------------------------------------------------------
// CSearchKeysSubscriptionItem::~CSearchKeysSubscriptionItem()
// ---------------------------------------------------------------------------
//
EXPORT_C CSearchKeysSubscriptionItem::~CSearchKeysSubscriptionItem()
    {
    
    MSearchItemParent* searchCache = static_cast<MSearchItemParent*>
                                     (iParent.GetInterface(SEARCH_ITEM_PARENT));
    searchCache->RemoveMe( this ); 

    }

// ---------------------------------------------------------------------------
// CSearchSubscriptionItem::SetKeyInfoArray()
// ---------------------------------------------------------------------------
//
EXPORT_C void CSearchKeysSubscriptionItem::SetKeyInfoArray(RSearchKeyInfoImpArray* aKeyInfoArray)
    {
    iKeyInfoArray = aKeyInfoArray;
    }

// ---------------------------------------------------------------------------
// From MXIMPSubscriptionItem class.
// CSearchKeysSubscriptionItem::SynthesiseSubscriptionEventToL()
// ---------------------------------------------------------------------------
//
void CSearchKeysSubscriptionItem::SynthesiseSubscriptionEventToL(
        MXIMPPscContext* aContext, TBool /*aForceEvent*/ )
    {

    CSearchKeysEventImp* newEvent = CSearchKeysEventImp::NewLC( iKeyInfoArray );      
    if( newEvent )
        {
        MSearchItemParent* searchCache = static_cast<MSearchItemParent*>(iParent.GetInterface(SEARCH_ITEM_PARENT));
        searchCache->AddEventL( *newEvent, aContext ); 
        CleanupStack::PopAndDestroy( newEvent ); //newEvent    
        }
    
    }


    
// --------- ------------------------------------------------------------------
// CGroupListSubscriptionItem::CleanExpired()
// ---------------------------------------------------------------------------
//
void CSearchKeysSubscriptionItem::CleanExpired()
    {
    
    }
 
    
// End of file