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