imservices/searchfeatureplugin/srcsearchdatamodel/search/searchkeysubscriptionitem.cpp
changeset 0 e6b17d312c8b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/imservices/searchfeatureplugin/srcsearchdatamodel/search/searchkeysubscriptionitem.cpp	Thu Dec 17 08:54:49 2009 +0200
@@ -0,0 +1,115 @@
+/*
+* 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