ncdengine/provider/client/src/ncdsearchnodeitemproxy.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006 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:   Contains CNcdSearchNodeItemProxy class implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "ncdsearchnodeitemproxy.h"
       
    20 #include "catalogsclientserver.h"
       
    21 #include "ncdnodemanagerproxy.h"
       
    22 #include "ncdoperationmanagerproxy.h"
       
    23 #include "catalogsdebug.h"
       
    24 #include "ncdutils.h"
       
    25 #include "ncdloadnodeoperationproxy.h"
       
    26 
       
    27 
       
    28 CNcdSearchNodeItemProxy::CNcdSearchNodeItemProxy( MCatalogsClientServer& aSession,
       
    29                                       TInt aHandle,
       
    30                                       CNcdNodeManagerProxy& aNodeManager,
       
    31                                       CNcdOperationManagerProxy& aOperationManager,
       
    32                                       CNcdFavoriteManagerProxy& aFavoriteManager ) 
       
    33 : CNcdNodeItemProxy( aSession, aHandle, aNodeManager, aOperationManager, aFavoriteManager )
       
    34     {
       
    35     }
       
    36 
       
    37 
       
    38 void CNcdSearchNodeItemProxy::ConstructL()
       
    39     {
       
    40     CNcdNodeItemProxy::ConstructL();
       
    41     }
       
    42 
       
    43 
       
    44 CNcdSearchNodeItemProxy::~CNcdSearchNodeItemProxy()
       
    45     {
       
    46     }
       
    47 
       
    48 
       
    49 CNcdSearchNodeItemProxy* CNcdSearchNodeItemProxy::NewL( MCatalogsClientServer& aSession,
       
    50                                             TInt aHandle,
       
    51                                             CNcdNodeManagerProxy& aNodeManager,
       
    52                                             CNcdOperationManagerProxy& aOperationManager,
       
    53                                             CNcdFavoriteManagerProxy& aFavoriteManager )
       
    54     {
       
    55     CNcdSearchNodeItemProxy* self = 
       
    56         CNcdSearchNodeItemProxy::NewLC(
       
    57             aSession, aHandle, aNodeManager, aOperationManager, aFavoriteManager );
       
    58     CleanupStack::Pop( self );
       
    59     return self;
       
    60     }
       
    61 
       
    62 CNcdSearchNodeItemProxy* CNcdSearchNodeItemProxy::NewLC( MCatalogsClientServer& aSession,
       
    63                                              TInt aHandle,
       
    64                                              CNcdNodeManagerProxy& aNodeManager,
       
    65                                              CNcdOperationManagerProxy& aOperationManager,
       
    66                                              CNcdFavoriteManagerProxy& aFavoriteManager )
       
    67     {
       
    68     CNcdSearchNodeItemProxy* self = 
       
    69         new( ELeave ) CNcdSearchNodeItemProxy(
       
    70             aSession, aHandle, aNodeManager, aOperationManager, aFavoriteManager );  
       
    71     // Using PushL because the object does not have any references yet
       
    72     CleanupStack::PushL( self );
       
    73     self->ConstructL();
       
    74     return self;
       
    75     }
       
    76     
       
    77 MNcdLoadNodeOperation* CNcdSearchNodeItemProxy::LoadL( MNcdLoadNodeOperationObserver& aObserver )
       
    78     {
       
    79     CNcdSearchFilter* emptyFilter = CNcdSearchFilter::NewLC();    
       
    80     CNcdLoadNodeOperationProxy* operation = OperationManager().CreateLoadNodeOperationL( *this,
       
    81         EFalse, // don't load children
       
    82         0, // pagesize, meaningless in this case
       
    83         0, // pagestart, meaningless in this case
       
    84         0, // depth, meaningless in this case
       
    85         ELoadStructure, // meaningless in this case
       
    86         emptyFilter );
       
    87     CleanupStack::PopAndDestroy( emptyFilter );
       
    88     CleanupReleasePushL( *operation );
       
    89     
       
    90     operation->AddObserverL( this );
       
    91     operation->AddObserverL( &aObserver );
       
    92     CleanupStack::Pop( operation );
       
    93     return operation;
       
    94     }