photosgallery/collectionframework/datasource/manager/inc/glxdatasourcetask.h
changeset 0 4e91876724a2
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2008 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 Task Class.   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef _C_GLXDATASOURCETASK_H_
       
    22 #define _C_GLXDATASOURCETASK_H_
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32cmn.h>
       
    26 #include <ecom/ecom.h>
       
    27 
       
    28 #include "mglxdatasource.h"
       
    29 // FORWARD DECLARATIONS
       
    30 class CGlxRequest;
       
    31 class CMPXMedia;
       
    32 class CGlxDataSource;
       
    33 // CONSTANTS
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  *  CGlxDataSourceTask class 
       
    39  *
       
    40  *  Data Source Request is the base class for executing requests.
       
    41  *	@ingroup collection_component_design
       
    42  *  @internal reviewed 11/07/2007 by Dave Schofield
       
    43  */
       
    44 class CGlxDataSourceTask : 	public CBase
       
    45 	{
       
    46 public:
       
    47 	IMPORT_C virtual ~CGlxDataSourceTask();
       
    48 	IMPORT_C CGlxDataSourceTask(CGlxRequest* aRequest, MGlxDataSourceRequestObserver& aObserver, CGlxDataSource* aDataSource);
       
    49 	
       
    50 public:
       
    51 	TBool ObserverMatch(MGlxDataSourceRequestObserver& aObserver);
       
    52     
       
    53 public:
       
    54 	virtual void ExecuteRequestL() = 0;
       
    55 	virtual void CancelRequest() = 0;
       
    56 
       
    57 	/**
       
    58 	 * Called when request is completed sucessfully or due to an error.
       
    59 	 * This is the default implementation that can be re-defined by 
       
    60 	 * deriving classes if required.
       
    61 	 * @param aError Error that occurred (if any)
       
    62 	 */
       
    63     IMPORT_C virtual void HandleRequestComplete(TInt aError);
       
    64     IMPORT_C void CreateResponseL();
       
    65     TBool IsDataSourceNeeded() const;
       
    66 protected:
       
    67 	IMPORT_C virtual void ListToMediaL(const RArray<TGlxMediaId>& aList); /// @todo overloaded until don't need name hack
       
    68 
       
    69 protected:
       
    70 	CGlxRequest* iRequest;
       
    71 	CMPXMedia* iResponse;
       
    72 	CGlxDataSource* iDataSource; // not owned
       
    73 	MGlxDataSourceRequestObserver* iObserver;
       
    74 	TBool iCancelled;
       
    75 	};
       
    76 
       
    77 #endif //_C_GLXDATASOURCETASK_H_