engine/collectionframework/datasource/manager/inc/mglxdatasource.h
changeset 23 74c9f037fd5d
equal deleted inserted replaced
5:f7f0874bfe7d 23:74c9f037fd5d
       
     1 /*
       
     2 * Copyright (c) 2008-2009 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:   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef _MGLXDATASOURCE_H_
       
    21 #define _MGLXDATASOURCE_H_
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32cmn.h>
       
    25 #include "mglxdatasourceupdateobserver.h"
       
    26 #include "mglxdatasourcerequestobserver.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CGlxRequest;
       
    30 
       
    31 // CONSTANTS
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  *  MGlxDataSource class 
       
    37  *
       
    38  *  Data Source  collates Data Source information.
       
    39  *  @lib GlxDataSource.lib
       
    40  *	@ingroup collection_component_design
       
    41  *  @internal reviewed 11/07/2007 by Dave Schofield
       
    42  */
       
    43 class MGlxDataSource 
       
    44 	{
       
    45 public:
       
    46 	/**
       
    47 	 * Asynchronous call to retrieve 
       
    48 	 * 
       
    49 	 * @param aListId list for this query relates to
       
    50 	 * @return error code
       
    51 	 */
       
    52 	virtual void DataSourceRequestL(CGlxRequest* aRequest, MGlxDataSourceRequestObserver& aObserver) = 0;
       
    53 	/**
       
    54 	 * Cancel asynchronous request call
       
    55 	 * as each requestor can only have one active request the observer is sufficient to cancel the request.
       
    56 	 * 
       
    57 	 */
       
    58 	virtual void CancelRequest(MGlxDataSourceRequestObserver& aObserver) = 0;
       
    59 public:
       
    60 
       
    61 	/**
       
    62 	 * Since there should be only one data source manager for a server,
       
    63 	 * clients can use this function to either create the instance or 
       
    64 	 * return the pointer if the instance already exists.
       
    65 	 *
       
    66 	 * The pointers are reference counter, and the instance is deleted after
       
    67 	 * there are no more clients. It is, therefore, necessary
       
    68 	 * to release the instance by calling Close() when no longer needed.
       
    69 	 *
       
    70 	 * @returns a pointer to a new or existing list manager instance
       
    71 	 */
       
    72 	IMPORT_C static MGlxDataSource* OpenDataSourceL(const TUid& aDataSource, MGlxDataSourceUpdateObserver& aObserver);
       
    73 	
       
    74 
       
    75 	/**
       
    76 	 * Decrements the reference count of the data source manager. Deletes the 
       
    77 	 * data source manager if there are no more references.
       
    78 	 */
       
    79 	virtual void Close(MGlxDataSourceUpdateObserver& aObserver)=0;
       
    80 	};
       
    81 
       
    82 
       
    83 
       
    84 #endif //_MGLXDATASOURCE_H_