imservices/searchfeatureplugin/srcsearchdatamodel/search/searchsubscriptionitem.cpp
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Search subscription implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <badesca.h>
       
    20 #include "ximpitemparentbase.h"
       
    21 #include "ximppanics.h"
       
    22 #include "ximppsccontext.h"
       
    23 #include "ximpobjecthelpers.h"
       
    24 #include "searchtypehelpers.h"
       
    25 #include "searcheventimp.h"
       
    26 #include "ximpidentityimp.h"
       
    27 #include "searchsubscriptionitem.h"
       
    28 
       
    29 #include "searchitemparent.h"
       
    30 
       
    31 // ---------------------------------------------------------------------------
       
    32 // CSearchSubscriptionItem::CSearchSubscriptionItem()
       
    33 // ---------------------------------------------------------------------------
       
    34 //
       
    35 CSearchSubscriptionItem::CSearchSubscriptionItem( MXIMPItemParentBase& aParent )
       
    36 : CXIMPSubscriptionItemBase( aParent )
       
    37     {
       
    38     }
       
    39 
       
    40 
       
    41 // ---------------------------------------------------------------------------
       
    42 // CSearchSubscriptionItem::ConstructL()
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 void CSearchSubscriptionItem::ConstructL()
       
    46     {
       
    47     }
       
    48 
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 // CSearchSubscriptionItem::NewL()
       
    52 // ---------------------------------------------------------------------------
       
    53 //
       
    54 CSearchSubscriptionItem* CSearchSubscriptionItem::NewLC( MXIMPItemParentBase& aParent )
       
    55     {
       
    56     CSearchSubscriptionItem* self = new( ELeave ) CSearchSubscriptionItem( aParent );
       
    57     CleanupClosePushL( *self );
       
    58     self->ConstructL();
       
    59     return self;
       
    60     }
       
    61 
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 // CSearchSubscriptionItem::~CSearchSubscriptionItem()
       
    65 // ---------------------------------------------------------------------------
       
    66 //
       
    67 EXPORT_C CSearchSubscriptionItem::~CSearchSubscriptionItem()
       
    68     {
       
    69     
       
    70     MSearchItemParent* searchCache = static_cast<MSearchItemParent*>
       
    71                                      (iParent.GetInterface(SEARCH_ITEM_PARENT));
       
    72     searchCache->RemoveMe( this ); 
       
    73 
       
    74     }
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // From MXIMPSubscriptionItem class.
       
    78 // CSearchSubscriptionItem::SynthesiseSubscriptionEventTo()
       
    79 // ---------------------------------------------------------------------------
       
    80 //
       
    81 void CSearchSubscriptionItem::SynthesiseSubscriptionEventToL(
       
    82         MXIMPPscContext* aContext, TBool /*aForceEvent*/ )
       
    83     {
       
    84 
       
    85     CSearchEventImp* newEvent = CSearchEventImp::NewLC(*iSearchId, iSearchResults);      
       
    86     if( newEvent )
       
    87         {
       
    88         MSearchItemParent* searchCache = static_cast<MSearchItemParent*>(iParent.GetInterface(SEARCH_ITEM_PARENT));
       
    89         searchCache->AddEventL( *newEvent, aContext ); 
       
    90         CleanupStack::PopAndDestroy( newEvent ); //newEvent*/     
       
    91         }
       
    92     
       
    93     }
       
    94 
       
    95 
       
    96 // ---------------------------------------------------------------------------
       
    97 // CSearchSubscriptionItem::SetNewListL()
       
    98 // ---------------------------------------------------------------------------
       
    99 //
       
   100 EXPORT_C void CSearchSubscriptionItem::SetSearchResults(RSearchInfoImpArray* aSearchResults)
       
   101     {
       
   102     iSearchResults =aSearchResults;
       
   103     }
       
   104 // ---------------------------------------------------------------------------
       
   105 // CSearchSubscriptionItem::SetNewListL()
       
   106 // ---------------------------------------------------------------------------
       
   107 //
       
   108 EXPORT_C void CSearchSubscriptionItem::SetSearchIdL(CXIMPIdentityImp& aSearchId)
       
   109     {
       
   110     iSearchId = &aSearchId;
       
   111     }    
       
   112 // --------- ------------------------------------------------------------------
       
   113 // CGroupListSubscriptionItem::CleanExpired()
       
   114 // ---------------------------------------------------------------------------
       
   115 //
       
   116 void CSearchSubscriptionItem::CleanExpired()
       
   117     {
       
   118     
       
   119     }
       
   120  
       
   121     
       
   122 // End of file